core/rawdb: fix head truncation below a diverged tail group - #35551
Open
rjl493456442 wants to merge 3 commits into
Open
core/rawdb: fix head truncation below a diverged tail group#35551rjl493456442 wants to merge 3 commits into
rjl493456442 wants to merge 3 commits into
Conversation
Tail groups are pruned independently. Truncating the head below the tail of group can happen just in case the tails across the groups are not aligned. Reset such table to empty at the new head instead, and refuse only truncations that fall below every group's tail.
Contributor
|
So we want to allow truncating below the head if there is at least one non-empty group ? But why do we want to prevent discarding all the data ? I think this is a valid fix, but I’m just a bit confused about the pruning. |
Member
Author
|
Before the BAL table was introduced, all tables were expected to remain strictly consistent: truncating from the chain head to a point below any table's tail was considered invalid. This was primarily a safeguard against programming errors, as go-ethereum has never had a use case for such an operation. With the BAL table, however, the table set is divided into multiple groups whose tails may differ. Therefore, rewinding the chain head to a point below the BAL group's tail must be supported. |
healthykim
approved these changes
Aug 24, 2026
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.
Tail groups are pruned independently. Truncating the head below the tail of group can happen just in case the tails across the groups are not aligned.
Reset such table to empty at the new head instead, and refuse only truncations that fall below every group's tail.
Superseded #35536