fix(resharding): use the boundary block to resolve the child shard layout#16068
fix(resharding): use the boundary block to resolve the child shard layout#16068Wiezzel wants to merge 3 commits into
Conversation
Pull request overviewFixes a validator-side layout-resolution bug during resharding chunk validation. In the Changes:
Reviewed changesPer-file summary
I verified the fix aligns with the producer path: in FindingsNo blocking issues found. Two very minor nits (non-blocking):
The long block comment at ✅ Approved |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16068 +/- ##
==========================================
+ Coverage 73.31% 73.34% +0.03%
==========================================
Files 857 857
Lines 189233 189264 +31
Branches 189233 189264 +31
==========================================
+ Hits 138731 138812 +81
+ Misses 46068 46020 -48
+ Partials 4434 4432 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
At an
E → E+1resharding split, the block producer and stateless validators resolved the child shard layout from different reference blocks. The producer uses the boundary block (last block of epochE), giving the new post-split layout; the validator's resharding-transition arm used the witness's main-transition block, i.e. the split shard's last new chunk. These agree only while that last new chunk lies inE. If the shard being split produced no chunk anywhere inE(a full-epoch, normally recoverable chunk outage), its last new chunk falls in an earlier epoch, so the validator resolved to the old layout, the child's brand-new shard id was absent from it, andget_child_congestion_info→finalize_allowed_shardfailed withInvalidShardId. Every validator then deterministically rejected the child shard's first chunk, permanently halting the resharded shards with no self-recovery.The fix resolves both epochs (and thus the child shard layout) from the resharding transition's own block (
transition.block_hash, the boundary block) instead of the main-transition block, matching exactly what the producer does. This is validator-side only; it changes no committed protocol state and needs no protocol-version gate.Also adds a test-loop regression test that drives a resharding split while the shard being split misses all of its chunks in the last old-layout epoch and asserts the children still produce endorsed chunks afterward (fails before this fix, passes after), plus a supporting
DropCondition::ChunksForShardsInEpochsthat silences a shard for whole specific epochs.