Add Benchmark Sequencer System Test#4341
Conversation
Codecov Report❌ Patch coverage is 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 |
❌ 6 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
|
I am just going to mark this as draft, and let the other PR merge first |
|
let me assign this PR back to you; once ready for review, please reassign me |
|
@pmikolajczyk41 @gligneul ready for another look 🫡 |
pmikolajczyk41
left a comment
There was a problem hiding this comment.
nothing really blocking, just a bunch of comments and questions; generally LGTM
| // DANGER! this file is included in all builds | ||
| // DANGER! do not place any experimental tag logic here |
There was a problem hiding this comment.
do you find these warnings helpful? I guess that nitro just won't compile, if one adds the experimental tag here
There was a problem hiding this comment.
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)") |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
| if err := c.BenchmarkingSequencer.Validate(); err != nil { | ||
| return err | ||
| } | ||
| return nil |
There was a problem hiding this comment.
maybe for now:
| 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 { |
There was a problem hiding this comment.
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) |
| // 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): | ||
| } | ||
| } |
There was a problem hiding this comment.
you can consider checkBatchPosting utility instead
| } | ||
|
|
||
| func (s *BenchmarkingSequencer) Start(ctx context.Context) error { | ||
| // override Sequencer.Start to not start the inner sequencer |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
does it make sense to test benchseq_txRetryQueueLength as well? I think we don't call this endpoint at all
|
oh, and you probably miss a companion geth PR (or at least a link in the description) |
Fixes NIT-4481 this code was originally apart of NIT-3912