You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(nns): Allow ManageNeuron proposals to make small ManageNeuron proposals - #12209
An earlier hot fix broke support for multiple levels of neuron management following, i.e. where neuron A controls neuron B, which controls neuron C. MakeProposal inside a ManageNeuron proposal was disabled in #4509, because a nested proposal can be large (e.g. a WASM), and ManageNeuron proposals are cheap (0.01 ICP) with up to 10,000 open at once. However, that broke the use case entirely.
What
Size bound. The action of every ManageNeuron proposal can be at most MANAGE_NEURON_ACTION_ENCODED_BYTES_MAX = 10,000 bytes (protobuf encoded_len). Every command other than MakeProposal is far below this (a unit test checks the largest valid SetFollowing); with MakeProposal, it bounds the nested proposal.
Nested MakeProposal. A ManageNeuron proposal for neuron B may again have the MakeProposal command, but only for a ManageNeuron proposal (validate_nested_make_proposal):
The nested proposal must be a ManageNeuron proposal. The size bound alone is not enough for other types: their actions can expand a lot when decoded (e.g. a RewardNodeProviders with thousands of empty elements).
Its command must not be MakeProposal (at most one level of nesting).
It is otherwise validated like any proposal.
Whether B is among the target's NeuronManagement followees is deliberately not checked when the outer proposal is made: that validation runs before the caller is authorized, so it would disclose the target's (possibly private) followees to anyone. It is checked, after authorization, when B makes the nested proposal; if it fails, the outer proposal fails to execute.
When the outer proposal is adopted, B (acting as its controller, as for any ManageNeuron proposal) makes the nested proposal and votes yes on it. If B is the target's only manager, the nested proposal is adopted and executed right away. No API, Candid, or stable-storage changes: MakeProposal : Proposal was already part of ManageNeuronProposalCommand.
Self-describing action. A nested MakeProposal is now rendered as {title, summary, url, action: {ManageNeuron: ...}} instead of a placeholder.
Not in this PR: letting the controllers and hotkeys of A read the full neuron C and see ManageNeuron proposals for C. That is in the stacked follow-up #12218.
Behavior worth knowing
B pays the (non-refundable) neuron management fee for each nested proposal, so it needs at least that much minted stake. The member who proposes the outer proposal pays it too.
The outer proposal is marked executed once the nested proposal is created; the nested proposal's own outcome is recorded on the nested proposal.
Testing
New unit tests: self-describing MakeProposal, largest valid SetFollowing fits the size bound.
New tests in tests/governance.rs: end-to-end A → B → C flow (including fees), rejection of a non-ManageNeuron nested proposal, of two levels of nesting, and of a too-large nested proposal, and a nested proposal for a neuron B does not manage (outer proposal fails at execution). test_disallow_large_manage_neuron_proposals now expects InvalidProposal.
Locally: cargo check, cargo fmt --check, rust-lint.sh, bazel build of the directly affected targets, and the affected Bazel tests. All passed except //rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state, which could not download the golden NNS state in the environment it ran in (no SSH access to the state host). It has not been run with this change yet.
…oposals
A ManageNeuron proposal can again have the MakeProposal command, but only
to make another ManageNeuron proposal. This lets a group of neurons
{A, B, C} manage many neurons E1..En through one intermediate neuron D
(each Ei follows D on NeuronManagement, D follows A, B, C): A, B, C make D
propose (and vote for) a ManageNeuron proposal for any Ei. Membership
changes only touch D's followees.
The nested proposal is kept small (the reason MakeProposal was disabled
in #4509): it must be a ManageNeuron proposal, its command must not be
MakeProposal (one level of nesting), its summary is capped at 2,000
bytes, and it must not set self_describing_action. It is otherwise
validated like any proposal, and D must be a manager of the target.
Read access follows the same two levels: controllers/hotkeys of A, B, C
can read the full Ei (get_full_neuron, list_neurons) and see ManageNeuron
proposals for Ei in list_proposals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The change exposes private neuron manager lists to unauthorized callers through validation errors and introduces unbounded follower scans and allocations when listing proposals.
This PR enables neuron groups to manage many neurons through one intermediate neuron, while restricting nested proposals to small ManageNeuron actions.
Changes:
Allows one level of nested ManageNeuron proposals with validation and a 2,000-byte summary limit.
Extends neuron and proposal read access through two management levels.
Adds nested-action rendering, tests, and release notes.
File
Description
rs/nns/governance/unreleased_changelog.md
Documents nested proposals and expanded read access.
rs/nns/governance/tests/governance.rs
Tests nested execution, fees, access, and rejection cases.
…wees
Addresses review feedback on the nested ManageNeuron MakeProposal change:
- list_proposals: instead of enumerating all NeuronManagement followers of
the caller's neurons (unbounded, and growable by anyone), check each
manager of the targeted neuron (at most 15) by loading its followees,
and cache the result per manager for the duration of the call.
- Validation of a nested MakeProposal no longer checks whether the
intermediate neuron manages the nested target. Validation runs before
the caller is authorized, so the error disclosed the target's (possibly
private) followees. The check still happens, after authorization, when
the intermediate neuron makes the nested proposal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Reading a single neuron now unconditionally scans and allocates all caller-associated neuron IDs, including in narrowly scoped list requests, creating an avoidable performance cost that other controllers can amplify by adding the caller as a hotkey.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Bound neuron visibility checks to the requested neuron's managers
rs/nns/governance/src/neuron_store.rs:725
Reading one managed neuron now scans and allocates every neuron ID associated with the caller, a population that other controllers can enlarge by adding the caller as a hotkey. The same scan runs unconditionally in governance.rs:1716, even when list_neurons explicitly requests only one caller-owned neuron and disables implicit inclusion. Use principal-index contains_entry lookups for the target's managers and their managers, and reuse that bounded check in list_neurons after its controller/public fast paths.
The reason will be displayed to describe this comment to others. Learn more.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
Update unreleased_changelog.md (if there are behavior changes, even if they are
non-breaking).
Are there BREAKING changes?
Is a data migration needed?
Security review?
How to Satisfy This Automatic Review
Go to the bottom of the pull request page.
Look for where it says this bot is requesting changes.
Click the three dots to the right.
Select "Dismiss review".
In the text entry box, respond to each of the numbered items in the previous
section, declare one of the following:
Done.
$REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
canister behavior changes.", or for item 2, "Existing APIs
behave as before.".
Brief Guide to "Externally Visible" Changes
"Externally visible behavior change" is very often due to some NEW canister API.
Changes to EXISTING APIs are more likely to be "breaking".
If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.
If your changes are behind a feature flag, then, do NOT add entrie(s) to unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.
Reading a single (managed) neuron used to collect all neuron IDs that
the caller is controller or hotkey of. That set is unbounded, and anyone
can grow it by adding the caller as a hotkey to their own neurons.
Instead, check the neuron's managers (and their managers) with point
lookups in the principal index: at most 15 followee loads and
15 * 16 index lookups per neuron, regardless of the caller.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re Copilot's "Bound neuron visibility checks to the requested neuron's managers" (review 5993822093): fixed in 151c7d7. get_full_neuron / list_neurons no longer collect all neuron IDs associated with the caller. They check the requested neuron's managers (and their managers) with point lookups in the principal index, so the cost is bounded by the neuron (at most 15 followee loads and 15 × 16 index lookups), not by the caller's (externally growable) hotkey set.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Re-enabling a command disabled by a deployed memory-exhaustion hotfix and expanding private-neuron read access require human security review of resource bounds and access rules, while the golden-state upgrade test remains unrun.
This PR now only allows nested MakeProposal in ManageNeuron proposals.
Reading neurons and listing proposals through an intermediate neuron
moves to a follow-up PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Two-level read access remains unimplemented, so a principal can initiate a nested proposal but cannot retrieve the target neuron’s full data or see the proposal in default listings.
The reason will be displayed to describe this comment to others. Learn more.
Most of my inline feedback is just about wording.
The one behavioral suggestion is this: to protect main memory, let's use encoded_len, since that addresses the issue of size DIRECTLY.
It is a bit weird to me that the second proposal MUST be a ManageNeuron proposal. Would it be HARMFUL if we allow other proposal types, or are we having this limitation simply because other proposal types do not seem useful (in this context)? I mean, I do not HATE this limitation. It just seems a little arbitrary, which sort of goes against the principle of least astonishment.
Tangents
I can't tell you how many times we have been like, "yeah, but who would ever want that ability? Let's just ban it" only to later find users who have legitimate use cases. I feel like the moral of the story is, do not make decisions based on failure of imagination.
Regarding planned follow up PRs, I am a bit worried about the new read authorizations (for neurons and proposals), both from a security and performance perspective. IIUC, list_neurons is already giving us performance head aches. What you plan to do squares the cost.
Address review feedback: limit the size of a ManageNeuron proposal's
action directly (MANAGE_NEURON_ACTION_ENCODED_BYTES_MAX = 10,000 bytes,
protobuf encoded), instead of limiting the summary of a nested proposal.
Also reorder and reword the doc comment and error messages of
validate_nested_make_proposal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The advertised 2,000-byte nested-summary limit is not enforced by the implemented 10,000-byte aggregate ManageNeuron cap, so the description or validation needs updating.
…oc comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dfinity-Bjoern
changed the title
feat(nns): Allow ManageNeuron proposals to make small ManageNeuron proposals
feat(nns): Allow ManageNeuron proposals to make proposals
Nov 22, 2026
Regarding planned follow up PRs, I am a bit worried about the new read authorizations (for neurons and proposals), both from a security and performance perspective. IIUC, list_neurons is already giving us performance head aches. What you plan to do squares the cost.
Let's discuss on #12218 but that isn't as urgent. There are other ways to achieve this, like setting the neurons to public, so this is less of an absolute blocker for the use case compared with this PR.
A ManageNeuron proposal's MakeProposal command can now make a proposal
of any type, not only a ManageNeuron proposal. The size of the nested
proposal is bounded by MANAGE_NEURON_ACTION_ENCODED_BYTES_MAX, and it
still cannot itself be a ManageNeuron proposal with MakeProposal.
Nested proposals are described without calling other canisters (the
payload of a nested ExecuteNnsFunction is not decoded).
Also remove the redundant self_describing_action check, trim the
changelog entry, and drop a test case for early validation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dfinity-Bjoern
changed the title
feat(nns): Allow ManageNeuron proposals to make proposals
feat(nns): Allow ManageNeuron proposals to make proposals again
Nov 22, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Validation permits compact nested rewards to expand into gigabytes of stored allocations across open proposals, risking governance low-memory mode because repeated-element counts and the expanded representation are not bounded.
The restriction to nested ManageNeuron proposals is not fundamentally necessary (and it would even be nicer to remove it), but as pointed out it is at least currently a restriction necessary for security.
For the concrete example given there: Maybe we should just get rid of the RewardNodeProviders proposals entirely, since they haven't been used for several years at all.
Restore the restriction that a proposal made via a ManageNeuron
proposal's MakeProposal command must itself be a ManageNeuron proposal.
The size bound on the protobuf encoding does not bound memory for other
proposal types: e.g. a RewardNodeProviders action with thousands of
empty elements fits in 10 KB but expands much more when decoded and
self-described, and up to 10,000 cheap ManageNeuron proposals can be
open at a time.
This also reverts the canister-call-free description of arbitrary
nested actions, which pushed the test canister over its size limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dfinity-Bjoern
changed the title
feat(nns): Allow ManageNeuron proposals to make proposals again
feat(nns): Allow ManageNeuron proposals to make small ManageNeuron proposals
Nov 23, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The PR description claims support for arbitrary nested actions and describes rendering and fees that do not apply to the ManageNeuron-only implementation.
The reason will be displayed to describe this comment to others. Learn more.
I still need to read other files in this PR, but I'm ok with what this PR does now.
(I would really like to get rid of limitations that would seem arbitrary from the outside, but then, it is not clear how to prevent space blow up. IOW, I accept this as a compromise so that we can get through this quickly and unblock you.)
Use the prost::Message trait method for encoded_len, and simplify the doc
comment: say what is enforced, and drop the note about where the followee
check happens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Reopening the security-hotfixed proposal path requires human validation of retained Wasm memory at 10,000 open proposals and upgrade compatibility, since the size test bounds only protobuf bytes and the golden-state upgrade test remains unrun.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Re-enabling proposal nesting after a security hotfix requires human security review of worst-case memory amplification, since native tests skip production self-description generation and the production golden-state upgrade test remains unrun.
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
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.
Why
An earlier hot fix broke support for multiple levels of neuron management following, i.e. where neuron A controls neuron B, which controls neuron C.
MakeProposalinside a ManageNeuron proposal was disabled in #4509, because a nested proposal can be large (e.g. a WASM), and ManageNeuron proposals are cheap (0.01 ICP) with up to 10,000 open at once. However, that broke the use case entirely.What
Size bound. The action of every ManageNeuron proposal can be at most
MANAGE_NEURON_ACTION_ENCODED_BYTES_MAX= 10,000 bytes (protobufencoded_len). Every command other thanMakeProposalis far below this (a unit test checks the largest validSetFollowing); withMakeProposal, it bounds the nested proposal.Nested
MakeProposal. A ManageNeuron proposal for neuron B may again have theMakeProposalcommand, but only for a ManageNeuron proposal (validate_nested_make_proposal):RewardNodeProviderswith thousands of empty elements).MakeProposal(at most one level of nesting).Whether B is among the target's NeuronManagement followees is deliberately not checked when the outer proposal is made: that validation runs before the caller is authorized, so it would disclose the target's (possibly private) followees to anyone. It is checked, after authorization, when B makes the nested proposal; if it fails, the outer proposal fails to execute.
When the outer proposal is adopted, B (acting as its controller, as for any ManageNeuron proposal) makes the nested proposal and votes yes on it. If B is the target's only manager, the nested proposal is adopted and executed right away. No API, Candid, or stable-storage changes:
MakeProposal : Proposalwas already part ofManageNeuronProposalCommand.Self-describing action. A nested
MakeProposalis now rendered as{title, summary, url, action: {ManageNeuron: ...}}instead of a placeholder.Not in this PR: letting the controllers and hotkeys of A read the full neuron C and see ManageNeuron proposals for C. That is in the stacked follow-up #12218.
Behavior worth knowing
Testing
MakeProposal, largest validSetFollowingfits the size bound.tests/governance.rs: end-to-end A → B → C flow (including fees), rejection of a non-ManageNeuron nested proposal, of two levels of nesting, and of a too-large nested proposal, and a nested proposal for a neuron B does not manage (outer proposal fails at execution).test_disallow_large_manage_neuron_proposalsnow expectsInvalidProposal.cargo check,cargo fmt --check,rust-lint.sh,bazel buildof the directly affected targets, and the affected Bazel tests. All passed except//rs/nns/integration_tests:upgrade_canisters_with_golden_nns_state, which could not download the golden NNS state in the environment it ran in (no SSH access to the state host). It has not been run with this change yet.🤖 Generated with Claude Code