Skip to content

feat(subnet-splitting): freeze registry version until summary is reached - #10938

Merged
pierugo-dfinity merged 21 commits into
masterfrom
pierugo/subnet-splitting/freeze-registry-version
Aug 6, 2026
Merged

feat(subnet-splitting): freeze registry version until summary is reached#10938
pierugo-dfinity merged 21 commits into
masterfrom
pierugo/subnet-splitting/freeze-registry-version

Conversation

@pierugo-dfinity

@pierugo-dfinity pierugo-dfinity commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Because Consensus passes the block’s validation context's registry version to other components (including DSM), it could happen that a subnet split has not yet happened from Consensus' point of view but it would have from the other components' point of view. While it does not necessarily have to lead to misbehavior, this PR proposes to "freeze" the registry version in the validation context from the moment a split is detected in the registry until the next summary block (which will have a Scheduled status).

More precisely, we will not bump the registry version in the validation context of any data block in a DKG interval to any version of the registry which has a flag indicating that the subnet splitting should happen. We only bump it when reaching the summary block (to exactly the registry version the split was scheduled at, not a more recent one).

@github-actions github-actions Bot added the feat label Jul 28, 2026
@pierugo-dfinity
pierugo-dfinity force-pushed the pierugo/subnet-splitting/status branch from 6af0506 to 46227a8 Compare July 30, 2026 10:04
@pierugo-dfinity
pierugo-dfinity force-pushed the pierugo/subnet-splitting/freeze-registry-version branch from c2411d8 to 91f9402 Compare July 31, 2026 08:34
Base automatically changed from pierugo/subnet-splitting/status to master August 3, 2026 08:32
@pierugo-dfinity
pierugo-dfinity force-pushed the pierugo/subnet-splitting/freeze-registry-version branch from 44f0377 to da13866 Compare August 3, 2026 08:49
@pierugo-dfinity
pierugo-dfinity marked this pull request as ready for review August 3, 2026 14:26
@pierugo-dfinity
pierugo-dfinity requested a review from a team as a code owner August 3, 2026 14:26
@zeropath-ai

zeropath-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 85b670f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/consensus/src/consensus/block_maker.rs
    Update get_stable_registry_version to consider last summary block and subnet splitting; add last_summary parameter and new logic for freezing/bumping registry version during subnet splitting
► rs/consensus/src/consensus/malicious_consensus.rs
    Use updated get_stable_registry_version signature with last_summary_block
► rs/consensus/src/consensus/validator.rs
    Integrate subnet_splitting status checks into validation flow and introduce new error variants for subnet splitting scenarios
► rs/consensus/utils/src/subnet_splitting.rs
    Add new module implementing subnet splitting status logic (get_status, Status enum, StatusError, tests)
Enhancement ► rs/consensus/utils/src/lib.rs
    Expose subnet_splitting module
Enhancement ► rs/consensus/utils/src/subnet_splitting.rs (new file)
    Implement get_status and related types for subnet splitting status management
Enhancement ► rs/consensus/utils/BUILD.bazel
    Add thiserror and registry/keys dependencies for tests and utilities
► rs/consensus/utils/Cargo.toml
    Add thiserror and ic-registry-keys as dependencies; add rstest to dev-dependencies
Enhancement ► rs/consensus/utils/src/lib.rs
    Publish subnet_splitting module
Enhancement ► rs/consensus/src/consensus/validator.rs (tests/usage updates)
    Update imports and usage to align with new subnet_splitting logic; handle new ValidationFailure variants
Enhancement ► rs/consensus/src/consensus/malicious_consensus.rs (tests/usage updates)
    Update call to get_stable_registry_version to pass last_summary_block
Enhancement ► Cargo.lock / dependencies (general) additions
    ic-registry-keys, rstest, thiserror included in appropriate sections

Comment thread rs/consensus/src/consensus/block_maker.rs Outdated
Comment thread rs/consensus/utils/src/subnet_splitting.rs Outdated
Comment thread rs/consensus/src/consensus/validator.rs
Comment thread rs/consensus/src/consensus/block_maker.rs Outdated
Comment thread rs/consensus/src/consensus/block_maker.rs Outdated
Comment thread rs/consensus/src/consensus/block_maker.rs Outdated
Comment thread rs/consensus/utils/src/subnet_splitting.rs
Comment thread rs/consensus/src/consensus/block_maker.rs
Comment thread rs/consensus/src/consensus/block_maker.rs

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

This PR adjusts consensus’ handling of registry versions during subnet splitting to prevent non-summary (data) blocks from adopting a registry version that already indicates a pending split, and to ensure the summary block adopts exactly the registry version at which the split was scheduled.

Changes:

  • Add a subnet_splitting utility to detect whether a subnet split is pending at a given registry version and expose a Status/StatusError API.
  • Update block-making to “freeze” the context registry version below the scheduled split version until the next summary block, then bump exactly to the scheduled version.
  • Update block validation to reject data blocks that reference a registry version at/above the scheduled split version, and to require summary blocks to reference exactly the scheduled version; add tests.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rs/types/types/src/consensus/catchup.rs Introduces SubnetSplittingArgs decoding from protobuf for subnet-splitting CUP contents.
rs/consensus/utils/src/subnet_splitting.rs New helper to determine whether subnet splitting is scheduled vs. already adopted, plus unit tests.
rs/consensus/utils/src/lib.rs Exposes the new subnet_splitting module.
rs/consensus/utils/Cargo.toml Adds dependencies for the new module and its tests (thiserror, ic-registry-keys, rstest).
rs/consensus/utils/BUILD.bazel Mirrors the new Rust deps for Bazel builds/tests.
rs/consensus/src/consensus/validator.rs Enforces frozen vs. exact registry-version rules during splitting; adds corresponding tests.
rs/consensus/src/consensus/malicious_consensus.rs Updates call site for get_stable_registry_version signature change.
rs/consensus/src/consensus/block_maker.rs Implements registry-version freezing/bumping behavior based on subnet-splitting status; adds tests.
Cargo.lock Records new dependency additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/consensus/src/consensus/block_maker.rs
Comment thread rs/consensus/src/consensus/validator.rs
Comment thread rs/consensus/src/consensus/validator.rs Outdated
Comment thread rs/consensus/src/consensus/validator.rs Outdated
Comment thread rs/consensus/src/consensus/block_maker.rs Outdated
Comment thread rs/consensus/src/consensus/block_maker.rs
@pierugo-dfinity
pierugo-dfinity added this pull request to the merge queue Aug 6, 2026
Merged via the queue into master with commit 06d6a7b Aug 6, 2026
40 checks passed
@pierugo-dfinity
pierugo-dfinity deleted the pierugo/subnet-splitting/freeze-registry-version branch August 6, 2026 15:14
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