chore(registry): [CON-1671] remove height field in Genesis CUPs - #11577
pierugo-dfinity wants to merge 2 commits into
Conversation
height field in Genesis CUPsheight field in Genesis CUPs
height field in Genesis CUPsheight field in Genesis CUPs
There was a problem hiding this comment.
🟢 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-prepheights.
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.
f9c8458 to
2ea438e
Compare
There was a problem hiding this comment.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
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
|
✅ No security or compliance issues detected. Reviewed everything up to 9e91d57. Security Overview
Detected Code Changes
|
|
✅ No security or compliance issues detected. Reviewed everything up to 9e91d57. Security Overview
Detected Code Changes
|
- Done.
- 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).
- No migration needed: the field was always set to 0 and even if not, it would simply get ignored by the new proto definition.
- No security review needed.
2ea438e to
9e91d57
Compare
The
heightfield of registry CUPs with typeGenesisis 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::Recoveryinstead, 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,timeandstate_hashfields entirely fromCatchUpPackageContentsand replacing them with their counterpart incup_type.