question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After calling `evm_mine`, `eth_getLogs` returns same logs for all blocks

See original GitHub issue

Expected 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)

  1. Start Ganache
  2. Execute a txn that generates a log (e.g., ERC20 transfer)
  3. Execute an evm_mine or evm_increaseTime call with or without params
  4. Execute another txn that generates a log (e.g. ERC20 allowance)
  5. 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:open
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
davidmurdochcommented, Jan 15, 2020

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.

1reaction
bigspidercommented, Mar 24, 2020

We ran into this issue as well because of tests using evm_mine.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found