Skip to content

Add a steady-state load test for validators serving historical state - #649

Open
kollegian wants to merge 9 commits into
mainfrom
test/nightly-validator-history
Open

kollegian wants to merge 9 commits into
mainfrom
test/nightly-validator-history

Conversation

@kollegian

@kollegian kollegian commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Add TestNightlyValidatorHistory to measure the cost of enabling historical state, Tendermint transaction indexing, and EVM HTTP and WebSocket on four signing validators. It runs the existing 200 TPS steady-state profile for 30 minutes against two RPC followers, with a separate chain and the validator-history metrics label. State and block retention are both set to 100,000.

The harness records the funding account’s balance at a fixed height before load. After load it checks HTTP availability, Tendermint index status, and a WebSocket query for that same historical balance on each validator. The standard receipt coverage and inclusion checks also run.

The integration package passed its offline tests. Rendering both roles with the pinned sei-config version produced the intended state-store, retention, index, and listener settings. Scheduling the new test requires a subsequent platform harness image bump.

The validator-history chain also runs the post-load RPC benchmark on the receipt follower before teardown. It checks pinned block, transaction, receipt, balance, code and log responses. Log expectations come from block receipts. It samples a contiguous suffix of up to 500 load blocks, capped at 100,000 transactions and the follower’s 10,000-log response limit. After warmup, it measures one request at a time within its five-minute step and records response bytes and latency per scenario, plus requests/s for repeated stateless reads in the harness log.

The runner uses Node from the scheduled RELEASE_TEST_IMAGE. The release-test functional suite is separate. Validation includes the integration package and six offline Node tests covering the wire protocol, corrupted responses, trailing empty blocks and the bounded log range.

The benchmark also times populated and drained eth_getFilterChanges polls separately on the same filter. Setup and cleanup are outside the poll timings. It reads ERC-20 balanceOf at two pinned heights, checks debug_traceCall against the returned balance, and traces a workload transaction. It compares debug_traceBlockByNumber and debug_traceBlockByHash on the same blocks selected at the 50th and 90th percentiles of gas used. Trace reports include the first observed request and the warmed latency distribution. Reports show sample counts and omit p95 below 20 samples and p99 below 100.

The four RPC steps each get five minutes, for twenty minutes of target measurement time. The runner times first and immediately repeated reads on disjoint historical heights and ranges, then checks responses against the send follower. The suite methodology describes the workload groups, metrics and cache interpretation.

A versioned JSON profile defines the read mix and phase budgets. The mix offers 10 requests/s with 60% contract balance reads, 30% filtered log reads and 10% full blocks. It verifies every completed response, counts missed arrivals and records per-fixture log counts. Isolated block reads also compare hashes-only and full transaction responses on the same heights.

The validator-history harness independently probes all four validators and both RPC followers throughout transaction load and the RPC benchmark. Each five-second sample records latency, height and failure status. The ephemeral nodes disable the EVM per-IP and large-log-query rate limiters. Request-size and range limits still apply. Timed reads include block receipts, indexed-sender log queries, 8/16-block log responses and transaction traces by position.

@cursor

cursor Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches SDK network provisioning (ConfigValues on SeiNetwork) and a long-running nightly path that schedules cluster Jobs and changes validator/RPC app.toml via typed config; benchmark logic is new but mostly isolated to integration testdata and CI.

Overview
Adds TestNightlyValidatorHistory, a nightly integration path that provisions a chain with historical state, KV tx indexing, and EVM HTTP/WebSocket on validators, runs the existing 30-minute steady-state load, then checks per-validator availability, index status, and a pinned WebSocket eth_getBalance at a pre-load height. Continuous eth_blockNumber probes on all validators and RPC followers log JSON rpc-responsiveness lines across load phases.

After load, a Kubernetes Job runs an embedded Node benchmark (post_load_rpc.mjs) against the receipt follower (send follower as reference). The runner seals fixtures from the load window, then executes four five-minute steps: paired first/repeat historical reads, limit rejection/recovery with follower CPU/RSS sampling, a 10 RPS weighted read mix, and isolated verified reads (logs, blocks, traces, filters, state). CI adds node --test on the offline MJS tests; Docker build context re-includes the benchmark script.

The SDK gains NetworkSpec.ConfigValues (validated and rendered onto SeiNetwork like nodes). The harness applies commonConfigValues to the network and concatenates them onto RPC nodes so validators and followers share settings such as disabled EVM rate limiting. docs/post-load-rpc.md documents workload groups and how to read the JSON logs.

Reviewed by Cursor Bugbot for commit d26ac29. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Adds TestNightlyValidatorHistory, a 30-minute 200 TPS steady-state run on four validators with the state store, kv tx indexing and both EVM listeners enabled; after load it checks each validator's EVM HTTP, Tendermint tx_index and a WebSocket eth_getBalance at a pre-load height. I found nothing blocking: the overlaid keys match sei-config v0.0.29's full-mode defaults, so the followers are unchanged; the WS origin default is "*"; and the funded cast address is what eth_getBalance on the EVM address reads, so the check is meaningful. codex found nothing and I agree no blocker exists; it contributed no findings to keep or drop.

Non-blocking

  • The nightly runs every TestNightly suite in sequence in one CronJob. This suite adds up to durationMin+80 = 110 minutes of scenario deadline, so check the CronJob's activeDeadlineSeconds in the platform repo still covers the whole sequence before the harness image bump. The package doc in harness_test.go that lists the nightly suites also does not mention the new suite.
2 nits, not posted on the code
  • test/integration/validator_history_test.go:67 — TestNightlyBenchmark cancels on SIGTERM and SIGINT. This suite cancels only on SIGTERM, so a manual Ctrl-C skips the context unwind the other suites get.
  • test/integration/validator_history_test.go:84 — Subtests are named after the per-run validator name, which carries the run token. Each night's results get different test names, so history for the same validator ordinal cannot be lined up across runs. Naming subtests by ordinal (e.g. "validator-0") keeps them stable.

seidroid review · decision approve · session cad7b9ac867b4309a0bab9cb8f9ae84d · turn resp_claude_54dac1e4dffa421129442fb2a1272b59 · item 3d75b0f6134453fca4befe2143b72521

Findings: 0 blocking | 1 non-blocking | 0 posted inline

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

assert.equal(block?.number, quantity(h), 'missing load block ' + h);
assert.ok(Array.isArray(block.transactions));
const count = block.transactions.length;
if (!blocks.length && !count) continue; // sender has stopped, chain still advances

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty post-load blocks use up the scan window

Medium Severity

The backward scan is capped at last - 499, and trailing empty blocks are skipped but still count toward that cap. postLoadHeight is read only after runSeiload finishes its own checks: waiting for the Job, draining the summary, and up to 5 minutes of follower catch-up. If those take longer than about 500 blocks, every scanned block is empty, and the benchmark fails with "load window contains no transactions" even though the load succeeded.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 76bcb56. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

report('historical-' + c.name + '-' + access, c.method, rows, { startedAt, endedAt, access,
blockSpan: c.width, distinctTargets: rows.length, distinctHeights: rows.length * c.width, eligibleTargets: c.targets.length, poolExhausted: rows.length === c.targets.length });
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Paired historical rows lack their documented group

Low Severity

The docs list "Paired historical reads" as a group and say runs are compared by group. However, measureDistinctBlocks calls report with no group field, so suiteGroup(method) labels these rows logs, traces or blocks-transactions-receipts. That mixes first-read and repeat timings with the pinned scenarios, and the height-pair events have no group at all.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 711633b. Configure here.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

var postLoadRPCScript string

//go:embed testdata/post_load_rpc_profile.json
var postLoadRPCProfile string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Embedded profile JSON excluded from Docker context

High Severity

post_load_rpc_test.go now uses //go:embed to pull in testdata/post_load_rpc_profile.json. .dockerignore excludes everything by default and only lets post_load_rpc.mjs back in from testdata. As a result, go test -c -tags integration ./test/integration/ in test/integration/Dockerfile fails because the embed pattern matches no files, and the nightly harness image can't be built.

Fix in Cursor Fix in Web

Triggered by learned rule: New files referenced by Dockerfile COPY must be re-included in .dockerignore

Reviewed by Cursor Bugbot for commit 6a0e39c. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 4 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d26ac29. Configure here.

scenarios.push(traceScenario('trace-position-' + index, 'debug_traceTransaction', [tx.hash],
{ height: prefixBlock.number, blockHash: prefixBlock.hash, txHash: tx.hash, transactionIndex: index,
transactions: transactions.length }, frame => verifyFrame(frame, tx)));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Position traces assume non-reverted transactions

Low Severity

The trace-position-* fixtures trace the first, middle and last transactions of the busiest block, chosen only by index. Their check, verifyFrame, requires the call frame to have no error. If any of those transactions reverted on-chain, the trace correctly reports an error, and the nightly run fails even though the follower behaved correctly.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d26ac29. Configure here.

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.

1 participant