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
Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127
  • 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 Oct 02 '18 at 17:57

1 Answers1

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.

Motoma
  • 301
  • 1
  • 5
  • 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. – Mikko Ohtamaa Oct 01 '18 at 09:53