Skip to content

Conversation

@pierugo-dfinity
Copy link
Contributor

@pierugo-dfinity pierugo-dfinity commented Dec 22, 2025

This PR introduces a new testnet mainnet_nns: A single-node NNS subnet holding mainnet state, along with 1 API BN and 1 HTTP Gateway, for general use-case. In a separate PR, the current nns_recovery testnet will be adapted to also be able to spawn it with mainnet state. Finally, that second PR will also introduce an NNS recovery system test that will use mainnet state.

Most of the changes are the revert of e38941a, but some changes were required in ic-replay:

  • Bumping the ingress messages' expiry, otherwise some messages would expire if delivered in multiple batches. This was already done for certain SubCommands, so we generalize it to all of them.
  • The list of trusted neurons was outdated.
  • Now neurons need to be made public to be followed.
  • Trusted neurons will follow the new neuron on all topics and not just Unspecified to be more robust.

The code lives in its own crate in //rs/tests/testnets/mainnet_nns/ as a library such that one can turn any testnet or system test into a variant that holds mainnet state, with as few modifications as possible to their original code. For example, the setup of the IC can be done by running the provided setup and making proposals to change the topology to achieve the intended initial topology. Such proposals can be made as easily as calling ProposalWithMainnetState::[name_of_the_proposal].

Finally, it is intended to use the mainnet's version of ic-replay and ic-recovery like previously, but since I needed to modify those to create this testnet, we need to wait for this change to reach mainnet NNS before downloading those. This is tracked in ticket CON-1624.

@github-actions github-actions bot added the test label Dec 22, 2025
Copy link
Collaborator

@basvandijk basvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

Copy link
Contributor

@eichhorl eichhorl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

@pierugo-dfinity pierugo-dfinity added this pull request to the merge queue Dec 23, 2025
Merged via the queue into master with commit 2e062e3 Dec 23, 2025
38 checks passed
@pierugo-dfinity pierugo-dfinity deleted the pierugo/revive-mainnet-nns-testnet branch December 23, 2025 16:53
mraszyk pushed a commit that referenced this pull request Jan 5, 2026
This PR introduces a new testnet `mainnet_nns`: A single-node NNS subnet
holding mainnet state, along with 1 API BN and 1 HTTP Gateway, for
general use-case. In a separate PR, the current `nns_recovery` testnet
will be adapted to also be able to spawn it with mainnet state. Finally,
that second PR will also introduce an NNS recovery system test that will
use mainnet state.

Most of the changes are the revert of
e38941a,
but some changes were required in `ic-replay`:
- Bumping the ingress messages' expiry, otherwise some messages would
expire if delivered in multiple batches. This was already done for
certain `SubCommand`s, so we generalize it to all of them.
- The list of trusted neurons was outdated.
- Now neurons need to be made public to be followed.
- Trusted neurons will follow the new neuron on all topics and not just
`Unspecified` to be more robust.

The code lives in its own crate in `//rs/tests/testnets/mainnet_nns/` as
a library such that one can turn any testnet or system test into a
variant that holds mainnet state, with as few modifications as possible
to their original code. For example, the setup of the IC can be done by
running the provided `setup` and making proposals to change the topology
to achieve the intended initial topology. Such proposals can be made as
easily as calling `ProposalWithMainnetState::[name_of_the_proposal]`.

Finally, it is intended to use the mainnet's version of `ic-replay` and
`ic-recovery` like
[previously](https://github.com/dfinity/ic/blob/6cd54499b0ec4f4190043f66769e54e78ffa0ccf/rs/tests/nns/ic_mainnet_nns_recovery/src/lib.rs#L206-L212),
but since I needed to modify those to create this testnet, we need to
wait for this change to reach mainnet NNS before downloading those. This
is tracked in ticket CON-1624.

---------

Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
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.

3 participants