-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: integrate snapshot into pathdb #29754
Conversation
4da023c
to
22cee6d
Compare
Related issue. #28617 |
22cee6d
to
f9fb58e
Compare
I'm not entirely sure how this will help us. If I understand it correctly, you used range queries on the database to look up path-based leaves "directly". I'm unsude how fast that is (it might actually be reasonable for 1 value lookups). That said, the primary purpose of snapshots is to serve snap sync, which needs a way to very quickly and cheaply iterate a range of accounts (e.g. 10K accounts), without having to go through the trie. This work doesn't seem to address that at all, so at teh end of the day, it seems we're still needing the snapshots just as before? |
One thing that would be interesting to see, is
|
Thanks for your reply.
The reasons for the PR:
In the end, this PR may not solve all the problems and hope your suggestions. |
This seems to be based on As I understand it, this can work if you implement a special new seek-method which positions itself on step back, or somehow make the iterator step back on step. Please explain if I've misunderstood something |
The
And there is a special case which the embedded leaf node in fullnode. The PR handles this special case by redundantly storing a copy of the embedded short node in the database. |
According to the leveldb description,
Iterator.Seek will return the first key/value pair whose key is greater than or equal to the given key. |
Oh, I made a mistake and you're right. The default behavior of
And in pathdb, it is impossible to have a pathkey that is the same as a 32-bit hash, so the last key lower than it must be what we are looking for. |
This PR implements a way to fetch account/storage directly from pathdb as an alternative to snapshot for better robustness and simplicity, then reducing data storage space.
Major changes:
db.seekLT
to query the leaf node of account/storage in pathdbdeleteRange
to destruct the storage trieStatus: Testing