I am forking the mainnet from my own geth node with ganache-cli --fork option. Immediately after the fork, I simulate a transaction to a contract on the forked, private network. I then immediately send that same exact transaction on the mainnet. These are the same transactions from the same account with the same nonce.

After the transactions are processed, I am finding that the gas_used on the mainnet is ~1% (or less) different than the gas_used on the ganache fork. How can this be if I simply forked the network and sent two equivalent contract transactions? Can it have something to do with the solc compiler versions?

  • 1
    There are optimizations done on the solc all the time but difficult to say if that's the real reason. – Lauri Peltonen Mar 28 '19 at 6:26
  • @LauriPeltonen What additional information would help? – python_crypto_questions Mar 28 '19 at 17:36
  • Sorry, I don't have much ideas currently and I'm not too familiar with solc so can't help you much further. Hopefully someone else can give you a better answer. – Lauri Peltonen Mar 28 '19 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.