-
Notifications
You must be signed in to change notification settings - Fork 21.6k
core,triedb: prevent debug_setHead from rewinding below oldest available state block #32139
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
Open
jsvisa
wants to merge
9
commits into
ethereum:master
Choose a base branch
from
jsvisa:setHead-block-check
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Member
Can you provide more logs before the panic? |
Signed-off-by: Delweng <[email protected]>
Signed-off-by: Delweng <[email protected]>
Signed-off-by: Delweng <[email protected]>
Signed-off-by: Delweng <[email protected]>
Signed-off-by: jsvisa <[email protected]>
60a3902 to
ddc42b8
Compare
Contributor
Author
|
@rjl493456442 sorry for the delay response. If we reset head to a block older than the state freezer's tail state, seems it will not panic currently(maybe fixed in recent pathdb updates), but it will reset the chain to stateless, here is an example.
INFO [09-11|16:11:06.976] Truncating from head ohead=3963 tail=3961 nhead=3962
INFO [09-11|16:11:06.988] Rewound to block with state number=3961 hash=47c7c0..0f16ef
INFO [09-11|16:11:06.989] Truncating from head ohead=3962 tail=3961 nhead=3961
INFO [09-11|16:11:07.002] Rewound to block with state number=3960 hash=08fafb..486fa0
INFO [09-11|16:11:07.053] Genesis block reached number=0 hash=d560b1..c69f8f
INFO [09-11|16:11:07.053] Chain is stateless, wait state sync number=0 hash=d560b1..c69f8f
WARN [09-11|16:11:07.053] Force rewinding till ancient limit head=0
ERROR[09-11|16:11:07.199] Missing block in the middle, resetting to genesis number=18,446,744,073,709,551,615 hash=000000..000000
INFO [09-11|16:11:07.199] Chain is stateless, wait state sync number=0 hash=d560b1..c69f8f
WARN [09-11|16:11:07.209] Truncating freezer table database=/md1/geth-dev/geth/chaindata/ancient/chain table=hashes items=4501 limit=1
WARN [09-11|16:11:07.212] Truncating freezer table database=/md1/geth-dev/geth/chaindata/ancient/chain table=bodies items=4501 limit=1
WARN [09-11|16:11:07.215] Truncating freezer table database=/md1/geth-dev/geth/chaindata/ancient/chain table=receipts items=4501 limit=1
WARN [09-11|16:11:07.217] Truncating freezer table database=/md1/geth-dev/geth/chaindata/ancient/chain table=headers items=4501 limit=1
WARN [09-11|16:11:07.220] SetHead invalidated safe block
ERROR[09-11|16:11:07.220] SetHead invalidated finalized block
INFO [09-11|16:11:07.221] Loaded most recent local block number=0 hash=d560b1..c69f8f age=56y6mo2d
ERROR[09-11|16:11:07.221] Failed to reset txpool state err="missing trie node 20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 (path ) state 0x20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 is not available"
null
> ERROR[09-11|16:11:07.221] Failed to reset txpool state err="missing trie node 20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 (path ) state 0x20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 is not available"
ERROR[09-11|16:11:07.221] Failed to reset blobpool state err="missing trie node 20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 (path ) state 0x20d8452ff7af5031fcea768ce6814cf2b0927efb8dc40fc5ab7194ced0724061 is not available"
> eth.blockNumber
0 |
Signed-off-by: jsvisa <[email protected]>
This reverts commit aff6811. Signed-off-by: jsvisa <[email protected]>
Signed-off-by: jsvisa <[email protected]>
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.
When invoking
debug_setHeadto an old block, which is below the first stored state in ancient/state, it will panic the node:after the fix, now it won't let
debug_setHeadto rewind to an older block: