eth: return iterator errors from debug_storageRangeAt - #35554
Open
ghwo336 wants to merge 1 commit into
Open
Conversation
| } | ||
| } | ||
|
|
||
| // TestStorageRangeAtMissingNode ensures that storageRangeAt returns an error, |
Member
There was a problem hiding this comment.
Pls remove the attached test.
Contributor
Author
There was a problem hiding this comment.
Done, removed the test.
ghwo336
force-pushed
the
fix/storage-range-iterator-error
branch
from
August 24, 2026 09:01
85663ea to
4dff7d8
Compare
rjl493456442
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
debug_storageRangeAt stops iterating when the iterator's Next method
returns false. Next returns false both when the range is exhausted and
when a trie node cannot be resolved, storing the failure in the
iterator's Err field. The method does not check Err after iteration, so
a trie failure can be reported as a normal result.
This also gives the response the wrong pagination meaning. When
iteration fails, the follow-up Next call used to compute NextKey returns
false and leaves NextKey nil. StorageRangeResult defines a nil NextKey
as meaning that the response includes the last key in the trie. The
caller is therefore told that the range is complete even though it was
truncated by a trie error.
Return the error already produced by the iterator. This follows the
existing handling used by other trie.NewIterator consumers, including
cmd/geth/dbcmd.go and the generators in core/state/snapshot and
triedb/pathdb.
Added a regression test that removes a storage trie node from the
database and verifies that storageRangeAt returns an error instead of a
truncated result.