Skip to content

rpc: fix prestateTracer diff mode missing deleted accounts#20807

Draft
lupin012 wants to merge 2 commits intomainfrom
lupin012/fix_prestate_diff_mode_deleted_accounts
Draft

rpc: fix prestateTracer diff mode missing deleted accounts#20807
lupin012 wants to merge 2 commits intomainfrom
lupin012/fix_prestate_diff_mode_deleted_accounts

Conversation

@lupin012
Copy link
Copy Markdown
Contributor

@lupin012 lupin012 commented Apr 25, 2026

Port of release/3.4 fix (#20775): adds GetCodeHash to tracing.IntraBlockState so processDiffState can distinguish deleted accounts (NilCodeHash → zero hash) from codeless-but-existing ones (EmptyCodeHash). GetCode returns empty bytes for both cases and cannot make that distinction.

Also replaces repeated t.pre[addr] map lookups with the range variable state and adds a compile-time interface assertion in the unit test.

Fixes flaky rpc-compat test_42 (debug_traceBlockByNumber with prestateTracer diffMode:true).

The rpc-tests will be modified after merge PR #20755

…nts on main

Port of release/3.4 fix (#20775): adds GetCodeHash to tracing.IntraBlockState
so processDiffState can distinguish deleted accounts (NilCodeHash → zero hash)
from codeless-but-existing ones (EmptyCodeHash). GetCode returns empty bytes
for both cases and cannot make that distinction.

Also replaces repeated t.pre[addr] map lookups with the range variable `state`
and adds a compile-time interface assertion in the unit test.

Fixes flaky rpc-compat test_42 (debug_traceBlockByNumber with prestateTracer
diffMode:true).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lupin012 lupin012 changed the title rpc_ fix prestateTracer diff mode missing deleted accounts rpc: fix prestateTracer diff mode missing deleted accounts Apr 25, 2026
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