Skip to content

feat(nns): support reserved_cycles_limit in canister settings proposals - #11173

Draft
Rachit2323 wants to merge 1 commit into
dfinity:masterfrom
Rachit2323:feat/nns-reserved-cycles-limit
Draft

feat(nns): support reserved_cycles_limit in canister settings proposals#11173
Rachit2323 wants to merge 1 commit into
dfinity:masterfrom
Rachit2323:feat/nns-reserved-cycles-limit

Conversation

@Rachit2323

Copy link
Copy Markdown
Contributor

The problem

Every canister has a setting called "reserved cycles limit" - basically a cap on how many cycles it's allowed to keep in reserve. You can already change almost every other canister setting through an NNS vote (who controls it, memory limits, etc), but not this one. The code had it hardcoded to "off," with a comment saying it wasn't supported yet.

What I did

Hooked this setting up the same way the existing settings already work, following the same pattern used for a similar setting called wasm_memory_threshold:

  • Added the new field everywhere it needs to exist (the data format, the public interface, the code that converts between them)
  • Made the two places that update canister settings actually use it instead of ignoring it

Testing

  • Updated the existing tests so they check this new setting too
  • Added a new test for the second place that uses it
  • Ran everything - all tests pass

@github-actions github-actions Bot added the feat label Aug 17, 2026
@basvandijk basvandijk added the security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR. label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@claude

claude Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Heads up — CI Main is failing on this commit with a real compile error caused by this change: CanisterSettings gained a new reserved_cycles_limit field (rs/nns/governance/api/src/types.rs:2751), but two other places in the tree still construct it exhaustively without that field, so they no longer compile (E0063):

  • rs/registry/admin/bin/main.rs:1840
  • rs/nns/integration_tests/src/update_canister_settings.rs:88

Adding reserved_cycles_limit: None, (or wiring it through properly, e.g. as a new ic-admin flag) to both should fix the build. See the CI Main run for full logs: https://github.com/dfinity/ic/actions/runs/32057954799


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor feat security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants