Skip to content

fix(evm): query state_snapshot.storage in ForkDbStateSnapshot::storage_ref#14007

Open
gutonosa wants to merge 2 commits intofoundry-rs:masterfrom
gutonosa:evm
Open

fix(evm): query state_snapshot.storage in ForkDbStateSnapshot::storage_ref#14007
gutonosa wants to merge 2 commits intofoundry-rs:masterfrom
gutonosa:evm

Conversation

@gutonosa
Copy link
Copy Markdown
Contributor

@gutonosa gutonosa commented Mar 30, 2026

ForkDbStateSnapshot::storage_ref was skipping state_snapshot.storage entirely. The lookup path went from local.cache straight to the remote RPC backend, missing any storage data that SharedBackend had previously fetched and persisted in the BlockchainDb. This caused stale or incorrect values to be returned when reverting to a state snapshot, since the RPC would return current on-chain state rather than the snapshotted state.

aligns storage_ref with basic_ref, which already queries state_snapshot as the second lookup layer. Replaced the redundant get_storage() helper (which only re-checked local.cache) with storage_from_snapshot_or_backend(), giving the correct lookup order: local.cachestate_snapshot.storageSharedBackend / RPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant