-
Notifications
You must be signed in to change notification settings - Fork 841
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
feature: Add optional worldstate move flag to debug_setHead #7821
Merged
garyschulte
merged 6 commits into
hyperledger:main
from
garyschulte:feature/debug-setHead-with-worldstate
Nov 4, 2024
Merged
feature: Add optional worldstate move flag to debug_setHead #7821
garyschulte
merged 6 commits into
hyperledger:main
from
garyschulte:feature/debug-setHead-with-worldstate
Nov 4, 2024
+310
−11
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
garyschulte
force-pushed
the
feature/debug-setHead-with-worldstate
branch
3 times, most recently
from
October 29, 2024 20:58
5ef0329
to
296fb44
Compare
garyschulte
commented
Oct 29, 2024
...i/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugSetHead.java
Outdated
Show resolved
Hide resolved
matkt
reviewed
Oct 30, 2024
|
||
return JsonRpcSuccessResponse.SUCCESS_RESULT; | ||
} | ||
|
||
private void rollWorldStateIncrementally( |
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.
maybe we can move this logic directly in the bonsai archive class ? I feel that this method can be used in other part of the code
matkt
approved these changes
Nov 4, 2024
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…and resources Signed-off-by: garyschulte <garyschulte@gmail.com>
…usly Signed-off-by: garyschulte <garyschulte@gmail.com>
garyschulte
force-pushed
the
feature/debug-setHead-with-worldstate
branch
from
November 4, 2024 22:38
296fb44
to
90b1391
Compare
…e able to roll forward and backward Signed-off-by: garyschulte <garyschulte@gmail.com>
JanetMo
pushed a commit
to JanetMo/besu
that referenced
this pull request
Nov 17, 2024
…ger#7821) * add optional worldstate move to debug_setHead * make state rolling occur incrementally so as not to overwhelm memory and resources Signed-off-by: garyschulte <garyschulte@gmail.com> Signed-off-by: Marlene Marz <m.marz@kabelmail.de>
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.
PR description
This PR adds an optional parameter to
debug_setHead
that allows one to move the head worldstate along with the blockchain. This is a no-op for Forest, but for DiffBased worldstates like bonsai and verkle, this will roll the head worldstate to the specified block number / block hash.This is a debug method only and should not be used when a consensus client is directing besu, or while the node is actively importing or proposing blocks.
This feature is a stop-gap measure until #7475 is complete. This debug feature will allow users to move bonsai worldstate head far back into block history so that expensive operations like
debug_traceBlock
can be run on historical blocks. Otherwise, trying to execute RPC calls on old historical states will inevitably encounter an OOM (out of memory) while trying to roll the worldstate back in-memory.This is a debug feature, if used incorrectly (like while some concurrent process is trying to move or modify the worldstate) it will corrupt the database.
Fixed Issue(s)
related to #7804
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests