chore(registry): [CON-1671] backfill cup_types of CatchUpPackageContents records + invariant ensuring their presence - #11578
Draft
pierugo-dfinity wants to merge 6 commits into
Draft
pierugo-dfinity wants to merge 6 commits into
pierugo-dfinity wants to merge 6 commits into
Conversation
pierugo-dfinity
added this pull request to stack #11579
September 15, 2026 15:08
cup_types of existing records + invariant ensuring their presencecup_types of CatchUpContents records + invariant ensuring their presence
pierugo-dfinity
force-pushed
the
pierugo/backfill-cup-type
branch
from
September 15, 2026 16:42
7ae7b71 to
5397f21
Compare
cup_types of CatchUpContents records + invariant ensuring their presencecup_types of CatchUpPackageContents records + invariant ensuring their presence
pierugo-dfinity
force-pushed
the
pierugo/backfill-cup-type
branch
from
September 16, 2026 11:33
cd80a80 to
27714ad
Compare
pierugo-dfinity
removed this pull request from stack #11579
September 16, 2026 11:34
pierugo-dfinity
added this pull request to stack #11590
September 16, 2026 11:35
pierugo-dfinity
force-pushed
the
pierugo/backfill-cup-type
branch
from
September 23, 2026 15:09
5908386 to
0d55517
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Each node in each subnet looks at their
catch_up_package_contents_{subnet_id}record to find so-called "registry CUPs", used forThe
height,timeandstate_hashfields in those records are really only useful for Recovery CUPs. Both Genesis and Subnet Splitting set them to0,0andvec![]respectively. This is why acup_typefield was introduced, containing the required information specific to each scenario.This means that the three fields are redundant with the ones in
RecoveryArgs, can be removed, and we can make the consumers (including the protocol stack) readcup_typeinstead. This PR adds an invariant thatcup_typemust always be set. It also adapts various locations to fill thatcup_typeif currently set toNone.Though in the production registry, all subnets whose genesis and last recovery (if any) predate the introduction of
cup_typehave that field unset and would break the invariant. Thus, this PR backfills all records'cup_typewith a suitable variant: if all three fields are0,0andvec![], this is aGenesis, otherwise it is aRecovery. At the time of writing, noSubnetSplittingwas ever made.This PR does not change the protocol stack yet, it still reads
height,timeandstate_hashoutside thecup_type.