diff --git a/Cargo.lock b/Cargo.lock index 4eb8f8ea..2e461fd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "asn1-rs" -version = "0.5.2" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -239,33 +239,27 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", "synstructure", ] [[package]] name = "asn1-rs-impl" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] -[[package]] -name = "assert_matches" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" - [[package]] name = "async-trait" version = "0.1.80" @@ -379,7 +373,7 @@ checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" dependencies = [ "autocfg", "libm", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-integer", "num-traits", ] @@ -418,11 +412,11 @@ dependencies = [ [[package]] name = "bip32" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e141fb0f8be1c7b45887af94c88b182472b57c96b56773250ae00cd6a14a164" +checksum = "aa13fae8b6255872fd86f7faf4b41168661d7d78609f7bfe6771b85c6739a15b" dependencies = [ - "bs58 0.5.1", + "bs58", "hmac", "k256", "once_cell", @@ -509,7 +503,7 @@ dependencies = [ "digest 0.9.0", "ff 0.12.1", "group 0.12.1", - "pairing", + "pairing 0.22.0", "rand_core", "subtle", ] @@ -540,17 +534,12 @@ dependencies = [ [[package]] name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bs58" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ "sha2 0.10.8", + "tinyvec", ] [[package]] @@ -601,7 +590,7 @@ dependencies = [ "base64 0.13.1", "bincode", "build-info-common", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "proc-macro-error", "proc-macro-hack", @@ -664,9 +653,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cached" @@ -715,7 +704,7 @@ dependencies = [ "hex", "ic_principal", "leb128", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "paste", "pretty", @@ -751,7 +740,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "logos", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "pretty", "thiserror", ] @@ -1159,7 +1148,7 @@ dependencies = [ [[package]] name = "cycles-minting-canister" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "base64 0.13.1", @@ -1193,7 +1182,7 @@ dependencies = [ "rand", "serde", "serde_cbor", - "sha2 0.9.9", + "sha2 0.10.8", "yansi", ] @@ -1270,14 +1259,14 @@ dependencies = [ [[package]] name = "der-parser" -version = "8.2.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ "asn1-rs", "displaydoc", "nom", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "rusticata-macros", ] @@ -1307,7 +1296,7 @@ dependencies = [ [[package]] name = "dfn_candid" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "dfn_core", @@ -1319,7 +1308,7 @@ dependencies = [ [[package]] name = "dfn_core" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", "on_wire", @@ -1328,7 +1317,7 @@ dependencies = [ [[package]] name = "dfn_http" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "dfn_candid", @@ -1340,7 +1329,7 @@ dependencies = [ [[package]] name = "dfn_http_metrics" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "dfn_candid", "dfn_core", @@ -1352,7 +1341,7 @@ dependencies = [ [[package]] name = "dfn_protobuf" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "on_wire", "prost", @@ -1377,12 +1366,6 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" -[[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - [[package]] name = "digest" version = "0.9.0" @@ -1600,7 +1583,7 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fe-derive" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "num-bigint-dig", @@ -1652,15 +1635,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "float-cmp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1979,6 +1953,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.12" @@ -2146,7 +2129,7 @@ dependencies = [ [[package]] name = "ic-base-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "byte-unit", "bytes", @@ -2161,8 +2144,9 @@ dependencies = [ [[package]] name = "ic-btc-interface" -version = "0.2.0" -source = "git+https://github.com/dfinity/bitcoin-canister?rev=62a71e47c491fb842ccc257b1c675651501f4b82#62a71e47c491fb842ccc257b1c675651501f4b82" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0152e14e697b0e988dbfdcb3f7e352d1c76a65b7d2d75c5d76bad22c3aca10d" dependencies = [ "candid", "serde", @@ -2170,9 +2154,9 @@ dependencies = [ ] [[package]] -name = "ic-btc-types-internal" +name = "ic-btc-replica-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-btc-interface", @@ -2185,7 +2169,7 @@ dependencies = [ [[package]] name = "ic-canister-client-sender" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", "ic-crypto-ecdsa-secp256k1", @@ -2198,7 +2182,7 @@ dependencies = [ [[package]] name = "ic-canister-log" version = "0.2.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "serde", ] @@ -2206,7 +2190,7 @@ dependencies = [ [[package]] name = "ic-canister-profiler" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-metrics-encoder", "ic0 0.18.11", @@ -2215,7 +2199,7 @@ dependencies = [ [[package]] name = "ic-canisters-http-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "serde", @@ -2303,7 +2287,7 @@ dependencies = [ [[package]] name = "ic-ckbtc-kyt" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "askama", "candid", @@ -2323,11 +2307,11 @@ dependencies = [ [[package]] name = "ic-ckbtc-minter" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "bech32", - "bs58 0.4.0", + "bs58", "candid", "ciborium", "hex", @@ -2364,16 +2348,17 @@ dependencies = [ [[package]] name = "ic-constants" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-crypto-ecdsa-secp256k1" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ + "hmac", "k256", "lazy_static", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "pem 1.1.1", "rand", "simple_asn1", @@ -2383,21 +2368,21 @@ dependencies = [ [[package]] name = "ic-crypto-ed25519" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "curve25519-dalek", "ed25519-dalek", "hkdf", "pem 1.1.1", "rand", - "sha2 0.10.8", + "thiserror", "zeroize", ] [[package]] name = "ic-crypto-extended-bip32" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-crypto-internal-threshold-sig-ecdsa", ] @@ -2405,7 +2390,7 @@ dependencies = [ [[package]] name = "ic-crypto-getrandom-for-wasm" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "getrandom", ] @@ -2413,7 +2398,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-basic-sig-der-utils" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "ic-types", @@ -2423,12 +2408,12 @@ dependencies = [ [[package]] name = "ic-crypto-internal-basic-sig-ed25519" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base64 0.13.1", "curve25519-dalek", - "ed25519-consensus", "hex", + "ic-crypto-ed25519", "ic-crypto-internal-basic-sig-der-utils", "ic-crypto-internal-seed", "ic-crypto-internal-types", @@ -2445,17 +2430,17 @@ dependencies = [ [[package]] name = "ic-crypto-internal-bls12-381-type" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "ic_bls12_381", "itertools 0.12.1", "lazy_static", - "pairing", + "pairing 0.23.0", "paste", "rand", "rand_chacha", - "sha2 0.9.9", + "sha2 0.10.8", "subtle", "zeroize", ] @@ -2463,7 +2448,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-hmac" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-crypto-internal-sha2", ] @@ -2471,7 +2456,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-multi-sig-bls12381" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base64 0.13.1", "hex", @@ -2490,7 +2475,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-seed" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "ic-crypto-sha2", @@ -2503,7 +2488,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-sha2" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "sha2 0.10.8", ] @@ -2511,7 +2496,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-threshold-sig-bls12381" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base64 0.13.1", "cached 0.49.3", @@ -2537,7 +2522,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-threshold-sig-ecdsa" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "curve25519-dalek", "fe-derive", @@ -2567,7 +2552,7 @@ dependencies = [ [[package]] name = "ic-crypto-internal-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "arrayvec 0.7.4", "hex", @@ -2584,7 +2569,7 @@ dependencies = [ [[package]] name = "ic-crypto-node-key-validation" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "ic-base-types", @@ -2602,7 +2587,7 @@ dependencies = [ [[package]] name = "ic-crypto-secrets-containers" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "serde", "zeroize", @@ -2611,28 +2596,18 @@ dependencies = [ [[package]] name = "ic-crypto-sha2" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-crypto-internal-sha2", ] -[[package]] -name = "ic-crypto-test-utils-reproducible-rng" -version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" -dependencies = [ - "rand", - "rand_chacha", -] - [[package]] name = "ic-crypto-tls-cert-validation" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-test-utils-reproducible-rng", "ic-protobuf", "ic-types", "serde", @@ -2642,9 +2617,8 @@ dependencies = [ [[package]] name = "ic-crypto-tree-hash" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ - "assert_matches", "ic-crypto-internal-types", "ic-crypto-sha2", "ic-protobuf", @@ -2656,7 +2630,7 @@ dependencies = [ [[package]] name = "ic-crypto-utils-basic-sig" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", "ic-crypto-ed25519", @@ -2666,7 +2640,7 @@ dependencies = [ [[package]] name = "ic-crypto-utils-ni-dkg" version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-crypto-internal-types", "ic-protobuf", @@ -2676,7 +2650,7 @@ dependencies = [ [[package]] name = "ic-error-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-protobuf", "ic-utils", @@ -2688,7 +2662,7 @@ dependencies = [ [[package]] name = "ic-icrc1" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ciborium", @@ -2699,7 +2673,7 @@ dependencies = [ "ic-ledger-core", "ic-ledger-hash-of", "icrc-ledger-types", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "serde", "serde_bytes", @@ -2710,7 +2684,7 @@ dependencies = [ [[package]] name = "ic-icrc1-index-ng" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ciborium", @@ -2724,6 +2698,7 @@ dependencies = [ "ic-crypto-sha2", "ic-icrc1", "ic-icrc1-tokens-u64", + "ic-ledger-canister-core", "ic-ledger-core", "ic-metrics-encoder", "ic-stable-structures", @@ -2737,7 +2712,7 @@ dependencies = [ [[package]] name = "ic-icrc1-ledger" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -2765,7 +2740,7 @@ dependencies = [ [[package]] name = "ic-icrc1-tokens-u64" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-ledger-core", @@ -2790,7 +2765,7 @@ dependencies = [ [[package]] name = "ic-ledger-canister-core" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -2808,7 +2783,7 @@ dependencies = [ [[package]] name = "ic-ledger-core" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-ledger-hash-of", @@ -2820,7 +2795,7 @@ dependencies = [ [[package]] name = "ic-ledger-hash-of" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "hex", @@ -2830,14 +2805,15 @@ dependencies = [ [[package]] name = "ic-management-canister-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-base-types", "ic-btc-interface", - "ic-btc-types-internal", + "ic-btc-replica-types", "ic-error-types", "ic-protobuf", + "ic-utils", "num-traits", "serde", "serde_bytes", @@ -2855,7 +2831,7 @@ checksum = "8b5c7628eac357aecda461130f8074468be5aa4d258a002032d82d817f79f1f8" [[package]] name = "ic-nervous-system-clients" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -2868,6 +2844,7 @@ dependencies = [ "ic-nervous-system-common", "ic-nervous-system-proxied-canister-calls-tracker", "ic-nervous-system-runtime", + "ic-utils", "icrc-ledger-client", "icrc-ledger-types", "num-traits", @@ -2877,12 +2854,12 @@ dependencies = [ [[package]] name = "ic-nervous-system-collections-union-multi-map" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-nervous-system-common" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "base64 0.13.1", @@ -2918,12 +2895,12 @@ dependencies = [ [[package]] name = "ic-nervous-system-common-build-metadata" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-nervous-system-common-test-keys" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", "ic-canister-client-sender", @@ -2936,7 +2913,7 @@ dependencies = [ [[package]] name = "ic-nervous-system-governance" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", "ic-stable-structures", @@ -2948,12 +2925,12 @@ dependencies = [ [[package]] name = "ic-nervous-system-lock" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-nervous-system-proto" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "comparable", @@ -2966,7 +2943,7 @@ dependencies = [ [[package]] name = "ic-nervous-system-proxied-canister-calls-tracker" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", ] @@ -2974,7 +2951,7 @@ dependencies = [ [[package]] name = "ic-nervous-system-root" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "dfn_core", @@ -2990,7 +2967,7 @@ dependencies = [ [[package]] name = "ic-nervous-system-runtime" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3003,12 +2980,12 @@ dependencies = [ [[package]] name = "ic-nervous-system-string" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-neurons-fund" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-nervous-system-common", "lazy_static", @@ -3021,7 +2998,7 @@ dependencies = [ [[package]] name = "ic-nns-common" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "comparable", @@ -3040,21 +3017,23 @@ dependencies = [ "on_wire", "prost", "serde", - "sha2 0.9.9", + "serde_bytes", + "sha2 0.10.8", ] [[package]] name = "ic-nns-constants" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-base-types", + "maplit", ] [[package]] name = "ic-nns-governance" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "build-info", @@ -3073,6 +3052,7 @@ dependencies = [ "ic-crypto-getrandom-for-wasm", "ic-crypto-sha2", "ic-ledger-core", + "ic-management-canister-types", "ic-metrics-encoder", "ic-nervous-system-clients", "ic-nervous-system-common", @@ -3085,7 +3065,10 @@ dependencies = [ "ic-neurons-fund", "ic-nns-common", "ic-nns-constants", + "ic-nns-governance-api", + "ic-nns-governance-init", "ic-nns-gtc-accounts", + "ic-nns-handler-root-interface", "ic-protobuf", "ic-sns-init", "ic-sns-root", @@ -3093,6 +3076,7 @@ dependencies = [ "ic-sns-wasm", "ic-stable-structures", "ic-types", + "ic-utils", "icp-ledger", "itertools 0.12.1", "lazy_static", @@ -3101,6 +3085,7 @@ dependencies = [ "num-traits", "on_wire", "pretty_assertions", + "prometheus-parse", "prost", "rand", "rand_chacha", @@ -3114,15 +3099,58 @@ dependencies = [ "strum_macros", ] +[[package]] +name = "ic-nns-governance-api" +version = "0.9.0" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" +dependencies = [ + "bytes", + "candid", + "comparable", + "ic-base-types", + "ic-nervous-system-clients", + "ic-nervous-system-proto", + "ic-nns-common", + "ic-protobuf", + "ic-sns-root", + "ic-sns-swap", + "ic-types", + "ic-utils", + "icp-ledger", + "itertools 0.12.1", + "prost", + "serde", + "serde_bytes", + "strum", + "strum_macros", +] + +[[package]] +name = "ic-nns-governance-init" +version = "0.9.0" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" +dependencies = [ + "csv", + "ic-base-types", + "ic-nervous-system-common", + "ic-nervous-system-common-build-metadata", + "ic-nervous-system-common-test-keys", + "ic-nns-common", + "ic-nns-governance-api", + "icp-ledger", + "rand", + "rand_chacha", +] + [[package]] name = "ic-nns-gtc-accounts" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-nns-handler-root-interface" version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3137,12 +3165,11 @@ dependencies = [ [[package]] name = "ic-protobuf" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "bincode", "candid", "erased-serde", - "maplit", "prost", "serde", "serde_json", @@ -3152,7 +3179,7 @@ dependencies = [ [[package]] name = "ic-registry-keys" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-base-types", @@ -3164,7 +3191,7 @@ dependencies = [ [[package]] name = "ic-registry-routing-table" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-base-types", @@ -3175,7 +3202,7 @@ dependencies = [ [[package]] name = "ic-registry-subnet-features" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-management-canister-types", @@ -3186,7 +3213,7 @@ dependencies = [ [[package]] name = "ic-registry-subnet-type" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-protobuf", @@ -3198,7 +3225,7 @@ dependencies = [ [[package]] name = "ic-registry-transport" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "ic-base-types", @@ -3210,7 +3237,7 @@ dependencies = [ [[package]] name = "ic-sns-governance" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "base64 0.13.1", @@ -3267,7 +3294,7 @@ dependencies = [ [[package]] name = "ic-sns-governance-proposal-criticality" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-nervous-system-proto", ] @@ -3275,7 +3302,7 @@ dependencies = [ [[package]] name = "ic-sns-governance-proposals-amount-total-limit" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "ic-sns-governance-token-valuation", "num-traits", @@ -3286,7 +3313,7 @@ dependencies = [ [[package]] name = "ic-sns-governance-token-valuation" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3307,7 +3334,7 @@ dependencies = [ [[package]] name = "ic-sns-init" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base64 0.13.1", "candid", @@ -3334,7 +3361,7 @@ dependencies = [ [[package]] name = "ic-sns-root" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "build-info", @@ -3363,7 +3390,7 @@ dependencies = [ [[package]] name = "ic-sns-swap" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "build-info", @@ -3401,7 +3428,7 @@ dependencies = [ [[package]] name = "ic-sns-swap-proto-library" version = "0.0.1" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "comparable", @@ -3416,7 +3443,7 @@ dependencies = [ [[package]] name = "ic-sns-wasm" version = "1.0.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3453,9 +3480,9 @@ dependencies = [ [[package]] name = "ic-stable-structures" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e2282054c8ddf0cb2a7abf5c174c373917b4345c9a096ae4aa7f7185cdcdc7" +checksum = "03f3044466a69802de74e710dc0300b706a05696a0531c942ca856751a13b0db" dependencies = [ "ic_principal", ] @@ -3479,7 +3506,7 @@ dependencies = [ [[package]] name = "ic-types" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base64 0.13.1", "bincode", @@ -3487,7 +3514,7 @@ dependencies = [ "chrono", "hex", "ic-base-types", - "ic-btc-types-internal", + "ic-btc-replica-types", "ic-constants", "ic-crypto-internal-types", "ic-crypto-sha2", @@ -3514,10 +3541,9 @@ dependencies = [ [[package]] name = "ic-utils" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "hex", - "prost", "scoped_threadpool", "serde", "serde_bytes", @@ -3526,7 +3552,7 @@ dependencies = [ [[package]] name = "ic-utils-ensure" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "ic-verify-bls-signature" @@ -3536,7 +3562,7 @@ checksum = "583b1c03380cf86059160cc6c91dcbf56c7b5f141bf3a4f06bc79762d775fac4" dependencies = [ "bls12_381", "lazy_static", - "pairing", + "pairing 0.22.0", "sha2 0.9.9", ] @@ -3581,14 +3607,14 @@ checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" [[package]] name = "ic_bls12_381" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682cb199cd8fcb582a6023325d571a6464edda26c8063fe04b6f6082a1a363c" +checksum = "22c65787944f32af084dffd0c68c1e544237b76e215654ddea8cd9f527dd8b69" dependencies = [ - "digest 0.9.0", - "ff 0.12.1", - "group 0.12.1", - "pairing", + "digest 0.10.7", + "ff 0.13.0", + "group 0.13.0", + "pairing 0.23.0", "rand_core", "subtle", "zeroize", @@ -3611,7 +3637,7 @@ dependencies = [ [[package]] name = "icp-ledger" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "comparable", @@ -3621,6 +3647,7 @@ dependencies = [ "dfn_protobuf", "hex", "ic-base-types", + "ic-cdk", "ic-crypto-sha2", "ic-ledger-canister-core", "ic-ledger-core", @@ -3630,7 +3657,6 @@ dependencies = [ "num-traits", "on_wire", "prost", - "prost-derive", "serde", "serde_bytes", "serde_cbor", @@ -3641,7 +3667,7 @@ dependencies = [ [[package]] name = "icrc-ledger-client" version = "0.1.2" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3652,7 +3678,7 @@ dependencies = [ [[package]] name = "icrc-ledger-client-cdk" version = "0.1.2" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -3662,18 +3688,139 @@ dependencies = [ [[package]] name = "icrc-ledger-types" -version = "0.1.5" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +version = "0.1.6" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "base32", "candid", "crc32fast", "hex", - "num-bigint 0.4.5", + "itertools 0.12.1", + "num-bigint 0.4.6", "num-traits", "serde", "serde_bytes", "sha2 0.10.8", + "strum", + "time", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", ] [[package]] @@ -3698,6 +3845,18 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd69211b9b519e98303c015e21a007e293db403b6c85b9b124e133d25e242cdd" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -3917,7 +4076,7 @@ dependencies = [ [[package]] name = "ledger-canister" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "async-trait", "candid", @@ -4054,6 +4213,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -4201,9 +4366,9 @@ dependencies = [ [[package]] name = "mockall" -version = "0.11.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" dependencies = [ "cfg-if", "downcast", @@ -4216,21 +4381,21 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.4" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "multimap" -version = "0.10.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "new_debug_unreachable" @@ -4254,12 +4419,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - [[package]] name = "num-bigint" version = "0.2.6" @@ -4273,9 +4432,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -4362,9 +4521,9 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" dependencies = [ "asn1-rs", ] @@ -4372,7 +4531,7 @@ dependencies = [ [[package]] name = "on_wire" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" [[package]] name = "once_cell" @@ -4413,6 +4572,15 @@ dependencies = [ "group 0.12.1", ] +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group 0.13.0", +] + [[package]] name = "parking_lot" version = "0.12.2" @@ -4553,7 +4721,7 @@ dependencies = [ [[package]] name = "phantom_newtype" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "candid", "serde", @@ -4656,16 +4824,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "2.1.5" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" dependencies = [ - "difflib", - "float-cmp", - "itertools 0.10.5", - "normalize-line-endings", + "anstyle", "predicates-core", - "regex", ] [[package]] @@ -4782,11 +4946,23 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "811031bea65e5a401fb2e1f37d802cca6601e204ac463809a3189352d13b78a5" +dependencies = [ + "chrono", + "itertools 0.12.1", + "once_cell", + "regex", +] + [[package]] name = "prost" -version = "0.12.6" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "5a5a410fc7882af66deb8d01d01737353cf3ad6204c408177ba494291a626312" dependencies = [ "bytes", "prost-derive", @@ -4794,13 +4970,13 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.6" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "1fa3d084c8704911bfefb2771be2f9b6c5c0da7343a71e0021ee3c665cada738" dependencies = [ "bytes", - "heck 0.5.0", - "itertools 0.12.1", + "heck 0.4.1", + "itertools 0.11.0", "log", "multimap", "once_cell", @@ -4811,6 +4987,7 @@ dependencies = [ "regex", "syn 2.0.65", "tempfile", + "which", ] [[package]] @@ -4828,9 +5005,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "8339f32236f590281e2f6368276441394fcd1b2133b549cc895d0ae80f2f9a52" dependencies = [ "prost", ] @@ -4909,10 +5086,11 @@ dependencies = [ "ledger-apdu", "ledger-canister", "ledger-transport-hid", - "num-bigint 0.4.5", + "num-bigint 0.4.6", "once_cell", "pem 2.0.1", "pkcs8", + "pretty_assertions", "qrcodegen", "rand", "ring", @@ -5041,12 +5219,11 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "registry-canister" version = "0.9.0" -source = "git+https://github.com/dfinity/ic?rev=479fc39a7ee082a62ec070efeed224784a83eb1b#479fc39a7ee082a62ec070efeed224784a83eb1b" +source = "git+https://github.com/dfinity/ic?rev=2f9ae6bf5eafed03599fd29475100aca9f78ae81#2f9ae6bf5eafed03599fd29475100aca9f78ae81" dependencies = [ "build-info", "build-info-build", "candid", - "cycles-minting-canister", "dfn_candid", "dfn_core", "dfn_http_metrics", @@ -5071,6 +5248,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-registry-transport", "ic-types", + "idna 1.0.2", "ipnet", "lazy_static", "leb128", @@ -5407,9 +5585,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] @@ -5435,9 +5613,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", @@ -5630,7 +5808,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "num-bigint 0.4.5", + "num-bigint 0.4.6", "num-traits", "thiserror", "time", @@ -5849,14 +6027,13 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "synstructure" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", - "unicode-xid", + "syn 2.0.65", ] [[package]] @@ -5932,18 +6109,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -6015,6 +6192,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -6211,21 +6398,34 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", + "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -6407,6 +6607,18 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -6605,6 +6817,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -6616,9 +6840,9 @@ dependencies = [ [[package]] name = "x509-parser" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ "asn1-rs", "data-encoding", @@ -6646,6 +6870,30 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -6666,6 +6914,27 @@ dependencies = [ "syn 2.0.65", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", + "synstructure", +] + [[package]] name = "zeroize" version = "1.7.0" @@ -6685,3 +6954,25 @@ dependencies = [ "quote", "syn 2.0.65", ] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.65", +] diff --git a/Cargo.toml b/Cargo.toml index 48623eeb..d1e0f0e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,20 +9,24 @@ repository = "https://github.com/dfinity/quill" license = "Apache-2.0" [dependencies] -ic-base-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -icp-ledger = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } -ledger-canister = { git = "https://github.com/dfinity/ic", rev = "479fc39a7ee082a62ec070efeed224784a83eb1b" } +# To update this section, it is recommended that +# ./scripts/point-to-ic-repo-commit-id.sh be used. That also updates the files +# in the candid directory. (This core would be unnecessary if this code also +# lived in the ic repo.) +ic-base-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-ckbtc-minter = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-management-canister-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-nervous-system-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-nns-common = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-nns-constants = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-nns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-sns-governance = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-sns-root = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-sns-swap = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ic-sns-wasm = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +icp-ledger = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +icrc-ledger-types = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } +ledger-canister = { git = "https://github.com/dfinity/ic", rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81" } candid = "0.10.2" candid_parser = "0.1.2" @@ -66,6 +70,7 @@ tiny-bip39 = "1.0.0" tokio = { version = "1.18.5", features = ["full"] } [dev-dependencies] +pretty_assertions = "1" tempfile = "3.3.0" shellwords = "1" serial_test = "2.0.0" diff --git a/candid/governance.did b/candid/governance.did index 40eaf16b..c5d5dcba 100644 --- a/candid/governance.did +++ b/candid/governance.did @@ -2,6 +2,9 @@ type AccountIdentifier = record { hash : blob }; type Action = variant { RegisterKnownNeuron : KnownNeuron; ManageNeuron : ManageNeuron; + UpdateCanisterSettings : UpdateCanisterSettings; + InstallCode : InstallCode; + StopOrStartCanister : StopOrStartCanister; CreateServiceNervousSystem : CreateServiceNervousSystem; ExecuteNnsFunction : ExecuteNnsFunction; RewardNodeProvider : RewardNodeProvider; @@ -10,7 +13,7 @@ type Action = variant { SetDefaultFollowees : SetDefaultFollowees; RewardNodeProviders : RewardNodeProviders; ManageNetworkEconomics : NetworkEconomics; - ApproveGenesisKyc : ApproveGenesisKyc; + ApproveGenesisKyc : Principals; AddOrRemoveNodeProvider : AddOrRemoveNodeProvider; Motion : Motion; }; @@ -26,6 +29,14 @@ type By = variant { Memo : nat64; }; type Canister = record { id : opt principal }; +type CanisterSettings = record { + freezing_threshold : opt nat64; + controllers : opt Controllers; + log_visibility : opt int32; + wasm_memory_limit : opt nat64; + memory_allocation : opt nat64; + compute_allocation : opt nat64; +}; type CanisterStatusResultV2 = record { status : opt int32; freezing_threshold : opt nat64; @@ -41,10 +52,12 @@ type CanisterSummary = record { }; type CfNeuron = record { has_created_neuron_recipes : opt bool; + hotkeys : opt Principals; nns_neuron_id : nat64; amount_icp_e8s : nat64; }; type CfParticipant = record { + controller : opt principal; hotkey_principal : text; cf_neurons : vec CfNeuron; }; @@ -110,6 +123,7 @@ type Committed_1 = record { sns_governance_canister_id : opt principal; }; type Configure = record { operation : opt Operation }; +type Controllers = record { controllers : vec principal }; type Countries = record { iso_codes : vec text }; type CreateServiceNervousSystem = record { url : opt text; @@ -158,7 +172,7 @@ type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 }; type Governance = record { default_followees : vec record { int32; Followees }; making_sns_proposal : opt MakingSnsProposal; - most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards; + most_recent_monthly_node_provider_rewards : opt MonthlyNodeProviderRewards; maturity_modulation_last_updated_at_timestamp_seconds : opt nat64; wait_for_quiet_threshold_seconds : nat64; metrics : opt GovernanceCachedMetrics; @@ -201,11 +215,13 @@ type GovernanceCachedMetrics = record { not_dissolving_neurons_count : nat64; total_locked_e8s : nat64; neurons_fund_total_active_neurons : nat64; + total_voting_power_non_self_authenticating_controller : opt nat64; total_staked_maturity_e8s_equivalent : nat64; not_dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; total_staked_e8s_ect : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64; dissolved_neurons_e8s : nat64; + total_staked_e8s_non_self_authenticating_controller : opt nat64; dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; neurons_with_less_than_6_months_dissolve_delay_e8s : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record { @@ -214,11 +230,13 @@ type GovernanceCachedMetrics = record { }; dissolving_neurons_count_buckets : vec record { nat64; nat64 }; dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; + non_self_authenticating_controller_neuron_subset_metrics : opt NeuronSubsetMetrics; dissolving_neurons_count : nat64; dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; total_staked_maturity_e8s_equivalent_seed : nat64; community_fund_total_staked_e8s : nat64; not_dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; + public_neuron_subset_metrics : opt NeuronSubsetMetrics; timestamp_seconds : nat64; seed_neuron_count : nat64; }; @@ -247,6 +265,13 @@ type InitialTokenDistribution = record { developer_distribution : opt DeveloperDistribution; swap_distribution : opt SwapDistribution; }; +type InstallCode = record { + arg : opt blob; + wasm_module : opt blob; + skip_stopping_before_installing : opt bool; + canister_id : opt principal; + install_mode : opt int32; +}; type KnownNeuron = record { id : opt NeuronId; known_neuron_data : opt KnownNeuronData; @@ -260,7 +285,9 @@ type LedgerParameters = record { }; type ListKnownNeuronsResponse = record { known_neurons : vec KnownNeuron }; type ListNeurons = record { + include_public_neurons_in_full_neurons : opt bool; neuron_ids : vec nat64; + include_empty_neurons_readable_by_caller : opt bool; include_neurons_readable_by_caller : bool; }; type ListNeuronsResponse = record { @@ -314,9 +341,14 @@ type Migrations = record { neuron_indexes_migration : opt Migration; copy_inactive_neurons_to_stable_memory_migration : opt Migration; }; -type MostRecentMonthlyNodeProviderRewards = record { +type MonthlyNodeProviderRewards = record { + minimum_xdr_permyriad_per_icp : opt nat64; + registry_version : opt nat64; + node_providers : vec NodeProvider; timestamp : nat64; rewards : vec RewardNodeProvider; + xdr_conversion_rate : opt XdrConversionRate; + maximum_node_provider_rewards_e8s : opt nat64; }; type Motion = record { motion_text : text }; type NetworkEconomics = record { @@ -349,6 +381,7 @@ type Neuron = record { dissolve_state : opt DissolveState; followees : vec record { int32; Followees }; neuron_fees_e8s : nat64; + visibility : opt int32; transfer : opt NeuronStakeTransfer; known_neuron_data : opt KnownNeuronData; spawn_at_timestamp_seconds : opt nat64; @@ -383,6 +416,7 @@ type NeuronInfo = record { stake_e8s : nat64; joined_community_fund_timestamp_seconds : opt nat64; retrieved_at_timestamp_seconds : nat64; + visibility : opt int32; known_neuron_data : opt KnownNeuronData; voting_power : nat64; age_seconds : nat64; @@ -396,6 +430,18 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : nat64; }; +type NeuronSubsetMetrics = record { + total_maturity_e8s_equivalent : opt nat64; + maturity_e8s_equivalent_buckets : vec record { nat64; nat64 }; + voting_power_buckets : vec record { nat64; nat64 }; + total_staked_e8s : opt nat64; + count : opt nat64; + total_staked_maturity_e8s_equivalent : opt nat64; + staked_maturity_e8s_equivalent_buckets : vec record { nat64; nat64 }; + staked_e8s_buckets : vec record { nat64; nat64 }; + total_voting_power : opt nat64; + count_buckets : vec record { nat64; nat64 }; +}; type NeuronsFundAuditInfo = record { final_neurons_fund_participation : opt NeuronsFundParticipation; initial_neurons_fund_participation : opt NeuronsFundParticipation; @@ -418,13 +464,17 @@ type NeuronsFundMatchedFundingCurveCoefficients = record { full_participation_milestone_xdr : opt Decimal; }; type NeuronsFundNeuron = record { + controller : opt principal; hotkey_principal : opt text; + hotkeys : opt Principals; is_capped : opt bool; nns_neuron_id : opt nat64; amount_icp_e8s : opt nat64; }; type NeuronsFundNeuronPortion = record { + controller : opt principal; hotkey_principal : opt principal; + hotkeys : vec principal; is_capped : opt bool; maturity_equivalent_icp_e8s : opt nat64; nns_neuron_id : opt NeuronId; @@ -461,6 +511,7 @@ type Operation = variant { StopDissolving : record {}; StartDissolving : record {}; IncreaseDissolveDelay : IncreaseDissolveDelay; + SetVisibility : SetVisibility; JoinCommunityFund : record {}; LeaveCommunityFund : record {}; SetDissolveTimestamp : SetDissolveTimestamp; @@ -479,6 +530,7 @@ type Params = record { max_direct_participation_icp_e8s : opt nat64; }; type Percentage = record { basis_points : opt nat64 }; +type Principals = record { principals : vec principal }; type Progress = variant { LastNeuronId : NeuronId }; type Proposal = record { url : text; @@ -581,6 +633,7 @@ type SetSnsTokenSwapOpenTimeWindow = record { request : opt SetOpenTimeWindowRequest; swap_canister_id : opt principal; }; +type SetVisibility = record { visibility : opt int32 }; type SettleCommunityFundParticipation = record { result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; @@ -602,6 +655,10 @@ type StakeMaturityResponse = record { maturity_e8s : nat64; staked_maturity_e8s : nat64; }; +type StopOrStartCanister = record { + action : opt int32; + canister_id : opt principal; +}; type SwapBackgroundInformation = record { ledger_index_canister_summary : opt CanisterSummary; fallback_controller_principal_ids : vec principal; @@ -646,6 +703,10 @@ type TimeWindow = record { end_timestamp_seconds : nat64; }; type Tokens = record { e8s : opt nat64 }; +type UpdateCanisterSettings = record { + canister_id : opt principal; + settings : opt CanisterSettings; +}; type UpdateNodeProvider = record { reward_account : opt AccountIdentifier }; type VotingRewardParameters = record { reward_rate_transition_duration : opt Duration; @@ -671,7 +732,7 @@ service : (Governance) -> { get_metrics : () -> (Result_3) query; get_monthly_node_provider_rewards : () -> (Result_4); get_most_recent_monthly_node_provider_rewards : () -> ( - opt MostRecentMonthlyNodeProviderRewards, + opt MonthlyNodeProviderRewards, ) query; get_network_economics_parameters : () -> (NetworkEconomics) query; get_neuron_ids : () -> (vec nat64) query; diff --git a/candid/icrc1.did b/candid/icrc1.did index c8cc56b9..53f49e45 100644 --- a/candid/icrc1.did +++ b/candid/icrc1.did @@ -125,6 +125,17 @@ type ChangeFeeCollector = variant { Unset; SetTo: Account; }; +type ChangeArchiveOptions = record { + num_blocks_to_archive : opt nat64; + max_transactions_per_response : opt nat64; + trigger_threshold : opt nat64; + max_message_size_bytes : opt nat64; + cycles_for_archive_creation : opt nat64; + node_max_memory_size_bytes : opt nat64; + controller_id : opt principal; + more_controller_ids : opt vec principal; +}; + type UpgradeArgs = record { metadata : opt vec record { text; MetadataValue }; token_symbol : opt text; @@ -135,6 +146,7 @@ type UpgradeArgs = record { feature_flags : opt FeatureFlags; maximum_number_of_accounts: opt nat64; accounts_overflow_trim_quantity: opt nat64; + change_archive_options : opt ChangeArchiveOptions; }; type LedgerArg = variant { @@ -243,14 +255,14 @@ type Transfer = record { spender : opt Account; }; -type Value = variant { - Blob : blob; - Text : text; +type Value = variant { + Blob : blob; + Text : text; Nat : nat; - Nat64: nat64; + Nat64: nat64; Int : int; - Array : vec Value; - Map : Map; + Array : vec Value; + Map : Map; }; type Map = vec record { text; Value }; @@ -364,6 +376,15 @@ type ArchiveInfo = record { block_range_end: BlockIndex; }; +type ICRC3Value = variant { + Blob : blob; + Text : text; + Nat : nat; + Int : int; + Array : vec ICRC3Value; + Map : vec record { text; ICRC3Value }; +}; + type GetArchivesArgs = record { // The last archive seen by the client. // The Ledger will return archives coming @@ -383,6 +404,19 @@ type GetArchivesResult = vec record { end : nat; }; +type GetBlocksResult = record { + // Total number of blocks in the + // block log + log_length : nat; + + blocks : vec record { id : nat; block: ICRC3Value }; + + archived_blocks : vec record { + args : vec GetBlocksArgs; + callback : func (vec GetBlocksArgs) -> (GetBlocksResult) query; + }; +}; + type ICRC3DataCertificate = record { // See https://internetcomputer.org/docs/current/references/ic-interface-spec#certification certificate : blob; @@ -391,11 +425,68 @@ type ICRC3DataCertificate = record { hash_tree : blob; }; +type icrc21_consent_message_metadata = record { + language: text; + utc_offset_minutes: opt int16; +}; + +type icrc21_consent_message_spec = record { + metadata: icrc21_consent_message_metadata; + device_spec: opt variant { + GenericDisplay; + LineDisplay: record { + characters_per_line: nat16; + lines_per_page: nat16; + }; + }; +}; + +type icrc21_consent_message_request = record { + method: text; + arg: blob; + user_preferences: icrc21_consent_message_spec; +}; + +type icrc21_consent_message = variant { + GenericDisplayMessage: text; + LineDisplayMessage: record { + pages: vec record { + lines: vec text; + }; + }; +}; + +type icrc21_consent_info = record { + consent_message: icrc21_consent_message; + metadata: icrc21_consent_message_metadata; +}; + +type icrc21_error_info = record { + description: text; +}; + +type icrc21_error = variant { + UnsupportedCanisterCall: icrc21_error_info; + ConsentMessageUnavailable: icrc21_error_info; + InsufficientPayment: icrc21_error_info; + + // Any error not covered by the above variants. + GenericError: record { + error_code: nat; + description: text; + }; +}; + +type icrc21_consent_message_response = variant { + Ok: icrc21_consent_info; + Err: icrc21_error; +}; + service : (ledger_arg : LedgerArg) -> { archives : () -> (vec ArchiveInfo) query; get_transactions : (GetTransactionsRequest) -> (GetTransactionsResponse) query; - get_blocks : (GetBlocksArgs) -> (GetBlocksResponse) query; - get_data_certificate : () -> (DataCertificate) query; + get_blocks : (GetBlocksArgs) -> (GetBlocksResponse) query; + get_data_certificate : () -> (DataCertificate) query; icrc1_name : () -> (text) query; icrc1_symbol : () -> (text) query; @@ -407,12 +498,16 @@ service : (ledger_arg : LedgerArg) -> { icrc1_balance_of : (Account) -> (Tokens) query; icrc1_transfer : (TransferArg) -> (TransferResult); icrc1_supported_standards : () -> (vec StandardRecord) query; - + icrc2_approve : (ApproveArgs) -> (ApproveResult); icrc2_allowance : (AllowanceArgs) -> (Allowance) query; icrc2_transfer_from : (TransferFromArgs) -> (TransferFromResult); icrc3_get_archives : (GetArchivesArgs) -> (GetArchivesResult) query; icrc3_get_tip_certificate : () -> (opt ICRC3DataCertificate) query; + icrc3_get_blocks : (vec GetBlocksArgs) -> (GetBlocksResult) query; icrc3_supported_block_types : () -> (vec record { block_type : text; url : text }) query; + + icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response); + icrc10_supported_standards : () -> (vec record { name : text; url : text }) query; } diff --git a/candid/ledger.did b/candid/ledger.did index 124d40ad..62725e3e 100644 --- a/candid/ledger.did +++ b/candid/ledger.did @@ -425,6 +425,63 @@ type TransferFromError = variant { GenericError : record { error_code : nat; message : text }; }; +type icrc21_consent_message_metadata = record { + language: text; + utc_offset_minutes: opt int16; +}; + +type icrc21_consent_message_spec = record { + metadata: icrc21_consent_message_metadata; + device_spec: opt variant { + GenericDisplay; + LineDisplay: record { + characters_per_line: nat16; + lines_per_page: nat16; + }; + }; +}; + +type icrc21_consent_message_request = record { + method: text; + arg: blob; + user_preferences: icrc21_consent_message_spec; +}; + +type icrc21_consent_message = variant { + GenericDisplayMessage: text; + LineDisplayMessage: record { + pages: vec record { + lines: vec text; + }; + }; +}; + +type icrc21_consent_info = record { + consent_message: icrc21_consent_message; + metadata: icrc21_consent_message_metadata; +}; + +type icrc21_error_info = record { + description: text; +}; + +type icrc21_error = variant { + UnsupportedCanisterCall: icrc21_error_info; + ConsentMessageUnavailable: icrc21_error_info; + InsufficientPayment: icrc21_error_info; + + // Any error not covered by the above variants. + GenericError: record { + error_code: nat; + description: text; + }; +}; + +type icrc21_consent_message_response = variant { + Ok: icrc21_consent_info; + Err: icrc21_error; +}; + service: (LedgerCanisterPayload) -> { // Transfers tokens from a subaccount of the caller to the destination address. // The source address is computed from the principal of the caller and the specified subaccount. @@ -476,4 +533,7 @@ service: (LedgerCanisterPayload) -> { icrc2_approve : (ApproveArgs) -> (ApproveResult); icrc2_allowance : (AllowanceArgs) -> (Allowance) query; icrc2_transfer_from : (TransferFromArgs) -> (TransferFromResult); + + icrc21_canister_call_consent_message: (icrc21_consent_message_request) -> (icrc21_consent_message_response); + icrc10_supported_standards : () -> (vec record { name : text; url : text }) query; } diff --git a/candid/registry.did b/candid/registry.did index f2fd1b6d..2b0680a9 100644 --- a/candid/registry.did +++ b/candid/registry.did @@ -1,10 +1,25 @@ -type AddApiBoundaryNodePayload = record { node_id : principal; version : text }; +// A brief note about the history of this file: This file used to be +// automatically generated, but now, it is hand-crafted, because the +// auto-generator has some some pretty degenerate behaviors. The worst of those +// behaviors are 1. type conflation 2. (unstable) numeric suffixes. These +// behaviors made it impractical for clients to do the right thing: program +// against registry.did (by using `didc bind`). +// +// test_implementated_interface_matches_declared_interface_exactly (defined in +// ./tests.rs) ensures that the implementation stays in sync with this file. + +type AddApiBoundaryNodesPayload = record { + version : text; + node_ids : vec principal; +}; + type AddFirewallRulesPayload = record { expected_hash : text; scope : FirewallRulesScope; positions : vec int32; rules : vec FirewallRule; }; + type AddNodeOperatorPayload = record { ipv6 : opt text; node_operator_principal_id : opt principal; @@ -13,6 +28,7 @@ type AddNodeOperatorPayload = record { node_provider_principal_id : opt principal; dc_id : text; }; + type AddNodePayload = record { prometheus_metrics_endpoint : text; http_endpoint : text; @@ -27,14 +43,17 @@ type AddNodePayload = record { ni_dkg_dealing_encryption_pk : blob; p2p_flow_endpoints : vec text; }; + type AddNodesToSubnetPayload = record { subnet_id : principal; node_ids : vec principal; }; + type AddOrRemoveDataCentersProposalPayload = record { data_centers_to_add : vec DataCenterRecord; data_centers_to_remove : vec text; }; + type BlessReplicaVersionPayload = record { release_package_urls : opt vec text; node_manager_sha256_hex : text; @@ -46,32 +65,34 @@ type BlessReplicaVersionPayload = record { node_manager_binary_url : text; binary_url : text; }; + type CanisterIdRange = record { end : principal; start : principal }; + type ChangeSubnetMembershipPayload = record { node_ids_add : vec principal; subnet_id : principal; node_ids_remove : vec principal; }; + type CompleteCanisterMigrationPayload = record { canister_id_ranges : vec CanisterIdRange; migration_trace : vec principal; }; + type CreateSubnetPayload = record { unit_delay_millis : nat64; - max_instructions_per_round : nat64; features : SubnetFeatures; - max_instructions_per_message : nat64; gossip_registry_poll_period_ms : nat32; max_ingress_bytes_per_message : nat64; dkg_dealings_per_block : nat64; max_block_payload_size : nat64; - max_instructions_per_install_code : nat64; start_as_nns : bool; is_halted : bool; gossip_pfn_evaluation_period_ms : nat32; max_ingress_messages_per_block : nat64; max_number_of_canisters : nat64; ecdsa_config : opt EcdsaInitialConfig; + chain_key_config : opt InitialChainKeyConfig; gossip_max_artifact_streams_per_peer : nat32; replica_version_id : text; gossip_max_duplicity : nat32; @@ -88,13 +109,46 @@ type CreateSubnetPayload = record { gossip_receive_check_cache_size : nat32; node_ids : vec principal; }; + type DataCenterRecord = record { id : text; gps : opt Gps; region : text; owner : text; }; -type DeleteSubnetPayload = record { subnet_id : opt principal }; + +type DeployGuestosToAllSubnetNodesPayload = record { + subnet_id : principal; + replica_version_id : text; +}; + +type DeployGuestosToAllUnassignedNodesPayload = record { + elected_replica_version : text; +}; + +type InitialChainKeyConfig = record { + key_configs : vec KeyConfigRequest; + signature_request_timeout_ns : opt nat64; + idkg_key_rotation_period_ms : opt nat64; +}; + +type KeyConfigRequest = record { + key_config : opt KeyConfig; + subnet_id : opt principal; +}; + +type KeyConfig = record { + key_id : opt MasterPublicKeyId; + pre_signatures_to_create_in_advance : opt nat32; + max_queue_size : opt nat32; +}; + +type MasterPublicKeyId = variant { Schnorr : SchnorrKeyId; Ecdsa : EcdsaKeyId }; + +type SchnorrKeyId = record { algorithm : SchnorrAlgorithm; name : text }; + +type SchnorrAlgorithm = variant { ed25519; bip340secp256k1 }; + type EcdsaConfig = record { quadruples_to_create_in_advance : nat32; max_queue_size : opt nat32; @@ -102,7 +156,9 @@ type EcdsaConfig = record { signature_request_timeout_ns : opt nat64; idkg_key_rotation_period_ms : opt nat64; }; + type EcdsaCurve = variant { secp256k1 }; + type EcdsaInitialConfig = record { quadruples_to_create_in_advance : nat32; max_queue_size : opt nat32; @@ -110,11 +166,14 @@ type EcdsaInitialConfig = record { signature_request_timeout_ns : opt nat64; idkg_key_rotation_period_ms : opt nat64; }; + type EcdsaKeyId = record { name : text; curve : EcdsaCurve }; + type EcdsaKeyRequest = record { key_id : EcdsaKeyId; subnet_id : opt principal; }; + type FirewallRule = record { ipv4_prefixes : vec text; direction : opt int32; @@ -124,20 +183,40 @@ type FirewallRule = record { ipv6_prefixes : vec text; ports : vec nat32; }; + type FirewallRulesScope = variant { Node : principal; ReplicaNodes; + ApiBoundaryNodes; Subnet : principal; Global; }; + +type GetNodeOperatorsAndDcsOfNodeProviderResponse = variant { + Ok : vec record { DataCenterRecord; NodeOperatorRecord }; + Err : text; +}; + +type GetNodeProvidersMonthlyXdrRewardsResponse = variant { + Ok : NodeProvidersMonthlyXdrRewards; + Err : text; +}; + type GetSubnetForCanisterRequest = record { "principal" : opt principal }; -type GetSubnetForCanisterResponse = record { subnet_id : opt principal }; + +type GetSubnetForCanisterResponse = variant { + Ok : record { subnet_id : opt principal }; + Err : text; +}; + type Gps = record { latitude : float32; longitude : float32 }; + type IPv4Config = record { prefix_length : nat32; gateway_ip_addr : text; ip_addr : text; }; + type NodeOperatorRecord = record { ipv6 : opt text; node_operator_principal_id : blob; @@ -146,96 +225,126 @@ type NodeOperatorRecord = record { node_provider_principal_id : blob; dc_id : text; }; + type NodeProvidersMonthlyXdrRewards = record { rewards : vec record { text; nat64 }; + registry_version : opt nat64; }; + type NodeRewardRate = record { xdr_permyriad_per_node_per_month : nat64; reward_coefficient_percent : opt int32; }; + type NodeRewardRates = record { rates : vec record { text; NodeRewardRate } }; + type PrepareCanisterMigrationPayload = record { canister_id_ranges : vec CanisterIdRange; source_subnet : principal; destination_subnet : principal; }; + type RecoverSubnetPayload = record { height : nat64; replacement_nodes : opt vec principal; subnet_id : principal; registry_store_uri : opt record { text; text; nat64 }; ecdsa_config : opt EcdsaInitialConfig; + chain_key_config : opt InitialChainKeyConfig; state_hash : blob; time_ns : nat64; }; + type RemoveApiBoundaryNodesPayload = record { node_ids : vec principal }; + type RemoveFirewallRulesPayload = record { expected_hash : text; scope : FirewallRulesScope; positions : vec int32; }; + type RemoveNodeDirectlyPayload = record { node_id : principal }; + type RemoveNodeOperatorsPayload = record { node_operators_to_remove : vec blob; }; + type RemoveNodesPayload = record { node_ids : vec principal }; + +type RemoveNodesFromSubnetPayload = record { node_ids : vec principal }; + type RerouteCanisterRangesPayload = record { source_subnet : principal; reassigned_canister_ranges : vec CanisterIdRange; destination_subnet : principal; }; -type Result = variant { Ok : principal; Err : text }; -type Result_1 = variant { Ok; Err : text }; -type Result_2 = variant { - Ok : vec record { DataCenterRecord; NodeOperatorRecord }; - Err : text; -}; -type Result_3 = variant { Ok : NodeProvidersMonthlyXdrRewards; Err : text }; -type Result_4 = variant { Ok : GetSubnetForCanisterResponse; Err : text }; + type RetireReplicaVersionPayload = record { replica_version_ids : vec text }; + +type ReviseElectedGuestosVersionsPayload = record { + release_package_urls : vec text; + replica_versions_to_unelect : vec text; + replica_version_to_elect : opt text; + guest_launch_measurement_sha256_hex : opt text; + release_package_sha256_hex : opt text; +}; + type SetFirewallConfigPayload = record { ipv4_prefixes : vec text; firewall_config : text; ipv6_prefixes : vec text; }; + type SubnetFeatures = record { canister_sandboxing : bool; http_requests : bool; sev_enabled : opt bool; }; + type SubnetType = variant { application; verified_application; system }; + type UpdateApiBoundaryNodesVersionPayload = record { version : text; node_ids : vec principal; }; + type UpdateElectedHostosVersionsPayload = record { release_package_urls : vec text; hostos_version_to_elect : opt text; hostos_versions_to_unelect : vec text; release_package_sha256_hex : opt text; }; -type UpdateElectedReplicaVersionsPayload = record { - release_package_urls : vec text; - replica_versions_to_unelect : vec text; - replica_version_to_elect : opt text; - guest_launch_measurement_sha256_hex : opt text; - release_package_sha256_hex : opt text; + +type UpdateFirewallRulesPayload = record { + expected_hash : text; + scope : FirewallRulesScope; + positions : vec int32; + rules : vec FirewallRule; }; + type UpdateNodeDirectlyPayload = record { idkg_dealing_encryption_pk : opt blob; }; + type UpdateNodeDomainDirectlyPayload = record { node_id : principal; domain : opt text; }; + +type UpdateNodeDomainDirectlyResponse = variant { Ok; Err : text }; + type UpdateNodeIPv4ConfigDirectlyPayload = record { ipv4_config : opt IPv4Config; node_id : principal; }; + +type UpdateNodeIpv4ConfigDirectlyResponse = variant { Ok; Err : text }; + type UpdateNodeOperatorConfigDirectlyPayload = record { node_operator_id : opt principal; node_provider_id : opt principal; }; + type UpdateNodeOperatorConfigPayload = record { node_operator_id : opt principal; set_ipv6_to_none : opt bool; @@ -245,74 +354,88 @@ type UpdateNodeOperatorConfigPayload = record { rewardable_nodes : vec record { text; nat32 }; dc_id : opt text; }; + type UpdateNodeRewardsTableProposalPayload = record { new_entries : vec record { text; NodeRewardRates }; }; + type UpdateNodesHostosVersionPayload = record { hostos_version_id : opt text; node_ids : vec principal; }; + +type UpdateSshReadOnlyAccessForAllUnassignedNodesPayload = record { + ssh_readonly_keys : vec text; +}; + type UpdateSubnetPayload = record { unit_delay_millis : opt nat64; max_duplicity : opt nat32; - max_instructions_per_round : opt nat64; features : opt SubnetFeatures; set_gossip_config_to_default : bool; - max_instructions_per_message : opt nat64; halt_at_cup_height : opt bool; pfn_evaluation_period_ms : opt nat32; subnet_id : principal; max_ingress_bytes_per_message : opt nat64; dkg_dealings_per_block : opt nat64; - ecdsa_key_signing_disable : opt vec EcdsaKeyId; max_block_payload_size : opt nat64; - max_instructions_per_install_code : opt nat64; start_as_nns : opt bool; is_halted : opt bool; max_ingress_messages_per_block : opt nat64; max_number_of_canisters : opt nat64; - ecdsa_config : opt EcdsaConfig; retransmission_request_ms : opt nat32; dkg_interval_length : opt nat64; registry_poll_period_ms : opt nat32; max_chunk_wait_ms : opt nat32; receive_check_cache_size : opt nat32; - ecdsa_key_signing_enable : opt vec EcdsaKeyId; ssh_backup_access : opt vec text; max_chunk_size : opt nat32; initial_notary_delay_millis : opt nat64; max_artifact_streams_per_peer : opt nat32; subnet_type : opt SubnetType; ssh_readonly_access : opt vec text; + chain_key_config : opt ChainKeyConfig; + chain_key_signing_enable : opt vec MasterPublicKeyId; + chain_key_signing_disable : opt vec MasterPublicKeyId; + ecdsa_config : opt EcdsaConfig; + ecdsa_key_signing_enable : opt vec EcdsaKeyId; + ecdsa_key_signing_disable : opt vec EcdsaKeyId; }; -type UpdateSubnetReplicaVersionPayload = record { - subnet_id : principal; - replica_version_id : text; + +type ChainKeyConfig = record { + key_configs : vec KeyConfig; + signature_request_timeout_ns : opt nat64; + idkg_key_rotation_period_ms : opt nat64; }; + type UpdateUnassignedNodesConfigPayload = record { replica_version : opt text; ssh_readonly_access : opt vec text; }; + service : { - add_api_boundary_node : (AddApiBoundaryNodePayload) -> (); + add_api_boundary_nodes : (AddApiBoundaryNodesPayload) -> (); add_firewall_rules : (AddFirewallRulesPayload) -> (); - add_node : (AddNodePayload) -> (Result); + add_node : (AddNodePayload) -> (principal); add_node_operator : (AddNodeOperatorPayload) -> (); add_nodes_to_subnet : (AddNodesToSubnetPayload) -> (); add_or_remove_data_centers : (AddOrRemoveDataCentersProposalPayload) -> (); bless_replica_version : (BlessReplicaVersionPayload) -> (); change_subnet_membership : (ChangeSubnetMembershipPayload) -> (); clear_provisional_whitelist : () -> (); - complete_canister_migration : (CompleteCanisterMigrationPayload) -> ( - Result_1, - ); + complete_canister_migration : (CompleteCanisterMigrationPayload) -> (); create_subnet : (CreateSubnetPayload) -> (); - delete_subnet : (DeleteSubnetPayload) -> (); + deploy_guestos_to_all_subnet_nodes : ( + DeployGuestosToAllSubnetNodesPayload + ) -> (); + deploy_guestos_to_all_unassigned_nodes : ( + DeployGuestosToAllUnassignedNodesPayload + ) -> (); get_build_metadata : () -> (text) query; - get_node_operators_and_dcs_of_node_provider : (principal) -> (Result_2) query; - get_node_providers_monthly_xdr_rewards : () -> (Result_3) query; - get_subnet_for_canister : (GetSubnetForCanisterRequest) -> (Result_4) query; - prepare_canister_migration : (PrepareCanisterMigrationPayload) -> (Result_1); + get_node_operators_and_dcs_of_node_provider : (principal) -> (GetNodeOperatorsAndDcsOfNodeProviderResponse) query; + get_node_providers_monthly_xdr_rewards : () -> (GetNodeProvidersMonthlyXdrRewardsResponse) query; + get_subnet_for_canister : (GetSubnetForCanisterRequest) -> (GetSubnetForCanisterResponse) query; + prepare_canister_migration : (PrepareCanisterMigrationPayload) -> (); recover_subnet : (RecoverSubnetPayload) -> (); remove_api_boundary_nodes : (RemoveApiBoundaryNodesPayload) -> (); remove_firewall_rules : (RemoveFirewallRulesPayload) -> (); @@ -320,27 +443,29 @@ service : { remove_node_operators : (RemoveNodeOperatorsPayload) -> (); remove_nodes : (RemoveNodesPayload) -> (); remove_nodes_from_subnet : (RemoveNodesPayload) -> (); - reroute_canister_ranges : (RerouteCanisterRangesPayload) -> (Result_1); + reroute_canister_ranges : (RerouteCanisterRangesPayload) -> (); retire_replica_version : (RetireReplicaVersionPayload) -> (); + revise_elected_replica_versions : (ReviseElectedGuestosVersionsPayload) -> (); set_firewall_config : (SetFirewallConfigPayload) -> (); - update_api_boundary_nodes_version : ( - UpdateApiBoundaryNodesVersionPayload, - ) -> (); + update_api_boundary_nodes_version : (UpdateApiBoundaryNodesVersionPayload) -> (); update_elected_hostos_versions : (UpdateElectedHostosVersionsPayload) -> (); - update_elected_replica_versions : (UpdateElectedReplicaVersionsPayload) -> (); - update_firewall_rules : (AddFirewallRulesPayload) -> (); - update_node_directly : (UpdateNodeDirectlyPayload) -> (Result_1); - update_node_domain_directly : (UpdateNodeDomainDirectlyPayload) -> (Result_1); + update_elected_replica_versions : (ReviseElectedGuestosVersionsPayload) -> (); + update_firewall_rules : (UpdateFirewallRulesPayload) -> (); + update_node_directly : (UpdateNodeDirectlyPayload) -> (); + update_node_domain_directly : (UpdateNodeDomainDirectlyPayload) -> (UpdateNodeDomainDirectlyResponse); update_node_ipv4_config_directly : (UpdateNodeIPv4ConfigDirectlyPayload) -> ( - Result_1, - ); + UpdateNodeIpv4ConfigDirectlyResponse + ); update_node_operator_config : (UpdateNodeOperatorConfigPayload) -> (); update_node_operator_config_directly : ( - UpdateNodeOperatorConfigDirectlyPayload, - ) -> (); + UpdateNodeOperatorConfigDirectlyPayload + ) -> (); update_node_rewards_table : (UpdateNodeRewardsTableProposalPayload) -> (); update_nodes_hostos_version : (UpdateNodesHostosVersionPayload) -> (); + update_ssh_readonly_access_for_all_unassigned_nodes : ( + UpdateSshReadOnlyAccessForAllUnassignedNodesPayload + ) -> (); update_subnet : (UpdateSubnetPayload) -> (); - update_subnet_replica_version : (UpdateSubnetReplicaVersionPayload) -> (); + update_subnet_replica_version : (DeployGuestosToAllSubnetNodesPayload) -> (); update_unassigned_nodes_config : (UpdateUnassignedNodesConfigPayload) -> (); -} \ No newline at end of file +}; diff --git a/candid/sns-governance.did b/candid/sns-governance.did index 474db667..d8de2d3f 100644 --- a/candid/sns-governance.did +++ b/candid/sns-governance.did @@ -49,6 +49,7 @@ type ChangeAutoStakeMaturity = record { type ClaimOrRefresh = record { by : opt By }; type ClaimOrRefreshResponse = record { refreshed_neuron_id : opt NeuronId }; type ClaimSwapNeuronsRequest = record { + neuron_recipes : opt NeuronRecipes; neuron_parameters : vec NeuronParameters; }; type ClaimSwapNeuronsResponse = record { @@ -323,6 +324,7 @@ type Neuron = record { neuron_fees_e8s : nat64; }; type NeuronId = record { id : blob }; +type NeuronIds = record { neuron_ids : vec NeuronId }; type NeuronInFlightCommand = record { command : opt Command_2; timestamp : nat64; @@ -341,6 +343,20 @@ type NeuronPermission = record { permission_type : vec int32; }; type NeuronPermissionList = record { permissions : vec int32 }; +type NeuronRecipe = record { + controller : opt principal; + dissolve_delay_seconds : opt nat64; + participant : opt Participant; + stake_e8s : opt nat64; + followees : opt NeuronIds; + neuron_id : opt NeuronId; +}; +type NeuronRecipes = record { neuron_recipes : vec NeuronRecipe }; +type NeuronsFund = record { + nns_neuron_hotkeys : opt Principals; + nns_neuron_controller : opt principal; + nns_neuron_id : opt nat64; +}; type Operation = variant { ChangeAutoStakeMaturity : ChangeAutoStakeMaturity; StopDissolving : record {}; @@ -348,7 +364,9 @@ type Operation = variant { IncreaseDissolveDelay : IncreaseDissolveDelay; SetDissolveTimestamp : SetDissolveTimestamp; }; +type Participant = variant { NeuronsFund : NeuronsFund; Direct : record {} }; type Percentage = record { basis_points : opt nat64 }; +type Principals = record { principals : vec principal }; type Proposal = record { url : text; title : text; diff --git a/candid/sns-root.did b/candid/sns-root.did index b8b96aa5..91c7d555 100644 --- a/candid/sns-root.did +++ b/candid/sns-root.did @@ -36,6 +36,8 @@ type DefiniteCanisterSettings = record { freezing_threshold : opt nat; controllers : vec principal; reserved_cycles_limit : opt nat; + log_visibility : opt LogVisibility; + wasm_memory_limit : opt nat; memory_allocation : opt nat; compute_allocation : opt nat; }; @@ -68,6 +70,7 @@ type ListSnsCanistersResponse = record { dapps : vec principal; archives : vec principal; }; +type LogVisibility = variant { controllers; public }; type ManageDappCanisterSettingsRequest = record { freezing_threshold : opt nat64; canister_ids : vec principal; diff --git a/candid/sns-swap.did b/candid/sns-swap.did index 8b5ca1b9..796c7a1b 100644 --- a/candid/sns-swap.did +++ b/candid/sns-swap.did @@ -12,13 +12,20 @@ type CanisterStatusResultV2 = record { module_hash : opt blob; }; type CanisterStatusType = variant { stopped; stopping; running }; -type CfInvestment = record { hotkey_principal : text; nns_neuron_id : nat64 }; +type CfInvestment = record { + controller : opt principal; + hotkey_principal : text; + hotkeys : opt Principals; + nns_neuron_id : nat64; +}; type CfNeuron = record { has_created_neuron_recipes : opt bool; + hotkeys : opt Principals; nns_neuron_id : nat64; amount_icp_e8s : nat64; }; type CfParticipant = record { + controller : opt principal; hotkey_principal : text; cf_neurons : vec CfNeuron; }; @@ -182,11 +189,6 @@ type Ok_1 = record { neurons_fund_neurons_count : opt nat64; }; type Ok_2 = record { ticket : opt Ticket }; -type OpenRequest = record { - cf_participants : vec CfParticipant; - params : opt Params; - open_sns_token_swap_proposal_id : opt nat64; -}; type Params = record { min_participant_icp_e8s : nat64; neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters; @@ -211,6 +213,7 @@ type Possibility = variant { type Possibility_1 = variant { Ok : Response; Err : CanisterCallError }; type Possibility_2 = variant { Ok : Ok_1; Err : Error }; type Possibility_3 = variant { Ok : record {}; Err : CanisterCallError }; +type Principals = record { principals : vec principal }; type RefreshBuyerTokensRequest = record { confirmation_text : opt text; buyer : text; @@ -303,9 +306,7 @@ service : (Init) -> { ) query; new_sale_ticket : (NewSaleTicketRequest) -> (NewSaleTicketResponse); notify_payment_failure : (record {}) -> (Ok_2); - open : (OpenRequest) -> (record {}); refresh_buyer_tokens : (RefreshBuyerTokensRequest) -> ( RefreshBuyerTokensResponse, ); - restore_dapp_controllers : (record {}) -> (SetDappControllersCallResult); } \ No newline at end of file diff --git a/candid/snsw.did b/candid/snsw.did index 611bcfdd..24f07a35 100644 --- a/candid/snsw.did +++ b/candid/snsw.did @@ -2,15 +2,6 @@ type AddWasmRequest = record { hash : blob; wasm : opt SnsWasm }; type AddWasmResponse = record { result : opt Result }; type AirdropDistribution = record { airdrop_neurons : vec NeuronDistribution }; type Canister = record { id : opt principal }; -type CfNeuron = record { - has_created_neuron_recipes : opt bool; - nns_neuron_id : nat64; - amount_icp_e8s : nat64; -}; -type CfParticipant = record { - hotkey_principal : text; - cf_neurons : vec CfNeuron; -}; type Countries = record { iso_codes : vec text }; type DappCanisters = record { canisters : vec Canister }; type DappCanistersTransferResult = record { @@ -57,6 +48,8 @@ type GetNextSnsVersionRequest = record { current_version : opt SnsVersion; }; type GetNextSnsVersionResponse = record { next_version : opt SnsVersion }; +type GetProposalIdThatAddedWasmRequest = record { hash : blob }; +type GetProposalIdThatAddedWasmResponse = record { proposal_id : opt nat64 }; type GetSnsSubnetIdsResponse = record { sns_subnet_ids : vec principal }; type GetWasmMetadataRequest = record { hash : opt blob }; type GetWasmMetadataResponse = record { result : opt Result_1 }; @@ -107,7 +100,6 @@ type NeuronDistribution = record { stake_e8s : nat64; vesting_period_seconds : opt nat64; }; -type NeuronsFundParticipants = record { participants : vec CfParticipant }; type NeuronsFundParticipationConstraints = record { coefficient_intervals : vec LinearScalingCoefficient; max_neurons_fund_participation_icp_e8s : opt nat64; @@ -160,7 +152,6 @@ type SnsInitPayload = record { transaction_fee_e8s : opt nat64; dapp_canisters : opt DappCanisters; neurons_fund_participation_constraints : opt NeuronsFundParticipationConstraints; - neurons_fund_participants : opt NeuronsFundParticipants; max_age_bonus_percentage : opt nat64; initial_token_distribution : opt InitialTokenDistribution; reward_rate_transition_duration_seconds : opt nat64; @@ -228,6 +219,9 @@ service : (SnsWasmCanisterInitPayload) -> { get_next_sns_version : (GetNextSnsVersionRequest) -> ( GetNextSnsVersionResponse, ) query; + get_proposal_id_that_added_wasm : (GetProposalIdThatAddedWasmRequest) -> ( + GetProposalIdThatAddedWasmResponse, + ) query; get_sns_subnet_ids : (record {}) -> (GetSnsSubnetIdsResponse) query; get_wasm : (GetWasmRequest) -> (GetWasmResponse) query; get_wasm_metadata : (GetWasmMetadataRequest) -> ( diff --git a/docs/cli-reference/quill-neuron-manage.mdx b/docs/cli-reference/quill-neuron-manage.mdx index acc31967..4a654eb1 100644 --- a/docs/cli-reference/quill-neuron-manage.mdx +++ b/docs/cli-reference/quill-neuron-manage.mdx @@ -22,34 +22,30 @@ quill neuron-manage [option] ## Flags -| Flag | Description | -|----------------------|-------------------------------------------------------------------------------------------| -| `--clear-manage-neuron-followees` | Remove all followees for the NeuronManagement topic. | -| `--disburse` | Disburse the entire staked amount to the controller's account. | -| `-h`, `--help` | Displays usage information. | -| `--join-community-fund` | Join the Internet Computer's community fund with this neuron's entire stake. | -| `--leave-community-fund` | Leave the Internet Computer's community fund. | -| `--reject` | Reject the proposal(s) specified with `--register-vote`. | -| `--spawn` | Spawn rewards to a new neuron under the controller's account. | -| `--start-dissolving` | Start dissolving. | -| `--stop-dissolving` | Stop dissolving. | - -## Options - -| Option | Description | +| Flag | Description | |-------------------------------------------------------|----------------------------------------------------------------------------------| -| `-a`, `--additional-dissolve-delay-seconds ` | Number of dissolve seconds to add. | | `--add-hot-key ` | Principal to be used as a hot key. | +| `-a`, `--additional-dissolve-delay-seconds ` | Number of dissolve seconds to add. | | `--auto-stake-maturity enabled|disabled` | Set whether new maturity should be automatically staked. | +| `--clear-manage-neuron-followees` | Remove all followees for the NeuronManagement topic. | | `--disburse-amount` | Disburse only the selected amount. | | `--disburse-to` | Disburse to the selected NNS account instead of the controller. | +| `--disburse` | Disburse the entire staked amount to the controller's account. | | `--follow-neurons ...` | Defines the neuron ids of a follow rule. | | `--follow-topic ` | Defines the topic of a follow rule as defined [here][follow-rules]. | +| `-h`, `--help` | Displays usage information. | +| `--join-community-fund` | Join the Internet Computer's community fund with this neuron's entire stake. | +| `--leave-community-fund` | Leave the Internet Computer's community fund. | | `--merge-from-neuron ` | Merge stake, maturity and age from the specified neuron into the managed neuron. | -| `--stake-maturity ` | Stake the percentage (between 1 and 100) of the maturity of a neuron. | +| `--register-vote ... [--reject]` | Vote to approve (default) or reject proposal(s). | +| `--reject` | Reject the proposal(s) specified with `--register-vote`. | | `--remove-hot-key ` | Principal hot key to be removed. | +| `--set-visibility [public|private]` | Set visibility. This controls what fields are readable to arbitrary principals. | +| `--spawn` | Spawn rewards to a new neuron under the controller's account. | | `--split ` | Split off the given number of ICP from a neuron. | -| `--register-vote ... [--reject]` | Vote to approve (default) or reject proposal(s). | +| `--stake-maturity ` | Stake the percentage (between 1 and 100) of the maturity of a neuron. | +| `--start-dissolving` | Start dissolving. | +| `--stop-dissolving` | Stop dissolving. | [follow-rules]: https://github.com/dfinity/ic/blob/4c9e71499d90d00da986dbe7b985d861fd031c4e/rs/nns/governance/gen/ic_nns_governance.pb.v1.rs#L1571-L1632 diff --git a/e2e/utils/setup_nns.bash b/e2e/utils/setup_nns.bash index a2cdbac8..fb08383f 100755 --- a/e2e/utils/setup_nns.bash +++ b/e2e/utils/setup_nns.bash @@ -2,7 +2,7 @@ set -euo pipefail -IC_COMMIT="b3b00ba59c366384e3e0cd53a69457e9053ec987" +IC_COMMIT="2f9ae6bf5eafed03599fd29475100aca9f78ae81" if [[ -z "${DOWNLOAD_DIR:-}" ]]; then DOWNLOAD_DIR=$(mktemp -d -t dfx-e2e-XXXXXXXX) diff --git a/scripts/point-to-ic-repo-commit-id.sh b/scripts/point-to-ic-repo-commit-id.sh new file mode 100755 index 00000000..82fc2e4e --- /dev/null +++ b/scripts/point-to-ic-repo-commit-id.sh @@ -0,0 +1,124 @@ +#!/bin/bash +set -euo pipefail + +# Phase 0: Get ready. + +# Require exactly one argument: the new commit ID. +if [[ "$#" -ne 1 ]]; then + echo "🙅 Oops! You need to provide exactly one argument to this command." >&2 + echo "Usage: ${0} NEW_COMMIT_ID" >&2 + echo "A good place to look for a suitable commit ID is at" >&2 + echo "https://github.com/dfinity/ic/actions/workflows/ci-main.yml?query=branch%3Amaster" >&2 + exit 1 +fi +NEW_COMMIT_ID="$1" + +# Do not allow unstaged changes. Otherwise, it is harder for the user to see the +# changes they've made vs. the changes made by this script. Ideally, we'd +# support --allow-unstaged-changes flag, but this has not been implemented (yet). +if ! git diff --quiet; then + echo "🙅 There are unstaged changes." >&2 + echo "Therefore, no files have been modified. Please, stage all changes" >&2 + echo "before running this script again." >&2 + exit 1 +fi + +# cd to the root of the repo +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +# Infer the current ic repo commit ID. +ORIGINAL_COMMIT_ID=$( + grep '{ git = "https://github.com/dfinity/ic", rev = ".*" }' \ + Cargo.toml \ + | head -n 1 \ + | sed 's/.*rev *= *"\(.*\)".*/\1/' +) +echo "Original ic repo commit ID: ${ORIGINAL_COMMIT_ID}" >&2 + +if [[ "${NEW_COMMIT_ID}" == "${ORIGINAL_COMMIT_ID}" ]]; then + echo "" >&2 + echo "⚠️ Warning: Looks like there will be no changes here, because" >&2 + echo "the new commit ID appears to be the same as the old one." >&2 + echo "Proceeding anyways." >&2 +fi + +# Phase 1.1: Update Cargo.toml + +echo >&2 +sed -i '' \ + -e "s~{ git = \"https://github.com/dfinity/ic\", rev = \".*\"~{ git = \"https://github.com/dfinity/ic\", rev = \"${NEW_COMMIT_ID}\"~g" \ + Cargo.toml +echo "Updated Cargo.toml." >&2 +echo >&2 + + +# Phase 1.2: Download .did files. +# From the ic repo to the candid directory as of $NEW_COMMIT_ID. +# (This is more interesting/work step.) + +function download_from_ic_repo { + local source_path="${1}" + local destination_path="${2}" + + echo " $(basename ${destination_path})" >&2 + + curl \ + --fail \ + --location \ + --silent \ + --output "${destination_path}" \ + "https://raw.githubusercontent.com/dfinity/ic/${NEW_COMMIT_ID}/${source_path}" +} + +echo "Updating candid files..." >&2 +download_from_ic_repo rs/bitcoin/ckbtc/minter/ckbtc_minter.did candid/ckbtc_minter.did +download_from_ic_repo rs/nns/governance/canister/governance.did candid/governance.did +download_from_ic_repo rs/nns/gtc/canister/gtc.did candid/gtc.did +download_from_ic_repo rs/rosetta-api/icrc1/ledger/ledger.did candid/icrc1.did +download_from_ic_repo rs/rosetta-api/icp_ledger/ledger.did candid/ledger.did +download_from_ic_repo rs/registry/canister/canister/registry.did candid/registry.did +download_from_ic_repo rs/sns/governance/canister/governance.did candid/sns-governance.did +download_from_ic_repo rs/sns/root/canister/root.did candid/sns-root.did +download_from_ic_repo rs/sns/swap/canister/swap.did candid/sns-swap.did +download_from_ic_repo rs/nns/sns-wasm/canister/sns-wasm.did candid/snsw.did +echo "Done updating candid files." >&2 +echo >&2 + +# Phase 1.3: Update end to end test(s). +sed -i '' \ + "s/IC_COMMIT=.*/IC_COMMIT=\"${NEW_COMMIT_ID}\"/" \ + e2e/utils/setup_nns.bash +echo "Done updating end to end tests." >&2 +echo >&2 + +# Phase 1.4: Update Cargo.lock. +echo "Updating Cargo.lock..." +cargo build --quiet +echo "Done." >&2 +echo >&2 + +# Phase 2: Verify tests still pass. Often, this will surface all (or at least +# most of) the Rust code that needs to be updated as a result of pulling in a +# more recent ic commit. +if ! cargo test; then + # Report partial success. We made updates, but now manual changes are needed. + echo >&2 + echo "⚠️ Warning: test(s) no longer pass after pointing to ic repo commit" >&2 + echo "${NEW_COMMIT_ID}. Most likely, this is due to updated canister interfaces" >&2 + echo "(in particular new fields in Candid records and variants)." >&2 + echo "You will have to make manual (Rust) code changes in order to get things" >&2 + echo "working again. Alternatively, you can run `git restore .` at the root" >&2 + echo "of this repo to undo the changes made here." >&2 + exit 1 +fi + +# Finally, report results. +echo >&2 +git diff --stat Cargo.toml candid e2e >&2 +echo >&2 +echo "🎉 Success!" >&2 +echo "I have changed Cargo.toml, updated files in the candid dir and updated end to" >&2 +echo "end tests. We are now referring to ic repo commit ${NEW_COMMIT_ID}." >&2 +echo "These changes have NOT been staged. Therefore, you can inspect them by" >&2 +echo "running `git diff`. Once you are satisfied, proceed with the rest of your" >&2 +echo "usual git workflow." >&2 diff --git a/src/commands/neuron_manage.rs b/src/commands/neuron_manage.rs index d2418d8b..ba8d21c8 100644 --- a/src/commands/neuron_manage.rs +++ b/src/commands/neuron_manage.rs @@ -9,17 +9,21 @@ use candid::{CandidType, Encode, Principal}; use clap::{Parser, ValueEnum}; use ic_base_types::PrincipalId; use ic_nns_common::pb::v1::{NeuronId, ProposalId}; -use ic_nns_governance::pb::v1::manage_neuron::NeuronIdOrSubaccount; use ic_nns_governance::pb::v1::{ manage_neuron::{ configure::Operation, disburse::Amount, AddHotKey, ChangeAutoStakeMaturity, Command, Configure, Disburse, Follow, IncreaseDissolveDelay, JoinCommunityFund, LeaveCommunityFund, - Merge, RegisterVote, RemoveHotKey, Split, StakeMaturity, StartDissolving, StopDissolving, + Merge, NeuronIdOrSubaccount, RegisterVote, RemoveHotKey, SetVisibility, Split, + StakeMaturity, StartDissolving, StopDissolving, }, ManageNeuron, }; use icp_ledger::Tokens; +mod pb { + pub use ic_nns_governance::pb::v1::Visibility; +} + // These constants are copied from src/governance.rs pub const ONE_DAY_SECONDS: u32 = 24 * 60 * 60; pub const ONE_YEAR_SECONDS: u32 = (4 * 365 + 1) * ONE_DAY_SECONDS / 4; @@ -128,6 +132,18 @@ pub struct ManageOpts { #[arg(from_global)] ledger: bool, + + /// Set whether the neuron is public or private. This controls whether an + /// arbitrary principal can view all fields of the neuron (Public), or just + /// a limited subset (Private). + #[arg(long)] + set_visibility: Option, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] +enum NativeVisibility { + Public = pb::Visibility::Public as isize, + Private = pb::Visibility::Private as isize, } pub fn exec(auth: &AuthInfo, opts: ManageOpts) -> AnyhowResult> { @@ -135,7 +151,8 @@ pub fn exec(auth: &AuthInfo, opts: ManageOpts) -> AnyhowResult [u8; 32] { + let mut hasher = Sha256::new(); + hasher.update(blob); + <[u8; 32]>::from(hasher.finalize()) +} + pub fn display_get_neuron_info(blob: &[u8]) -> AnyhowResult { let info = Decode!(blob, Result)?; let fmt = match info { @@ -573,6 +588,120 @@ fn display_proposal_info(proposal_info: ProposalInfo) -> AnyhowResult { } } } + Action::InstallCode(install_code) => { + let InstallCode { + canister_id, + install_mode, + wasm_module, + arg, + skip_stopping_before_installing, + } = install_code; + + // Unwrap required fields. + let canister_id = canister_id + .context("canister ID was not specified within an InstallCode proposal")?; + let install_mode = install_mode + .context("install mode was not specified within an InstallCode proposal")?; + let wasm_module = wasm_module + .context("WASM was not specified within an InstallCode proposal")?; + + // Humanify fields (aka interpret them). + + let canister_principal_id = canister_id; + let canister_id = canister_id_to_nns_canister_name( + CanisterId::unchecked_from_principal(canister_id), + ); + + let install_mode = CanisterInstallMode::try_from(install_mode) + .map_err(|err| anyhow::Error::msg(format!("{}", err))) + .context( + "interpretting the install_mode field in an InstallCode proposal", + )?; + + let wasm_module = hex::encode(hash_sha256(&wasm_module)); + + let skip_stopping_before_installing = + if skip_stopping_before_installing.unwrap_or_default() { + " (Warning: canister will NOT be stopped before installing new WASM!)" + } else { + "" + }; + + let arg = match arg { + None => "no arg".to_string(), + Some(arg) => { + let args = display_init_args(&arg, canister_principal_id); + format!("init args = {}", args) + } + }; + + writeln!( + fmt, + "{:?} {} to WASM with SHA256 = {} with {}{}.", + install_mode, + canister_id, + wasm_module, + arg, + skip_stopping_before_installing, + )?; + } + Action::StopOrStartCanister(stop_or_start_canister) => { + let StopOrStartCanister { + canister_id, + action, + } = stop_or_start_canister; + + // Unwrap required fields. + let canister_id = canister_id.context( + "canister ID was not specified within a StopOrStartCanister proposal", + )?; + let action = action + .context("no action (e.g. Upgrade) was specified within a StopOrStartCanister proposal")?; + + // Humanify fields (aka interpret them). + + let canister_id = canister_id_to_nns_canister_name( + CanisterId::unchecked_from_principal(canister_id), + ); + + let action = stop_or_start_canister::CanisterAction::try_from(action) + .with_context(|| { + format!( + "interpretting {} as an action within a StopOrStartCanister proposal.", + action, + ) + })?; + + writeln!(fmt, "{:?} {}", action, canister_id)?; + } + Action::UpdateCanisterSettings(update_canister_settings) => { + let UpdateCanisterSettings { + canister_id, + settings, + } = update_canister_settings; + + // Unwrap required fields. + let canister_id = canister_id.context( + "canister ID was not specified within an UpdateCanisterSettings proposal", + )?; + let settings = settings.context( + "settings not specified within an UpdateCanisterSettings proposal", + )?; + + // Humanify fields (aka interpret them). + + let canister_id = canister_id_to_nns_canister_name( + CanisterId::unchecked_from_principal(canister_id), + ); + + let settings = display_canister_settings(settings); + + writeln!( + fmt, + "Make the following changes to {}: {}.", + canister_id, settings, + )?; + } Action::ManageNeuron(a) => { let neuron = a .get_neuron_id_or_subaccount() @@ -714,6 +843,20 @@ fn display_proposal_info(proposal_info: ProposalInfo) -> AnyhowResult { Operation::StopDissolving(_) => { writeln!(fmt, "Stop dissolving neuron {neuron}")? } + Operation::SetVisibility(set_visibility) => { + let SetVisibility { visibility } = set_visibility; + + let visibility = visibility + .context("visibility not specified within a SetVisibility (ManageNeuron) proposal")?; + + let visibility = Visibility::try_from(visibility) + .map_err(|err| anyhow!( + "unable to interpret the visibility field within a SetVisibility (ManageNeuron) proposal: {}", + err, + ))?; + + writeln!(fmt, "Set visibility of {neuron} to {visibility:?}")? + } } } } @@ -838,3 +981,47 @@ fn display_neuron_id(id: NeuronIdOrSubaccount) -> String { pub fn display_governance_error(err: GovernanceError) -> String { format!("NNS error: {}", err.error_message) } + +fn display_canister_settings(settings: CanisterSettings) -> String { + let CanisterSettings { + controllers, + compute_allocation, + memory_allocation, + freezing_threshold, + log_visibility, + wasm_memory_limit, + } = settings; + + let mut chunks = vec![]; + + if let Some(controllers) = controllers { + let controllers = controllers + .controllers + .into_iter() + .map(CanisterId::unchecked_from_principal) + .map(canister_id_to_nns_canister_name) + .join(", "); + chunks.push(format!("set controllers to [{}]", controllers)); + } + + fn display_set_field(name: &str, value: Option, chunks: &mut Vec) { + let Some(value) = value else { + return; + }; + + // TODO: Units and SI prefixes (e.g. GiB). + chunks.push(format!("set {} to {}", name, value)); + } + + display_set_field("compute allocation", compute_allocation, &mut chunks); + display_set_field("memory allocation", memory_allocation, &mut chunks); + display_set_field("freezing threshold", freezing_threshold, &mut chunks); + display_set_field("log visibility", log_visibility, &mut chunks); + display_set_field("WASM memory limit", wasm_memory_limit, &mut chunks); + + if chunks.is_empty() { + return "no changes".to_string(); + } + + chunks.join("; ") +} diff --git a/src/lib/mod.rs b/src/lib/mod.rs index 52bbfdb1..faf1cf2e 100644 --- a/src/lib/mod.rs +++ b/src/lib/mod.rs @@ -5,19 +5,19 @@ use bigdecimal::BigDecimal; use bip32::DerivationPath; use bip39::{Mnemonic, Seed}; use candid::{types::Function, Nat, Principal, TypeEnv}; -use candid_parser::{typing::check_prog, IDLProg}; +use candid_parser::{typing::check_prog, utils::CandidSource, IDLProg}; use crc32fast::Hasher; use data_encoding::BASE32_NOPAD; use ic_agent::{ identity::{AnonymousIdentity, BasicIdentity, Secp256k1Identity}, Agent, Identity, }; -use ic_base_types::PrincipalId; +use ic_base_types::{CanisterId, PrincipalId}; #[cfg(feature = "hsm")] use ic_identity_hsm::HardwareIdentity; use ic_nns_constants::{ - GENESIS_TOKEN_CANISTER_ID, GOVERNANCE_CANISTER_ID, LEDGER_CANISTER_ID, REGISTRY_CANISTER_ID, - SNS_WASM_CANISTER_ID, + canister_id_to_nns_canister_name, GENESIS_TOKEN_CANISTER_ID, GOVERNANCE_CANISTER_ID, + LEDGER_CANISTER_ID, REGISTRY_CANISTER_ID, SNS_WASM_CANISTER_ID, }; use icp_ledger::{AccountIdentifier, Subaccount}; use icrc_ledger_types::icrc1::account::Account; @@ -26,15 +26,17 @@ use pkcs8::pkcs5::{pbes2::Parameters, scrypt::Params}; use ring::signature::Ed25519KeyPair; use serde_cbor::Value; -#[cfg(feature = "hsm")] -use std::{cell::RefCell, path::PathBuf}; use std::{ env, fmt::{self, Display, Formatter}, path::Path, - time::Duration, + rc::Rc, + str::FromStr, + time::{Duration, SystemTime}, }; -use std::{str::FromStr, time::SystemTime}; + +#[cfg(feature = "hsm")] +use std::{cell::RefCell, path::PathBuf}; #[cfg(feature = "ledger")] use self::ledger::LedgerIdentity; @@ -240,6 +242,108 @@ pub fn get_idl_string( Ok(format!("{}", result?)) } +/// Returns a string representation of init_args. +/// +/// Similar to get_idl_string, but that assumes you have a blob that gets passed +/// to, or returned from a method. Whereas, this deals with data that you pass +/// during installation (or upgrade). +/// +/// Ideally, the string is human-readable. Otherwise, this falls back to +/// encoding init_args as in hex. +/// +/// This only works well in for some NNS canisters, specifically, +/// +/// - governance +/// - ledger +/// - gtc +/// - registry +/// - sns-wasm +fn display_init_args(init_args: &[u8], canister_id: PrincipalId) -> String { + let canister_name = + canister_id_to_nns_canister_name(CanisterId::unchecked_from_principal(canister_id)); + + let main = || { + let canister_role = get_default_role(canister_id.0).with_context(|| { + format!( + "unable to humanize install args, because the role of {} is unknown.", + canister_id, + ) + })?; + + // Glean supporting information about how to (decode and) interpret args + // from (embedded) .did file. + let interface = get_local_candid(canister_id.0, canister_role).with_context(|| { + format!( + "unable to humanize install args, because we do not have \ + the interface definition of the {} canister", + canister_name, + ) + })?; + + let (name_to_type, service) = CandidSource::Text(interface).load().with_context(|| { + format!( + "unable to humanize install args, because we could not \ + parse the interface definition of the {} canister.", + canister_name, + ) + })?; + + let service = service.with_context(|| { + format!( + "unable to humanize install args, because there seems to \ + be no service in the interface definition of the {} canister.", + canister_name, + ) + })?; + let service = unwrap_type(service).context("unable to humanize install args")?; + + let init_args_type = match service { + candid::types::TypeInner::Class(init_args_type, _methods) => init_args_type, + not_class => bail!("Somehow, service is not a service??? {:?}", not_class), + }; + + let init_args_type = init_args_type + .into_iter() + .map(|arg_type| { + let arg_type = unwrap_type(arg_type).context("unable to humanize install args")?; + match arg_type { + candid::types::TypeInner::Var(name) => name_to_type + .find_type(&name) + .with_context(|| format!("unable find the type definition of {}", name,)) + .cloned(), + arg_type => Ok(candid::types::Type::from(arg_type)), + } + }) + .collect::, _>>() + .with_context(|| { + format!( + "unable to humanize install args, because init args \ + type could not be determined from the {} interface \ + definition (i.e. .did file).", + canister_name, + ) + })?; + + // Finally, decode and interpret init args. + candid::IDLArgs::from_bytes_with_types(init_args, &name_to_type, &init_args_type) + .with_context(|| format!("unable to decode install args of {}", canister_name,)) + }; + + match main() { + Ok(ok) => format!("{}", ok), + Err(err) => { + eprintln!("Warning: Unable to humanify init args. Reason: {:#?}", err); + hex::encode(init_args) + } + } +} + +fn unwrap_type(type_: candid::types::Type) -> anyhow::Result { + let candid::types::Type(type_) = type_; + + Rc::into_inner(type_).context("unable to unwrap type") +} + /// Returns pretty-printed encoding of a candid value. pub fn display_response( blob: &[u8], @@ -638,8 +742,12 @@ pub fn key_encryption_params<'a>(salt: &'a [u8; 16], iv: &'a [u8; 16]) -> Parame #[cfg(test)] mod tests { - use super::{ParsedAccount, ParsedSubaccount}; - use candid::Principal; + use super::{display_init_args, ParsedAccount, ParsedSubaccount}; + use candid::{Encode, Principal}; + use ic_base_types::PrincipalId; + use ic_nns_constants::GOVERNANCE_CANISTER_ID; + use ic_nns_governance::pb::v1::Governance as GovernanceProto; + use pretty_assertions::assert_eq; use std::str::FromStr; #[test] @@ -754,4 +862,54 @@ mod tests { *b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02" ); } + + #[test] + fn test_display_init_args() { + // Step 1: Construct input. + let governance_proto = GovernanceProto { + wait_for_quiet_threshold_seconds: 123_456_789, + ..Default::default() + }; + let encoded = Encode!(&governance_proto).unwrap(); + + // Step 2: Call code under test. + let decoded = display_init_args(&encoded, PrincipalId::from(GOVERNANCE_CANISTER_ID)); + + // Step 3: Inspect results. + assert_eq!( + decoded, + // If you dig deep enough, you will see a line in this string that + // looks like the field value we choose at the beginning of this + // test. Other fields are "false-y" (according to their type). + // Common "false-y" values are null, vec {}, and 0. (This assert + // needs to be updated every time a field is added to + // GovernanceProto.) + "( + record { + default_followees = vec {}; + making_sns_proposal = null; + most_recent_monthly_node_provider_rewards = null; + maturity_modulation_last_updated_at_timestamp_seconds = null; + wait_for_quiet_threshold_seconds = 123_456_789 : nat64; + metrics = null; + neuron_management_voting_period_seconds = null; + node_providers = vec {}; + cached_daily_maturity_modulation_basis_points = null; + economics = null; + restore_aging_summary = null; + spawning_neurons = null; + latest_reward_event = null; + to_claim_transfers = vec {}; + short_voting_period_seconds = 0 : nat64; + topic_followee_index = vec {}; + migrations = null; + proposals = vec {}; + xdr_conversion_rate = null; + in_flight_commands = vec {}; + neurons = vec {}; + genesis_timestamp_seconds = 0 : nat64; + }, +)", + ); + } } diff --git a/tests/output/default/list_neurons/many.txt b/tests/output/default/list_neurons/many.txt index c1f81097..8bd1f226 100644 --- a/tests/output/default/list_neurons/many.txt +++ b/tests/output/default/list_neurons/many.txt @@ -6,7 +6,9 @@ Sending message with Method name: list_neurons Arguments: ( record { + include_public_neurons_in_full_neurons = null; neuron_ids = vec { 123 : nat64; 456 : nat64; 789 : nat64 }; + include_empty_neurons_readable_by_caller = null; include_neurons_readable_by_caller = false; }, ) diff --git a/tests/output/default/list_neurons/simple.txt b/tests/output/default/list_neurons/simple.txt index 989f6358..23bb630c 100644 --- a/tests/output/default/list_neurons/simple.txt +++ b/tests/output/default/list_neurons/simple.txt @@ -4,4 +4,11 @@ Sending message with Sender: fdsgv-62ihb-nbiqv-xgic5-iefsv-3cscz-tmbzv-63qd5-vh43v-dqfrt-pae Canister id: rrkah-fqaaa-aaaaa-aaaaq-cai Method name: list_neurons - Arguments: (record { neuron_ids = vec {}; include_neurons_readable_by_caller = true }) + Arguments: ( + record { + include_public_neurons_in_full_neurons = null; + neuron_ids = vec {}; + include_empty_neurons_readable_by_caller = null; + include_neurons_readable_by_caller = true; + }, +) diff --git a/tests/output/default/neuron_manage/set_visibility.txt b/tests/output/default/neuron_manage/set_visibility.txt new file mode 100644 index 00000000..7edd30ab --- /dev/null +++ b/tests/output/default/neuron_manage/set_visibility.txt @@ -0,0 +1,21 @@ +Sending message with + + Call type: update + Sender: fdsgv-62ihb-nbiqv-xgic5-iefsv-3cscz-tmbzv-63qd5-vh43v-dqfrt-pae + Canister id: rrkah-fqaaa-aaaaa-aaaaq-cai + Method name: manage_neuron + Arguments: ( + record { + id = null; + command = opt variant { + Configure = record { + operation = opt variant { + SetVisibility = record { visibility = opt (2 : int32) } + }; + } + }; + neuron_id_or_subaccount = opt variant { + NeuronId = record { id = 2_313_380_519_530_470_538 : nat64 } + }; + }, +) diff --git a/tests/output/neuron_manage.rs b/tests/output/neuron_manage.rs index 4eca2620..013e6dcd 100644 --- a/tests/output/neuron_manage.rs +++ b/tests/output/neuron_manage.rs @@ -112,3 +112,11 @@ fn vote() { )) .diff("neuron_manage/vote.txt") } + +#[test] +fn set_visibility() { + quill_send(&format!( + "neuron-manage {NEURON_ID} --set-visibility=public" + )) + .diff("neuron_manage/set_visibility.txt") +}