Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC Filter parameters ignored; events from current block always returned #226

Closed
DefiDebauchery opened this issue Nov 25, 2021 · 3 comments
Assignees

Comments

@DefiDebauchery
Copy link

DefiDebauchery commented Nov 25, 2021

Describe the bug
When using event filters (eth_newFilter), neither block nor topic arguments are honored; all(?) events from the current block are returned.

To Reproduce
Steps to reproduce the behavior:
See code snippet below.

Expected behavior
Event logs are returned relevant to the block(s) and topic(s) requested.

Actual behavior
All event logs from the current block are returned, including Transfers and other unrequested events.

Additional context
python 3.9 with web3.py installed

Added similar BSC network call for reference/control

from web3 import Web3

cronos_block = 204485  # Random block in the past
topic = '0x4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e38426'
cronos = Web3(Web3.HTTPProvider('https://evm-cronos.crypto.org'))

test_filter = cronos.eth.filter({'fromBlock': cronos_block, 'toBlock': cronos_block, 'topics': [topic]})

print('Cronos Target Block', target_block, '| Received Block', test_filter.get_all_entries()[0].blockNumber)

bsc_block = 12935778
bsc = Web3(Web3.HTTPProvider('https://bsc-dataseed.binance.org'))
test_filter = bsc.eth.filter({'fromBlock': bsc_block, 'toBlock': bsc_block, 'topics': [topic]})

print('BSC Target Block', target_block, '| Received Block', test_filter.get_all_entries()[0].blockNumber)

outputs

Cronos Target Block 204485 | Received Block 264670
BSC Target Block 12935778 | Received Block 12935778
@tomtau
Copy link
Contributor

tomtau commented Nov 29, 2021

it looks like an issue on Ethermint, re-opened here evmos/ethermint#792

@DefiDebauchery
Copy link
Author

Hi @tomtau - Looks like this has been fixed upstream (evmos/ethermint#865). Hoping this can be live on Cronos soon, it will open up a lot of important analytics work for projects!

@yihuang
Copy link
Collaborator

yihuang commented Mar 9, 2022

Hi @tomtau - Looks like this has been fixed upstream (tharsis/ethermint#865). Hoping this can be live on Cronos soon, it will open up a lot of important analytics work for projects!

I think the fix has already been included in Cronos releases, closing for now, feel free to reopen if still exists.

@yihuang yihuang closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants