Repository navigation
feat(recovery): [CON-1604] allow to override what state height to download - #9707
Merged
pierugo-dfinity merged 41 commits intoApr 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the subnet recovery test harness and ic-recovery tooling to allow explicitly selecting which checkpoint height to download (targeting the latest CUP height), reducing flakes caused by manifest/CUP timing races during state download.
Changes:
- Add
--download-state-heightsupport to recovery flows (App subnet, NNS same-nodes, NNS failover-nodes) and thread it through download/copy-local steps. - Extend node metrics parsing to include CUP height and last computed manifest height; update node selection logic in tests to use these heights.
- Update system tests to pass an explicit
download_state_heightderived from CUP height and refactor parameter selection into a helper.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rs/tests/testnets/nns_recovery.rs | Switches to updated node-height selection helper and struct return type. |
| rs/tests/nested/nns_recovery/common.rs | Uses CUP height to set download_state_height for NNS recovery runs. |
| rs/tests/consensus/subnet_recovery/utils.rs | Introduces NodeHeights + selects node based on cert-share/CUP heights; threads download_state_height into local CLI args. |
| rs/tests/consensus/subnet_recovery/sr_nns_failover_nodes_test.rs | Passes download_state_height into NNS failover recovery args. |
| rs/tests/consensus/subnet_recovery/common.rs | Refactors app-subnet recovery parameter selection; ensures state download node has manifest >= CUP; passes download_state_height. |
| rs/recovery/subnet_splitting/src/subnet_splitting.rs | Updates get_ic_state_includes call signature. |
| rs/recovery/src/steps.rs | Makes local state copy step accept precomputed include paths; uses MaybeRemote for latest checkpoint lookup remotely. |
| rs/recovery/src/recovery_state.rs | Updates tests to account for new args field and simplifies expectations. |
| rs/recovery/src/nns_recovery_same_nodes.rs | Adds CLI arg + interactive prompt for download_state_height; threads it into download/copy-local steps. |
| rs/recovery/src/nns_recovery_failover_nodes.rs | Adds CLI arg + interactive prompt for download_state_height; threads it into download step. |
| rs/recovery/src/lib.rs | Implements download_height support in get_ic_state_includes; adds MaybeRemote; extends NodeMetrics; adds unit test. |
| rs/recovery/src/cli.rs | Updates height-selection guidance message to mention CUP height. |
| rs/recovery/src/app_subnet_recovery.rs | Adds CLI arg + interactive prompt for download_state_height; threads it into download/copy-local steps. |
| rs/recovery/Cargo.toml | Adds assert_matches dev-dependency for new unit test assertions. |
| rs/recovery/BUILD.bazel | Adds Bazel dev-dependency for assert_matches. |
| Cargo.lock | Locks assert_matches into ic-recovery dependency set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
r-birkner
approved these changes
Apr 16, 2026
kpop-dfinity
left a comment
Contributor
There was a problem hiding this comment.
This will make @basvandijk very happy
Contributor
|
One more meta thing: I don't think |
Collaborator
It does! |
kpop-dfinity
approved these changes
Apr 23, 2026
pierugo-dfinity
deleted the
pierugo/recovery/download-state-chosen-by-user
branch
April 23, 2026 15:08
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.
This PR aims at deflaking subnet recovery system tests that either:
download_state_nodehas not computed the manifest yet.It does so by introducing a new
download_state_heightargument toic-recovery. If provided, it will download the checkpoint at that height and throw and error if it does not exist.If not provided (recommended in most production cases), it will default to the latest checkpoint.
Subnet recovery system tests are then adapted as such: