Skip to content

feat(nns): Let people read neurons that they can indirectly "touch" via proposal - #12218

Merged
Dfinity-Bjoern merged 32 commits into
masterfrom
nns-nested-manage-neuron-read-access
Dec 1, 2026
Merged

Dfinity-Bjoern merged 32 commits into
masterfrom
nns-nested-manage-neuron-read-access

Conversation

@Dfinity-Bjoern

@Dfinity-Bjoern Dfinity-Bjoern commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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 MakeProposal for 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 (see NeuronStore::can_principal_manage_neuron_via_proposals). There are no more levels, because a nested proposal cannot itself contain MakeProposal.

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_neurons follows in a separate PR. list_proposals and get_neuron_ids are unchanged; list_proposals' filter for ManageNeuron proposals is only a default view (include_all_manage_neuron_proposals and get_proposal_info already show any proposal).

Testing

  • New unit test: two-level get_full_neuron (neuron_store_tests.rs).
  • 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 (no SSH access to the golden state host).

🤖 Generated with Claude Code

Bjoern Tackmann and others added 5 commits November 20, 2026 14:17
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread rs/nns/governance/src/governance.rs Resolved
Comment thread rs/nns/governance/src/governance.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Bjoern Tackmann and others added 5 commits November 22, 2026 23:50
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the expanded neuron and proposal read-access change.

3 open issues

Review effort: Balanced

Bjoern Tackmann and others added 4 commits November 23, 2026 01:02
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>
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the indirect neuron and proposal read-access changes.

3 open issues

Review effort: Balanced

Bjoern Tackmann and others added 2 commits November 23, 2026 17:29
…l tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from nns-nested-manage-neuron-make-proposal to master November 23, 2026 17:26
@Dfinity-Bjoern
Dfinity-Bjoern requested a balanced review from Copilot November 23, 2026 20:43
Copilot AI balanced review requested due to automatic review settings November 30, 2026 22:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change extending full-neuron read access to two management levels.

No open issues 🎉

Review effort: Balanced

Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
Comment thread rs/nns/governance/src/neuron_store.rs Resolved
@daniel-wong-dfinity-org-twin

Copy link
Copy Markdown
Contributor

Thank you for splitting!

Co-authored-by: daniel-wong-dfinity-org-twin <daniel.wong+twin@dfinity.org>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 11:47
Dfinity-Bjoern and others added 2 commits December 1, 2026 12:48
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because the pending SplitSubnet release note duplicates an already-released change and could misrepresent the next upgrade’s contents.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings December 1, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The governance test target cannot compile because the test declares controller_principal_id but references an undefined principal_id in the neuron builder and assertions.

1 open issue

Review effort: Balanced

…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>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues with the change extending neuron read access to second-level managers.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@daniel-wong-dfinity-org-twin

Copy link
Copy Markdown
Contributor

Title suggestion: let people read neurons that they can indirectly "touch" via proposal.

@Dfinity-Bjoern Dfinity-Bjoern changed the title feat(nns): Two-level read access in get_full_neuron feat(nns): Let people read neurons that they can indirectly "touch" via proposal Dec 1, 2026
…on_via_proposals

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 17:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the indirect neuron-management read-access change.

No open issues 🎉

Review effort: Balanced

@Dfinity-Bjoern
Dfinity-Bjoern added this pull request to the merge queue Dec 1, 2026
Merged via the queue into master with commit 795f1b6 Dec 1, 2026
44 checks passed
@Dfinity-Bjoern
Dfinity-Bjoern deleted the nns-nested-manage-neuron-read-access branch December 1, 2026 19:03
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