Skip to content

Config to enable/disable filtering when sequencing delayed messages#4377

Merged
tsahee merged 19 commits intomasterfrom
sequencing_run_ctx
Mar 5, 2026
Merged

Config to enable/disable filtering when sequencing delayed messages#4377
tsahee merged 19 commits intomasterfrom
sequencing_run_ctx

Conversation

@diegoximenes
Copy link
Copy Markdown
Contributor

@diegoximenes diegoximenes commented Feb 12, 2026

Resolves NIT-4026

  • Adds messageSequencingMode messageRunMode. To be used when filtering transactions in the geth layer.
  • Adds --execution.sequencer.transaction-filtering.disable-delayed-sequencing-filter to enable/disable filtering when sequencing delayed messages

pulls in OffchainLabs/go-ethereum#622

@diegoximenes diegoximenes changed the title Sequencing run ctx Config to enable/disable filtering when sequencing delayed messages Feb 12, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 32.77%. Comparing base (b9b3864) to head (a33c859).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4377      +/-   ##
==========================================
+ Coverage   32.72%   32.77%   +0.05%     
==========================================
  Files         493      493              
  Lines       58290    58294       +4     
==========================================
+ Hits        19076    19108      +32     
+ Misses      35868    35850      -18     
+ Partials     3346     3336      -10     

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
4240 6 4234 0
View the top 3 failed tests by shortest run time
TestVersion30
Stack Traces | 5.620s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc07d687c00, 0x1e, {0xc08bbf3db0, 0x6, 0xc07e2cfbd8?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion30(0xc07d687c00?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:67 +0x798
        testing.tRunner(0xc07d687c00, 0x3d28798)
        	/opt/hostedtoolcache/go/1.25.7/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.7/x64/src/testing/testing.go:1997 +0x465
        
    precompile_inclusion_test.go:94: �[31;1m [] execution aborted (timeout = 5s) �[0;0m
INFO [03-04|12:20:30.463] Starting work on payload                 id=0x03ce03b77a9e1c0a
INFO [03-04|12:20:30.463] Imported new potential chain segment     number=22 hash=8f442f..56813f blocks=1  txs=1  mgas=3.088  elapsed=3.307ms     mgasps=933.680  triediffs=81.09KiB  triedirty=0.00B
INFO [03-04|12:20:30.463] Imported new potential chain segment     number=3  hash=829ebf..e95142 blocks=1  txs=1  mgas=0.073  elapsed=3.223ms     mgasps=22.597   triediffs=9.17KiB   triedirty=0.00B
INFO [03-04|12:20:30.464] Chain head was updated                   number=22 hash=8f442f..56813f root=dbd909..fea51b elapsed="317.909µs"
INFO [03-04|12:20:30.464] Persisted dirty state to disk            size=143.91KiB elapsed=7.233ms
INFO [03-04|12:20:30.464] Chain head was updated                   number=3  hash=829ebf..e95142 root=0c0e08..46e137 elapsed="189.823µs"
INFO [03-04|12:20:30.464] Updated payload                          id=0x03ce03b77a9e1c0a number=4  hash=7c9482..141785 txs=1  withdrawals=0 gas=72844      fees=7.2844e-08    root=5fbcf7..be6099 elapsed=1.111ms
INFO [03-04|12:20:30.464] Blockchain stopped
INFO [03-04|12:20:30.465] Starting work on payload                 id=0x03985f6ada20c933
--- FAIL: TestVersion30 (5.62s)
TestSequencerInboxReader
Stack Traces | 10.010s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=af7ed5..edfa08 parent=8dd5f4..913b84 id=104                block=103
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=d77dee..d81689 parent=af7ed5..edfa08 id=105                block=104
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=766ce0..dbbb15 parent=d77dee..d81689 id=106                block=105
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=260903..919f6e parent=766ce0..dbbb15 id=107                block=106
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=11a795..f277c1 parent=260903..919f6e id=108                block=107
DEBUG[03-04|12:17:40.612] Journaled pathdb diff layer              root=8832f3..cf338e parent=11a795..f277c1 id=109                block=108
DEBUG[03-04|12:17:40.613] Journaled pathdb diff layer              root=679f06..3ad94e parent=8832f3..cf338e id=110                block=109
DEBUG[03-04|12:17:40.613] Journaled pathdb diff layer              root=4bd1ea..b7ab36 parent=679f06..3ad94e id=111                block=110
DEBUG[03-04|12:17:40.613] Journaled pathdb diff layer              root=afd3b0..ead48e parent=4bd1ea..b7ab36 id=112                block=111
DEBUG[03-04|12:17:40.613] Journaled pathdb diff layer              root=e8fb9a..544507 parent=afd3b0..ead48e id=113                block=112
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=d8da8c..1b443c parent=e8fb9a..544507 id=114                block=113
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=b4ebd5..70f001 parent=d8da8c..1b443c id=115                block=114
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=92d7b4..24b1ed parent=b4ebd5..70f001 id=116                block=115
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=87a2b4..09df28 parent=92d7b4..24b1ed id=117                block=116
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=6854cb..f513c8 parent=87a2b4..09df28 id=118                block=117
DEBUG[03-04|12:17:40.614] Journaled pathdb diff layer              root=172810..49a404 parent=6854cb..f513c8 id=119                block=118
INFO [03-04|12:17:40.614] Persisted dirty state to disk            size=552.70KiB elapsed=11.958ms
INFO [03-04|12:17:40.615] Blockchain stopped
TRACE[03-04|12:17:40.615] P2P networking is spinning down
--- FAIL: TestSequencerInboxReader (10.01s)
TestSequencerPriceAdjustsFrom25Gwei
Stack Traces | 11.460s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
INFO [03-04|12:27:45.238] Starting snapshot generation             root=56e81f..63b421 accounts=0 slots=0 storage=0.00B dangling=0 elapsed="3.035µs"
INFO [03-04|12:27:45.238] Initialized path database                triecache=600.00MiB statecache=400.00MiB buffer=256.00MiB state-history="last 345600 blocks"
INFO [03-04|12:27:45.239] Stopping work on payload                 id=0x03e9d7b6f98b6ba7 reason=delivery
INFO [03-04|12:27:45.239] addresss table import complete
INFO [03-04|12:27:45.239] retryables import complete
INFO [03-04|12:27:45.239] Resuming snapshot generation             root=56e81f..63b421 accounts=0 slots=0 storage=0.00B dangling=0 elapsed=1.248ms
INFO [03-04|12:27:45.239] Generated snapshot                       accounts=0 slots=0 storage=0.00B dangling=0 elapsed=1.380ms
INFO [03-04|12:27:45.239] Imported new potential chain segment     number=39  hash=79e6ba..063bd4 blocks=1  txs=1   mgas=0.142  elapsed=15.147ms     mgasps=9.382    triediffs=205.37KiB triedirty=0.00B
INFO [03-04|12:27:45.239] Chain head was updated                   number=39  hash=79e6ba..063bd4 root=da9175..2f02fc elapsed="103.232µs"
INFO [03-04|12:27:45.240] Imported new potential chain segment     number=90  hash=246baf..284d25 blocks=1  txs=1   mgas=0.142  elapsed=13.953ms     mgasps=10.180   triediffs=446.93KiB triedirty=0.00B
INFO [03-04|12:27:45.240] Chain head was updated                   number=90  hash=246baf..284d25 root=388cbb..0f74ce elapsed="103.803µs"
INFO [03-04|12:27:45.243] Imported new potential chain segment     number=49  hash=69a477..4b05a7 blocks=1  txs=1   mgas=0.021  elapsed=5.842ms      mgasps=3.595    triediffs=226.97KiB triedirty=0.00B
INFO [03-04|12:27:45.243] Chain head was updated                   number=49  hash=69a477..4b05a7 root=68763a..97b382 elapsed="69.87µs"
INFO [03-04|12:27:45.244] Imported new potential chain segment     number=59  hash=9ca56f..13a5fa blocks=1  txs=1   mgas=0.021  elapsed=13.599ms     mgasps=1.544    triediffs=276.19KiB triedirty=0.00B
INFO [03-04|12:27:45.245] Chain head was updated                   number=59  hash=9ca56f..13a5fa root=10181c..856a62 elapsed="106.598µs"
INFO [03-04|12:27:45.248] Submitted transaction                    hash=0xb03a100d491473715c228d41324f850f7f1c06933a534dad7f3c1660aa24784d from=0xb386a74Dcab67b66F8AC07B4f08365d37495Dd23 nonce=0   recipient=0xf183F2D67b8a7C59A34c62EBB0444356194761B8 value=0
INFO [03-04|12:27:45.248] DataPoster sent transaction              nonce=0   hash=b03a10..24784d feeCap=42,071,848,360 tipCap=50,000,000    blobFeeCap=<nil> gas=155,759
INFO [03-04|12:27:45.248] BatchPoster: batch sent                  sequenceNumber=1  from=1   to=3   prevDelayed=1  currentDelayed=1  totalSegments=4  numBlobs=0
INFO [03-04|12:27:45.249] Starting work on payload                 id=0x03a78fd0295170d5
--- FAIL: TestSequencerPriceAdjustsFrom25Gwei (11.46s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Comment thread execution/gethexec/executionengine.go Outdated
Comment thread execution/gethexec/executionengine.go Outdated
Comment thread execution/gethexec/executionengine.go Outdated
// different hooks, and we need access to filteringHooks.FilteredTxHash to report
// which tx caused the halt.
if applyDelayedFilter {
if !s.disableDelayedSequencingFilterConfigFetcher() && applyDelayedFilter {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a problem now where applyDelayedFilter is true in the case where we are doing a reorg (resequenceReorgedMessages->sequenceDelayedMessageWithBlockMutex->createBlockFromNextMessage(applyDelayedFilter=true). We shouldn't be going into sequencing mode and hence filtering transactions by address when in reorg mode. The filtered address list may change and cause historically already sequenced transactions to now be filtered. I think, conceptually, we don't want to be in MessageSequencingContext if we are reorging.

I saw your comment that #3111 might address this, but in the meantime, before it is merged, what should we do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this issue today, this is not coupled with introducing filtering BTW.

We can inject SyncMonitor into ExecutionEngine, so ExecutionEngine can check if it is synced before trying to resequence a reorged out message.
But this introduces a circular dependency between ExecutionEngine and SyncMonitor, since SyncMonitor already depends on ExecutionEngine today, which is annoying.
We can solve that, but we are creating more conflicts that will need to be handled by #3111, that already solves that in a more elegant way.

I am OK with not solving that since resequencing reorged out messages is unlikely to happen today, at least in arb1 with our current deployment architecture.

I will let @tsahee decide if we should tackle that right now 🙂

Comment thread execution/gethexec/sequencer.go Outdated
require.NoError(t, err)
require.True(t, senderBalanceAfter.Cmp(senderBalanceBefore) < 0, "sender balance should decrease due to gas consumption")
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test requested in the ticket with two sequencers, one with filtering and one without is not present.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but current test isn't enough for the changes included in this PR?

Comment thread execution/gethexec/executionengine.go Outdated
@Tristan-Wilson
Copy link
Copy Markdown
Member

This PR doesn't actually use the sequencing mode for anything either so it doesn't resolve NIT-4026.

@diegoximenes
Copy link
Copy Markdown
Contributor Author

This PR doesn't actually use the sequencing mode for anything either so it doesn't resolve NIT-4026.

Current PR uses the sequencing mode, but it doesn't change node's behavior based on it today.
My understanding from what I discussed with Tsahi, is that this new mode can be used in the future.

@Tristan-Wilson
Copy link
Copy Markdown
Member

Reassigning to @tsahee since we need his input here.

Comment thread execution/gethexec/sequencer.go Outdated

// must hold createBlockMutex
func (s *ExecutionEngine) createBlockFromNextMessage(msg *arbostypes.MessageWithMetadata, isMsgForPrefetch bool, applyDelayedFilter bool) (*types.Block, *state.StateDB, types.Receipts, error) {
func (s *ExecutionEngine) createBlockFromNextMessage(msg *arbostypes.MessageWithMetadata, isMsgForPrefetch bool, isSequencing bool) (*types.Block, *state.StateDB, types.Receipts, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to check the disableDelayedSequencingFilterConfigFetcher config when calling this function (from sequenceDelayedMessageWithBlockMutex) and not here. That'll make it easier to use the entire config from sequencer and eventually remove the need of executionEngine to be aware of the config.

Copy link
Copy Markdown
Contributor Author

@diegoximenes diegoximenes Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I completely understand this comment, but it is still valid given that this other comment was addressed?

I also created another task to refactor this part of the codebase.

@tsahee tsahee assigned diegoximenes and unassigned tsahee Feb 24, 2026
tsahee
tsahee previously approved these changes Feb 24, 2026
Copy link
Copy Markdown
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsahee tsahee enabled auto-merge February 24, 2026 22:24
@diegoximenes diegoximenes assigned tsahee and unassigned diegoximenes Feb 26, 2026
@tsahee tsahee assigned diegoximenes and unassigned tsahee Feb 28, 2026
Copy link
Copy Markdown
Contributor

@tsahee tsahee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tsahee tsahee added this pull request to the merge queue Mar 5, 2026
Merged via the queue into master with commit f9004e9 Mar 5, 2026
40 of 41 checks passed
@tsahee tsahee deleted the sequencing_run_ctx branch March 5, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants