After calling `evm_mine`, `eth_getLogs` returns same logs for all blocks
See original GitHub issueExpected Behavior
eth_getLogs
should return the logs for the blockHash specified in the request.
Current Behavior
After executing a evm_mine
or evm_increaseTime
call to Ganache, eth_getLogs
always returns the logs for the latest block even if the request specifies a different blockHash.
Possible Solution
Figure out what stateful change made during the evm_mine
call is causing subsequent eth_getLogs
calls to ignore the supplied blockHash
and always use the latest block.
Steps to Reproduce (for bugs)
- Start Ganache
- Execute a txn that generates a log (e.g., ERC20 transfer)
- Execute an
evm_mine
orevm_increaseTime
call with or without params - Execute another txn that generates a log (e.g. ERC20 allowance)
- Call
eth_getLogs
specifying any blockHash and you will always receive the logs from the latest block mined.
Context
I am trying to write smart contract tests that check 0x order filling and expiration. I cannot cause orders to expire deterministically without use of evm_mine
/evm_increaseTime
but cannot use it if it bricks eth_getLogs
.
Your Environment
- Version used: Mac OS
- Version of Truffle/Remix/Other tools used: Ganache CLI v6.7.0 (ganache-core: 2.8.0)
- NodeJS Version: 10.x
- Operating System and version (include distro if Linux): mhart/alpine-node:10
- I intend to submit a pull request to fix this issue: [ ]
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
eth_getLogs request returns an error `failed to get logs for ...
Parity/OE and Erigon nodes respond correctly. When I get the error, this appears in the geth logs: ERROR[11-08|20:15:32.914] ...
Read more >Understanding Logs: Deep Dive into eth_getLogs
This is a beginner-friendly guide into the commonly used eth_getLogs JSON-RPC call and understanding logs on Ethereum. It discusses some key topics and...
Read more >eth_getLogs - Ethereum RPC method documentation
Eth Get Logs. Returns an array of all logs matching a given filter object. Supported chains for eth_getLogs. ETH.
Read more >Reference | Ethereum development environment for ... - Hardhat
A boolean that controls if Hardhat Network logs every request or not. Default value: false for the in-process Hardhat Network provider, ...
Read more >'removed' could be true in the response of eth_getLogs?
When using eth_getLogs to get logs of minted blocks, could 'removed' field of the returned logs be true?
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
I’ve updated your comment to remove Ben, as he doesn’t work on this project anymore.
Thanks for taking the time to file this issue. I’ve added it to our queue of issues but don’t currently have an ETA for the fix.
We ran into this issue as well because of tests using
evm_mine
.