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

EVM: Revamp and fix filters system #2736

Merged
merged 14 commits into from
Dec 6, 2023
Merged

EVM: Revamp and fix filters system #2736

merged 14 commits into from
Dec 6, 2023

Conversation

sieniven
Copy link
Contributor

@sieniven sieniven commented Dec 4, 2023

Summary

This PR cleans up the node's filter system, aligning ourselves as much as possible with geth.

Filter System

Ref: https://github.com/ethereum/go-ethereum/blob/master/eth/filters/filter_system.go

  1. Switch to LRU cache with cache size limit (defaults to 5000) to safeguard against attack vectors.
  2. Revamp design of how we accumulate our filters - this PR shifts filter update out of validation pipeline, and is only accumulated on every call request.
  3. Add block range limit and response log limit, defaulting to 2000 and 10_000 respectively. Aligns with Alchemy, BNB, etc for maximum reliability on calls.
  4. Exit early if topics filter has more than 4 topics - Ref: eth/filters: exit early if topics-filter has more than 4 topics ethereum/go-ethereum#28494
  5. Use FilterCriteria context to be passed directly when querying db for node information.
  6. Discontinue updating filter cache on commit block pipeline and block template creation pipeline.
  7. Cleanup and add more test coverage on filters RPC

RPCs

  1. Fixes to eth_getLogs and eth_newFilter RPCs handling of topics optional argument - each event should be able to digest a list of possible topics, matching a prefix of that list.
  2. Shift handling of logic of RPC into filter service from RPC.
  3. eth_newFilter - should allow fromBlock and toBlock specified to be future blocks.

To do:

  • Implementation of pending transactions filter change RPC.

Implications

  • Storage

    • Database reindex required
    • Database reindex optional
    • Database reindex not required
    • None
  • Consensus

    • Network upgrade required
    • Includes backward compatible changes
    • Includes consensus workarounds
    • Includes consensus refactors
    • None

@sieniven sieniven linked an issue Dec 4, 2023 that may be closed by this pull request
@sieniven sieniven marked this pull request as ready for review December 5, 2023 06:21
lib/ain-grpc/src/rpc/eth.rs Outdated Show resolved Hide resolved
lib/ain-grpc/src/rpc/eth.rs Outdated Show resolved Hide resolved
Jouzo
Jouzo previously approved these changes Dec 6, 2023
@Bushstar Bushstar merged commit d870a58 into master Dec 6, 2023
15 of 16 checks passed
@Bushstar Bushstar deleted the niven/fix-evm-filters branch December 6, 2023 14:17
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

Successfully merging this pull request may close these issues.

evm: graph_node fails to parse block output in beta4
3 participants