Skip to content

Conversation

@daniel-wong-dfinity-org
Copy link
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Jan 12, 2026

Like with TakeCanisterSnapshot, this works by calling a new method on the Root canister: load_canister_snapshot.

Future Work

Snapshot operations should should generally be performed while the canister is stopped (like with upgrades). The reason for this is explained in the ICP specification:

It's important to stop a canister before loading a snapshot to ensure that all outstanding callbacks are completed. Failing to do so may cause the canister to not make sense of the callbacks if its state is restored. It is expected that the canister controllers (or their tooling) do this separately.

References

Closes NNS1-4297.

…. This is analogous to the changes in PR 8158.
This is analogous to changes made in commit cbd88f0, but here, we do not add a new NnsFunction; but rather, we add directly to Action.

Why direct Action instead of NnsFunction: The Governance canister cannot treat the arguments of LoadCanisterSnapshot as an opaque blob. In particular, Governance needs to know which canister is being restored in order to determine the proposal's topic, like for canister upgrades.
@github-actions github-actions bot added the feat label Jan 12, 2026
@daniel-wong-dfinity-org daniel-wong-dfinity-org marked this pull request as ready for review January 12, 2026 15:39
@daniel-wong-dfinity-org daniel-wong-dfinity-org requested a review from a team as a code owner January 12, 2026 15:39
github-actions[bot]

This comment was marked as resolved.

…pt blob;`, rs/nns/governance/api/src/types.rs should say `snapshot_id: Option<Vec<u8>>,`. Without this, interface test fails.
Conflicts:
- rs/nns/governance/src/pb/conversions/mod.rs :: Conflict seems to arrise from the fact that in master,
  some code was deleted right next to where I added some code. `git diff --cached master` seems to indicate
  that I preserved my addition while also preserving the deletion in master.
Base automatically changed from test-action-based-take-snapshot-daniel-wong to master January 13, 2026 11:10
Conflicts occurred due to changes being added to master via a squash commit.
IIUC, `git merge -X ours master` would have resolved the conflicts in the same
way that I just did.
@daniel-wong-dfinity-org daniel-wong-dfinity-org added this pull request to the merge queue Jan 13, 2026
Merged via the queue into master with commit c9408c0 Jan 13, 2026
37 checks passed
@daniel-wong-dfinity-org daniel-wong-dfinity-org deleted the action-based-load-snapshot-daniel-wong branch January 13, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants