Repository navigation
feat(nns): Let people read neurons that they can indirectly "touch" via proposal - #12218
Merged
Merged
Conversation
…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>
…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>
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>
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>
… manages If neuron C follows neuron B on the NeuronManagement topic, and B follows A, then the controller and hotkeys of A can make C do things via a nested ManageNeuron proposal (B makes a proposal for C). They can now also read the full neuron C (get_full_neuron, list_neurons when C is requested) and see ManageNeuron proposals for C in list_proposals. The cost is bounded by C, not by the caller: at most one followees-only neuron read per manager of C, plus point lookups in the principal index. In list_proposals, the per-manager result is cached for the call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Proposal visibility scanning can exhaust the query instruction budget even with a limit of 1, while manager checks also perform unnecessary stable-memory reads.
3 open issues
What changed in this PR
Extends NNS governance read access through one intermediate managing neuron, complementing the nested ManageNeuron proposal support in #12209.
Changes:
- Lets controllers and hotkeys of indirect managers read explicitly requested full neurons.
- Expands ManageNeuron proposal visibility, with request-local caching of intermediate-manager checks.
- Adds authorization tests and documents the expanded access; implicit neuron inclusion remains unchanged.
| File | Description |
|---|---|
rs/nns/governance/unreleased_changelog.md |
Documents indirect managers’ expanded read access. |
rs/nns/governance/tests/governance.rs |
Tests two-level access through list_neurons and get_full_neuron. |
rs/nns/governance/src/neuron_store/neuron_store_tests.rs |
Tests controller and hotkey access, unrelated callers, and the depth limit. |
rs/nns/governance/src/neuron_store.rs |
Adds bounded-depth management checks for full-neuron authorization. |
rs/nns/governance/src/governance/tests/list_proposals.rs |
Tests indirect-manager proposal visibility and the depth limit. |
rs/nns/governance/src/governance.rs |
Applies expanded authorization to neuron listing and cached proposal visibility. |
Review effort: Balanced
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>
…-manage-neuron-read-access Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oc comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…-manage-neuron-read-access
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>
…-manage-neuron-read-access
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>
…-manage-neuron-read-access
…l tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-manage-neuron-read-access
Base automatically changed from
nns-nested-manage-neuron-make-proposal
to
master
November 23, 2026 17:26
daniel-wong-dfinity-org-twin
approved these changes
Dec 1, 2026
Contributor
|
Thank you for splitting! |
Co-authored-by: daniel-wong-dfinity-org-twin <daniel.wong+twin@dfinity.org>
Co-authored-by: daniel-wong-dfinity-org-twin <daniel.wong+twin@dfinity.org>
Co-authored-by: daniel-wong-dfinity-org-twin <daniel.wong+twin@dfinity.org>
…ccess - can_principal_manage_neuron_via_proposals returns errors from loading a manager instead of treating them as "not authorized". A manager that no longer exists still grants nothing, since following a neuron does not keep it from being removed. - Reduce its doc comment's last paragraph to the cost. - Fix the test, which did not compile after renaming principal_id to controller_principal_id, and adopt the suggested names and structure. - Drop the SplitSubnet changelog entry that a merge brought back; it was already released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Title suggestion: let people read neurons that they can indirectly "touch" via proposal. |
…on_via_proposals Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.


Why
With #12209, a group of neurons A can manage neuron C through an intermediate neuron B: C follows B on the NeuronManagement topic, B follows A, and A makes a ManageNeuron proposal for B whose command is
MakeProposalfor C. Today, only the controllers and hotkeys of C's direct managers (B) can read the full C. The members (A) need to see what they are managing.What
Controllers and hotkeys of A can now read the full C via
get_full_neuron(seeNeuronStore::can_principal_manage_neuron_via_proposals). There are no more levels, because a nested proposal cannot itself containMakeProposal.Cost: the check starts from C, not from the caller's neurons (whose number anyone can inflate by adding the caller as a hotkey). It loads the followees of each of C's (at most 15) managers, and checks in the principal index whether the caller controls one of their managers.
list_neuronsfollows in a separate PR.list_proposalsandget_neuron_idsare unchanged;list_proposals' filter for ManageNeuron proposals is only a default view (include_all_manage_neuron_proposalsandget_proposal_infoalready show any proposal).Testing
get_full_neuron(neuron_store_tests.rs).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(no SSH access to the golden state host).🤖 Generated with Claude Code