5

I would like to get a snapshot of EVM state on a certain block and then execute smart contract call actions against this state.

Do Go Ethereum, Parity or any of other Ethereum clients provide functionality that could help here?

  • Maintaing the historical state and expose it over JSON-RPC APIs

... or ...

  • Allow to fast forward the chain from a genesis block to a certain block and then stop syncing, so that the state is frozen to a historical block
1
  • 1
    With geth if you create a full node in archive mode it should process the blocks in order, once you passed the specific block you can stop syncing. Most JSON-RPC apis include a parameter to indicate the block to use to answer.
    – Ismael
    Commented Oct 2, 2018 at 17:57

1 Answer 1

1

Disclaimer: I can't answer if Geth or Parity provide this functionality, but I assume there is a way to do this.

What I can tell you is that Ganache does allow you to do this, and the Truffle team has a fantastic tutorial on using it: https://truffleframework.com/tutorials/chain-forking-exploiting-the-dao

In this tutorial, they show you how to fork the Ethereum chain prior to the DAO hack, participate in the presale, and then exploit the DAO vulnerability yourself.

1
  • Thank you @Motoma. Interesting. I am not that interested in Ganache or Truffle, but the underlying TestRPC protocol to proxy an existing live chain from a certain block. Commented Oct 1, 2018 at 9:53

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.