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?