Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

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

Closed
tomtau opened this issue Nov 29, 2021 · 0 comments · Fixed by #865
Closed

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

tomtau opened this issue Nov 29, 2021 · 0 comments · Fixed by #865
Assignees

Comments

@tomtau
Copy link
Contributor

tomtau commented Nov 29, 2021

from crypto-org-chain/cronos#226

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants