Skip to content

feat(governance): Added success_value to ProposalData (and ProposalInfo).#9789

Open
daniel-wong-dfinity-org wants to merge 7 commits intomasterfrom
proposal-success-value-daniel-wong
Open

feat(governance): Added success_value to ProposalData (and ProposalInfo).#9789
daniel-wong-dfinity-org wants to merge 7 commits intomasterfrom
proposal-success-value-daniel-wong

Conversation

@daniel-wong-dfinity-org
Copy link
Copy Markdown
Contributor

@daniel-wong-dfinity-org daniel-wong-dfinity-org commented Apr 9, 2026

Why

The immediate use case for this is creating a canister (in another subnet). See "References". We'll want to know the ID of the created canister. This allows us to link to that datum from the proposal. Having this info will also facilitate testing this new proposal type.

In the not too distant future, this will also be used when taking a snapshot of an NNS-controlled canister.

Minor Associated Changes

Internally, added

trait CallCanisterReply {
  fn try_decode(...

next to existing CallCanister trait. Also, added

trait CallCanister {
    type Reply: CallCanisterReply;

This way, perform_call_canister knows how to decode the reply, instead of just throwing it away (it used to just throw the reply away).

perform_call_canister now also records the status of the proposal execution by calling set_proposal_execution_status. As a result, the body of all existing perform_whatever methods have been reduced to a single line:

self.perform_call_canister(proposal_id, request).await;

set_proposal_execution_status now takes Result<Vec<u8>, ...> instead of just Result<(), ...>. Actually, perform_call_canister doesn't directly decode the reply; it really happens here, in set_proposal_execution_status.

Existing callers of set_proposal_execution_status are mechanically updated from

self.set_proposal_execution_status(proposal_id, result);

to

self.set_proposal_execution_status::<()>(proposal_id, result.map(|()| vec![]));

Moved humanize_blob to a ic-nervous-system-string.

References

👈 Previous PR

Base automatically changed from new-create-canister-proposal-type-daniel-wong to master April 9, 2026 13:19
@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the proposal-success-value-daniel-wong branch from 0286456 to 0e924d3 Compare April 9, 2026 13:24
@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the proposal-success-value-daniel-wong branch from a1a43a1 to a90fe92 Compare April 9, 2026 13:28
@daniel-wong-dfinity-org daniel-wong-dfinity-org force-pushed the proposal-success-value-daniel-wong branch from a5ad713 to da676ff Compare April 9, 2026 14:10
@daniel-wong-dfinity-org daniel-wong-dfinity-org changed the title Added success_value to ProposalData and ProposalInfo. feat(governance): Added success_value to ProposalData (and ProposalInfo). Apr 9, 2026
@github-actions github-actions bot added the feat label Apr 9, 2026
@daniel-wong-dfinity-org daniel-wong-dfinity-org marked this pull request as ready for review April 9, 2026 14:20
@daniel-wong-dfinity-org daniel-wong-dfinity-org requested a review from a team as a code owner April 9, 2026 14:20
github-actions[bot]

This comment was marked as resolved.

@daniel-wong-dfinity-org daniel-wong-dfinity-org dismissed github-actions[bot]’s stale review April 9, 2026 14:22
  1. Behind flag.
  2. Messaged clients on Slack.
  3. Changed Proposal (add new Action). Existing proposals are fine.
  4. Asking...
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.

1 participant