feat(spice): non-tracking validators pull witness for fallback (4/6)#15940
feat(spice): non-tracking validators pull witness for fallback (4/6)#15940darioush wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## darioush/spice/all-stake-fallback-certify #15940 +/- ##
=============================================================================
- Coverage 69.64% 69.61% -0.04%
=============================================================================
Files 947 947
Lines 204472 204570 +98
Branches 204472 204570 +98
=============================================================================
- Hits 142406 142404 -2
- Misses 57318 57416 +98
- Partials 4748 4750 +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:
|
There was a problem hiding this comment.
Pull request overview
Enables SPICE all-stake fallback certification to progress even when a validator is not designated for a chunk and does not track the chunk’s shard, by having the data distributor proactively pull the chunk’s witness once it becomes fallback-eligible. Adds supporting test-loop infrastructure and end-to-end fallback tests that simulate a full designated-endorser outage and an epoch-boundary transition.
Changes:
- Add per-processed-block logic in
SpiceDataDistributorActorto request fallback-eligible witnesses for non-designated, non-tracking epoch validators. - Extend SPICE endorsement primitives with
SpiceChunkEndorsement::shard_id()and add test-loop helpers for observing certification progress and selectively dropping designated endorsements. - Add new test-loop SPICE e2e tests covering fallback-only certification and certification across an epoch boundary.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test-loop-tests/src/utils/node.rs | Adds last_certified_block_header() helper for fallback e2e assertions. |
| test-loop-tests/src/utils/network.rs | Adds a network dropper that filters designated SPICE endorsements to force fallback-only certification in tests. |
| test-loop-tests/src/tests/spice/mod.rs | Registers the new all_stake_fallback test module. |
| test-loop-tests/src/tests/spice/all_stake_fallback.rs | New e2e tests for fallback-only certification and across-epoch-boundary certification. |
| test-loop-tests/src/setup/drop_condition.rs | Adds DropCondition::DesignatedSpiceEndorsements wiring to install the new dropper. |
| core/primitives/src/spice/chunk_endorsement.rs | Adds SpiceChunkEndorsement::shard_id() accessor used by tests/infrastructure. |
| chain/client/src/spice/data_distributor_actor.rs | Implements contribute_fallback_endorsements and witness-pull initiation for fallback-eligible uncertified chunks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1df6ba7 to
5b84f99
Compare
727c38b to
c2c9b00
Compare
Lets a non-designated epoch validator that doesn't track a chunk's shard contribute to the all-stake fallback. Once a chunk is past the fallback window and still uncertified, the data distributor pulls the chunk's witness (
start_waiting_on_fallback_witness) so the validator can apply and endorse it; the existing witness-validation flow then broadcasts the endorsement, which the fallback tally certifies.contribute_fallback_endorsementsruns per processed block: for each uncertified, fallback-eligible chunk the node is a non-designated epoch validator of, it pulls the witness if it isn't already tracking the shard or hasn't already endorsed.Adds
SpiceChunkEndorsement::shard_id()and the test infra used by the fallback e2e tests: aDesignatedSpiceEndorsementsdrop condition (drops endorsements from designated senders so chunks can certify only via the fallback) and alast_certified_block_headernode helper.e2e: certifies-without-designated-endorsements (total designated outage) and certifies-across-epoch-boundary.