Skip to content

feat(spice): non-tracking validators pull witness for fallback (4/6)#15940

Open
darioush wants to merge 1 commit into
darioush/spice/all-stake-fallback-certifyfrom
darioush/spice/all-stake-fallback-witness
Open

feat(spice): non-tracking validators pull witness for fallback (4/6)#15940
darioush wants to merge 1 commit into
darioush/spice/all-stake-fallback-certifyfrom
darioush/spice/all-stake-fallback-witness

Conversation

@darioush

Copy link
Copy Markdown
Contributor

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_endorsements runs 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: a DesignatedSpiceEndorsements drop condition (drops endorsements from designated senders so chunks can certify only via the fallback) and a last_certified_block_header node helper.

e2e: certifies-without-designated-endorsements (total designated outage) and certifies-across-epoch-boundary.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 98 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.61%. Comparing base (5b84f99) to head (c2c9b00).

Files with missing lines Patch % Lines
chain/client/src/spice/data_distributor_actor.rs 0.00% 59 Missing ⚠️
test-loop-tests/src/utils/network.rs 0.00% 20 Missing ⚠️
test-loop-tests/src/setup/drop_condition.rs 0.00% 10 Missing ⚠️
test-loop-tests/src/utils/node.rs 0.00% 5 Missing ⚠️
core/primitives/src/spice/chunk_endorsement.rs 0.00% 4 Missing ⚠️
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     
Flag Coverage Δ
pytests-nightly 1.10% <0.00%> (-0.01%) ⬇️
unittests 69.35% <0.00%> (-0.04%) ⬇️
unittests-nightly 69.30% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SpiceDataDistributorActor to 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.

@darioush darioush changed the title feat(spice): non-tracking validators pull witness for fallback feat(spice): non-tracking validators pull witness for fallback (4/6) Jun 17, 2026
@darioush darioush force-pushed the darioush/spice/all-stake-fallback-certify branch from 1df6ba7 to 5b84f99 Compare June 17, 2026 23:46
@darioush darioush force-pushed the darioush/spice/all-stake-fallback-witness branch from 727c38b to c2c9b00 Compare June 17, 2026 23:46
@darioush darioush requested a review from pugachAG June 17, 2026 23:50
@darioush darioush marked this pull request as ready for review June 17, 2026 23:50
@darioush darioush requested a review from a team as a code owner June 17, 2026 23:50
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