-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: support getting withdrawal proof on pbss #74
Merged
Conversation
This file contains 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
joeylichang
force-pushed
the
pbss_wp
branch
8 times, most recently
from
March 26, 2024 04:12
4dff2fd
to
ffbfda8
Compare
joeylichang
changed the title
[WIP] feat: support get withdrawal proof on pathdb
feat: support get withdrawal proof on pathdb
Mar 26, 2024
joeylichang
added
enhancement
New feature or request
and removed
wontfix
This will not be worked on
labels
Mar 26, 2024
joeylichang
changed the title
feat: support get withdrawal proof on pathdb
feat: support getting withdrawal proof in pbss
Mar 26, 2024
joeylichang
force-pushed
the
pbss_wp
branch
4 times, most recently
from
March 29, 2024 04:08
e53be06
to
17caa0e
Compare
joeylichang
force-pushed
the
pbss_wp
branch
4 times, most recently
from
April 2, 2024 01:17
0f73d36
to
789c943
Compare
welkin22
reviewed
Apr 3, 2024
krish-nr
previously approved these changes
Apr 7, 2024
joeylichang
force-pushed
the
pbss_wp
branch
2 times, most recently
from
April 7, 2024 07:22
b6252cc
to
c81711e
Compare
will-2012
previously approved these changes
Apr 8, 2024
owen-reorg
reviewed
Apr 8, 2024
joeylichang
force-pushed
the
pbss_wp
branch
2 times, most recently
from
April 10, 2024 01:52
225b376
to
92e7445
Compare
joeylichang
changed the title
feat: support getting withdrawal proof in pbss
feat: support getting withdrawal proof on pbss
Apr 10, 2024
joeylichang
commented
Apr 15, 2024
owen-reorg
approved these changes
Apr 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
welkin22
approved these changes
Apr 15, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Description
This PR proposes a solution that makes it possible to obtain proof of withdrawal in PBSS.
NodeBufferList consists of a NodeCache list and a BaseNodeBuffer. A NodeCache is used to store the diffLayers committed. The diffLayers in one NodeCache is limited to 1800. When a NodeCache is full, another new NodeCache is initialized and placed at the top of the list. In the background, the NodeCache from the end of the list is regularly inserted into the BaseNodeBuffer. When the BaseNodeBuffer reaches 256M, it will be flushed to the backend database. There are at least two NodeCaches in the list, which ensure that there are at least 3600 diffLayers in the memory.
Rationale
PBSS can only support the world state of the recent last 129 (128 difflayers + 1 disklayer) blocks’ state data; while getting withdrawal proof needs the world state of the last block divisible by 3600, which MUST be kept.
Example
If you want to use nodebufferlist, you can use the
--pathdb.nodebuffer list
flag.--pathdb.nodebuffer
is set type of trienodebuffer to cache trie nodes in disklayer('list', 'sync', or 'async'), which default is async. async is double nodebuffer for flushing db in background. sync is the community’s native nodebuffer, which block flushing db.flag is deleted.--pathdb.sync
Changes
Notable changes: