Repository navigation
Commit e035369
feat(evmonly): add the polling filter API to the EVM-only RPC (#4668)
This PR adds log filtering to EVM-only RPC.
- `eth_newFilter`: installs a log filter and returns its ID. Polls start
at a numeric fromBlock, or else at the block after the latest indexed
one.
- `eth_newBlockFilter`: installs a filter whose polls return the hashes
of blocks committed since the previous poll.
- `eth_getFilterChanges`: returns what a filter matched since its last
poll, using the same cursor rules, range limits and log caps as the
regular RPC. A block filter that falls more than max_block_filter_hashes
blocks behind is removed.
- `eth_getFilterLogs`: returns every log a log filter matches, without
moving its poll cursor.
- `eth_uninstallFilter`: removes a filter and reports whether it
existed.
- `eth_newPendingTransactionFilter`: returns the regular RPC's "not
supported" error, since there's no pending-transaction feed to poll.
Filters that aren't polled within `filter_timeout` expire. New
`[giga.rpc]` keys use the regular RPC's defaults:
- `filter_timeout` (120s)
- `max_filters` (1000)
- `max_block_filter_hashes` (1000).
Log matching reuses the eth_getLogs code.
Test coverage: table tests for the cursor rules, pruning, caps and
expiry, an HTTP end-to-end test, and new checks in the Autobahn Basic
suite.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 883f6e8 commit e035369
9 files changed
Lines changed: 931 additions & 7 deletions
File tree
- giga
- config
- evmonly/rpc
- integration_test/autobahn
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
140 | 151 | | |
141 | 152 | | |
142 | 153 | | |
| |||
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
189 | 203 | | |
190 | 204 | | |
191 | 205 | | |
| |||
311 | 325 | | |
312 | 326 | | |
313 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
314 | 343 | | |
315 | 344 | | |
316 | 345 | | |
| |||
404 | 433 | | |
405 | 434 | | |
406 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
407 | 439 | | |
408 | 440 | | |
409 | 441 | | |
| |||
511 | 543 | | |
512 | 544 | | |
513 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
514 | 557 | | |
515 | 558 | | |
516 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| |||
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
131 | 140 | | |
132 | 141 | | |
133 | 142 | | |
| |||
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
179 | 192 | | |
180 | 193 | | |
181 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
0 commit comments