Skip to content

chore(registry): [CON-1671] remove height field in Genesis CUPs - #11577

Open
pierugo-dfinity wants to merge 2 commits into
masterfrom
pierugo/remove-genesis-height
Open

pierugo-dfinity wants to merge 2 commits into
masterfrom
pierugo/remove-genesis-height

Conversation

@pierugo-dfinity

@pierugo-dfinity pierugo-dfinity commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The height field of registry CUPs with type Genesis is never read within the protocol stack and is always set to 0 in production.
Its only place where it is set differently is in system test setup, where we would potentially like to start at a non-zero height. This use-case can definitely be achieved with a CupType::Recovery instead, which allows to cleanup that field in production code (where it does not make sense to set it differently than 0).

This PR lays the groundwork for removing the height, time and state_hash fields entirely from CatchUpPackageContents and replacing them with their counterpart in cup_type.

@github-actions github-actions Bot added the chore label Sep 15, 2026
@pierugo-dfinity pierugo-dfinity changed the title chore: remove height field in Genesis CUPs chore: [CON-1671] remove height field in Genesis CUPs Sep 15, 2026
@pierugo-dfinity
pierugo-dfinity added this pull request to stack #11579 September 15, 2026 15:08
@pierugo-dfinity pierugo-dfinity changed the title chore: [CON-1671] remove height field in Genesis CUPs chore(registry): [CON-1671] remove height field in Genesis CUPs Sep 15, 2026
@pierugo-dfinity
pierugo-dfinity requested a balanced review from Copilot September 15, 2026 16:52

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 schema migration is backward-compatible and all affected Genesis constructors were updated consistently.

Pull request overview

Removes the obsolete Genesis CUP height argument and represents non-zero test startup heights as recovery CUPs.

Changes:

  • Reserves the removed protobuf field and updates generated bindings.
  • Updates production and test Genesis constructors.
  • Creates recovery CUP metadata for non-zero ic-prep heights.
File summaries
File Description
rs/registry/canister/src/mutations/do_create_subnet.rs Constructs empty Genesis arguments.
rs/protobuf/src/gen/types/registry.subnet.v1.rs Updates generated types binding.
rs/protobuf/src/gen/state/registry.subnet.v1.rs Updates generated state binding.
rs/protobuf/src/gen/registry/registry.subnet.v1.rs Updates generated registry binding.
rs/protobuf/def/registry/subnet/v1/subnet.proto Reserves the removed field number and name.
rs/prep/src/subnet_configuration.rs Uses recovery CUPs for non-zero initial heights.
rs/consensus/utils/src/subnet_splitting.rs Updates Genesis CUP test fixtures.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: 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 force-pushed the pierugo/remove-genesis-height branch from f9c8458 to 2ea438e Compare September 15, 2026 17:01
@pierugo-dfinity
pierugo-dfinity marked this pull request as ready for review September 15, 2026 17:02
@pierugo-dfinity
pierugo-dfinity requested review from a team as code owners September 15, 2026 17:02

@github-actions github-actions Bot 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.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@zeropath-ai

zeropath-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 9e91d57.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► rs/consensus/utils/src/subnet_splitting.rs
    Change GenesisArgs construction from height 0 to empty GenesisArgs for several CupType variants
Refactor ► rs/prep/src/subnet_configuration.rs
    Update CupType generation to GenesisArgs {} and adjust state_hash handling accordingly
Refactor ► rs/protobuf/def/registry/subnet/v1/subnet.proto
    GenesisArgs: replace height field with reserved placeholder
Refactor ► rs/protobuf/src/gen/registry/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/protobuf/src/gen/state/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/protobuf/src/gen/types/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/registry/canister/src/mutations/do_create_subnet.rs
    CupType::Genesis(GenesisArgs { height: 0 }) -> CupType::Genesis(GenesisArgs {})
Documentation/Changelog ► rs/registry/canister/unreleased_changelog.md
    Note about Genesis CUPs no longer containing a height field

@zeropath-ai

zeropath-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 9e91d57.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► rs/consensus/utils/src/subnet_splitting.rs
    Change GenesisArgs construction from height 0 to empty GenesisArgs for several CupType variants
Refactor ► rs/prep/src/subnet_configuration.rs
    Update CupType generation to GenesisArgs {} and adjust state_hash handling accordingly
Refactor ► rs/protobuf/def/registry/subnet/v1/subnet.proto
    GenesisArgs: replace height field with reserved placeholder
Refactor ► rs/protobuf/src/gen/registry/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/protobuf/src/gen/state/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/protobuf/src/gen/types/registry.subnet.v1.rs
    GenesisArgs: replace height field with empty struct
Refactor ► rs/registry/canister/src/mutations/do_create_subnet.rs
    CupType::Genesis(GenesisArgs { height: 0 }) -> CupType::Genesis(GenesisArgs {})
Documentation/Changelog ► rs/registry/canister/unreleased_changelog.md
    Note about Genesis CUPs no longer containing a height field

@pierugo-dfinity
pierugo-dfinity dismissed github-actions[bot]’s stale review September 15, 2026 17:15
  1. Done.
  2. This removes a field, so new records could in theory break old clients. Luckily, this was always set to the default value of 0, meaning there is virtually no difference with omitting it (from a protobuf perspective).
  3. No migration needed: the field was always set to 0 and even if not, it would simply get ignored by the new proto definition.
  4. No security review needed.
@pierugo-dfinity
pierugo-dfinity force-pushed the pierugo/remove-genesis-height branch from 2ea438e to 9e91d57 Compare September 16, 2026 11:33
@pierugo-dfinity
pierugo-dfinity removed this pull request from stack #11579 September 16, 2026 11:34
@pierugo-dfinity
pierugo-dfinity added this pull request to stack #11590 September 16, 2026 11:35
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.

4 participants