eth_getStorageAt with block number parameter doesn't return correct result when using fork feature
See original GitHub issueJSON RPC method eth_getStorageAt always returns the latest state when using fork feature regardless of the third parameter
Expected Behavior
When changing the storage value in contract c at key k from v1 to v2 in block b, eth_getStorageAt(c, k, b-1)
should return v1.
Current Behavior
eth_getStorageAt(c, k, b-1)
returns v2 for any b.
For storage values that didn’t change after fork, eth_getStorageAt
works as expected
Steps to Reproduce (for bugs)
ganache-cli -f mainnet_node --networkId 1
truffle migrate
eth_getStorageAt("[migration_contract]", "0x1", "0x0")
Your Environment
- Version used: Ganache CLI v6.9.1 (ganache-core: 2.10.2)
- Operating System and version: macOS Catalina 10.15.4
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Ganache CLI - Nethereum Documentation
Returns the total time adjustment, in seconds. evm_mine, Force a block to be mined. Takes no parameters. Mines a block independent of whether...
Read more >web3.eth API — Web3.py 5.31.3 documentation - Read the Docs
Returns the number of transactions in the block specified by block_identifier . Delegates to eth_getBlockTransactionCountByNumber if block_identifier is an ...
Read more >ganache-cli - npm
evm_snapshot : Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the integer id of the snapshot created....
Read more >How eth_getStorageAt works when block option is not "latest"?
For that it will read the root node from the block header and then it will use the Patricia-Trie that correspond to the...
Read more >Reference | Ethereum development environment for ... - Hardhat
If no value is provided, the latest block is used. enabled : an optional boolean to switch on or off the fork functionality....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was just officially released in ganache-cli@6.10.1-beta.2 / ganache-core@2.11.3-beta.0
Hey @nebojsa94, while I was assessing the validity of your solution, I was trying to find a more elegant solution by hacking away. However, I ended up on your proposed solution anyway and opened a PR since it was done. I didn’t intend to steal your thunder and hope you didn’t spend any time with implementation! Nevertheless, I really appreciate the proposal you made as it saved me discovery time!