rewrite of sei-load generator and sender.#56
Conversation
PR SummaryHigh Risk Overview Sender: The dispatcher, open/closed-loop scheduler, and sharded worker queues are gone. Generator: Other: Scenarios return signed Reviewed by Cursor Bugbot for commit a28e7c0. Bugbot is set up for automated code reviews on this repo. Configure here. |
| if nonce != state.nextNonce { | ||
| // It is expected in case of send failure. | ||
| log.Printf("bad nonce for %v: got %v, want %v", addr, nonce, state.nextNonce) | ||
| return nil |
There was a problem hiding this comment.
Dropped txs look successful
Medium Severity
When TxsQueue.Push rejects a transaction for a nonce mismatch, it logs and returns nil. Generator.Run treats that as a successful send and immediately builds another transaction, which can spin at full speed without making progress until context cancel if the queue and generator stay desynchronized.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 91db965. Configure here.
| }, nil | ||
| cfg: cfg, | ||
| queue: NewTxsQueue(cfg.Settings.MaxInFlight), | ||
| limiter: limiter, |
There was a problem hiding this comment.
Buffer size no longer bounds queue
Medium Severity
NewShardedSender sizes TxsQueue only from Settings.MaxInFlight. Settings.BufferSize and LoadConfig.TotalQueueSize() are no longer used, so existing configs that tune bufferSize/--buffer-size do not limit queue depth or memory as before.
Reviewed by Cursor Bugbot for commit 34ba3fe. Configure here.
| attribute.String("chain_id", stats.ChainID), | ||
| )) | ||
| } | ||
| }*/ |
There was a problem hiding this comment.
Worker queue metric disabled
Low Severity
The worker_queue_length observable gauge callback no longer records observations: the ShardStats loop is commented out and only assigns _ = ss. Scrapers always see an empty series after the sender rewrite removed per-shard queues.
Reviewed by Cursor Bugbot for commit 34ba3fe. Configure here.
| } | ||
| ltx := &types.LoadTx{EthTx: tx, IntendedSendTime: time.Now(), Scenario: scenario} | ||
| if err := txSender.Send(ctx, ltx); err != nil { | ||
| return err |
There was a problem hiding this comment.
Stale nonce before async send
Medium Severity
Run reads txSender.Nonce, builds and signs the tx, then calls Send without holding sender/queue state. A concurrent send failure and Reset can advance the queue nonce before Push, producing signed txs the queue rejects.
Reviewed by Cursor Bugbot for commit b83e882. Configure here.
There was a problem hiding this comment.
Rejection is silent and it is expected, since we send the txs asynchronously.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 5 total unresolved issues (including 4 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a28e7c0. Configure here.
| // Start the sender (starts all workers) | ||
| s.SpawnBgNamed("sender", func() error { return sharedSender.Run(ctx) }) | ||
| log.Printf("✅ Connected to %d endpoints", len(cfg.Endpoints)) | ||
| snd = sharedSender |
There was a problem hiding this comment.
Workers setting no longer applied
Medium Severity
The send path now runs a single ShardedSender background task and no longer uses Settings.TasksPerEndpoint (workers) or LoadConfig.GetNumShards, even though those settings remain in config, CLI, and tests. Raising --workers does not increase RPC parallelism as documented.
Reviewed by Cursor Bugbot for commit a28e7c0. Configure here.


Primary reason for the rewrite is support for non-happy paths for autobahn loadtesting - rejected transactions/not successfully executed/etc. The idea is that if sending a tx fails, we need to check the account nonce before sending the next transaction. Note that this affects only accounts from the long-lived pools - accounts generated for the sake of sending just 1 transaction (aka "new accounts") do not benefit from this extra logic.
The nonces, as well as the txs waiting to be sent are managed by TxsQueue, which ensures that:
TxsQueue is managed by ShardedSender.
Additionally