triedb/pathdb: implement iterator of history index - #32981
Merged
Conversation
rjl493456442
force-pushed
the
index-iterator
branch
2 times, most recently
from
October 25, 2025 08:27
ede86f2 to
926fc24
Compare
rjl493456442
force-pushed
the
index-iterator
branch
from
October 26, 2025 07:50
926fc24 to
ab41279
Compare
MariusVanDerWijden
approved these changes
Nov 8, 2025
MariusVanDerWijden
left a comment
Member
There was a problem hiding this comment.
LGTM, one single nit, we could rename the init functions to tryInit() in order to convey that they only initialize if it wasn't initialized before
Comment on lines
+179
to
+183
| if it.dataPtr != -1 { | ||
| return | ||
| } | ||
| it.dataPtr = 0 | ||
| it.restartPtr = 0 |
Member
There was a problem hiding this comment.
Can we turn this logic around?
It's easier to see that this only does something when the iterator is not initialized yet
Suggested change
| if it.dataPtr != -1 { | |
| return | |
| } | |
| it.dataPtr = 0 | |
| it.restartPtr = 0 | |
| if it.dataPtr == -1 { | |
| it.dataPtr = 0 | |
| it.restartPtr = 0 | |
| } |
Member
Author
|
I would prefer to include this PR as the base of following modifications. I will address the outstanding issues in the next PR! |
prestoalvarez
pushed a commit
to prestoalvarez/go-ethereum
that referenced
this pull request
Nov 27, 2025
This change introduces an iterator for the history index in the pathdb. It provides sequential access to historical entries, enabling efficient scanning and future features built on top of historical state traversal.
fjl
pushed a commit
to lightclient/go-ethereum
that referenced
this pull request
Nov 28, 2025
This change introduces an iterator for the history index in the pathdb. It provides sequential access to historical entries, enabling efficient scanning and future features built on top of historical state traversal.
weiihann
pushed a commit
to weiihann/go-ethereum
that referenced
this pull request
Jan 14, 2026
This change introduces an iterator for the history index in the pathdb. It provides sequential access to historical entries, enabling efficient scanning and future features built on top of historical state traversal.
gballet
pushed a commit
to BZO95/go-ethereum
that referenced
this pull request
May 21, 2026
This change introduces an iterator for the history index in the pathdb. It provides sequential access to historical entries, enabling efficient scanning and future features built on top of historical state traversal.
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.
The iterator feature is required for trienode history, in which a set of trienode diffs
need to be resolved to assemble a node value.