Skip to content

core/rawdb: fix head truncation below a diverged tail group - #35551

Open
rjl493456442 wants to merge 3 commits into
ethereum:masterfrom
rjl493456442:fix-bal-table-initialize
Open

core/rawdb: fix head truncation below a diverged tail group#35551
rjl493456442 wants to merge 3 commits into
ethereum:masterfrom
rjl493456442:fix-bal-table-initialize

Conversation

@rjl493456442

Copy link
Copy Markdown
Member

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

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.
@healthykim

Copy link
Copy Markdown
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.

@rjl493456442

Copy link
Copy Markdown
Member Author

@healthykim

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants