Skip to content

fix: state pressure benchmark test#3203

Merged
chatton merged 2 commits intomainfrom
cian/fix-state-pressure-measurement-window
Mar 26, 2026
Merged

fix: state pressure benchmark test#3203
chatton merged 2 commits intomainfrom
cian/fix-state-pressure-measurement-window

Conversation

@chatton
Copy link
Contributor

@chatton chatton commented Mar 26, 2026

Summary

Fix State pressure benchmark, there was a timing issue where the test was not actually running long enough, and there were times where it had finished before the time window of metrics was being pulled in ev-reth.

Summary by CodeRabbit

  • Chores
    • Updated benchmark configuration parameters to enhance testing accuracy.

…ndow

With 2 spammers at 200 tx/s each, the previous default of 2000 txs per
spammer meant all 4000 txs could complete during the 3s init sleep +
warmup phase, leaving the measurement window with only empty blocks.
Increasing to 5000 (10000 total) ensures enough txs remain after warmup.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e17f364-304e-4c72-bc4c-5b16351a5be9

📥 Commits

Reviewing files that changed from the base of the PR and between 47ed4ed and 5a8685c.

📒 Files selected for processing (1)
  • test/e2e/benchmark/config.go

📝 Walkthrough

Walkthrough

This PR updates the default value of the BENCH_COUNT_PER_SPAMMER environment parameter in the end-to-end benchmark configuration from 2000 to 5000. No other configuration fields or parsing logic are modified.

Changes

Cohort / File(s) Summary
Benchmark Configuration
test/e2e/benchmark/config.go
Updated default value for BENCH_COUNT_PER_SPAMMER from 2000 to 5000.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Possibly related PRs

Suggested reviewers

  • alpe
  • julienrbrt

Poem

🐰 A spammer count takes flight,
From two-thou to five in the night,
More chaos to test,
Our benchmarks grow blessed,
Hopping faster with all of its might! 🚀

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description includes a summary of the issue and rationale, but lacks the structured template with an 'Overview' section and proper issue reference as specified in the repository template. Restructure the description to follow the template format with a clear 'Overview' section and include issue reference (Closes #issue_number) if applicable.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a timing issue in the state pressure benchmark test by increasing the transaction count threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cian/fix-state-pressure-measurement-window

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Mar 26, 2026

Claude finished @chatton's task in 52s —— View job


Code Review

  • Gather context
  • Read changed files
  • Provide review feedback

Summary

This is a minimal, focused fix: bumping the default CountPerSpammer from 2000 to 5000 in test/e2e/benchmark/config.go:41.

The fix is correct and appropriate. The root cause is clear — with 2 spammers × 2000 txs = 4000 total transactions at a throughput of 200 TPS, the benchmark would complete in ~20 seconds. If ev-reth's metrics scrape window is longer than the actual run duration, results could be sampled from an empty/incomplete window. Raising to 5000 gives 2 × 5000 = 10,000 txs at 200 TPS = ~50 seconds of load, providing a wider measurement window with more headroom.

Observations

test/e2e/benchmark/config.go

  • The change is overridable via BENCH_COUNT_PER_SPAMMER env var, so it doesn't lock in the value for CI environments that tune these numbers explicitly — good.
  • totalCount() (line 51) correctly reflects the new value: 2 × 5000 = 10,000 txs.

Minor Considerations (non-blocking)

  1. Relationship between CountPerSpammer and Throughput: The default Throughput is 200 TPS and ScrapeInterval is 1s. At 200 TPS with 10,000 total txs, the theoretical minimum run duration is ~50 seconds, which is well above any reasonable metrics scrape window. The fix is appropriately sized.

  2. spamoor_state_pressure_test.go uses cfg.CountPerSpammer directly (line 36: "total_count": cfg.CountPerSpammer) rather than cfg.totalCount(). This means each spammer gets CountPerSpammer (5000) txs, and with 2 spammers, the global total is 10,000. The waitForMetricTarget call on line 82 correctly waits for cfg.totalCount() (10,000) cumulative txs before measuring — the logic is consistent.

  3. WaitTimeout of 10 minutes is generous enough to accommodate the increased count without risking flaky timeouts.

Verdict

The change is correct, minimal, and non-breaking. The fix directly addresses the timing issue described in the PR. No issues found.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2026

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 26, 2026, 12:44 PM

@chatton chatton changed the title fix: increase default CountPerSpammer to prevent empty measurement window fix: state pressure benchmark test Mar 26, 2026
@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.42%. Comparing base (47ed4ed) to head (5a8685c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3203   +/-   ##
=======================================
  Coverage   61.42%   61.42%           
=======================================
  Files         120      120           
  Lines       12449    12449           
=======================================
  Hits         7647     7647           
  Misses       3942     3942           
  Partials      860      860           
Flag Coverage Δ
combined 61.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatton chatton marked this pull request as ready for review March 26, 2026 12:41
@chatton chatton added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 162cda6 Mar 26, 2026
39 checks passed
@chatton chatton deleted the cian/fix-state-pressure-measurement-window branch March 26, 2026 13:58
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