8000 Fix sns demo proposals creation by mstrasinskis · Pull Request #6722 · dfinity/nns-dapp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix sns demo proposals creation #6722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

mstrasinskis
Copy link
Contributor
@mstrasinskis mstrasinskis commented Apr 22, 2025

Motivation

Currently, creating dummy SNS proposals displays an error due to multiple failing calls.
This PR addresses a few related issues to make the flow work — except for executeNSFunctionProposal, which is still failing.

Proposals that would fail in the worst-case scenario before this PR (with reasons).

  1. "Dummy NS Function Proposal" (variant GenericNervousSystemFunction is missing key "topic")
  2. "Dummy NS Function Proposal 2" (variant GenericNervousSystemFunction is missing key "topic")
  3. "Register Dapp Canister" (Neuron has an ongoing operation)
  4. "Dummy Metadata Proposal" (Neuron has an ongoing operation.)
  5. "Dummy Motion Proposal 2" (Neuron has an ongoing operation)
  6. "Execute Generic Nervoys system Function" (There is no NervousSystemFunction with id: 1002)

Most of the proposals fail because the neuron is locked during some proposals creation.

Changes

  • Add new required field: topic (errors 1-2).
  • Make proposal execution sequential to avoid locked neuron state and improve robustness (errors 3-5). This feature shouldn't affect the e2e tests, since it's not used there.
  • Comment out executeNSFunctionProposal (error 6) — solution still pending.

Tests

  • Verified locally that it creates proposals w/o errors.

Todos

  • Add entry to changelog (if necessary).
    Not necessary.

@mstrasinskis mstrasinskis changed the title Fix sns demo proposals Fix sns demo proposals creation Apr 22, 2025
@mstrasinskis mstrasinskis marked this pull request as ready for review April 22, 2025 08:45
@mstrasinskis mstrasinskis requested a review from a team as a code owner April 22, 2025 08:45
},
] as [SnsAction],
};
// const executeNSFunctionProposal = {
Copy link
Contributor

Is this block of code commented out because of the linter? What if we add a linter exception for the unused variable instead of commenting it?

// The following proposals require specific state to be set up first.
executeNSFunctionProposal,

// Fails with error: 1 defects in Proposal: There is no NervousSystemFunction with id: 1002
Copy link
Contributor

Choose a reason for hiding this comment

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

do you know why we get this error now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This proposal was failing before this PR. I assume the backend added stricter validation, which makes sense — proposals shouldn’t be allowed to execute non-existent NS-functions.

@mstrasinskis mstrasinskis requested a review from yhabib May 16, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0