Skip to content

feat: add TestStatePressure benchmark for state trie stress test#3188

Merged
chatton merged 5 commits intomainfrom
cian/add-state-pressure-benchmark
Mar 24, 2026
Merged

feat: add TestStatePressure benchmark for state trie stress test#3188
chatton merged 5 commits intomainfrom
cian/add-state-pressure-benchmark

Conversation

@chatton
Copy link
Contributor

@chatton chatton commented Mar 23, 2026

Summary

  • Add TestStatePressure benchmark measuring SSTORE-heavy throughput
  • Use benchConfig with BENCH_* env vars, add BENCH_GAS_UNITS_TO_BURN
  • Add CI job

Part of #2288

Results , local docker

Run Block Time Gas Limit Spammers Throughput Gas/Tx MGas/s ProduceBlock avg Overhead ev-reth GGas/s
1 100ms 100M 4 30 2M 206.46 154ms 1.1% 0.418
2 100ms 100M 6 50 2M 247.47 191ms 0.8% 0.488
3 100ms 100M 8 80 2M 252.89 168ms 0.6% 0.579
4 100ms 200M 8 80 5M 215.29 429ms 4.9% 0.626
5 500ms 200M 8 80 5M 189.11 365ms 0.5% 0.606
6 100ms 100M 10 100 2M 271.95 172ms 12.5% 0.663
7 100ms 100M 8 100 2M 199.78 211ms 10.8% 0.473
8 100ms 300M 6 60 2M 325.35 300ms 0.5% 0.642
9 100ms 300M 8 80 2M 316.70 463ms 11.7% 0.661
10 100ms 500M 6 80 2M 271.54 615ms 10.3% 0.521
11 2s 1G 8 120 10M 290.71 1352ms 0.2% 0.824
12 50ms 100M 6 60 2M 263.59 173ms 0.8% 0.585
13 50ms 30M 6 60 2M 138.11 96ms 6.3% 0.334
14 50ms 300M 8 100 2M 268.89 409ms 0.4% 0.512

Best sustained: 325 MGas/s (run 8). Highest ev-reth rate: 0.824 GGas/s (run 11).
Storage writes ~40% slower than pure compute (325 vs ~383 MGas/s gasburner).
ev-node overhead: 0.2-1.1% in clean runs. 50ms blocks not achievable under load.

Summary by CodeRabbit

  • Tests
    • Added a new end-to-end state-pressure benchmark that runs a sustained transaction spam scenario and records timing, block, and trace metrics to validate system behavior under load.
  • Chores
    • Added a CI job to execute the state-pressure benchmark as part of automated workflows (results collection/publishing not changed in this update).

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 23, 2026, 8:47 PM

@claude
Copy link
Contributor

claude bot commented Mar 23, 2026

Claude finished @chatton's task in 2m 15s —— View job


Code Review

  • Gather context and read changed files
  • Review test implementation (spamoor_state_pressure_test.go)
  • Review CI workflow changes (benchmark.yml)
  • Post comprehensive review

The test is well-structured and closely follows the established pattern from TestDeFiSimulation. Good work overall. A few things worth flagging:


test/e2e/benchmark/spamoor_state_pressure_test.go

Potential test reliability gap — silent timeout on completion wait

waitForMetricTarget (used at lines 70 and 82) silently returns when it times out — it logs a message but does not fail the test:

// helpers.go:475-478
case <-timer.C:
    t.Logf("metric %s did not reach target %.0f within %v", name, target, timeout)
    return  // no t.Fatal / require.Fail

If the send target is never reached (e.g. spammers stuck, infra slow), the test proceeds, collects partial block metrics, and reports misleading throughput numbers. The only guard is s.Require().Greater(result.summary.SteadyState, time.Duration(0)) — which would trigger a confusing "non-zero steady-state" message rather than "timed out waiting for N txs".

This pattern is also present in TestDeFiSimulation, so it's not new, but it's worth tracking as a tech debt item. An alternative would be to check a bool return from waitForMetricTarget and t.Fatal on timeout, or add an assert.GreaterOrEqual(t, sent, float64(cfg.totalCount()), "target not reached") after the call. Fix this →


Minor: doc comment has stale scrape interval

The doc comment at line 17 says "25ms scrape" but newBenchConfig defaults ScrapeInterval to "1s". The same stale value appears in TestDeFiSimulation's comment — this was likely copied from there. Worth fixing so the documented defaults match reality.


Good: s.Require().Zero(failed) assertion (line 113)

This is a meaningful improvement over TestDeFiSimulation which drops the failed-tx check entirely. Catching non-zero failures here makes regressions in storage-heavy scenarios easier to diagnose.


Good: explicit warmup phase

The two-phase approach (warmup → measurement window) is cleaner than TestERC20Throughput's approach of recording startBlock before wallets are funded. The e.traces.resetStartTime() call after warmup ensures trace spans are correctly scoped.


Good: id capture in cleanup closure is correct

for i := range cfg.NumSpammers {
    id, err := e.spamoorAPI.CreateSpammer(...)  // new `id` per iteration
    t.Cleanup(func() { _ = e.spamoorAPI.DeleteSpammer(id) })
}

id is declared inside the loop body (not the range variable), so each closure captures its own copy. No stale closure bug here.


.github/workflows/benchmark.yml

Unpinned extractions/setup-just@v3 (line 139)

This is pre-existing across all jobs in the file, but the new job adds another instance. Per the CodeQL finding and to match how other steps are pinned, this should use a commit SHA. The hash proposed by CodeRabbit (f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b) looks correct for v3.

# current (unpinned)
- name: Install just
  uses: extractions/setup-just@v3

# pinned
- name: Install just
  uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3

Note: I'm unable to modify .github/workflows/ files directly (GitHub App permissions don't allow workflow file edits). This fix needs to be applied manually.


No artifact upload (nitpick)

As noted by CodeRabbit: the job doesn't persist results as artifacts. Given the # TODO: wire up to publish results comment on line 125, this is intentional for now — just worth keeping in mind when the TODO is addressed.


Verdict: Looks good to merge with the minor doc comment fix. The waitForMetricTarget silent-timeout issue is pre-existing and doesn't block this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

Added a GitHub Actions job "State Pressure Benchmark" and a new E2E benchmark test (build tag evm) that configures Spamoor spammers, runs warmup and measurement phases, collects block/trace metrics, and emits a StatePressure benchmark result. (50 words)

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
​.github/workflows/benchmark.yml
Added state-pressure-benchmark job that checks out the repo, sets up Go, configures Docker Buildx, installs just, builds evm/da via just, and runs the state-pressure E2E test (go test -tags evm -run='^TestSpamoorSuite$/^TestStatePressure$' -timeout=15m). Job not wired to artifact upload/publish in this diff.
E2E Benchmark Tests
test/e2e/benchmark/spamoor_state_pressure_test.go
New test (*SpamoorSuite).TestStatePressure() (build tag evm) that configures an ev-node-state-pressure environment, clears/creates/configures Spamoor spammers, performs warmup then measurement, drains pending txs, collects block-level gas/tx metrics and traces, builds/writes a StatePressure benchmark result, and asserts basic spamoor metrics.

Sequence Diagram

sequenceDiagram
    participant Test as State Pressure Test
    participant Spamoor as Spamoor Spammers
    participant EVM as EVM Node
    participant Metrics as Metrics Collector

    rect rgba(220, 220, 255, 0.5)
    Test->>Test: Setup env (ev-node-state-pressure)\nConfigure spammer params
    end

    Test->>Spamoor: Create/start configured spammers
    Spamoor->>EVM: Send transaction stream

    rect rgba(255, 200, 100, 0.5)
    Note over Test,Metrics: Warmup phase
    Spamoor->>Metrics: Increment spamoor_transactions_sent_total
    Test->>Metrics: Wait for warmup target\nReset trace start time
    end

    Test->>Metrics: Record start block header

    rect rgba(100, 200, 255, 0.5)
    Note over Test,Metrics: Measurement phase
    Spamoor->>EVM: Continue sending to target count
    EVM->>Metrics: Record block gas/tx metrics
    Test->>Metrics: Wait for overall target reached
    end

    Test->>Test: Measure duration\nRecord end block header
    Test->>Metrics: Collect metrics & traces
    Test->>Test: Build and validate StatePressure result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • alpe
  • julienrbrt

Poem

🐰
I hopped in to spin up spammers and cheer,
Warmup then pressure — metrics appear,
Blocks and traces counted with light,
Benchmarks hum through day and night,
A tiny rabbit applauds this new test here!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add TestStatePressure benchmark for state trie stress test' directly and accurately describes the main change—adding a new benchmark test for measuring state trie performance under SSTORE-heavy load.
Description check ✅ Passed The PR description provides a clear summary of changes (adding TestStatePressure benchmark with benchConfig and CI job), references the related issue (#2288), and includes comprehensive local Docker benchmark results demonstrating the work's impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/add-state-pressure-benchmark

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.

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Install just
uses: extractions/setup-just@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Benchmarks' step
Uses Step
uses 'extractions/setup-just' with ref 'v3', not a pinned commit hash
@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.14%. Comparing base (f9c8717) to head (ebb914e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3188   +/-   ##
=======================================
  Coverage   61.14%   61.14%           
=======================================
  Files         117      117           
  Lines       12082    12082           
=======================================
  Hits         7387     7387           
  Misses       3868     3868           
  Partials      827      827           
Flag Coverage Δ
combined 61.14% <ø> (ø)

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/benchmark.yml (1)

119-123: Consider adding artifact upload for benchmark results.

The evm-benchmark and spamoor-benchmark jobs upload their results as artifacts, but this job (like erc20-benchmark) does not. If the benchmark produces useful output (e.g., via BENCH_JSON_OUTPUT), consider adding an upload step for result persistence and comparison across runs.

📦 Optional: Add artifact upload
       - name: Run state pressure test
         run: |
-          cd test/e2e && go test -tags evm \
+          cd test/e2e && BENCH_JSON_OUTPUT=state_pressure_bench.json go test -tags evm \
             -run='^TestSpamoorSuite$/^TestStatePressure$' -v -timeout=15m \
             ./benchmark/ --evm-binary=../../../build/evm
+      - name: Upload benchmark results
+        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
+        with:
+          name: state-pressure-benchmark-results
+          path: test/e2e/benchmark/state_pressure_bench.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 119 - 123, The "Run state
pressure test" step currently runs the benchmark but doesn't persist results;
add an upload-artifact step similar to the evm-benchmark/spamoor-benchmark jobs
to save the benchmark output (e.g., the BENCH_JSON_OUTPUT file or benchmark
directory). Specifically, after the run block in the "Run state pressure test"
job, add a step named like "Upload state pressure benchmark results" that uses
actions/upload-artifact to upload the BENCH_JSON_OUTPUT (or the generated
JSON/bench directory) with a clear name (e.g., state-pressure-results-${{
github.run_id }}), so outputs are retained for later download and comparison.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/benchmark.yml:
- Around line 115-116: Replace the unpinned GitHub Action reference uses:
extractions/setup-just@v3 with the same action pinned to a specific commit SHA
so the workflow uses a fixed revision; locate the line referencing the
setup-just action (uses: extractions/setup-just@v3) and update it to the
commit-pinned form (the action's repository@<commit-sha>) matching how other
actions are pinned in this workflow.

---

Nitpick comments:
In @.github/workflows/benchmark.yml:
- Around line 119-123: The "Run state pressure test" step currently runs the
benchmark but doesn't persist results; add an upload-artifact step similar to
the evm-benchmark/spamoor-benchmark jobs to save the benchmark output (e.g., the
BENCH_JSON_OUTPUT file or benchmark directory). Specifically, after the run
block in the "Run state pressure test" job, add a step named like "Upload state
pressure benchmark results" that uses actions/upload-artifact to upload the
BENCH_JSON_OUTPUT (or the generated JSON/bench directory) with a clear name
(e.g., state-pressure-results-${{ github.run_id }}), so outputs are retained for
later download and comparison.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4a0f6a69-98c1-4a47-a97c-f21b9d439a6f

📥 Commits

Reviewing files that changed from the base of the PR and between a44ae05 and 983abca.

📒 Files selected for processing (2)
  • .github/workflows/benchmark.yml
  • test/e2e/benchmark/spamoor_state_pressure_test.go

Comment on lines +115 to +116
- name: Install just
uses: extractions/setup-just@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get the commit SHA for extractions/setup-just v3 tag
curl -s "https://api.github.com/repos/extractions/setup-just/git/refs/tags/v3" | jq -r '.object.sha'

Repository: evstack/ev-node

Length of output: 63


🏁 Script executed:

#!/bin/bash

# Try alternative method to get the commit SHA for the v3 tag
# Using the commits API instead
curl -s "https://api.github.com/repos/extractions/setup-just/releases/tags/v3" | jq -r '.target_commitish'

echo "---"

# Also try getting commit info directly
curl -s "https://api.github.com/repos/extractions/setup-just/git/refs/tags/v3" | jq '.'

Repository: evstack/ev-node

Length of output: 448


🏁 Script executed:

#!/bin/bash

# Check if the repository exists and list recent releases
curl -s "https://api.github.com/repos/extractions/setup-just" | jq -r '.name, .full_name, .archived'

echo "---"

# Get all releases
curl -s "https://api.github.com/repos/extractions/setup-just/releases" | jq -r '.[0:3] | .[] | "\(.tag_name): \(.target_commitish)"'

Repository: evstack/ev-node

Length of output: 108


🏁 Script executed:

#!/bin/bash

# Check the benchmark.yml file around lines 115-116
sed -n '110,120p' .github/workflows/benchmark.yml

Repository: evstack/ev-node

Length of output: 501


Pin setup-just action to a commit hash.

The extractions/setup-just@v3 action is not pinned to a specific commit hash, unlike other actions in this workflow (e.g., actions/setup-go, docker/setup-buildx-action). Pinning to a commit hash improves supply chain security.

🔒 Proposed fix to pin the action
       - name: Install just
-        uses: extractions/setup-just@v3
+        uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install just
uses: extractions/setup-just@v3
- name: Install just
uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3
🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 116-116: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Benchmarks' step Uses Step uses 'extractions/setup-just' with ref 'v3', not a pinned commit hash

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 115 - 116, Replace the unpinned
GitHub Action reference uses: extractions/setup-just@v3 with the same action
pinned to a specific commit SHA so the workflow uses a fixed revision; locate
the line referencing the setup-just action (uses: extractions/setup-just@v3) and
update it to the commit-pinned form (the action's repository@<commit-sha>)
matching how other actions are pinned in this workflow.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.github/workflows/benchmark.yml (1)

116-117: ⚠️ Potential issue | 🟠 Major

Pin setup-just to a commit SHA (still unpinned).

Line [117] uses a mutable tag (extractions/setup-just@v3). Please pin to an immutable commit hash to reduce supply-chain risk.

🔒 Proposed fix
-      - name: Install just
-        uses: extractions/setup-just@v3
+      - name: Install just
+        uses: extractions/setup-just@<full-40-char-commit-sha> # v3
#!/bin/bash
# Verify unpinned uses in this workflow
rg -nP 'uses:\s*extractions/setup-just@(?![0-9a-f]{40}\b)' .github/workflows/benchmark.yml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 116 - 117, The workflow uses an
unpinned third-party action reference "extractions/setup-just@v3"; replace this
mutable tag with a specific commit SHA for the extractions/setup-just action
(e.g., extractions/setup-just@<40-char-commit-sha>) so the step named "Install
just" is pinned to an immutable reference; update the uses value accordingly and
verify the SHA corresponds to the intended release commit in the setup-just
repository.
🧹 Nitpick comments (1)
.github/workflows/benchmark.yml (1)

120-124: Persist state-pressure benchmark output for later comparison.

The new job runs the test but does not persist structured results, so trend/regression analysis is harder. Consider emitting JSON and uploading an artifact (same pattern as spamoor-benchmark).

📊 Suggested update
       - name: Run state pressure test
         run: |
-          cd test/e2e && go test -tags evm \
+          cd test/e2e && BENCH_JSON_OUTPUT=state_pressure_bench.json go test -tags evm \
             -run='^TestSpamoorSuite$/^TestStatePressure$' -v -timeout=15m \
             ./benchmark/ --evm-binary=../../../build/evm
+      - name: Upload benchmark results
+        uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
+        with:
+          name: state-pressure-benchmark-results
+          path: test/e2e/benchmark/state_pressure_bench.json
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 120 - 124, The "Run state
pressure test" job currently runs the Go test but doesn't persist structured
results; change the test invocation (the go test call in the Run state pressure
test step) to emit JSON output (use go test -json or the test's JSON flag) and
redirect it to a file (e.g. state-pressure-results.json) in the workspace, then
add a following step that uploads that file as an artifact (mirror the pattern
used by the spamoor-benchmark artifact upload, using actions/upload-artifact and
a descriptive name like state-pressure-benchmark) so results are stored for
later trend/regression analysis.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/benchmark.yml:
- Around line 116-117: The workflow uses an unpinned third-party action
reference "extractions/setup-just@v3"; replace this mutable tag with a specific
commit SHA for the extractions/setup-just action (e.g.,
extractions/setup-just@<40-char-commit-sha>) so the step named "Install just" is
pinned to an immutable reference; update the uses value accordingly and verify
the SHA corresponds to the intended release commit in the setup-just repository.

---

Nitpick comments:
In @.github/workflows/benchmark.yml:
- Around line 120-124: The "Run state pressure test" job currently runs the Go
test but doesn't persist structured results; change the test invocation (the go
test call in the Run state pressure test step) to emit JSON output (use go test
-json or the test's JSON flag) and redirect it to a file (e.g.
state-pressure-results.json) in the workspace, then add a following step that
uploads that file as an artifact (mirror the pattern used by the
spamoor-benchmark artifact upload, using actions/upload-artifact and a
descriptive name like state-pressure-benchmark) so results are stored for later
trend/regression analysis.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 66bc87a2-5106-4c3d-8996-880f4fd85dcb

📥 Commits

Reviewing files that changed from the base of the PR and between 983abca and 4853272.

📒 Files selected for processing (2)
  • .github/workflows/benchmark.yml
  • test/e2e/benchmark/spamoor_state_pressure_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/benchmark/spamoor_state_pressure_test.go

chatton added 4 commits March 23, 2026 13:37
- use cfg.GasUnitsToBurn instead of re-reading env var with different default
- add comment explaining time.Sleep before requireSpammersRunning
- add post-run assertions for sent > 0 and failed == 0
- add TODO comment for CI result publishing
@chatton chatton force-pushed the cian/add-state-pressure-benchmark branch from 4853272 to b6b0af4 Compare March 23, 2026 13:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
.github/workflows/benchmark.yml (1)

138-139: ⚠️ Potential issue | 🟠 Major

Pin extractions/setup-just to an immutable commit SHA.

Line 139 uses a movable tag (@v3), which weakens workflow supply-chain guarantees.

🔒 Suggested change
-      - name: Install just
-        uses: extractions/setup-just@v3
+      - name: Install just
+        uses: extractions/setup-just@f8a3cce218d9f83db3a2ecd90e41ac3de6cdfd9b # v3
#!/bin/bash
set -euo pipefail
# Verify the current target object for tag v3 before pinning.
curl -s https://api.github.com/repos/extractions/setup-just/git/ref/tags/v3 | jq -r '.object.sha'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/benchmark.yml around lines 138 - 139, Replace the movable
tag on the GitHub Action usage so the workflow uses an immutable commit SHA
instead of "extractions/setup-just@v3": locate the job step that sets up just
(the step with uses: "extractions/setup-just@v3") and change the reference to
the repository@<commit-sha> where <commit-sha> is the full SHA obtained from the
repo (e.g., the object SHA for tag v3); ensure you paste the full 40-char commit
SHA and update the workflow commit message accordingly.
🧹 Nitpick comments (1)
test/e2e/benchmark/spamoor_state_pressure_test.go (1)

58-60: Replace fixed sleep with condition-based readiness wait.

Line 59 adds a hard delay that can be flaky under variable CI load and makes runtime less deterministic. Prefer polling readiness directly (or rely on requireSpammersRunning if it already handles retries) instead of sleeping.

♻️ Suggested change
-	// allow spamoor time to initialise spammer goroutines before polling status
-	time.Sleep(3 * time.Second)
 	requireSpammersRunning(t, e.spamoorAPI, spammerIDs)

As per coding guidelines "Ensure tests are deterministic in Go".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/benchmark/spamoor_state_pressure_test.go` around lines 58 - 60,
Replace the fixed time.Sleep(3 * time.Second) with a condition-based wait:
remove the hard sleep and instead poll the spamoor readiness by calling or
extending requireSpammersRunning(t, e.spamoorAPI, spammerIDs) until it succeeds
(with a short interval and overall timeout) or use a dedicated helper like
waitForSpammersReady(spamoorAPI, spammerIDs, timeout) that retries under a
timeout; references for change: the existing time.Sleep call and the
requireSpammersRunning function should be updated so the test waits
deterministically for spammers to be running rather than sleeping.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/benchmark.yml:
- Around line 138-139: Replace the movable tag on the GitHub Action usage so the
workflow uses an immutable commit SHA instead of "extractions/setup-just@v3":
locate the job step that sets up just (the step with uses:
"extractions/setup-just@v3") and change the reference to the
repository@<commit-sha> where <commit-sha> is the full SHA obtained from the
repo (e.g., the object SHA for tag v3); ensure you paste the full 40-char commit
SHA and update the workflow commit message accordingly.

---

Nitpick comments:
In `@test/e2e/benchmark/spamoor_state_pressure_test.go`:
- Around line 58-60: Replace the fixed time.Sleep(3 * time.Second) with a
condition-based wait: remove the hard sleep and instead poll the spamoor
readiness by calling or extending requireSpammersRunning(t, e.spamoorAPI,
spammerIDs) until it succeeds (with a short interval and overall timeout) or use
a dedicated helper like waitForSpammersReady(spamoorAPI, spammerIDs, timeout)
that retries under a timeout; references for change: the existing time.Sleep
call and the requireSpammersRunning function should be updated so the test waits
deterministically for spammers to be running rather than sleeping.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2c6f05cd-7c2d-4905-909d-7855f1bd01db

📥 Commits

Reviewing files that changed from the base of the PR and between 4853272 and ebb914e.

📒 Files selected for processing (2)
  • .github/workflows/benchmark.yml
  • test/e2e/benchmark/spamoor_state_pressure_test.go

@chatton chatton requested a review from alpe March 24, 2026 09:09
@chatton chatton added this pull request to the merge queue Mar 24, 2026
Merged via the queue into main with commit ad76f1c Mar 24, 2026
39 checks passed
@chatton chatton deleted the cian/add-state-pressure-benchmark branch March 24, 2026 10:46
alpe added a commit that referenced this pull request Mar 25, 2026
* main:
  refactor(tools/da-debug): improve da debug (#3199)
  fix(pkg/da): fix json rpc types (#3200)
  chore: demote warn log as debug (#3198)
  build(deps): Bump the all-go group across 1 directory with 2 updates (#3191)
  refactor: display block source in sync log (#3193)
  chore: remove cache analyzer (#3192)
  feat: add TestStatePressure benchmark for state trie stress test (#3188)
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.

2 participants