0

I wondered whether ganache, which produces a blockchain on my machine and is used for development, implements the Etherum yellow paper protocol.

Please follow my line of logic:

That is when the Solidity code gets compiled, and bytecode is generated. The EVM that runs on my CPU interprets the bytecode into machine code and makes my CPU execute it, ticking the local blockchain ganache.

So I assume that the EVM (the software) is the same between local and main testnet but where this machine code is executed different, one on the local CPU, and the other is in all CPUs running full nodes. Is my interpretation correct?

1
  • Usually "view" functions are executed locally in the computer that makes the call using data from the blockchain. On the other hand "transactions" are executed by miners when producing a new block, other miners/validator will execute again and accept the block if the result is exactly the same.
    – Ismael
    Commented Nov 11, 2021 at 3:15

1 Answer 1

0

Yes, Ganache implements the specification in the yellow paper by using Ethereumjs to simulate full client behavior, see doc.

Ethereumjs is a Javascript/typescript implementation of the Ethereum Virtual Machine(EVM) so any behavior you'd expect to see with clients like Geth, Parity, e.t.c. are all supported in Ethereumjs.

So yes, your solidity code should run the same way it runs on the Ganache blockchain when deployed on testnets/mainnet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.