Commit 66d78e5
committed
Implement checkpoint-and-revert for cascading redeem filtering
When a retryable auto-redeem's inner execution touches a filtered address,
simply dropping the redeem causes consensus divergence: redeems are generated
inside ProduceBlockAdvanced via ScheduledTxes(), so during replay the redeem
re-executes (NoopSequencingHooks.RedeemFilter returns nil), producing a
different state root than the sequencer's block.
The fix is checkpoint-and-revert: take a state snapshot before each user tx
and process it with all its redeems tentatively (skipFinalise). If any redeem
triggers RedeemFilter, revert the entire group (user tx + all redeems) so the
redeem is never generated in the first place. Both sequencer and replay then
see the same block without the tx, maintaining consensus.
For the delayed path, the group revert reports the originating tx hash via
ReportGroupRevert, which halts the delayed sequencer. The the hash is added to
the onchain filter via the transaction-filterer service, and the
submission re-processes with redirected beneficiary and no auto-redeem.
Key design decisions:
- skipFinalise defers statedb.Finalise during tentative group processing so
that RevertToSnapshot can cleanly undo the entire group across tx boundaries
(Finalise destroys the journal and promotes dirtyStorage to pendingStorage,
making cross-tx revert impossible)
- SubRefund drains the EVM refund counter before each tx in a tentative group,
mimicking what Finalise normally does - without this, the leaked refund
causes GasUsed divergence (consensus break). SubRefund is journaled so group
revert restores it automatically
- ReportGroupRevert is a new SequencingHooks method that lets the block
processor signal a group revert to the hooks layer without coupling to
specific hook implementations1 parent 976a34f commit 66d78e5
File tree
7 files changed
+863
-181
lines changed- arbos
- changelog
- execution/gethexec
- system_tests
7 files changed
+863
-181
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| |||
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
| 175 | + | |
| 176 | + | |
163 | 177 | | |
164 | 178 | | |
165 | 179 | | |
| |||
252 | 266 | | |
253 | 267 | | |
254 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
255 | 313 | | |
256 | 314 | | |
257 | 315 | | |
| |||
272 | 330 | | |
273 | 331 | | |
274 | 332 | | |
| 333 | + | |
275 | 334 | | |
276 | 335 | | |
277 | 336 | | |
278 | 337 | | |
279 | 338 | | |
280 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
281 | 346 | | |
282 | 347 | | |
283 | 348 | | |
| |||
291 | 356 | | |
292 | 357 | | |
293 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
294 | 374 | | |
295 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
296 | 382 | | |
297 | 383 | | |
298 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
299 | 389 | | |
300 | 390 | | |
301 | 391 | | |
| |||
392 | 482 | | |
393 | 483 | | |
394 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
395 | 494 | | |
396 | 495 | | |
397 | 496 | | |
| |||
416 | 515 | | |
417 | 516 | | |
418 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
419 | 530 | | |
420 | 531 | | |
421 | 532 | | |
| |||
527 | 638 | | |
528 | 639 | | |
529 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
530 | 647 | | |
531 | 648 | | |
532 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
219 | 218 | | |
220 | 219 | | |
221 | 220 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| |||
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
150 | 165 | | |
151 | 166 | | |
152 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | | - | |
846 | 845 | | |
847 | 846 | | |
848 | 847 | | |
| |||
1153 | 1152 | | |
1154 | 1153 | | |
1155 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1156 | 1169 | | |
1157 | 1170 | | |
1158 | 1171 | | |
| |||
0 commit comments