chore: avoid pruning split block execution payloads #8572
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.
Summary
This PR ensures that the split block’s execution payload is never pruned during weak subjectivity checkpoint sync.
A guard is added to
try_prune_execution_payloadsso that pruning is skipped whenblock_root == split_block_root.Two new regression tests verify this behavior across aligned and unaligned checkpoint scenarios.
Changes
Code
try_prune_execution_payloadsto skip pruning for the split block root.Tests
Add helper
verify_pruning_preserves_payloadto set up aligned/unaligned checkpoint cases, enableprune_payloads = true, run checkpoint sync, and assert the split block payload is preserved.Add:
pruning_preserves_payload_alignedpruning_preserves_payload_unalignedRelation to Other Work
The new test
pruning_preserves_payload_unalignedcovers the failure mode tested by this open PR #8458 and goes further. It verifies both that:Because of this, the earlier reproduction test becomes partially redundant, but it can still be useful because it explicitly demonstrates the original bug fixed in #8426
Issue
Fixes: #8431