Skip to content

Updated spammer#127

Merged
ljoss17 merged 22 commits intomainfrom
marius/spammer
Dec 3, 2025
Merged

Updated spammer#127
ljoss17 merged 22 commits intomainfrom
marius/spammer

Conversation

@mpoke
Copy link
Copy Markdown
Contributor

@mpoke mpoke commented Nov 30, 2025

Replaces #120

  • Enable spammer to fill nonce gaps
  • Stop spammer if the pool size is too large (i.e., 30_000 txs)

Comment thread utils/src/spammer.rs
let nonce_span = nonce.saturating_sub(on_chain_nonce);
if nonce_span > self.max_rate {
debug!("Current nonce={nonce}, on-chain nonce={on_chain_nonce}. Sending 10 txs");
let batch_entries = self.build_batch_entries(10, on_chain_nonce).await?;
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.

Why 10? should it not be none_span?

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.

Just a small number of tx to clear the nonce gap in case there is one. Note that it might be that there is no nonce gap and the blocks are committed slower than the injection rate. So we shouldn't inject a lot of transactions here as we might very well send a lot of duplicates.

@mpoke mpoke marked this pull request as ready for review December 2, 2025 15:01
@mpoke mpoke marked this pull request as draft December 2, 2025 15:01
@sryps sryps marked this pull request as ready for review December 2, 2025 16:44
Comment thread utils/src/spammer.rs
break;
// Report individual results.
for ((_, tx_bytes_len), result) in batch_entries.into_iter().zip(results) {
let mapped_result = result.map(|_| tx_bytes_len);
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.

Why are we discarding the Ok value of results?

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 because it contains the tx hash, which isn't used later anywhere, and we don't care about single tx success because it will slow down the spammer. We should modify this if needed. cc @mpoke

Comment thread utils/src/spammer.rs Outdated
Comment thread utils/src/spammer.rs

// Report individual results.
for ((_, tx_bytes_len), result) in batch_entries.into_iter().zip(results) {
let mapped_result = result.map(|_| tx_bytes_len);
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.

Same question here

Copy link
Copy Markdown
Contributor

@ljoss17 ljoss17 left a comment

Choose a reason for hiding this comment

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

Pre-approving.
Left a few questions

@ljoss17 ljoss17 merged commit 69937ba into main Dec 3, 2025
5 checks passed
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.

5 participants