Skip to content

rpc: keep modified-account tags on committed view - #23193

Open
yperbasis wants to merge 2 commits into
mainfrom
fix/debug-modified-accounts-committed-tags
Open

rpc: keep modified-account tags on committed view#23193
yperbasis wants to merge 2 commits into
mainfrom
fix/debug-modified-accounts-committed-tags

Conversation

@yperbasis

Copy link
Copy Markdown
Member

Summary

  • resolve both debug_getModifiedAccountsByNumber bounds on the committed transaction view
  • make pending fall back to the latest committed block when pending history is not indexed
  • cover start and end tags while a forkchoice overlay is published ahead of MDBX

Context

Follow-up to #23129, discovered while reviewing the release backport in #23167.

#23129 resolves block tags through the API filters. During an FCU commit, that can select an in-flight overlay head while execution progress and the transaction-number/history scans still use the committed MDBX snapshot. With committed execution at block 5 and an overlay head at block 6, a valid latest request fails with start block (6) is later than the latest block (5).

This change resolves tags on the same committed transaction used by the history scan. APIs that can consume overlay data remain overlay-aware; this history-only endpoint does not mix the two views.

Testing

  • go test ./rpc/jsonrpc -run '^TestGetModifiedAccountsByNumber' -count=1
  • go test ./rpc/jsonrpc -count=1
  • make lint (repeated)
  • make erigon integration

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Ensures modified-account block tags resolve against the committed database view, matching history scans.

Changes:

  • Resolve start/end tags without forkchoice overlays.
  • Fall back pending to committed execution progress.
  • Add regression coverage for overlay-ahead conditions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
rpc/jsonrpc/debug_api.go Uses the committed transaction for tag resolution.
rpc/jsonrpc/debug_api_test.go Verifies committed-view pending behavior.
rpc/jsonrpc/overlay_race_test.go Tests start/end tags while an overlay is ahead.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rpc/jsonrpc/debug_api.go
}

startNum, _, _, err := rpchelper.GetBlockNumber(ctx, rpc.BlockNumberOrHashWithNumber(startNumber), tx, api._blockReader, api.filters)
startNum, _, _, err := rpchelper.GetBlockNumber(ctx, rpc.BlockNumberOrHashWithNumber(startNumber), tx, api._blockReader, nil)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this change looks so weird

@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants