Repository navigation
feat(evm-rpc): check trace replays cover every transaction - #599
Open
abernatskiy wants to merge 1 commit into
Open
abernatskiy wants to merge 1 commit into
abernatskiy wants to merge 1 commit into
Conversation
Providers have answered trace_replayBlockTransactions with an empty or truncated list for blocks with transactions. Nothing checked the count, so such blocks were archived without state diffs for the transactions left out. The trace_block and debug paths already check coverage. New mode traceReplayCompleteness (off|observe|reject, off in the library). observe logs the block with its missing replays and accepts it; reject marks the block invalid so the existing re-fetch retries it. Bor's state-sync transaction is not expected to have a replay. CLI flag --trace-replay-completeness: - evm-dump: default reject, so a dump retries and then fails rather than archive the block. - evm-data-service: default observe, a warning for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is consistent across consumers and covers the key success, failure, default, and chain-specific cases.
0 open findings
What changed in this PR
Adds configurable completeness checks for transaction trace replays across EVM ingestion tools.
Changes:
- Adds
off,observe, andrejectvalidation modes. - Exempts Bor state-sync transactions.
- Configures service defaults and adds coverage tests and release records.
| File | Description |
|---|---|
evm/evm-rpc/src/rpc.ts |
Implements replay completeness validation. |
evm/evm-rpc/test/rpc.trace-replay-completeness.test.ts |
Tests validation modes and Bor exemption. |
evm/evm-dump/src/dumper.ts |
Adds CLI option defaulting to reject. |
evm/evm-data-service/src/main.ts |
Adds CLI option defaulting to observe. |
evm/evm-data-service/src/data-source/setup.ts |
Propagates the validation mode into RPC setup. |
common/changes/@subsquid/evm-rpc/fix-trace-replay-completeness_2026-10-13-14-15.json |
Records the RPC package change. |
common/changes/@subsquid/evm-dump/fix-trace-replay-completeness_2026-10-13-14-15.json |
Records the dump package change. |
common/changes/@subsquid/evm-data-service/fix-trace-replay-completeness_2026-10-13-14-15.json |
Records the data-service package change. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
trace_replayBlockTransactionscan come back empty or truncated for a block that has transactions.addTraceTxReplaysaccepted any list, so such a block went through with no state diffs (or traces) for the transactions the provider left out. Thetrace_blockand debug paths already check per-transaction coverage; this path did not.Change
@subsquid/evm-rpc: newRpcOptions.traceReplayCompleteness,off | observe | reject,offby default in the library.observelogs the block (number, hash, transaction and replay counts, up to three missing hashes) and accepts it.rejectmarks the block invalid, so the existing re-fetch retries it and fails once retries are exhausted.@subsquid/evm-dump:--trace-replay-completeness, defaultreject.@subsquid/evm-data-service:--trace-replay-completeness, defaultobserve(warning only, for now).Rollout note
The dump default changes behaviour on upgrade: a dump on a chain whose trace API legitimately omits some transactions from
trace_replayBlockTransactionswill now retry and stop on that block instead of writing it.--trace-replay-completeness observerestores the old acceptance with a warning.Tests
evm/evm-rpc/test/rpc.trace-replay-completeness.test.ts: complete, empty and truncated replay lists in each mode,offas the default, and the Bor state-sync exemption. Full evm-rpc suite passes; evm-dump and evm-data-service type-check.🤖 Generated with Claude Code