integration_test: debug_traceBlockByNumber(pending) now returns an error - #588
Merged
Conversation
Erigon rejects the pending tag on the tracing methods: they resolve and replay on the committed view, which holds no pending block, so answering would trace the latest executed block and report it as pending. Depends on erigontech/erigon#22533.
awskii
added a commit
to erigontech/erigon
that referenced
this pull request
Aug 11, 2026
Completes the rejection started for the call methods. debug_traceBlockBy*, trace_block and trace_replayBlockTransactions resolve tags on the committed view, where "pending" falls through to the latest executed block, so they answered for the head block and reported it as the pending request. go-ethereum either traces a real pending block or errors; it never substitutes a different one, so answering for latest matches neither branch. Real pending-block tracing needs a pending state source and is left for later; until then an explicit error beats a wrong block. CI note: this changes debug_traceBlockByNumber/test_25 in the rpc-tests suite, updated in erigontech/rpc-tests#588. mainnet-rpc-integ-tests stays red until that merges and RPC_VERSION is bumped.
lupin012
approved these changes
Aug 18, 2026
yperbasis
added a commit
that referenced
this pull request
Aug 19, 2026
Remove the stale result member left beside the JSON-RPC error in #588. The corrected fixture matches the pending-trace rejection returned by Erigon.
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
Aug 25, 2026
During forkchoice flush and commit, the published `BlockOverlay` can be one block ahead of the MDBX snapshot held by an RPC request. Both are valid views, but combining an overlay block or transaction with committed temporal state or history can produce a response that never existed on-chain. This PR applies two explicit policies to the migrated handlers: | Read kind | Selected view | | --- | --- | | Head-sensitive, block-table-only reads | One selected overlay generation, when present | | Replay, proof, witness, and history reads | One committed database transaction | ## Behavior - Overlay-backed helpers preserve an already selected overlay generation across nested calls. Their non-owning read views can be closed without closing the shared overlay or the caller's transaction. - Migrated committed paths keep selector resolution and state or history reads on one transaction. Immutable headers may use the block LRU after their exact hash is resolved. Receipt regeneration is the remaining exception described below. - Migrated state-backed hash selectors reject non-canonical blocks, and targets above execution progress fail before reading incomplete state or history. - Tracing, simulation, proof, witness, `eth_call`, `eth_createAccessList`, and GraphQL `call` reject `pending` because they cannot acquire state matching the requested pending block. - The raw debug block family consistently returns `null` when it cannot fully represent a published pending block. - Migrated tracing, simulation, and Otterscan replay paths avoid state caches that are not bound to the selected transaction. Request-scoped proof and simulation domains also avoid the process-wide commitment branch cache. ## Scope This PR preserves an overlay generation after it has been selected. Atomic acquisition of the database snapshot and overlay, including pinning the absence of an overlay, remains in erigontech#22987. Until then, the temporary `IsOverlayReadView` marker prevents nested helpers from replacing an existing overlay view. Adoption by the remaining composite and independently transacted RPC paths is tracked by erigontech#23416. Receipt generation remains part of erigontech#23416: the generator can still select the live overlay internally and use a process-wide state cache instead of remaining bound to the transaction selected by its caller. This PR does not change `eth_estimateGas`. Consistent EstimateGas view selection and safe pending-template handling remain in stacked draft erigontech#23485. The generic embedded-daemon latest-state view remains tracked by erigontech#21314. Remote block readers also require snapshot propagation or result validation, tracked by erigontech#23416. `overlay_getLogs` selects its range from committed progress, but its parallel workers still open independent transactions under the same follow-up. Related follow-ups cover witness branch-cache isolation (erigontech#22198), selector and error-policy consolidation (erigontech#23424 and erigontech#23428), coherent replay-cache reuse (erigontech#23425), transaction-index validation (erigontech#23431), and call-many state-context validation (erigontech#23444). Overlay-history fallback when in-memory history is disabled is tracked by erigontech#23500; the historical state boundary for ad-hoc trace bundles is tracked by erigontech#23501. ## Review map - View primitives: `db/kv/membatchwithdb/memory_mutation.go`, `rpc/rpchelper/filters.go`, and `rpc/jsonrpc/eth_api.go` - Overlay-backed migrations: selected handlers in the raw-debug, block-count, transaction-lookup, receipt, uncle, Erigon, GraphQL, Otterscan, and overlay families - Committed migrations: tracing, logs, simulation, proof, witness, and debug state endpoints - Regression coverage: `rpc/jsonrpc/overlay_race_test.go` and `rpc/jsonrpc/trace_view_consistency_test.go` ## Tests Regression tests exercise overlay publication, replacement, and unpublish windows; reorgs; execution progress; pending selectors; missing data; cache isolation; and endpoint-compatible error behavior. RPC integration coverage uses the pinned `rpc-tests` release, which includes the corresponding test correction from [erigontech/rpc-tests#588](erigontech/rpc-tests#588). --------- Co-authored-by: awskii <artem.tsskiy@gmail.com>
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.
Erigon is changing the tracing methods to reject the
pendingblock tag instead of silently answering for a different block.Those methods resolve and replay on the committed view, which holds no pending block. Today
pendingfalls through to the latest executed block, sodebug_traceBlockByNumber("pending")returns a full trace of the head block while the caller asked for pending. go-ethereum either traces a real pending block or errors — it never substitutes another one.This updates the one fixture that pins the old behaviour. Paired with erigontech/erigon#22533, which needs a release of this repo and an
RPC_VERSIONbump before its CI goes green.Changes
debug_traceBlockByNumber/test_25.json— expect-32000 "tracing on top of pending is not supported"instead ofresult: null.