Commit 688a889
committed
Add prechecker address filtering via dry-run ProduceBlockAdvanced
Add address filtering to the prechecker by running the full block production
pipeline on a throwaway statedb. For each RPC-submitted transaction, when
filtering is enabled, the prechecker calls ProduceBlockAdvanced(dryRun=true)
through a thin PrefiltererSequencingHooks adapter that implements the same
TouchAddress/IsAddressFiltered logic the sequencer uses. This catches direct
address touches, direct redeems, contract-triggered redeems (where a contract
internally calls ArbRetryableTx.redeem), event-filter hits, and cascading
redeem chains -- all with zero coupling to retryable internals.
The approach is unified: every tx goes through ProduceBlockAdvanced rather than
trying to detect redeem-related transactions statically. A regular contract can
call ArbRetryableTx.redeem(ticketId) internally, making static detection
impossible. Running the real block processor as a black box sidesteps this
entirely.
Key design decisions:
- No isRedeemTx gate: the unified approach runs ALL txs through
ProduceBlockAdvanced when filtering is enabled. A static gate on
To == 0x6e misses contract-triggered redeems. The only gate is
addressChecker != nil.
- No statedb.Copy(): each PublishTransaction opens its own statedb via
bc.StateAt, never uses it after the dry-run, and ProduceBlockAdvanced
doesn't call Commit. The statedb is passed directly and GC'd on return.
This eliminates the main cost objection to running the full pipeline.
- dryRun mode: a new bool parameter on ProduceBlockAdvanced causes an early
return after the tx processing loop, skipping FinalizeBlock (which calls
IntermediateRoot -- likely the dominant fixed overhead per call),
receipt construction, block assembly, and balance delta checks. The
prechecker only needs hooks.filtered, not a valid block.
- Forwarder-only wiring: on the sequencer node, the sequencer already returns
ErrArbTxFilter synchronously from real block production so the prechecker
dry-run is redundant. The addressChecker/eventFilter are only wired to
TxPreChecker on forwarder nodes (which don't run a sequencer and relay
to a remote sequencer after prechecking).
- Config refactor: TransactionFilteringConfig is moved from SequencerConfig to
a top-level execution.transaction-filtering.* namespace. Forwarders don't
have a Sequencer component, so they couldn't access the filter config when
it lived under execution.sequencer. The new location makes it available to
any node role.1 parent 66d78e5 commit 688a889
File tree
10 files changed
+756
-88
lines changed- arbos
- contracts-local/src/mocks
- execution/gethexec
- system_tests
10 files changed
+756
-88
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
638 | 639 | | |
639 | 640 | | |
640 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
641 | 649 | | |
642 | 650 | | |
643 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
686 | 687 | | |
687 | 688 | | |
688 | 689 | | |
| |||
908 | 909 | | |
909 | 910 | | |
910 | 911 | | |
| 912 | + | |
911 | 913 | | |
912 | 914 | | |
913 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
140 | 143 | | |
141 | 144 | | |
142 | 145 | | |
| |||
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
| |||
181 | 187 | | |
182 | 188 | | |
183 | 189 | | |
| 190 | + | |
184 | 191 | | |
185 | 192 | | |
186 | 193 | | |
| |||
217 | 224 | | |
218 | 225 | | |
219 | 226 | | |
| 227 | + | |
220 | 228 | | |
221 | 229 | | |
222 | 230 | | |
| |||
262 | 270 | | |
263 | 271 | | |
264 | 272 | | |
| 273 | + | |
| 274 | + | |
265 | 275 | | |
266 | 276 | | |
267 | 277 | | |
| |||
318 | 328 | | |
319 | 329 | | |
320 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
321 | 348 | | |
322 | 349 | | |
323 | 350 | | |
| |||
371 | 398 | | |
372 | 399 | | |
373 | 400 | | |
| 401 | + | |
| 402 | + | |
374 | 403 | | |
375 | 404 | | |
376 | 405 | | |
| |||
458 | 487 | | |
459 | 488 | | |
460 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
461 | 495 | | |
462 | 496 | | |
463 | 497 | | |
| |||
488 | 522 | | |
489 | 523 | | |
490 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
491 | 543 | | |
492 | 544 | | |
493 | 545 | | |
| |||
509 | 561 | | |
510 | 562 | | |
511 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
512 | 567 | | |
513 | 568 | | |
514 | 569 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments