Skip to content

rpc/ethapi: stateDiff override visible to committed reads#157

Merged
kamuikatsurgi merged 3 commits into
release/3.2-developfrom
kamui/fix-stateoverride
May 22, 2026
Merged

rpc/ethapi: stateDiff override visible to committed reads#157
kamuikatsurgi merged 3 commits into
release/3.2-developfrom
kamui/fix-stateoverride

Conversation

@kamuikatsurgi

Copy link
Copy Markdown
Member

Description

Erigon's eth_call stateOverride.stateDiff only wrote dirtyStorage on the affected stateObject. GetCommittedState reads originStorage, so the override was invisible to EIP-2200's original-value read: SSTORE warm reset fell into the dirty branch (100 gas) instead of reset (2900 gas on Berlin onward, 2060 post-PIP-88). Bor doesn't hit this because their override applies SetState then statedb.Finalise, which promotes dirty into pending so GetCommittedState returns it.

Add IntraBlockState.SetStateOverride (writes both origin and dirty via stateObject.setCommittedStorage) and route the stateDiff loop through it. Mirrors Bor's post-Finalise semantics with a smaller surface change than porting Finalise itself, which would require chainRules and a StateWriter the override path can't supply.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kamuikatsurgi kamuikatsurgi merged commit 69afcdd into release/3.2-develop May 22, 2026
12 of 15 checks passed
@kamuikatsurgi kamuikatsurgi deleted the kamui/fix-stateoverride branch May 22, 2026 12:10
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.

2 participants