4

I use web3.getStorageAt to access historical information. I can specify a block to see the content of a variable in a given block. But one block can contain several transactions, each modifying this variable.

  1. Which value is retrieved by getStorageAt? The last one?
  2. How to retrieve the values of the storage in each transaction?
eth
  • 85,679
  • 53
  • 285
  • 406
bortzmeyer
  • 693
  • 3
  • 12

1 Answers1

3

web3.eth.getStorageAt will retrieve the value after all transactions in the block are executed in order: effectively the last transaction (but that transaction could set the value based on earlier transactions in the block).

To retrieve the values of the storage in each transaction, you can start with the state from the previous block, and then execute each transaction through the EVM, a little similar to How to get contract internal transactions. There is no web3.js API for this.

eth
  • 85,679
  • 53
  • 285
  • 406
  • OK, so no passive method, I need an EVM? – bortzmeyer Jun 27 '16 at 18:34
  • Are you trying to do something like what live.ether.camp does, but even more granular? They use EthereumJ and here's a question on Geth EVM: http://ethereum.stackexchange.com/questions/4446/instrumenting-evm – eth Jun 27 '16 at 19:39