Skip to content

fix(consensus): stop gossiping unsigned CUPs - #11873

Merged
pierugo-dfinity merged 4 commits into
masterfrom
pierugo/consensus/do-not-gossip-unsigned-CUPs
Oct 19, 2026
Merged

pierugo-dfinity merged 4 commits into
masterfrom
pierugo/consensus/do-not-gossip-unsigned-CUPs

Conversation

@pierugo-dfinity

Copy link
Copy Markdown
Contributor

CUPs taken from the registry, like genesis or recovery CUPs, are unsigned but totally legitimate and end up in the replica's validated pool on replica startup, without checking their signatures (which would fail because empty). P2P then replicates this artifact to the other peers' unvalidated pools, which cannot validate it since the signature is missing and this could raise an alert for suspicion of malicious behaviour.

Luckily, this rarely happens in production because:

  • On genesis, the other peers will not pull this artifact because they already have it in their own pools (passed by their own orchestrator).
  • On recoveries, the same reasoning applies though there is still a window where replica A has restarted with the new unsigned CUP, that replica B pulls while still running the old replica. In practice though, the subnet is normally halted and thus does not validate any artifact.
  • On recoveries where the subnet is not is_halted but is halt_at_cup_height (like in verifiable recoveries for resharing chain-keys), there the validator still runs. For now, the alert never triggered probably because the orchestrator stops the replica and restarts it only at the next iteration of the upgrade loop 10 seconds later, which considerably reduces the timing window. With fix(orchestrator): wait for processes to properly exit when restarting #11744 though, the replica will be restarted right away, and we might observe this alert.

For good practice, do not make replicas broadcast unsigned CUPs during pool initialization since other replicas would not be able to validate it anyways.

Kudos to @basvandijk for detecting the flakiness on the aforementioned PR and suggesting a fix!

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.

🟢 Approval recommended

The narrow filter preserves signed-CUP eligibility, and regression assertions cover unsigned-CUP exclusion.

0 open findings

What changed in this PR

Prevents replicas from broadcasting unsigned genesis and recovery catch-up packages (CUPs) at startup, avoiding peer validation failures during recovery restarts.

Changes:

  • Filters unsigned CUPs from initial broadcasts.
  • Updates regression assertions and expected artifact counts.
File Description
rs/​artifact_pool/​src/​consensus_pool.rs Excludes unsigned CUPs from startup broadcasts and verifies their exclusion in tests.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pierugo-dfinity
pierugo-dfinity marked this pull request as ready for review October 16, 2026 12:30
@pierugo-dfinity
pierugo-dfinity requested a review from a team as a code owner October 16, 2026 12:30
@zeropath-ai

zeropath-ai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to d017011.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/artifact_pool/src/consensus_pool.rs
      Filter unsigned Catch-Up Packages (CUPs) from broadcast
Bug Fix ► rs/artifact_pool/src/consensus_pool.rs
      Make CUP signing mandatory for initial broadcast (unsigned CUPs are ignored)
Enhancement ► rs/artifact_pool/src/consensus_pool.rs
      Adjust tests to create signed CUPs for broadcasting
► rs/artifact_pool/src/consensus_pool.rs
      Update test imports to include CombinedThresholdSig types

Comment thread rs/artifact_pool/src/consensus_pool.rs Resolved
Comment thread rs/artifact_pool/src/consensus_pool.rs Resolved
@pierugo-dfinity
pierugo-dfinity added this pull request to the merge queue Oct 19, 2026
Merged via the queue into master with commit 6df0cdb Oct 19, 2026
38 checks passed
@pierugo-dfinity
pierugo-dfinity deleted the pierugo/consensus/do-not-gossip-unsigned-CUPs branch October 19, 2026 10:30
dfinityianblenke added a commit that referenced this pull request Oct 19, 2026
dfinityianblenke added a commit that referenced this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants