From 9afc3e2ea61dd4ec36629b0b7c9873dbad02e9ea Mon Sep 17 00:00:00 2001 From: David de Kloet Date: Tue, 15 Oct 2024 15:52:14 +0200 Subject: [PATCH] Update candid and rust --- .../sns_governance/sns_governance.did | 20 ++++++++- .../sns_ledger/sns_ledger.did | 2 +- .../sns_root/sns_root.did | 2 +- .../sns_swap/sns_swap.did | 2 +- .../sns_wasm/sns_wasm.did | 2 +- dfx.json | 2 +- .../src/types/ic_sns_governance.rs | 45 ++++++++++++++----- rs/sns_aggregator/src/types/ic_sns_ledger.rs | 2 +- rs/sns_aggregator/src/types/ic_sns_root.rs | 2 +- rs/sns_aggregator/src/types/ic_sns_swap.rs | 2 +- rs/sns_aggregator/src/types/ic_sns_wasm.rs | 2 +- 11 files changed, 61 insertions(+), 22 deletions(-) diff --git a/declarations/used_by_sns_aggregator/sns_governance/sns_governance.did b/declarations/used_by_sns_aggregator/sns_governance/sns_governance.did index adabcd0000a..18f54b3f479 100644 --- a/declarations/used_by_sns_aggregator/sns_governance/sns_governance.did +++ b/declarations/used_by_sns_aggregator/sns_governance/sns_governance.did @@ -1,4 +1,4 @@ -//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: type Account = record { owner : opt principal; subaccount : opt Subaccount; @@ -265,6 +265,12 @@ type GetSnsInitializationParametersResponse = record { sns_initialization_parameters : text; }; +type CachedUpgradeSteps = record { + upgrade_steps : opt Versions; + requested_timestamp_seconds : opt nat64; + response_timestamp_seconds : opt nat64; +}; + type Governance = record { root_canister_id : opt principal; id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction }; @@ -274,6 +280,7 @@ type Governance = record { parameters : opt NervousSystemParameters; is_finalizing_disburse_maturity : opt bool; deployed_version : opt Version; + cached_upgrade_steps : opt CachedUpgradeSteps; sns_initialization_parameters : text; latest_reward_event : opt RewardEvent; pending_version : opt UpgradeInProgress; @@ -284,7 +291,6 @@ type Governance = record { sns_metadata : opt ManageSnsMetadata; neurons : vec record { text; Neuron }; genesis_timestamp_seconds : nat64; - migrated_root_wasm_memory_limit : opt bool; }; type GovernanceCachedMetrics = record { @@ -689,6 +695,8 @@ type Version = record { index_wasm_hash : blob; }; +type Versions = record { versions : vec Version }; + type VotingRewardsParameters = record { final_reward_rate_basis_points : opt nat64; initial_reward_rate_basis_points : opt nat64; @@ -700,6 +708,13 @@ type WaitForQuietState = record { current_deadline_timestamp_seconds : nat64; }; +type GetUpgradeJournalRequest = record {}; + +type GetUpgradeJournalResponse = record { + upgrade_steps : opt Versions; + response_timestamp_seconds : opt nat64; +}; + service : (Governance) -> { claim_swap_neurons : (ClaimSwapNeuronsRequest) -> (ClaimSwapNeuronsResponse); fail_stuck_upgrade_in_progress : (record {}) -> (record {}); @@ -716,6 +731,7 @@ service : (Governance) -> { get_sns_initialization_parameters : (record {}) -> ( GetSnsInitializationParametersResponse, ) query; + get_upgrade_journal : (GetUpgradeJournalRequest) -> (GetUpgradeJournalResponse) query; list_nervous_system_functions : () -> ( ListNervousSystemFunctionsResponse, ) query; diff --git a/declarations/used_by_sns_aggregator/sns_ledger/sns_ledger.did b/declarations/used_by_sns_aggregator/sns_ledger/sns_ledger.did index ba13e547d4d..2c63d39122f 100644 --- a/declarations/used_by_sns_aggregator/sns_ledger/sns_ledger.did +++ b/declarations/used_by_sns_aggregator/sns_ledger/sns_ledger.did @@ -1,4 +1,4 @@ -//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: type BlockIndex = nat; type Subaccount = blob; // Number of nanoseconds since the UNIX epoch in UTC timezone. diff --git a/declarations/used_by_sns_aggregator/sns_root/sns_root.did b/declarations/used_by_sns_aggregator/sns_root/sns_root.did index 444defa6279..72800b7f8e4 100644 --- a/declarations/used_by_sns_aggregator/sns_root/sns_root.did +++ b/declarations/used_by_sns_aggregator/sns_root/sns_root.did @@ -1,4 +1,4 @@ -//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: type CanisterCallError = record { code : opt int32; description : text; diff --git a/declarations/used_by_sns_aggregator/sns_swap/sns_swap.did b/declarations/used_by_sns_aggregator/sns_swap/sns_swap.did index eafca3baa74..744a6c9d27a 100644 --- a/declarations/used_by_sns_aggregator/sns_swap/sns_swap.did +++ b/declarations/used_by_sns_aggregator/sns_swap/sns_swap.did @@ -1,4 +1,4 @@ -//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: type BuyerState = record { icp : opt TransferableAmount; has_created_neuron_recipes : opt bool; diff --git a/declarations/used_by_sns_aggregator/sns_wasm/sns_wasm.did b/declarations/used_by_sns_aggregator/sns_wasm/sns_wasm.did index 899f1e6dfa5..6c0fe523755 100644 --- a/declarations/used_by_sns_aggregator/sns_wasm/sns_wasm.did +++ b/declarations/used_by_sns_aggregator/sns_wasm/sns_wasm.did @@ -1,4 +1,4 @@ -//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: type AddWasmRequest = record { hash : blob; wasm : opt SnsWasm; diff --git a/dfx.json b/dfx.json index 7ac80ecd524..ed85e993553 100644 --- a/dfx.json +++ b/dfx.json @@ -404,7 +404,7 @@ "CARGO_SORT_VERSION": "1.0.9", "SNSDEMO_RELEASE": "release-2024-10-09", "IC_COMMIT_FOR_PROPOSALS": "release-2024-09-26_01-31-no-canister-snapshots", - "IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-09-26_01-31-no-canister-snapshots" + "IC_COMMIT_FOR_SNS_AGGREGATOR": "release-2024-10-11_14-35-overload" }, "packtool": "" } diff --git a/rs/sns_aggregator/src/types/ic_sns_governance.rs b/rs/sns_aggregator/src/types/ic_sns_governance.rs index 6491ebbd051..5ab755a87d2 100644 --- a/rs/sns_aggregator/src/types/ic_sns_governance.rs +++ b/rs/sns_aggregator/src/types/ic_sns_governance.rs @@ -1,5 +1,5 @@ //! Rust code created from candid by: `scripts/did2rs.sh --canister sns_governance --out ic_sns_governance.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug` -//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: #![allow(clippy::all)] #![allow(unused_imports)] #![allow(missing_docs)] @@ -16,6 +16,25 @@ use ic_cdk::api::call::CallResult; // use candid::{self, CandidType, Deserialize, Principal}; // use ic_cdk::api::call::CallResult as Result; +#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] +pub struct Version { + pub archive_wasm_hash: serde_bytes::ByteBuf, + pub root_wasm_hash: serde_bytes::ByteBuf, + pub swap_wasm_hash: serde_bytes::ByteBuf, + pub ledger_wasm_hash: serde_bytes::ByteBuf, + pub governance_wasm_hash: serde_bytes::ByteBuf, + pub index_wasm_hash: serde_bytes::ByteBuf, +} +#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] +pub struct Versions { + pub versions: Vec, +} +#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] +pub struct CachedUpgradeSteps { + pub upgrade_steps: Option, + pub response_timestamp_seconds: Option, + pub requested_timestamp_seconds: Option, +} #[derive(Serialize, Clone, Debug, CandidType, Deserialize)] pub struct GenericNervousSystemFunction { pub validator_canister_id: Option, @@ -105,15 +124,6 @@ pub struct NervousSystemParameters { pub max_number_of_principals_per_neuron: Option, } #[derive(Serialize, Clone, Debug, CandidType, Deserialize)] -pub struct Version { - pub archive_wasm_hash: serde_bytes::ByteBuf, - pub root_wasm_hash: serde_bytes::ByteBuf, - pub swap_wasm_hash: serde_bytes::ByteBuf, - pub ledger_wasm_hash: serde_bytes::ByteBuf, - pub governance_wasm_hash: serde_bytes::ByteBuf, - pub index_wasm_hash: serde_bytes::ByteBuf, -} -#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] pub struct ProposalId { pub id: u64, } @@ -458,6 +468,7 @@ pub struct Neuron { #[derive(Serialize, Clone, Debug, CandidType, Deserialize)] pub struct Governance { pub root_canister_id: Option, + pub cached_upgrade_steps: Option, pub id_to_nervous_system_functions: Vec<(u64, NervousSystemFunction)>, pub metrics: Option, pub maturity_modulation: Option, @@ -473,7 +484,6 @@ pub struct Governance { pub proposals: Vec<(u64, ProposalData)>, pub in_flight_commands: Vec<(String, NeuronInFlightCommand)>, pub sns_metadata: Option, - pub migrated_root_wasm_memory_limit: Option, pub neurons: Vec<(String, Neuron)>, pub genesis_timestamp_seconds: u64, } @@ -621,6 +631,13 @@ pub struct GetSnsInitializationParametersArg {} pub struct GetSnsInitializationParametersResponse { pub sns_initialization_parameters: String, } +#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] +pub struct GetUpgradeJournalRequest {} +#[derive(Serialize, Clone, Debug, CandidType, Deserialize)] +pub struct GetUpgradeJournalResponse { + pub upgrade_steps: Option, + pub response_timestamp_seconds: Option, +} #[derive(Serialize, Clone, Debug, CandidType, Deserialize, Default)] pub struct ListNervousSystemFunctionsResponse { pub reserved_ids: Vec, @@ -780,6 +797,12 @@ impl Service { ) -> CallResult<(GetSnsInitializationParametersResponse,)> { ic_cdk::call(self.0, "get_sns_initialization_parameters", (arg0,)).await } + pub async fn get_upgrade_journal( + &self, + arg0: GetUpgradeJournalRequest, + ) -> CallResult<(GetUpgradeJournalResponse,)> { + ic_cdk::call(self.0, "get_upgrade_journal", (arg0,)).await + } pub async fn list_nervous_system_functions(&self) -> CallResult<(ListNervousSystemFunctionsResponse,)> { ic_cdk::call(self.0, "list_nervous_system_functions", ()).await } diff --git a/rs/sns_aggregator/src/types/ic_sns_ledger.rs b/rs/sns_aggregator/src/types/ic_sns_ledger.rs index 9f7eddaa8a5..418115406c4 100644 --- a/rs/sns_aggregator/src/types/ic_sns_ledger.rs +++ b/rs/sns_aggregator/src/types/ic_sns_ledger.rs @@ -1,5 +1,5 @@ //! Rust code created from candid by: `scripts/did2rs.sh --canister sns_ledger --out ic_sns_ledger.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug` -//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_ledger` obtained by `scripts/update_ic_commit` from: #![allow(clippy::all)] #![allow(unused_imports)] #![allow(missing_docs)] diff --git a/rs/sns_aggregator/src/types/ic_sns_root.rs b/rs/sns_aggregator/src/types/ic_sns_root.rs index 791181dbf00..efd95b0377a 100644 --- a/rs/sns_aggregator/src/types/ic_sns_root.rs +++ b/rs/sns_aggregator/src/types/ic_sns_root.rs @@ -1,5 +1,5 @@ //! Rust code created from candid by: `scripts/did2rs.sh --canister sns_root --out ic_sns_root.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug` -//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_root` obtained by `scripts/update_ic_commit` from: #![allow(clippy::all)] #![allow(unused_imports)] #![allow(missing_docs)] diff --git a/rs/sns_aggregator/src/types/ic_sns_swap.rs b/rs/sns_aggregator/src/types/ic_sns_swap.rs index 84d9dd52b15..ef89efddf2f 100644 --- a/rs/sns_aggregator/src/types/ic_sns_swap.rs +++ b/rs/sns_aggregator/src/types/ic_sns_swap.rs @@ -1,5 +1,5 @@ //! Rust code created from candid by: `scripts/did2rs.sh --canister sns_swap --out ic_sns_swap.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug` -//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_swap` obtained by `scripts/update_ic_commit` from: #![allow(clippy::all)] #![allow(unused_imports)] #![allow(missing_docs)] diff --git a/rs/sns_aggregator/src/types/ic_sns_wasm.rs b/rs/sns_aggregator/src/types/ic_sns_wasm.rs index c548d40532b..a7ff0e0dedf 100644 --- a/rs/sns_aggregator/src/types/ic_sns_wasm.rs +++ b/rs/sns_aggregator/src/types/ic_sns_wasm.rs @@ -1,5 +1,5 @@ //! Rust code created from candid by: `scripts/did2rs.sh --canister sns_wasm --out ic_sns_wasm.rs --header did2rs.header --traits Serialize\,\ Clone\,\ Debug` -//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: +//! Candid for canister `sns_wasm` obtained by `scripts/update_ic_commit` from: #![allow(clippy::all)] #![allow(unused_imports)] #![allow(missing_docs)]