SNS.yaml: month and year conversion to seconds

:+1:

:tada:

I concur that this is probably what happened.

Yes, I mentioned this earlier:

My main claim is that all fields define month the same. I could not find any evidence to the contrary.

2 Likes

For the track record, I get the same duration when I simulate submitting the SNS.yaml of DOGMI and ICVC with proposals.network locally as what was proposed on the mainnet. Sounds good.

Hi everyone,

I will soon be proposing to turn Juno into a DAO using the SNS framework. Since there is still some uncertainty regarding this specific duration issue, I would appreciate it if one of the foundation NNS developers participating in this thread could run my SNS YAML file with your tooling and confirm that you’re getting the same duration as I do with proposals.network.

After disabling the neuron funds and removing the dapp canisters from the YAML file, this is the payload of the Create Service Nervous System proposal that I am able to generate.

{
  "url": "https://juno.build",
  "governanceParameters": {
    "neuronMaximumDissolveDelayBonus": {
      "basisPoints": "7500"
    },
    "neuronMaximumAgeForAgeBonus": {
      "seconds": "94672800"
    },
    "neuronMaximumDissolveDelay": {
      "seconds": "94672800"
    },
    "neuronMinimumDissolveDelayToVote": {
      "seconds": "15780096"
    },
    "neuronMaximumAgeBonus": {
      "basisPoints": "2500"
    },
    "neuronMinimumStake": {
      "e8s": "10000000000"
    },
    "proposalWaitForQuietDeadlineIncrease": {
      "seconds": "86400"
    },
    "proposalInitialVotingPeriod": {
      "seconds": "259200"
    },
    "proposalRejectionFee": {
      "e8s": "10000000000"
    },
    "votingRewardParameters": {
      "rewardRateTransitionDuration": {
        "seconds": "31557600"
      },
      "initialRewardRate": {
        "basisPoints": "150"
      },
      "finalRewardRate": {
        "basisPoints": "150"
      }
    }
  },
  "fallbackControllerPrincipalIds": [
    "tpv2w-kr3vj-a3mac-wivgj-5mwwr-egoxz-vxdpg-oqul5-3oygd-derik-jqe",
    "miso6-cu5ju-xcxwf-v2upq-mn32j-sn7lf-7mgiq-rh5ec-olmvw-a6z54-pqe"
  ],
  "logo": {
    "base64Encoding": "data:image/png;base64,iVBO...gg=="
    },
    "tokenName": "Juno Build"
  },
  "description": "Juno is a blockchain-as-a-service platform that equips developers with all the essential tools to create Web3 applications, making it as easy as developing with Web2 cloud services. It offers a growing number of features, including authentication, data and file storage, hosting, serverless functions, and on-chain analytics.",
  "dappCanisters": [],
  "swapParameters": {
    "minimumParticipants": "100",
    "duration": {
      "seconds": "1209600"
    },
    "neuronBasketConstructionParameters": {
      "dissolveDelayInterval": {
        "seconds": "15780096"
      },
      "count": "5"
    },
    "confirmationText": "I confirm my understanding of the responsibilities and risks associated with participating in this token swap and that I am not a resident of any of the excluded countries.\n",
    "maximumParticipantIcp": {
      "e8s": "20000000000000"
    },
    "neuronsFundInvestmentIcp": undefined,
    "minimumIcp": undefined,
    "minimumParticipantIcp": {
      "e8s": "1000000000"
    },
    "startTime": undefined,
    "maximumIcp": undefined,
    "restrictedCountries": {
      "isoCodes": [
        "AF",
        "BY",
        "BA",
        "BI",
        "CF",
        "KP",
        "CD",
        "IR",
        "IQ",
        "LB",
        "LY",
        "ML",
        "ME",
        "MM",
        "NI",
        "RU",
        "RS",
        "SO",
        "SD",
        "SY",
        "UA",
        "VE",
        "YE",
        "ZW"
      ]
    },
    "maxDirectParticipationIcp": {
      "e8s": "35000000000000"
    },
    "minDirectParticipationIcp": {
      "e8s": "20000000000000"
    },
    "neuronsFundParticipation": false
  },
  "initialTokenDistribution": {
    "treasuryDistribution": {
      "total": {
        "e8s": "5000000000000000"
      }
    },
    "developerDistribution": {
      "developerNeurons": [
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "63115200"
          },
          "memo": "0",
          "vestingPeriod": {
            "seconds": "157788000"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "47340288"
          },
          "memo": "1",
          "vestingPeriod": {
            "seconds": "94672800"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "31557600"
          },
          "memo": "2",
          "vestingPeriod": {
            "seconds": "63115200"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "23670144"
          },
          "memo": "3",
          "vestingPeriod": {
            "seconds": "47340288"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "15780096"
          },
          "memo": "4",
          "vestingPeriod": {
            "seconds": "31557600"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        }
      ]
    },
    "swapDistribution": {
      "total": {
        "e8s": "3000000000000000"
      }
    }
  }
}

Thanks in advance for your feedback.

Given that I’m planning to create the proposal soon, up.

There were few adjustements in the sns_init.yaml file (as communicated in the related thread), so here is the up-to-date content of the generated Create Service Nervous System proposal (minus logo).

{
  "url": "https://juno.build",
  "governanceParameters": {
    "neuronMaximumDissolveDelayBonus": {
      "basisPoints": "7500"
    },
    "neuronMaximumAgeForAgeBonus": {
      "seconds": "94672800"
    },
    "neuronMaximumDissolveDelay": {
      "seconds": "94672800"
    },
    "neuronMinimumDissolveDelayToVote": {
      "seconds": "15780096"
    },
    "neuronMaximumAgeBonus": {
      "basisPoints": "2500"
    },
    "neuronMinimumStake": {
      "e8s": "1000000000"
    },
    "proposalWaitForQuietDeadlineIncrease": {
      "seconds": "86400"
    },
    "proposalInitialVotingPeriod": {
      "seconds": "259200"
    },
    "proposalRejectionFee": {
      "e8s": "10000000000"
    },
    "votingRewardParameters": {
      "rewardRateTransitionDuration": {
        "seconds": "31557600"
      },
      "initialRewardRate": {
        "basisPoints": "150"
      },
      "finalRewardRate": {
        "basisPoints": "150"
      }
    }
  },
  "fallbackControllerPrincipalIds": [
    "tpv2w-kr3vj-a3mac-wivgj-5mwwr-egoxz-vxdpg-oqul5-3oygd-derik-jqe",
    "miso6-cu5ju-xcxwf-v2upq-mn32j-sn7lf-7mgiq-rh5ec-olmvw-a6z54-pqe"
  ],
  "logo": {
    "base64Encoding": "data:image/png;base64,iVBOR...Jggg=="
  },
  "name": "Juno Build",
  "ledgerParameters": {
    "transactionFee": {
      "e8s": "1000000"
    },
    "tokenSymbol": "JUNOBUILD",
    "tokenLogo": {
      "base64Encoding": "data:image/png;base64,iVBOR...Jggg=="
    },
    "tokenName": "Juno Build"
  },
  "description": "Juno is a blockchain-as-a-service platform that empowers developers to build decentralized apps efficiently. It offers a comprehensive toolkit to scaffold secure and efficient projects.",
  "dappCanisters": [],
  "swapParameters": {
    "minimumParticipants": "1",
    "duration": {
      "seconds": "1209600"
    },
    "neuronBasketConstructionParameters": {
      "dissolveDelayInterval": {
        "seconds": "15780096"
      },
      "count": "5"
    },
    "confirmationText": "I confirm my understanding of the responsibilities and risks associated with participating in this token swap and that I am not a resident of any of the excluded countries.\n",
    "maximumParticipantIcp": {
      "e8s": "20000000000000"
    },
    "neuronsFundInvestmentIcp": undefined,
    "minimumIcp": undefined,
    "minimumParticipantIcp": {
      "e8s": "100000000"
    },
    "startTime": undefined,
    "maximumIcp": undefined,
    "restrictedCountries": {
      "isoCodes": [
        "AF",
        "BY",
        "BA",
        "BI",
        "CF",
        "KP",
        "CD",
        "IR",
        "IQ",
        "LB",
        "LY",
        "ML",
        "ME",
        "MM",
        "NI",
        "RU",
        "RS",
        "SO",
        "SD",
        "SY",
        "UA",
        "VE",
        "YE",
        "ZW"
      ]
    },
    "maxDirectParticipationIcp": {
      "e8s": "35000000000000"
    },
    "minDirectParticipationIcp": {
      "e8s": "20000000000000"
    },
    "neuronsFundParticipation": false
  },
  "initialTokenDistribution": {
    "treasuryDistribution": {
      "total": {
        "e8s": "5000000000000000"
      }
    },
    "developerDistribution": {
      "developerNeurons": [
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "63115200"
          },
          "memo": "0",
          "vestingPeriod": {
            "seconds": "157788000"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "47340288"
          },
          "memo": "1",
          "vestingPeriod": {
            "seconds": "94672800"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "31557600"
          },
          "memo": "2",
          "vestingPeriod": {
            "seconds": "63115200"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "23670144"
          },
          "memo": "3",
          "vestingPeriod": {
            "seconds": "47340288"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        },
        {
          "controller": "k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe",
          "dissolveDelay": {
            "seconds": "15780096"
          },
          "memo": "4",
          "vestingPeriod": {
            "seconds": "31557600"
          },
          "stake": {
            "e8s": "400000000000000"
          }
        }
      ]
    },
    "swapDistribution": {
      "total": {
        "e8s": "3000000000000000"
      }
    }
  }
}

Hi @peterparker

I added one line println!("proposal = {:#?}", proposal); to the load_configuration_and_validate function of the propose subcommand of SNS CLI tool (bazel run //rs/sns/cli:sns -- propose --test-neuron-proposer) to see what proposal payload would be generated for your YAML file, and it seems that all time-related fields match those that you posted above (there were 18 such fields, right?)

Here’s the full payload I’ve got:

proposal = Proposal {
    title: Some(
        "NNS Proposal to create an SNS named 'Juno Build'",
    ),
    summary: "",
    url: "https://forum.dfinity.org/thread-where-this-sns-is-discussed",
    action: Some(
        CreateServiceNervousSystem(
            CreateServiceNervousSystem {
                name: Some(
                    "Juno Build",
                ),
                description: Some(
                    "Juno is a blockchain-as-a-service platform that empowers developers to build decentralized apps efficiently. It offers a comprehensive toolkit to scaffold secure and efficient projects.",
                ),
                url: Some(
                    "https://juno.build",
                ),
                logo: Some(
                    Image {
                        base64_encoding: Some(
                            "data:image/png;base64,",
                        ),
                    },
                ),
                fallback_controller_principal_ids: [
                    tpv2w-kr3vj-a3mac-wivgj-5mwwr-egoxz-vxdpg-oqul5-3oygd-derik-jqe,
                    miso6-cu5ju-xcxwf-v2upq-mn32j-sn7lf-7mgiq-rh5ec-olmvw-a6z54-pqe,
                ],
                dapp_canisters: [
                    Canister {
                        id: Some(
                            cokmz-oiaaa-aaaal-aby6q-cai,
                        ),
                    },
                    Canister {
                        id: Some(
                            klbfr-lqaaa-aaaak-qbwsa-cai,
                        ),
                    },
                    Canister {
                        id: Some(
                            fmkjf-bqaaa-aaaal-acpza-cai,
                        ),
                    },
                ],
                initial_token_distribution: Some(
                    InitialTokenDistribution {
                        developer_distribution: Some(
                            DeveloperDistribution {
                                developer_neurons: [
                                    NeuronDistribution {
                                        controller: Some(
                                            k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe,
                                        ),
                                        dissolve_delay: Some(
                                            Duration {
                                                seconds: Some(
                                                    63115200,
                                                ),
                                            },
                                        ),
                                        memo: Some(
                                            0,
                                        ),
                                        stake: Some(
                                            Tokens {
                                                e8s: Some(
                                                    400000000000000,
                                                ),
                                            },
                                        ),
                                        vesting_period: Some(
                                            Duration {
                                                seconds: Some(
                                                    157788000,
                                                ),
                                            },
                                        ),
                                    },
                                    NeuronDistribution {
                                        controller: Some(
                                            k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe,
                                        ),
                                        dissolve_delay: Some(
                                            Duration {
                                                seconds: Some(
                                                    47340288,
                                                ),
                                            },
                                        ),
                                        memo: Some(
                                            1,
                                        ),
                                        stake: Some(
                                            Tokens {
                                                e8s: Some(
                                                    400000000000000,
                                                ),
                                            },
                                        ),
                                        vesting_period: Some(
                                            Duration {
                                                seconds: Some(
                                                    94672800,
                                                ),
                                            },
                                        ),
                                    },
                                    NeuronDistribution {
                                        controller: Some(
                                            k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe,
                                        ),
                                        dissolve_delay: Some(
                                            Duration {
                                                seconds: Some(
                                                    31557600,
                                                ),
                                            },
                                        ),
                                        memo: Some(
                                            2,
                                        ),
                                        stake: Some(
                                            Tokens {
                                                e8s: Some(
                                                    400000000000000,
                                                ),
                                            },
                                        ),
                                        vesting_period: Some(
                                            Duration {
                                                seconds: Some(
                                                    63115200,
                                                ),
                                            },
                                        ),
                                    },
                                    NeuronDistribution {
                                        controller: Some(
                                            k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe,
                                        ),
                                        dissolve_delay: Some(
                                            Duration {
                                                seconds: Some(
                                                    23670144,
                                                ),
                                            },
                                        ),
                                        memo: Some(
                                            3,
                                        ),
                                        stake: Some(
                                            Tokens {
                                                e8s: Some(
                                                    400000000000000,
                                                ),
                                            },
                                        ),
                                        vesting_period: Some(
                                            Duration {
                                                seconds: Some(
                                                    47340288,
                                                ),
                                            },
                                        ),
                                    },
                                    NeuronDistribution {
                                        controller: Some(
                                            k5nen-up7es-gfojt-3cbvu-ejeec-kjull-457tg-en2xi-ixjgm-vnxmv-tqe,
                                        ),
                                        dissolve_delay: Some(
                                            Duration {
                                                seconds: Some(
                                                    15780096,
                                                ),
                                            },
                                        ),
                                        memo: Some(
                                            4,
                                        ),
                                        stake: Some(
                                            Tokens {
                                                e8s: Some(
                                                    400000000000000,
                                                ),
                                            },
                                        ),
                                        vesting_period: Some(
                                            Duration {
                                                seconds: Some(
                                                    31557600,
                                                ),
                                            },
                                        ),
                                    },
                                ],
                            },
                        ),
                        treasury_distribution: Some(
                            TreasuryDistribution {
                                total: Some(
                                    Tokens {
                                        e8s: Some(
                                            5000000000000000,
                                        ),
                                    },
                                ),
                            },
                        ),
                        swap_distribution: Some(
                            SwapDistribution {
                                total: Some(
                                    Tokens {
                                        e8s: Some(
                                            3000000000000000,
                                        ),
                                    },
                                ),
                            },
                        ),
                    },
                ),
                swap_parameters: Some(
                    SwapParameters {
                        minimum_participants: Some(
                            100,
                        ),
                        minimum_icp: None,
                        maximum_icp: None,
                        minimum_direct_participation_icp: Some(
                            Tokens {
                                e8s: Some(
                                    20000000000000,
                                ),
                            },
                        ),
                        maximum_direct_participation_icp: Some(
                            Tokens {
                                e8s: Some(
                                    35000000000000,
                                ),
                            },
                        ),
                        minimum_participant_icp: Some(
                            Tokens {
                                e8s: Some(
                                    100000000,
                                ),
                            },
                        ),
                        maximum_participant_icp: Some(
                            Tokens {
                                e8s: Some(
                                    20000000000000,
                                ),
                            },
                        ),
                        neuron_basket_construction_parameters: Some(
                            NeuronBasketConstructionParameters {
                                count: Some(
                                    5,
                                ),
                                dissolve_delay_interval: Some(
                                    Duration {
                                        seconds: Some(
                                            15780096,
                                        ),
                                    },
                                ),
                            },
                        ),
                        confirmation_text: Some(
                            "I confirm my understanding of the responsibilities and risks associated with participating in this token swap and that I am not a resident of any of the excluded countries.\n",
                        ),
                        restricted_countries: Some(
                            Countries {
                                iso_codes: [
                                    "AF",
                                    "BY",
                                    "BA",
                                    "BI",
                                    "CF",
                                    "KP",
                                    "CD",
                                    "IR",
                                    "IQ",
                                    "LB",
                                    "LY",
                                    "ML",
                                    "ME",
                                    "MM",
                                    "NI",
                                    "RU",
                                    "RS",
                                    "SO",
                                    "SD",
                                    "SY",
                                    "UA",
                                    "VE",
                                    "YE",
                                    "ZW",
                                ],
                            },
                        ),
                        start_time: None,
                        duration: Some(
                            Duration {
                                seconds: Some(
                                    1209600,
                                ),
                            },
                        ),
                        neurons_fund_investment_icp: None,
                        neurons_fund_participation: Some(
                            true,
                        ),
                    },
                ),
                ledger_parameters: Some(
                    LedgerParameters {
                        transaction_fee: Some(
                            Tokens {
                                e8s: Some(
                                    1000000,
                                ),
                            },
                        ),
                        token_name: Some(
                            "Juno Build",
                        ),
                        token_symbol: Some(
                            "JUNOBUILD",
                        ),
                        token_logo: Some(
                            Image {
                                base64_encoding: Some(
                                    "data:image/png;base64,",
                                ),
                            },
                        ),
                    },
                ),
                governance_parameters: Some(
                    GovernanceParameters {
                        proposal_rejection_fee: Some(
                            Tokens {
                                e8s: Some(
                                    10000000000,
                                ),
                            },
                        ),
                        proposal_initial_voting_period: Some(
                            Duration {
                                seconds: Some(
                                    259200,
                                ),
                            },
                        ),
                        proposal_wait_for_quiet_deadline_increase: Some(
                            Duration {
                                seconds: Some(
                                    86400,
                                ),
                            },
                        ),
                        neuron_minimum_stake: Some(
                            Tokens {
                                e8s: Some(
                                    1000000000,
                                ),
                            },
                        ),
                        neuron_minimum_dissolve_delay_to_vote: Some(
                            Duration {
                                seconds: Some(
                                    15780096,
                                ),
                            },
                        ),
                        neuron_maximum_dissolve_delay: Some(
                            Duration {
                                seconds: Some(
                                    94672800,
                                ),
                            },
                        ),
                        neuron_maximum_dissolve_delay_bonus: Some(
                            Percentage {
                                basis_points: Some(
                                    7500,
                                ),
                            },
                        ),
                        neuron_maximum_age_for_age_bonus: Some(
                            Duration {
                                seconds: Some(
                                    94672800,
                                ),
                            },
                        ),
                        neuron_maximum_age_bonus: Some(
                            Percentage {
                                basis_points: Some(
                                    2500,
                                ),
                            },
                        ),
                        voting_reward_parameters: Some(
                            VotingRewardParameters {
                                initial_reward_rate: Some(
                                    Percentage {
                                        basis_points: Some(
                                            150,
                                        ),
                                    },
                                ),
                                final_reward_rate: Some(
                                    Percentage {
                                        basis_points: Some(
                                            150,
                                        ),
                                    },
                                ),
                                reward_rate_transition_duration: Some(
                                    Duration {
                                        seconds: Some(
                                            31557600,
                                        ),
                                    },
                                ),
                            },
                        ),
                    },
                ),
            },
        ),
    ),
}

Hope this helps.

1 Like

I manually compared all the fields of the payload you got with the ones I generated, and they all matched. Therefore, I’m confident that this issue is resolved, and I’ll be able to proceed with submitting Juno’s proposal. Thanks a lot for your help!

1 Like