refactor(mainnet-nns): fix regressions on testnet with mainnet state + refactor NNS recovery testnet#9721
Merged
pierugo-dfinity merged 16 commits intomasterfrom Apr 17, 2026
Conversation
4cea516 to
0631645
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Prepares the NNS Recovery system test to run against mainnet state on testnet, while refactoring the nested NNS recovery testnet setup to remove duplication and address several path/cleanup regressions.
Changes:
- Refactors nested NNS recovery setup by moving registration, NNS membership change, and backup access provisioning into the shared setup phase.
- Makes the “mainnet NNS with mainnet state” testnet accept an optional DKG interval override (instead of hard-coding env-var logic in the library).
- Fixes/adjusts recovery tooling integration: use
env.get_path(...)foric-recovery, retain recovery binaries while cleaning only the working directory, increase API BN health wait robustness, and rename the Bazel/Cargo target to avoid name collisions.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rs/tests/testnets/nns_recovery.rs | Removes duplicated setup steps from the test body and tightens DKG interval parsing for this testnet. |
| rs/tests/testnets/mainnet_nns_state.rs | Wraps mainnet NNS setup with an optional DKG interval override. |
| rs/tests/testnets/mainnet_nns/src/lib.rs | Implements optional DKG override, refactors recovery paths/cleanup, and improves API BN health waiting. |
| rs/tests/testnets/mainnet_nns/Cargo.toml | Drops ic-limits dependency after removing the hard-coded default from this crate. |
| rs/tests/testnets/mainnet_nns/BUILD.bazel | Removes the Bazel dependency on //rs/limits accordingly. |
| rs/tests/testnets/Cargo.toml | Renames the binary from mainnet_nns to mainnet_nns_state. |
| rs/tests/testnets/BUILD.bazel | Updates system test target name and removes no-longer-needed deps/flags for nns_recovery. |
| rs/tests/nested/nns_recovery/common.rs | Moves registration/membership/backup access provisioning into setup() to reduce duplication. |
| rs/tests/driver/src/driver/test_env_api.rs | Adds a configurable health-wait helper (await_status_is_healthy_with_retries_async). |
| Cargo.lock | Updates lockfile after dependency removal. |
Comments suppressed due to low confidence (1)
rs/tests/testnets/mainnet_nns_state.rs:27
- The usage example in this header comment still refers to
ict testnet create mainnet_nns(and--test_tmpdir=./mainnet_nns), but this PR renames the testnet/bin target tomainnet_nns_state. Please update the example command (and tmpdir name if applicable) so the instructions match the new target name.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kpop-dfinity
approved these changes
Apr 15, 2026
basvandijk
approved these changes
Apr 15, 2026
Bownairo
approved these changes
Apr 16, 2026
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 prepares for the NNS Recovery system test with mainnet state. As preliminary steps, it performs the following refactors:
setupphase to avoid code duplication.It also fixes the following introduced regressions:
env.get_path(PATH_IC_RECOVERY)instead ofget_dependency_path_from_env("IC_RECOVERY_PATH")(revert of chore: look up recovery tools from environment #8518).--test_tmpdir(revert of chore: look up recovery tools from environment #8518).--validate-nns-urlargument to emphasize that it is not actually used.ic-adminpath (revert of chore: look up recovery tools from environment #8518).ic-admin).:mainnet_nnstarget to:mainnet_nns_stateotherwise Bazel complains that it is a prefix of themainnet_nns:libtarget.