GenericNervousSystemFunction error: NervousSystemFunction must have a topic

Hello, I believe there has been an upgrade to the SNS governance which requires one to set topics for GenericNervousSystemFunctions. When trying to add a new GenericNervousSystemFunctions, I’m getting the following error

SNS governance error: 1 defects in Proposal:
NervousSystemFunction must have a topic

I am not sure if this is already intended as I found in this post that this is only supposed to be released on March 24. In any case, this is a nice function but it blocks us right now from adding a new method as we don’t know the required payload to the proposal.

Is there already some documentation about the payload needed to pass to the AddGenericNervousSystemFunction proposal regarding the topic?

Hello @Dustin,

The post you refer to says that submitting custom proposals without topics will be disabled with an upcoming SNS Governance upgrade ETA Match 24.

What you’re observing is that registering a new custom proposal already requires setting the topic for it. Please consider using the following command as a template for your use case:

dfx canister --ic call $SNS_GOVERNANCE_CANISTER_ID manage_neuron '(
  record {
    subaccount = blob "NEURON_SUBACCOUNT_BLOB";
    command = opt variant {
      MakeProposal = record {
        url = "abc";
        title = "abc";
        action = opt variant {
          AddGenericNervousSystemFunction = record {
            id = 42 : nat64;
            name = "test";
            description = null;
            function_type = opt variant {
              GenericNervousSystemFunction = record {
                topic = opt variant { ApplicationBusinessLogic };
                validator_canister_id = opt principal "2vxsx-fae";
                target_canister_id = opt principal "2jvtu-yqaaa-aaaaq-aaama-cai";
                validator_method_name = opt "foo";
                target_method_name = opt "bar";
              }
            };
          }
        };
        summary = "test";
      }
    };
  },
)'

If you run just dfx canister --ic call $SNS_GOVERNANCE_CANISTER_ID manage_neuron and hit enter, you should get a nice auto complete for the candid structure, including the list of existing topics. Note that the critical topics (Critical Dapp Operations and Treasury & asset management) cannot be used right now.

  • The ETA for these two topics to become available to specify is next Monday (March 10).
  • The ETA for proposal criticality to be defined based on critical topics is in +1 week (March 17).

Thank you for that clarification! That helps a lot!

Do you have somewhere the description of which topic is intended for what purpose? Just to understand the logic behind those.

Also, is it possible to set custom topics or are those all predefined?

Here you go: SNS topics - design - #3 by lara

The topics are the same for all SNSs, custom topics will not be supported in the foreseeable future. One advantage of this design is that users will have a familiar interface for setting neuron following across different SNSs.

1 Like

Thank you! Is this already available in the latest quill version? Trying to add the topic argument but it seems to not be considered.

1 Like

Unfortunately, quill would need to be updated to the newest version of the ICP mono repo, I made a PR for that (Bump IC version to 00b04a892dfb2fee1459f1de9d4a731aa04f1ca3 by aterga · Pull Request #259 · dfinity/quill · GitHub) but it got stuck on some build issues, and I didn’t have time to debug that yet.

The advantage of DFX is that it’s always up to date with the latest SNS API and features, and I recommend using DFX in interactive mode to submit SNS proposals more easily (no need to hand craft Candid payloads). I’m working on a documentation page for describing all of this, but it’s still a draft.

Please let me know if DFX can unblock you.

1 Like

Yeah I did it via dfx now but had all my templates previously setup in quill. So I’m good to go with dfx now :slight_smile:

2 Likes

I see. Thanks for confirming that DFX worked for you in this case.

Generally, we might migrate away from Quill to DFX for documenting SNS features, to avoid such issues in the future.

It’s also worth mentioning that the community has meantime developed some great tools, too. For example, I recommend looking into https://dev.ic-toolkit.app/ which makes submitting SNS proposals a breeze for those who prefer clicking rather than typing.

I have all my templates setup with quill, is there a way to get this to work with topic



# Set current directory to the directory this script is in
SCRIPT=$(readlink -f "$0")
SCRIPT_DIR=$(dirname "$SCRIPT")
cd $SCRIPT_DIR

PROPOSAL="(
    record {
        title = \"Create Update Club Callback Function\";          
        url = \"https://github.com/jamesbeadle/football_god/blob/master/src/data_canister/main.mo\";        
        summary = \"Proposal to create the endpoint for adding the callback function to update a club within the data canister.\";
        action = opt variant {
            AddGenericNervousSystemFunction = record {
                id = 62000 : nat64;
                name = \"Update Club\";
                description = opt \"Function to update a club.\";
                function_type = opt variant { 
                    GenericNervousSystemFunction = record { 
                        topic = opt variant { ApplicationBusinessLogic };
                        validator_canister_id = opt principal \"52fzd-2aaaa-aaaal-qmzsa-cai\"; 
                        target_canister_id = opt principal \"52fzd-2aaaa-aaaal-qmzsa-cai\"; 
                        validator_method_name = opt \"validateUpdateClub\";                         
                        target_method_name = opt \"updateClub\";
                    } 
                };
            }
        };
    }
)"

../../utils/submit_proposal.sh "$PROPOSAL"

I tried it but when I use

                        topic = opt variant { ApplicationBusinessLogic };

It doesn’t bring in the property:

I want to be able to still keep a record of the proposals I raise in github, so quill is good, also lets me bulk run proposals in one go locally

Hi @jamesbeadle,

The status of updating Quill is still the same, e.g., it’s blocked, and we didn’t have time to fix it yet. Let me get back to you with an ETA on that.

For now, please consider using either DFX or https://dev.ic-toolkit.app/

How do I record these proposals and then run them locally?

Manually do them all in dfx? It doesn’t work as a long term solution, scripting of proposals via files is really important, I do hope you find the time.

Running locally can be done by replacing --ic with --network local while calling the DFX command, e.g.,

dfx canister --network local call $SNS_GOVERNANCE_CANISTER_ID manage_neuron '(
  record {
    subaccount = blob "NEURON_SUBACCOUNT_BLOB";
    command = opt variant {
      MakeProposal = record {
        title = "Create Update Club Callback Function";          
        url = "https://github.com/jamesbeadle/football_god/blob/master/src/data_canister/main.mo";        
        summary = "Proposal to create the endpoint for adding the callback function to update a club within the data canister.";
        action = opt variant {
            AddGenericNervousSystemFunction = record {
                id = 62000 : nat64;
                name = "Update Club";
                description = opt "Function to update a club.";
                function_type = opt variant { 
                    GenericNervousSystemFunction = record { 
                        topic = opt variant { ApplicationBusinessLogic };
                        validator_canister_id = opt principal "52fzd-2aaaa-aaaal-qmzsa-cai"; 
                        target_canister_id = opt principal "52fzd-2aaaa-aaaal-qmzsa-cai"; 
                        validator_method_name = opt "validateUpdateClub";                         
                        target_method_name = opt "updateClub";
                    } 
                };
            }
        };
      }
    };
  },
)'