You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 47b8cac
Browse filesBrowse the repository at this point in the historyBrowse files
rpc: block filters return every block since the last poll (#4683)
On nodes without the Autobahn `BlockHeaderNotifier`,
`eth_getFilterChanges` on a block filter dropped blocks. It read the
CometBFT event log, which returns 10 items newest first, and moved its
cursor to the newest one, so a poll covering more than 10 blocks
returned only the newest 10. The first poll also returned blocks from
before the filter was created.
The filter now keeps a block height as its cursor, starting at the block
after the safe latest height, and `blockHashesFrom` reads hashes from
the block store through `BlockchainInfo`, oldest first, up to
`max_block_filter_hashes` heights per poll. Fixing the paging on the
event log instead would not be enough: the log keeps only 30 seconds of
events by default, less than the 120-second filter timeout. When pruning
passes the cursor, the poll fails with an error naming the pruned blocks
and the filter continues from the earliest block, as log filters already
do. Both filter types now update their cursor through
`advanceFilterCursor`, which never moves it backward.
`eth_getFilterLogs` now rejects block filters, as geth does.
The change affects the RPC only, not consensus or state.
Copy file name to clipboardExpand all lines: evmrpc/AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ EVM RPCs prefixed by `eth_` and `debug_` on Sei generally follows [Ethereum's sp
43
43
-`eth_syncing`
44
44
-`eth_getProof` — deprecated rather than permanently incompatible; the message directs callers who need proofs to the Sei team.
45
45
- **Log filters poll from a cursor.** `eth_newFilter` fixes where its polls start, once: a numeric `fromBlock` (or `earliest`, which is block 0) as given, otherwise the block after the head at creation; a numeric `toBlock` below that start is rejected. Each `eth_getFilterChanges` scans from that cursor to the head, or to a numeric `toBlock` below it; a tag `toBlock` such as `latest` follows the head and never ends the filter. A numeric `fromBlock` above 0 that is below the earliest available block is rejected, while a `fromBlock` of 0 polls from that block. When pruning passes the cursor of a filter, its next poll fails with an error naming the pruned blocks, and the filter continues from the earliest block. A poll covers at most `max_blocks_for_log` blocks, and fewer when its logs exceed the log caps; later polls return the rest. A block whose logs alone exceed the caps fails the poll that reaches it with an error naming the block, and the filter or subscription continues after it. Unlike geth, a numeric `fromBlock` in the past makes the first poll return that history. `eth_getFilterLogs` resolves tags when called and never moves the cursor. `eth_subscribe("logs")` polls through the same cursor logic, and treats a `fromBlock` of 0 with a tag `toBlock`, which ethclient sends for an open-ended query, as an omitted `fromBlock`. A failed subscription poll notifies `{"error": message}` in place of logs, adding the skipped block's `blockNumber` when the subscription continues past an oversized block; any other failure, pruned blocks included, ends the subscription.
46
+
-**Block filters.** Under Autobahn, `eth_newBlockFilter` collects hashes from the `BlockHeaderNotifier`, and a filter holding `max_block_filter_hashes` unpolled hashes is removed. Otherwise there is no notifier, and the filter polls the CometBFT block store from a cursor that starts at the block after the head at creation, so no poll returns a block from before the filter existed. Each `eth_getFilterChanges` covers at most `max_block_filter_hashes` heights from the cursor up to the head and returns their hashes oldest first; later polls cover the rest. A block store read failure leaves the cursor where it was, so the next poll retries the same heights. When pruning passes the cursor, before or during a poll, that poll fails with a `-32000` error naming the pruned blocks, and the filter continues from the earliest block. Concurrent polls of one filter may return the same hashes. `eth_getFilterLogs` rejects a block filter as not existing, as geth does.
46
47
47
48
## `sei_` prefixed endpoints
48
49
The legacy `sei_` namespace contains address and Cosmos transaction helpers.
0 commit comments