Skip to content

fix: check storage root existence for hash scheme too (ethereum#29341) - #121

Merged
hmlee-wm merged 1 commit into
devfrom
fix/snap-storage-root-hash-scheme
Sep 15, 2026
Merged

hmlee-wm merged 1 commit into
devfrom
fix/snap-storage-root-hash-scheme

Conversation

@hmlee-wm

@hmlee-wm hmlee-wm commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports ethereum#29341. The storage root existence check in processStorageResponse only worked under path scheme, causing state healing to run unnecessarily on hash-scheme nodes.

Upstream References

PR Description
#29341 eth/protocols/snap: check storage root existence for hash too

Problem

PR #28327 added a check to confirm the storage root node is present in the database before skipping state healing. However, the check used rawdb.HasStorageTrieNode, which only reads nodes under path scheme. On hash-scheme nodes the function always returns false, so the healing-skip optimization never fires.

Changes

  • eth/protocols/snap/sync.go: replace rawdb.HasStorageTrieNode(s.db, accountHash, nil, root) with rawdb.HasTrieNode(s.db, accountHash, nil, root, s.scheme), making the check work for both path and hash scheme

…341)

(cherry picked from commit 304879da20200f6912d241ccd471e140d3487093)
@hmlee-wm hmlee-wm self-assigned this Sep 4, 2026
@hmlee-wm hmlee-wm added the bug Something isn't working label Sep 4, 2026

@0xmhha 0xmhha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@colinkim colinkim 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.

LGTM

@eomti-wm eomti-wm 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.

LGTM

@hmlee-wm
hmlee-wm merged commit d651ce4 into dev Sep 15, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the fix/snap-storage-root-hash-scheme branch September 15, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants