Skip to content

Add Benchmark Sequencer System Test#4341

Open
KolbyML wants to merge 9 commits into
masterfrom
nit-3912-bench2
Open

Add Benchmark Sequencer System Test#4341
KolbyML wants to merge 9 commits into
masterfrom
nit-3912-bench2

Conversation

@KolbyML

@KolbyML KolbyML commented Feb 5, 2026

Copy link
Copy Markdown
Member

Fixes NIT-4481 this code was originally apart of NIT-3912

@codecov

codecov Bot commented Feb 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.70%. Comparing base (9927906) to head (14bd65e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4341      +/-   ##
==========================================
- Coverage   32.79%   32.70%   -0.10%     
==========================================
  Files         494      496       +2     
  Lines       58611    58675      +64     
==========================================
- Hits        19223    19190      -33     
- Misses      36026    36110      +84     
- Partials     3362     3375      +13     

@github-actions

github-actions Bot commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

❌ 6 Tests Failed:

Tests completed Failed Passed Skipped
4402 6 4396 0
View the top 3 failed tests by shortest run time
TestInvalidSignatureMessagesAreSkipped
Stack Traces | 0.230s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
ERROR[03-10|18:00:18.132] error validating feed signature          error="signature not verified: signer not approved" "sequence number"=3
ERROR[03-10|18:00:18.132] error validating one or more feed signatures, skipping the message
--- FAIL: TestInvalidSignatureMessagesAreSkipped (0.23s)
ERROR[03-10|18:00:18.319] Server connection timed out without receiving data url=ws://127.0.0.1:43173/ err="read tcp4 127.0.0.1:38594->127.0.0.1:43173: i/o timeout"
INFO [03-10|18:00:18.319] First reconnection attempt, skipping backoff url=ws://127.0.0.1:43173/
ERROR[03-10|18:00:18.323] Server connection timed out without receiving data url=ws://127.0.0.1:34877/ err="read tcp4 127.0.0.1:44420->127.0.0.1:34877: i/o timeout"
INFO [03-10|18:00:18.323] First reconnection attempt, skipping backoff url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.323] connecting to arbitrum inbox message broadcaster url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.324] Feed connected                           feedServerVersion=2 chainId=8742 requestedSeqNum=0
ERROR[03-10|18:00:18.525] Server connection timed out without receiving data url=ws://127.0.0.1:34877/ err="read tcp4 127.0.0.1:44428->127.0.0.1:34877: i/o timeout"
INFO [03-10|18:00:18.525] First reconnection attempt, skipping backoff url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.525] connecting to arbitrum inbox message broadcaster url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.525] Feed connected                           feedServerVersion=2 chainId=8742 requestedSeqNum=0
ERROR[03-10|18:00:18.726] Server connection timed out without receiving data url=ws://127.0.0.1:34877/ err="read tcp4 127.0.0.1:44440->127.0.0.1:34877: i/o timeout"
INFO [03-10|18:00:18.726] First reconnection attempt, skipping backoff url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.726] connecting to arbitrum inbox message broadcaster url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.726] Feed connected                           feedServerVersion=2 chainId=8742 requestedSeqNum=0
ERROR[03-10|18:00:18.927] Server connection timed out without receiving data url=ws://127.0.0.1:34877/ err="read tcp4 127.0.0.1:44456->127.0.0.1:34877: i/o timeout"
INFO [03-10|18:00:18.927] First reconnection attempt, skipping backoff url=ws://127.0.0.1:34877/
INFO [03-10|18:00:18.928] connecting to arbitrum inbox message broadcaster url=ws://127.0.0.1:34877/
TestVersion40
Stack Traces | 5.680s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        github.com/offchainlabs/nitro/system_tests.Require(0xc050cc2000, {0x40d4620, 0xc139b32ea0}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:2080 +0x5d
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc050cc2000, 0x28, {0xc0d559ddf8, 0x5, 0x39?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion40(0xc050cc2000?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:71 +0x64b
        testing.tRunner(0xc050cc2000, 0x3d4bf18)
        	/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-10|18:08:30.579] Writing cached state to disk             block=1  hash=6a2d99..06f6e2 root=d45d64..4e7811
INFO [03-10|18:08:30.579] Persisted trie from memory database      nodes=23  flushnodes=0 size=3.61KiB   flushsize=0.00B time="111.077µs" flushtime=0s gcnodes=0 gcsize=0.00B gctime=592ns      livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.579] Writing cached state to disk             block=1  hash=6a2d99..06f6e2 root=d45d64..4e7811
INFO [03-10|18:08:30.579] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time=602ns       flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s         livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.579] Writing snapshot state to disk           root=28fb26..40a768
INFO [03-10|18:08:30.579] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time=450ns       flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s         livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.580] Blockchain stopped
--- FAIL: TestVersion40 (5.68s)
TestVersion30
Stack Traces | 5.680s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:2080 +0x5d
        github.com/offchainlabs/nitro/system_tests.testPrecompiles(0xc042ccddc0, 0x1e, {0xc0967a5db0, 0x6, 0xd0?})
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:94 +0x371
        github.com/offchainlabs/nitro/system_tests.TestVersion30(0xc042ccddc0?)
        	/home/runner/work/nitro/nitro/system_tests/precompile_inclusion_test.go:67 +0x798
        testing.tRunner(0xc042ccddc0, 0x3d4bf10)
        	/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-10|18:08:30.582] Writing cached state to disk             block=1  hash=444271..c667d6 root=8448b4..050cee
INFO [03-10|18:08:30.582] Persisted trie from memory database      nodes=20  flushnodes=0 size=3.26KiB   flushsize=0.00B time="146.825µs" flushtime=0s gcnodes=0 gcsize=0.00B gctime="2.294µs"  livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.582] Writing cached state to disk             block=1  hash=444271..c667d6 root=8448b4..050cee
INFO [03-10|18:08:30.582] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time="2.234µs"   flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s         livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.582] Writing snapshot state to disk           root=6b754c..7398ca
INFO [03-10|18:08:30.582] Persisted trie from memory database      nodes=0   flushnodes=0 size=0.00B     flushsize=0.00B time="1.272µs"   flushtime=0s gcnodes=0 gcsize=0.00B gctime=0s         livenodes=0   livesize=0.00B
INFO [03-10|18:08:30.583] Blockchain stopped
INFO [03-10|18:08:30.583] Submitted transaction                    hash=0xc453d8cb78a0068a0e1f91636b3c5f62ffd0aed9f65e3998a740cc31252ba85e from=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A nonce=69  recipient=0xaF24Ca6c2831f4d4F629418b50C227DF0885613A value=1
--- FAIL: TestVersion30 (5.68s)

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

@KolbyML KolbyML changed the title Benchmark portion of NIT-3912 Add Benchmark Sequencer System Test Feb 6, 2026
@KolbyML KolbyML marked this pull request as ready for review February 6, 2026 17:37
Comment thread Makefile Outdated
Comment thread execution/gethexec/bench_sequencer.go Outdated
Comment thread changelog/kolbyml-nit-4481.md
Comment thread system_tests/bench_sequencer_stub_test.go Outdated
Comment thread system_tests/bench_sequencer_test.go Outdated
Comment thread system_tests/bench_sequencer_test.go Outdated
@KolbyML

KolbyML commented Feb 10, 2026

Copy link
Copy Markdown
Member Author

I am just going to mark this as draft, and let the other PR merge first

@KolbyML KolbyML marked this pull request as draft February 10, 2026 00:28
@pmikolajczyk41

Copy link
Copy Markdown
Member

let me assign this PR back to you; once ready for review, please reassign me

@KolbyML KolbyML marked this pull request as ready for review March 10, 2026 19:02
@KolbyML KolbyML assigned gligneul and unassigned KolbyML Mar 10, 2026
@KolbyML KolbyML requested a review from gligneul March 10, 2026 19:02
@KolbyML

KolbyML commented Mar 10, 2026

Copy link
Copy Markdown
Member Author

@pmikolajczyk41 @gligneul ready for another look 🫡

@pmikolajczyk41 pmikolajczyk41 left a comment

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.

nothing really blocking, just a bunch of comments and questions; generally LGTM

Comment on lines +4 to +5
// DANGER! this file is included in all builds
// DANGER! do not place any experimental tag logic here

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.

do you find these warnings helpful? I guess that nitro just won't compile, if one adds the experimental tag here

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 believe the comment means not to add experimental logic here because it is included in all builds.


func (c *BenchmarkingSequencerConfig) Validate() error {
if c.Enable {
log.Warn("benchmarking sequencer requested but not supported in this build (missing experimental build tag)")

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.

I'd consider returning an error here in case someone explicitly requests benchmarking, but doesn't add the tag

"--http.port", "8547",
"--http.addr", "127.0.0.1",
"--http.api=net,web3,eth,arb,arbdebug,debug",
"--http.api=net,web3,eth,arb,arbdebug,debug,benchseq",

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.

thinking out loud - in Rust, I'd definitely recommend:

#[cfg(feature = "experimental")]
"--http.api=net,web3,eth,arb,arbdebug,debug,benchseq",
#[cfg(not(feature = "experimental"))]
"--http.api=net,web3,eth,arb,arbdebug,debug",

but in Go, I'm wondering if we should somehow tag-gate this api, so that user's won't see unsupported api in the list

Comment on lines +229 to +232
if err := c.BenchmarkingSequencer.Validate(); err != nil {
return err
}
return nil

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.

maybe for now:

Suggested change
if err := c.BenchmarkingSequencer.Validate(); err != nil {
return err
}
return nil
return c.BenchmarkingSequencer.Validate()

return nil, err
}
txPublisher = sequencer
if config.Dangerous.BenchmarkingSequencer.Enable {

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.

we don't need this condition, do we?

Fatal(t, "benchseq_txRetryQueueLength failed with unexpected error:", err)
}
var blockCreated bool
// create block with all of the transactions (they should fit)

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.

leftover comment?

Comment on lines +52 to +69
// check that blocks are created automatically
startBlock, err := builder.L2.Client.BlockNumber(ctx)
Require(t, err)
tx := builder.L2Info.PrepareTx("Owner", "Owner", builder.L2Info.TransferGas, big.NewInt(1), nil)
builder.L2.SendWaitTestTransactions(t, types.Transactions{tx})
timeout := time.After(5 * time.Second)
for {
block, err := builder.L2.Client.BlockNumber(ctx)
Require(t, err)
if block > startBlock {
break
}
select {
case <-timeout:
Fatal(t, "timeout exceeded while waiting for new block")
case <-time.After(20 * time.Millisecond):
}
}

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.

you can consider checkBatchPosting utility instead

}

func (s *BenchmarkingSequencer) Start(ctx context.Context) error {
// override Sequencer.Start to not start the inner sequencer

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.

if we don't start the inner sequencer, how can createBlock succeed? shouldn't we run the logic from sequencer.go:Start() at some point?

return fmt.Errorf("error validating ConsensusRPCClient config: %w", err)
}
if err := c.Dangerous.Validate(); err != nil {
return err

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.

just for consistency, you can add context for the error, as the checks above do

}
// check that tx queue is empty
var txQueueLen int
err = rpcClient.CallContext(ctx, &txQueueLen, "benchseq_txQueueLength", false)

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.

does it make sense to test benchseq_txRetryQueueLength as well? I think we don't call this endpoint at all

@pmikolajczyk41

Copy link
Copy Markdown
Member

oh, and you probably miss a companion geth PR (or at least a link in the description)

@gligneul gligneul assigned KolbyML and unassigned gligneul Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants