diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f588257c..18efb86b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,13 +209,21 @@ jobs: os: [ ubuntu-latest ] rust: [ stable ] rust-target: [ x86_64-unknown-linux-gnu ] - check: [ fmt --all -- --check, clippy -p encointer-client-notee ] + check: [ +nightly fmt --all -- --check, clippy -p encointer-client-notee ] env: RUST_BACKTRACE: full RUSTV: ${{ matrix.rust }} TARGET: ${{ matrix.rust-target }} steps: - - uses: actions/checkout@v3 + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + + - name: Checkout + uses: actions/checkout@v3 - name: Install protoc run: sudo apt-get install protobuf-compiler diff --git a/Cargo.lock b/Cargo.lock index 8686db4f..cef94b71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,8 +14,8 @@ dependencies = [ [[package]] name = "ac-compose-macros" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.5.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-primitives", "log", @@ -24,33 +24,39 @@ dependencies = [ [[package]] name = "ac-node-api" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.6.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-primitives", "bitvec", "derive_more", "either", - "frame-metadata 15.1.0", + "frame-metadata 16.0.0", "hex", "log", "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", "scale-info", + "scale-value", "serde", "serde_json", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-runtime-interface", + "sp-storage", ] [[package]] name = "ac-primitives" -version = "0.7.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.9.1" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "frame-system", - "impl-serde 0.4.0", + "impl-serde", "pallet-assets", "pallet-balances", "parity-scale-codec", @@ -60,7 +66,7 @@ dependencies = [ "serde_json", "sp-application-crypto", "sp-core", - "sp-core-hashing", + "sp-crypto-hashing", "sp-runtime", "sp-runtime-interface", "sp-staking", @@ -92,15 +98,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "aead" version = "0.4.3" @@ -108,7 +105,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", ] [[package]] @@ -121,24 +117,13 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - [[package]] name = "aes" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.3.0", "cpufeatures", "opaque-debug 0.3.0", @@ -150,64 +135,44 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.4.4", "cpufeatures", ] [[package]] name = "aes-gcm" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" dependencies = [ "aead 0.4.3", "aes 0.7.5", "cipher 0.3.0", - "ctr 0.8.0", + "ctr 0.7.0", "ghash 0.4.4", - "subtle", + "subtle 2.5.0", ] [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead 0.5.2", "aes 0.8.3", "cipher 0.4.4", "ctr 0.9.2", "ghash 0.5.0", - "subtle", -] - -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", + "subtle 2.5.0", ] [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.10", "once_cell", @@ -216,25 +181,32 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2135563fb5c609d2b2b87c1e8ce7bc41b0b45430fa9661f457981503dd5bf0" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -256,14 +228,14 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -275,9 +247,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -299,9 +271,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -323,10 +295,147 @@ dependencies = [ ] [[package]] -name = "arc-swap" -version = "1.6.0" +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.50", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] [[package]] name = "array-bytes" @@ -336,9 +445,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.1.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" +checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" [[package]] name = "arrayref" @@ -358,29 +467,13 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -390,18 +483,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -432,7 +513,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] @@ -442,9 +523,9 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "futures-lite", "log", @@ -462,29 +543,29 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", ] [[package]] -name = "async-recursion" -version = "1.0.5" +name = "async-lock" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite 0.2.12", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -493,19 +574,13 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] -[[package]] -name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - [[package]] name = "atty" version = "0.2.14" @@ -514,7 +589,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi 0.1.19", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -531,10 +606,10 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line 0.21.0", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object 0.32.2", "rustc-demangle", ] @@ -544,12 +619,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -564,9 +633,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -604,15 +673,34 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.15", + "prettyplease 0.2.12", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.37", + "syn 2.0.50", ] +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -637,6 +725,18 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + [[package]] name = "blake2" version = "0.10.6" @@ -648,37 +748,37 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", - "cfg-if 1.0.0", - "constant_time_eq", + "cfg-if", + "constant_time_eq 0.3.0", ] [[package]] @@ -687,7 +787,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -711,16 +811,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -730,17 +820,11 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "bounded-collections" -version = "0.1.8" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" dependencies = [ "log", "parity-scale-codec", @@ -755,13 +839,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] -name = "bstr" -version = "1.6.2" +name = "bs58" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ - "memchr", - "serde", + "tinyvec", ] [[package]] @@ -775,9 +858,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -793,9 +876,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" @@ -805,19 +888,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - -[[package]] -name = "bytes" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -830,6 +903,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher 0.2.5", + "ppv-lite86", +] + [[package]] name = "camino" version = "1.1.6" @@ -872,17 +955,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -901,12 +973,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -919,13 +985,23 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" +dependencies = [ + "byteorder", + "keystream", +] + [[package]] name = "chacha20" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.3.0", "cpufeatures", "zeroize", @@ -1027,9 +1103,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -1046,33 +1122,34 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim 0.11.0", + "terminal_size", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "codespan-reporting" @@ -1092,15 +1169,21 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "7.0.1" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" dependencies = [ - "strum", - "strum_macros", + "strum 0.25.0", + "strum_macros 0.25.3", "unicode-width", ] +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" version = "2.2.0" @@ -1112,15 +1195,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1151,12 +1234,24 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "constant_time_eq" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f272d0c4cf831b4fa80ee529c7707f76585986e910e1fbce1d7921970bc1a241" + [[package]] name = "convert_case" version = "0.4.0" @@ -1194,7 +1289,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1230,7 +1325,7 @@ dependencies = [ "gimli 0.27.3", "hashbrown 0.13.2", "log", - "regalloc2", + "regalloc2 0.6.1", "smallvec", "target-lexicon", ] @@ -1297,7 +1392,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -1310,16 +1405,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ - "crc-catalog 1.1.1", -] - -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog 2.2.0", + "crc-catalog", ] [[package]] @@ -1328,19 +1414,13 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1349,7 +1429,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1359,7 +1439,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -1371,7 +1451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset 0.9.0", "scopeguard", @@ -1383,7 +1463,7 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1394,37 +1474,35 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", "zeroize", ] [[package]] -name = "crypto-bigint" -version = "0.5.3" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", - "zeroize", + "typenum", ] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "crypto-mac" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "typenum 1.17.0", + "generic-array 0.12.4", + "subtle 1.0.0", ] [[package]] @@ -1434,24 +1512,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] name = "ctr" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ "cipher 0.3.0", ] @@ -1474,7 +1552,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -1487,24 +1565,24 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "4.1.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms 3.1.2", + "platforms", "rustc_version 0.4.0", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -1516,14 +1594,14 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "cxx" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe98ba1789d56fb3db3bee5e032774d4f421b685de7ba703643584ba24effbe" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -1533,9 +1611,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4ce20f6b8433da4841b1dadfb9468709868022d829d5ca1f2ffbda928455ea3" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -1543,24 +1621,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "cxxbridge-flags" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20888d9e1d2298e2ff473cee30efe7d5036e437857ab68bbfea84c74dba91da2" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fa16a70dd58129e4dfffdff535fb1bce66673f7bbeec4a5a1765a504e1ccd84" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -1598,6 +1676,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dashmap" +version = "5.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core 0.9.8", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -1624,17 +1715,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.8" @@ -1645,27 +1725,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -1680,10 +1746,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] -name = "derive-syn-parse" -version = "0.1.5" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -1691,36 +1757,16 @@ dependencies = [ ] [[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" +name = "derive-syn-parse" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ - "darling", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1767,14 +1813,14 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] name = "directories" -version = "4.0.1" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ "dirs-sys", ] @@ -1785,19 +1831,20 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -1808,7 +1855,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1819,7 +1866,34 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", +] + +[[package]] +name = "docify" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.50", + "termcolor", + "toml 0.8.8", + "walkdir", ] [[package]] @@ -1857,21 +1931,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" - -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -1879,21 +1941,12 @@ version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.5", - "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", -] - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature 1.6.4", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -1902,33 +1955,22 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "pkcs8 0.10.2", - "signature 2.1.0", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519 1.5.3", - "sha2 0.9.9", - "zeroize", + "pkcs8", + "signature", ] [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek 4.1.0", - "ed25519 2.2.2", + "curve25519-dalek 4.1.2", + "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.7", + "subtle 2.5.0", "zeroize", ] @@ -1952,44 +1994,22 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", - "subtle", + "sec1", + "subtle 2.5.0", "zeroize", ] @@ -2003,10 +2023,13 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" name = "encointer-api-client-extension" version = "0.8.2" dependencies = [ + "async-trait", "encointer-ceremonies-assignment", "encointer-node-notee-runtime", "encointer-primitives", + "futures", "log", + "maybe-async", "parity-scale-codec", "serde", "serde_json", @@ -2014,12 +2037,14 @@ dependencies = [ "sp-runtime", "substrate-api-client", "substrate-client-keystore", + "tokio", ] [[package]] name = "encointer-balances-tx-payment" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251506c9355c69057c171a1bc06ad89b2666b537840bba7db35a55cc11f0df40" dependencies = [ "encointer-primitives", "frame-support", @@ -2034,8 +2059,9 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4d938ac122c2b8587762b7f637b2a09bfef9c24f438bc6f086f37b01cd9947" dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", @@ -2058,8 +2084,9 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc-runtime-api" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e86b74f092dcddd4db942896ccf4d4d77656215a9d81e19ca7d746256bc018a" dependencies = [ "encointer-primitives", "frame-support", @@ -2071,8 +2098,9 @@ dependencies = [ [[package]] name = "encointer-ceremonies-assignment" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251e6d08cb28d5e9c4ef96c049473896f73ab1ca90f87b4b1ed805a0529f0259" dependencies = [ "encointer-primitives", "sp-runtime", @@ -2081,7 +2109,7 @@ dependencies = [ [[package]] name = "encointer-client-notee" -version = "1.5.4" +version = "1.8.0" dependencies = [ "clap 2.34.0", "clap-nested", @@ -2092,6 +2120,7 @@ dependencies = [ "env_logger 0.9.3", "frame-support", "frame-system", + "futures", "geojson", "hex", "log", @@ -2115,8 +2144,9 @@ dependencies = [ [[package]] name = "encointer-meetup-validation" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faad8c1800e6f4bddaa8504e03e0b96e89e1eb4917e4286356b4b5f628d1806e" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -2128,9 +2158,9 @@ dependencies = [ [[package]] name = "encointer-node-notee" -version = "1.5.4" +version = "1.8.0" dependencies = [ - "clap 4.4.3", + "clap 4.5.1", "encointer-balances-tx-payment-rpc", "encointer-balances-tx-payment-rpc-runtime-api", "encointer-node-notee-runtime", @@ -2150,6 +2180,7 @@ dependencies = [ "pallet-encointer-communities-rpc-runtime-api", "pallet-transaction-payment-rpc", "sc-basic-authorship", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-consensus", @@ -2180,12 +2211,11 @@ dependencies = [ "sp-timestamp", "substrate-build-script-utils", "substrate-frame-rpc-system", - "try-runtime-cli", ] [[package]] name = "encointer-node-notee-runtime" -version = "1.5.30" +version = "1.8.31" dependencies = [ "encointer-balances-tx-payment", "encointer-balances-tx-payment-rpc-runtime-api", @@ -2229,28 +2259,29 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", + "sp-genesis-builder", "sp-inherents", "sp-offchain", "sp-runtime", "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", - "try-runtime-cli", ] [[package]] name = "encointer-primitives" -version = "1.3.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba38a5cbbc7ab654341dd4c6ef3c52b94a15e1eb2c3937384175429443e83d3" dependencies = [ - "bs58", - "crc 2.1.0", + "bs58 0.5.0", + "crc", "ep-core", "frame-support", - "geohash", "log", "parity-scale-codec", "scale-info", @@ -2259,14 +2290,18 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "substrate-geohash", ] [[package]] name = "encointer-rpc" -version = "0.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c32d392100f7cb83e895a066cd7f925b1caec238b5ad76e1712a126348a766c" dependencies = [ "jsonrpsee", + "jsonrpsee-core", + "jsonrpsee-types", "thiserror", ] @@ -2297,9 +2332,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -2316,11 +2351,12 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "ep-core" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7711e015884f38f87267ba1348657b4cf92483ad2685e5d42c7446f08be8ecda" dependencies = [ - "array-bytes 6.1.0", - "impl-serde 0.3.2", + "array-bytes 6.2.2", + "impl-serde", "parity-scale-codec", "scale-info", "serde", @@ -2339,9 +2375,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -2364,6 +2400,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.12", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite 0.2.12", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -2379,11 +2436,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" dependencies = [ - "blake2", + "blake2 0.10.6", "fs-err", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -2398,6 +2455,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.9.0" @@ -2415,21 +2478,12 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fdlimit" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", -] - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle", + "thiserror", ] [[package]] @@ -2439,14 +2493,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "file-per-thread-logger" @@ -2454,7 +2508,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.0", + "env_logger 0.10.1", "log", ] @@ -2464,7 +2518,7 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.3.5", "windows-sys 0.48.0", @@ -2493,7 +2547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2530,25 +2584,11 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93d3f0315c2eccf23453609e0ab92fe7c6ad1ca8129bcaf80b9a08c8d7fc52b" dependencies = [ "parity-scale-codec", ] @@ -2570,8 +2610,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34134abd64876c2cba150b703d8c74b1b222147e61dbc33cbb9db72f7c1cdb2f" dependencies = [ "frame-support", "frame-support-procedural", @@ -2595,25 +2636,26 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e618a6cbce60ed9a94850b2cb7d08a08e391ee0f287ee20082430da2d385916b" dependencies = [ "Inflector", - "array-bytes 6.1.0", + "array-bytes 6.2.2", "chrono", - "clap 4.4.3", + "clap 4.5.1", "comfy-table", "frame-benchmarking", "frame-support", "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", "parity-scale-codec", - "rand 0.8.5", + "rand", "rand_pcg", "sc-block-builder", "sc-cli", @@ -2643,12 +2685,14 @@ dependencies = [ [[package]] name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4542ef9abae48cb665f9992ece20ecded914ecfdaafb3f76968c645358b8df" dependencies = [ "frame-support", "frame-system", "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -2664,10 +2708,9 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", - "serde", ] [[package]] @@ -2676,39 +2719,22 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", ] -[[package]] -name = "frame-remote-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-recursion", - "futures", - "indicatif", - "jsonrpsee", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", -] - [[package]] name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40bde5b74ac70a1c9fe4f846220ea10e78b81b0ffcdb567d16d28472bc332f95" dependencies = [ + "aquamarine", + "array-bytes 6.2.2", "bitflags 1.3.2", + "docify", "environmental", "frame-metadata 16.0.0", "frame-support-procedural", @@ -2720,69 +2746,79 @@ dependencies = [ "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", "sp-core", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bf871c6655636a40a74d06f7f1bf69813f8037ad269704ae35b1c56c42ec" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", "expander", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.37", + "sp-crypto-hashing", + "syn 2.0.50", ] [[package]] name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", + "docify", "frame-support", "log", "parity-scale-codec", @@ -2798,8 +2834,9 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e41213421daaf14370e6d59016bd1be5e8d8c990bb336b72e72b3c60d874d3df" dependencies = [ "frame-benchmarking", "frame-support", @@ -2813,8 +2850,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48b28339a07bb7e797d3546c29600dd0b7c97ffd9d6642665dc96d81c0b475" dependencies = [ "parity-scale-codec", "sp-api", @@ -2822,8 +2860,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be404b49a2c947a77ec813b372ca5119182f8de131ee98a5656bc1043958b8b" dependencies = [ "frame-support", "parity-scale-codec", @@ -2845,25 +2884,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags 1.3.2", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -2872,9 +2895,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -2887,9 +2910,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -2897,15 +2920,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2915,9 +2938,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -2930,19 +2953,19 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -2952,21 +2975,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.9", - "webpki 0.22.1", + "rustls 0.20.8", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -2976,9 +2999,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -2987,7 +3010,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -3007,7 +3030,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.17.0", + "typenum", ] [[package]] @@ -3016,21 +3039,11 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.17.0", + "typenum", "version_check", "zeroize", ] -[[package]] -name = "geohash" -version = "0.13.0" -source = "git+https://github.com/encointer/geohash?tag=polkadot-v1.0.0#c5a8e70ea8b5db68571e51838b54612b556a4c7e" -dependencies = [ - "parity-scale-codec", - "scale-info", - "substrate-fixed", -] - [[package]] name = "geojson" version = "0.22.4" @@ -3050,7 +3063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3059,7 +3072,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -3070,11 +3083,21 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand", + "rand_core 0.6.4", +] + [[package]] name = "ghash" version = "0.4.4" @@ -3101,7 +3124,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -3111,6 +3134,10 @@ name = "gimli" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] [[package]] name = "glob" @@ -3119,27 +3146,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "globset" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "group" -version = "0.12.1" +name = "governor" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", + "cfg-if", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.1", + "quanta", + "rand", + "smallvec", ] [[package]] @@ -3148,24 +3169,24 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ - "bytes 1.5.0", + "bytes", "fnv", "futures-core", "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -3174,9 +3195,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.4.0" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -3207,7 +3228,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -3216,14 +3237,27 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.8", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.8", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.3", +] [[package]] name = "heck" @@ -3254,9 +3288,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" @@ -3283,7 +3317,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -3307,15 +3341,6 @@ dependencies = [ "hmac 0.8.1", ] -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -3324,7 +3349,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ "libc", "match_cfg", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3333,7 +3358,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "bytes 1.5.0", + "bytes", "fnv", "itoa", ] @@ -3344,9 +3369,9 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.5.0", + "bytes", "http", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -3379,7 +3404,7 @@ version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -3389,7 +3414,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "socket2 0.4.9", "tokio", "tower-service", @@ -3407,11 +3432,10 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.7", - "rustls-native-certs", + "rustls 0.21.6", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", - "webpki-roots 0.23.1", + "tokio-rustls 0.24.1", ] [[package]] @@ -3471,7 +3495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3502,15 +3526,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - [[package]] name = "impl-serde" version = "0.4.0" @@ -3531,6 +3546,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -3544,25 +3578,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "indicatif" -version = "0.17.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", + "hashbrown 0.14.3", ] [[package]] @@ -3580,7 +3601,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -3592,25 +3613,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes 1.5.0", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -3622,15 +3624,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ip_network" version = "0.4.1" @@ -3643,7 +3636,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.4", + "socket2 0.5.3", "widestring", "windows-sys 0.48.0", "winreg", @@ -3662,7 +3655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.13", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -3675,6 +3668,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -3701,96 +3703,74 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", - "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", - "jsonrpsee-ws-client", + "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83" dependencies = [ "futures-util", "http", "jsonrpsee-core", - "jsonrpsee-types", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.7.0", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tracing", - "webpki-roots 0.25.2", + "url", ] [[package]] name = "jsonrpsee-core" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +checksum = "82030d038658974732103e623ba2e0abec03bbbe175b39c0a2fafbada60c5868" dependencies = [ "anyhow", - "arrayvec 0.7.4", - "async-lock", + "async-lock 3.3.0", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", - "globset", "hyper", "jsonrpsee-types", "parking_lot 0.12.1", - "rand 0.8.5", - "rustc-hash", - "serde", - "serde_json", - "soketto", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "pin-project", + "rand", "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "69fc56131589f82e57805f7338b87023db4aafef813555708b159787e34ad6bc" dependencies = [ "heck", - "proc-macro-crate", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3798,19 +3778,21 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +checksum = "d85be77fe5b2a94589e3164fb780017f7aff7d646b49278c0d0346af16975c8e" dependencies = [ - "futures-channel", "futures-util", "http", "hyper", "jsonrpsee-core", "jsonrpsee-types", + "pin-project", + "route-recognizer", "serde", "serde_json", "soketto", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -3820,28 +3802,15 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.3" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +checksum = "9a48fdc1202eafc51c63e00406575e59493284ace8b8b61aa16f3a6db5d64f1a" dependencies = [ "anyhow", "beef", "serde", "serde_json", "thiserror", - "tracing", -] - -[[package]] -name = "jsonrpsee-ws-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" -dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", ] [[package]] @@ -3850,9 +3819,9 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ - "cfg-if 1.0.0", - "ecdsa 0.16.8", - "elliptic-curve 0.13.5", + "cfg-if", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.7", ] @@ -3867,14 +3836,10 @@ dependencies = [ ] [[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "keystream" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" [[package]] name = "kvdb" @@ -3923,9 +3888,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -3933,17 +3898,23 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", - "winapi 0.3.9", + "cfg-if", + "winapi", ] +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ - "bytes 1.5.0", + "bytes", "futures", "futures-timer", "getrandom 0.2.10", @@ -3964,7 +3935,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -4015,7 +3985,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand", "rw-stream-sink", "smallvec", "thiserror", @@ -4065,13 +4035,13 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "bs58", - "ed25519-dalek 2.0.0", + "bs58 0.4.0", + "ed25519-dalek", "log", "multiaddr", "multihash", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "thiserror", "zeroize", @@ -4085,7 +4055,7 @@ checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", - "bytes 1.5.0", + "bytes", "either", "fnv", "futures", @@ -4096,7 +4066,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "smallvec", "thiserror", @@ -4118,7 +4088,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.9", "tokio", @@ -4146,7 +4116,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ - "bytes 1.5.0", + "bytes", "curve25519-dalek 3.2.0", "futures", "libp2p-core", @@ -4154,7 +4124,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "snow", "static_assertions", @@ -4176,7 +4146,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "void", ] @@ -4186,7 +4156,7 @@ version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ - "bytes 1.5.0", + "bytes", "futures", "futures-timer", "if-watch", @@ -4196,8 +4166,8 @@ dependencies = [ "log", "parking_lot 0.12.1", "quinn-proto", - "rand 0.8.5", - "rustls 0.20.9", + "rand", + "rustls 0.20.8", "thiserror", "tokio", ] @@ -4214,7 +4184,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand", "smallvec", ] @@ -4233,7 +4203,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand 0.8.5", + "rand", "smallvec", "tokio", "void", @@ -4276,12 +4246,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", - "ring", - "rustls 0.20.9", + "rcgen", + "ring 0.16.20", + "rustls 0.20.8", "thiserror", - "webpki 0.22.1", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -4299,37 +4269,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes 1.5.0", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -4346,7 +4285,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -4390,10 +4329,10 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", - "typenum 1.17.0", + "typenum", ] [[package]] @@ -4404,7 +4343,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -4462,9 +4401,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" dependencies = [ "nalgebra", ] @@ -4483,9 +4422,21 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" + +[[package]] +name = "lioness" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" +dependencies = [ + "arrayref", + "blake2 0.8.1", + "chacha", + "keystream", +] [[package]] name = "lock_api" @@ -4551,59 +4502,62 @@ dependencies = [ ] [[package]] -name = "macro_magic" +name = "mach2" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "macro_magic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "macro_magic_core" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "macro_magic_core_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "macro_magic_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.37", + "syn 2.0.50", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -4637,29 +4591,20 @@ dependencies = [ [[package]] name = "maybe-async" -version = "0.2.7" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.7", + "syn 2.0.50", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" @@ -4680,12 +4625,12 @@ dependencies = [ ] [[package]] -name = "memoffset" -version = "0.6.5" +name = "memmap2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -4727,6 +4672,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -4742,25 +4699,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.8.8" @@ -4773,27 +4711,28 @@ dependencies = [ ] [[package]] -name = "mio-extras" -version = "2.0.6" +name = "mixnet" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" dependencies = [ - "lazycell", + "arrayref", + "arrayvec 0.7.4", + "bitflags 1.3.2", + "blake2 0.10.6", + "c2-chacha", + "curve25519-dalek 4.1.2", + "either", + "hashlink", + "lioness", "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "parking_lot 0.12.1", + "rand", + "rand_chacha", + "rand_distr", + "subtle 2.5.0", + "thiserror", + "zeroize", ] [[package]] @@ -4802,7 +4741,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "lazy_static", @@ -4817,7 +4756,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2", "quote", "syn 1.0.109", @@ -4872,11 +4811,11 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -4896,7 +4835,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ - "bytes 1.5.0", + "bytes", "futures", "log", "pin-project", @@ -4917,7 +4856,7 @@ dependencies = [ "num-rational", "num-traits", "simba", - "typenum 1.17.0", + "typenum", ] [[package]] @@ -4933,22 +4872,11 @@ dependencies = [ [[package]] name = "names" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" -dependencies = [ - "rand 0.8.5", -] - -[[package]] -name = "net2" -version = "0.2.39" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "rand", ] [[package]] @@ -4995,7 +4923,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.5.0", + "bytes", "futures", "log", "netlink-packet-core", @@ -5010,7 +4938,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "bytes 1.5.0", + "bytes", "futures", "libc", "log", @@ -5024,11 +4952,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", - "memoffset 0.6.5", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5045,6 +4978,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -5104,11 +5043,12 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -5121,12 +5061,6 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.30.4" @@ -5141,36 +5075,27 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -5184,32 +5109,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" -dependencies = [ - "bitflags 2.4.0", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -5217,43 +5116,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "openssl-sys" -version = "0.9.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - -[[package]] -name = "p384" -version = "0.11.2" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "pallet-asset-tx-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6530bad86d493df89539037e6dca0114d979f8e6c3c9f0c704ff6ee2dc6df676" dependencies = [ "frame-benchmarking", "frame-support", @@ -5270,12 +5142,14 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c54b67fb2fab83382f7cd860aa5e0e0d478c914f81b87a7c24df2d93f740a89" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5285,11 +5159,13 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1085f847e49c5a56d4a7f87815f4ac6d37cd7e3997e2444abc105e2207aeca" dependencies = [ "frame-support", "frame-system", + "log", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -5301,8 +5177,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa1f02863403c1cf5e9f49fd492c8cdb329d4b45029f3f19f278b3ba832a2b81" dependencies = [ "frame-support", "frame-system", @@ -5315,9 +5192,11 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f68b79a1f9f10c63377177155a4ac3ac08db356027a3d8bc826e1af65c885b8d" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5330,8 +5209,9 @@ dependencies = [ [[package]] name = "pallet-encointer-balances" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec62256b1cd42994b7426749e94d58756e0dcc69d3a7fdb09480dc85ad67e62" dependencies = [ "approx", "encointer-primitives", @@ -5349,8 +5229,9 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar" -version = "1.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c9aaf617cd960574b0fca15e6a63e1e94e12635eb775c31a99a7ca59b891eb" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5366,14 +5247,16 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "569c9989fe1d75ed8a13da1739eeb093c0a7a89d9d475716af0a0088e82d9d8c" dependencies = [ "encointer-primitives", "encointer-rpc", "jsonrpsee", "log", "pallet-encointer-bazaar-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", @@ -5385,19 +5268,22 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc-runtime-api" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b175dee52071e95e1cf381e902a9d446e8b63338ccf8fc70027ce65fd6238c" dependencies = [ "encointer-primitives", "frame-support", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-ceremonies" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729f6823ee810fb9d170f78b7c25ea13591959b97550aa5ff42d00f8dfbeb7b" dependencies = [ "encointer-ceremonies-assignment", "encointer-meetup-validation", @@ -5421,14 +5307,16 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ef64d5a30e547670798c2b4325d380aa7ada374c50bc5816ed5e68d4d04f64" dependencies = [ "encointer-primitives", "encointer-rpc", "jsonrpsee", "log", "pallet-encointer-ceremonies-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", @@ -5440,19 +5328,22 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc-runtime-api" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e062e2c5176a1422ed0d67ab8428e785e685fc6576c550c9841f5bbae12a783f" dependencies = [ "encointer-primitives", "frame-support", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-communities" -version = "1.3.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9712c7d1284e70962dba1ac2a2d2b36a747ff1cfb334f308a618ce271709c7fe" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5470,37 +5361,43 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a957dfec89f99c91743d443402dbd1b4aa349e0a42df4348d96b4d655feab6" dependencies = [ "encointer-primitives", "encointer-rpc", "jsonrpsee", "log", "pallet-encointer-communities-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", "sp-api", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] [[package]] name = "pallet-encointer-communities-rpc-runtime-api" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d8a2c35e3d03360d5b4396a1c43568537654a22c06cb362f54ccd4281ddc2cb" dependencies = [ "encointer-primitives", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-democracy" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e887b2e0901227ec3173d2b231c4a385b320eadf04a2182fe2cdb6ba03395d6" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5509,6 +5406,7 @@ dependencies = [ "log", "pallet-encointer-ceremonies", "pallet-encointer-communities", + "pallet-encointer-reputation-commitments", "pallet-encointer-scheduler", "pallet-timestamp", "parity-scale-codec", @@ -5522,8 +5420,9 @@ dependencies = [ [[package]] name = "pallet-encointer-faucet" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781009e5cb4895afcbc79db3b79124676fc6544a6ace2b1c62402ac0ef23e957" dependencies = [ "approx", "encointer-primitives", @@ -5543,8 +5442,9 @@ dependencies = [ [[package]] name = "pallet-encointer-reputation-commitments" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d92071eb5f4f0c7084a40291546177887a6f2bd3dc497917376f4f8b83d77e0" dependencies = [ "approx", "encointer-primitives", @@ -5565,8 +5465,9 @@ dependencies = [ [[package]] name = "pallet-encointer-scheduler" -version = "1.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b2e414fef4a80f8edf1da5692222a3f8918b3202946e12b5a6faa13f2d7381" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5583,8 +5484,9 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b22d7b2ad0fa9811c441051cc90792924d58fe6d0cfeff8db231da68fcc9fa" dependencies = [ "frame-benchmarking", "frame-support", @@ -5606,8 +5508,9 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe899a5ccb1bf4934f9ea344b9c45040d6cae4f9553be642580738afe5ff8ea" dependencies = [ "frame-support", "frame-system", @@ -5620,8 +5523,9 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d6b9f7210b6cd4dcf531c1f8729eaeb7dfbed8e8b1b01b1747240b0f8a715d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5635,9 +5539,11 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5daf9f2a35fb6902011fc66e0d8c9831acd86512a78f298b52aba4970b121075" dependencies = [ + "docify", "frame-support", "frame-system", "log", @@ -5651,8 +5557,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42218759d10405996ae378968751a9b1142b47f6b887562f2df50cc14b1c7eaa" dependencies = [ "frame-support", "frame-system", @@ -5666,15 +5573,18 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", + "sp-state-machine", "sp-std", "sp-trie", ] [[package]] name = "pallet-sudo" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78e1b72aeabc9f0ba731229ccef31d8e5a160faae5edf2651a8cdacaa2690124" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5687,9 +5597,11 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c307589adc04a0d578ae00231bc04f1a53ef07a0aa2f3e9d4c7e4bf419bf6e3d" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5700,13 +5612,15 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-storage", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d598d0ad779d19fa44ce6f80c57192537fa9f84995953bf2a8c104b7676b6b7" dependencies = [ "frame-support", "frame-system", @@ -5721,8 +5635,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5737,8 +5652,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d34487aec13e174906b6bba112f672e72948d16b8ee0752b8bebd659ac528dc" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5749,9 +5665,11 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317d231ff8a773e94fe5be8d3710213215208e7993bfeedd96bd6f4402da114a" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5760,14 +5678,16 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-runtime", "sp-std", ] [[package]] name = "pallet-utility" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b879fb8c20405663309986621856050efc31969c2d2a209d78373356a62e27" dependencies = [ "frame-support", "frame-system", @@ -5781,20 +5701,20 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab512a34b3c2c5e465731cc7668edf79208bbe520be03484eeb05e63ed221735" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ - "blake2", + "blake2 0.10.6", "crc32fast", "fs2", "hex", "libc", "log", "lz4", - "memmap2", + "memmap2 0.5.10", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "siphasher", "snap", ] @@ -5808,7 +5728,7 @@ dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", - "bytes 1.5.0", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5820,7 +5740,7 @@ version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -5871,12 +5791,12 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall 0.2.16", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -5885,7 +5805,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.3.5", "smallvec", @@ -5910,16 +5830,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", + "crypto-mac 0.11.0", ] [[package]] @@ -5937,15 +5848,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -5954,20 +5856,19 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ - "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -5975,22 +5876,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", @@ -6004,7 +5905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.2.3", ] [[package]] @@ -6024,7 +5925,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -6035,53 +5936,89 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "platforms" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] -name = "pin-utils" -version = "0.1.0" +name = "polkavm-common" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "polkavm-derive" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" dependencies = [ - "der 0.6.1", - "spki 0.6.0", + "polkavm-derive-impl-macro", ] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "polkavm-derive-impl" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "polkavm-common", + "proc-macro2", + "quote", + "syn 2.0.50", ] [[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "platforms" -version = "1.1.0" +name = "polkavm-derive-impl-macro" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" +checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +dependencies = [ + "polkavm-derive-impl", + "syn 2.0.50", +] [[package]] -name = "platforms" -version = "3.1.2" +name = "polkavm-linker" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "fdec1451cb18261d5d01de82acc15305e417fb59588cdcb3127d3dcc9672b925" +dependencies = [ + "gimli 0.28.0", + "hashbrown 0.14.3", + "log", + "object 0.32.2", + "polkavm-common", + "regalloc2 0.9.3", + "rustc-demangle", +] [[package]] name = "polling" @@ -6091,11 +6028,11 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "windows-sys 0.48.0", ] @@ -6107,7 +6044,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -6116,10 +6053,10 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -6128,18 +6065,12 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug 0.3.0", "universal-hash 0.5.1", ] -[[package]] -name = "portable-atomic" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -6154,7 +6085,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -6188,12 +6119,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -6204,19 +6135,28 @@ checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "uint", ] [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml 0.5.11", + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +dependencies = [ + "toml_edit 0.21.0", ] [[package]] @@ -6251,20 +6191,20 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-warning" -version = "0.4.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] @@ -6275,7 +6215,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -6303,7 +6243,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -6312,8 +6252,18 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.5.0", - "prost-derive", + "bytes", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive 0.12.3", ] [[package]] @@ -6322,15 +6272,15 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ - "bytes 1.5.0", + "bytes", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", "prettyplease 0.1.25", - "prost", + "prost 0.11.9", "prost-types", "regex", "syn 1.0.109", @@ -6345,19 +6295,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", ] [[package]] @@ -6369,6 +6332,22 @@ dependencies = [ "cc", ] +[[package]] +name = "quanta" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +dependencies = [ + "crossbeam-utils", + "libc", + "mach2", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -6391,7 +6370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes", "quick-protobuf", "thiserror", "unsigned-varint", @@ -6410,27 +6389,27 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ - "bytes 1.5.0", - "rand 0.8.5", - "ring", + "bytes", + "rand", + "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls 0.20.8", "slab", "thiserror", "tinyvec", "tracing", - "webpki 0.22.1", + "webpki", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -6441,19 +6420,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -6461,20 +6427,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -6504,12 +6460,13 @@ dependencies = [ ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "rand_distr" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ - "rand_core 0.5.1", + "num-traits", + "rand", ] [[package]] @@ -6521,6 +6478,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "10.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -6549,19 +6515,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -6569,7 +6522,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring", + "ring 0.16.20", "time", "yasna", ] @@ -6592,6 +6545,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -6620,7 +6582,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -6635,16 +6597,29 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -6658,13 +6633,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -6675,9 +6650,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "resolv-conf" @@ -6689,17 +6664,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -6707,7 +6671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -6719,10 +6683,24 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", - "winapi 0.3.9", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", ] [[package]] @@ -6735,6 +6713,12 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.2.0" @@ -6743,18 +6727,7 @@ checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", "rtoolbox", - "winapi 0.3.9", -] - -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes 1.5.0", - "thiserror", - "webrtc-util", + "winapi", ] [[package]] @@ -6779,21 +6752,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" dependencies = [ "libc", - "winapi 0.3.9", -] - -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes 1.5.0", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", + "winapi", ] [[package]] @@ -6871,52 +6830,53 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ - "base64 0.13.1", "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", + "ring 0.16.20", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", - "ring", - "sct 0.7.0", - "webpki 0.22.1", + "ring 0.16.20", + "rustls-webpki 0.101.4", + "sct", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring", - "rustls-webpki 0.101.5", - "sct 0.7.0", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle 2.5.0", + "zeroize", ] [[package]] @@ -6926,7 +6886,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.3", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.0.0", + "rustls-pki-types", "schannel", "security-framework", ] @@ -6937,27 +6910,44 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.4", + "base64 0.21.2", +] + +[[package]] +name = "rustls-pemfile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +dependencies = [ + "base64 0.21.2", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" + [[package]] name = "rustls-webpki" -version = "0.100.3" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "rustls-pki-types", + "untrusted 0.9.0", ] [[package]] @@ -7012,8 +7002,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97e78cc21b2bb1d13b33d9c64fbb02a10efde428e8f0a68a0ca2084203123933" dependencies = [ "log", "sp-core", @@ -7023,15 +7014,15 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cede898c7079b789b42c4fdd8f1ff74f7007232406cd0299e2c3a5ada1db2910" dependencies = [ "futures", "futures-timer", "log", "parity-scale-codec", "sc-block-builder", - "sc-client-api", "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", @@ -7046,25 +7037,31 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a2f425079daf382b0f1cf3b9085bed25db13ec8ad0ff64b0dc75ff457c0f7" dependencies = [ "parity-scale-codec", - "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", "sp-core", "sp-inherents", "sp-runtime", + "sp-trie", ] [[package]] name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41472507ca721651ef117a2702a9bd6d9d9e8ce5f16840a71741993319926191" dependencies = [ - "memmap2", + "array-bytes 6.2.2", + "docify", + "log", + "memmap2 0.9.3", + "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", "sc-executor", @@ -7074,41 +7071,49 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", + "sp-crypto-hashing", + "sp-genesis-builder", + "sp-io", "sp-runtime", "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274117ab32d7b3b2f790c841b61f22027d80f344c00b8ce38df772553a8a5409" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", + "bip39", "chrono", - "clap 4.4.3", + "clap 4.5.1", "fdlimit", "futures", + "itertools 0.10.5", "libp2p-identity", "log", "names", "parity-scale-codec", - "rand 0.8.5", + "rand", "regex", "rpassword", "sc-client-api", "sc-client-db", "sc-keystore", + "sc-mixnet", "sc-network", "sc-service", "sc-telemetry", @@ -7124,14 +7129,14 @@ dependencies = [ "sp-runtime", "sp-version", "thiserror", - "tiny-bip39", "tokio", ] [[package]] name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acaa6df639ac7a7f10060daf50461afddf6635ea148514a1eceba3384046c30" dependencies = [ "fnv", "futures", @@ -7151,13 +7156,15 @@ dependencies = [ "sp-state-machine", "sp-statement-store", "sp-storage", + "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d946e00b4bef179ef7c2d29966935d96e38176a543249c1b17fdeacfc3446bb4" dependencies = [ "hash-db", "kvdb", @@ -7182,8 +7189,9 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081b1b7bd2894e4614acbfa47424771a5102bf907b31d2bbd379e8c4f3b55b09" dependencies = [ "async-trait", "futures", @@ -7207,8 +7215,9 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca4c0040ba696f6eac9a6b627dbb487b27076203c5ed1b03fac6c993df5b627" dependencies = [ "async-trait", "futures", @@ -7236,11 +7245,12 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ea4771511dfcabe0e0dd3a43368ba3f430b0aaf736463b14286cc10a6494e6" dependencies = [ - "ahash 0.8.3", - "array-bytes 6.1.0", + "ahash 0.8.8", + "array-bytes 6.2.2", "async-trait", "dyn-clone", "finality-grandpa", @@ -7250,7 +7260,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -7258,6 +7268,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-gossip", + "sc-network-sync", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", @@ -7269,6 +7280,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", @@ -7277,8 +7289,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ddad1b613fa5118016c11f1015ba5ff9a9f2ce914a72482ec0303d4d828e2f9" dependencies = [ "async-trait", "futures", @@ -7300,8 +7313,9 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a331ae16b0a17ed474eaf9c2dc01b145511cf4bd62ffc165d7dd1d3f13e48a94" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -7322,8 +7336,9 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f414028dc468aafd449cb659f7664e39540f3308945ec9cf2209c1359fa67e" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7334,13 +7349,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcacfc88265486c337ef97a042ba42ccd1903520dbff40116dbe837e3ee6b89" dependencies = [ "anyhow", - "cfg-if 1.0.0", + "cfg-if", "libc", "log", + "parking_lot 0.12.1", "rustix 0.36.15", "sc-allocator", "sc-executor-common", @@ -7351,8 +7368,9 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5d24b1f02efd53092a78be46b7e6fc4805b3fb723bbcc8928574d9fa309a94" dependencies = [ "ansi_term", "futures", @@ -7361,16 +7379,18 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sp-blockchain", "sp-runtime", ] [[package]] name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0413f82a27eded5a12e1f3d02c478b378e72912fbdf3b8b9cae7c5995c5a8f89" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -7379,16 +7399,47 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-mixnet" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9aaa5a9d17d0ea54a5da0af04f0c187f65500d7597395eaae313c511a08db6c" +dependencies = [ + "array-bytes 4.2.0", + "arrayvec 0.7.4", + "blake2 0.10.6", + "bytes", + "futures", + "futures-timer", + "libp2p-identity", + "log", + "mixnet", + "multiaddr", + "parity-scale-codec", + "parking_lot 0.12.1", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "sp-api", + "sp-consensus", + "sp-core", + "sp-keystore", + "sp-mixnet", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf955c8966573e7e3cc940e831d792945a41d6e443766ad50e50a5af75e1ef74" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "asynchronous-codec", - "bytes 1.5.0", + "bytes", "either", "fnv", "futures", @@ -7402,7 +7453,7 @@ dependencies = [ "parking_lot 0.12.1", "partial_sort", "pin-project", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network-common", "sc-utils", @@ -7415,6 +7466,8 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", "unsigned-varint", "wasm-timer", "zeroize", @@ -7422,15 +7475,16 @@ dependencies = [ [[package]] name = "sc-network-bitswap" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b34047c641db262b9035ef809b1184e55b3f6c45bf3f6110f293d3652ec663" dependencies = [ "async-channel", "cid", "futures", "libp2p-identity", "log", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -7442,8 +7496,9 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7cfe68e017be02fd9911cd1e4db50bae31671e01e988ef5c375d0092ff7c71" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7459,16 +7514,18 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6c4ffd60fe240d9b0963ec60752810660a201755a77b922aa5e8ef7256f6b5" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.8", "futures", "futures-timer", "libp2p", "log", "sc-network", "sc-network-common", + "sc-network-sync", "schnellru", "sp-runtime", "substrate-prometheus-endpoint", @@ -7477,16 +7534,17 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01f3ca1b7e567ca60535bb76b3f8617e8d40de0067f7d1794d3f5ef7ed7a4d0e" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "futures", "libp2p-identity", "log", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -7498,10 +7556,11 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50a16e2817ef6def510a89b2e439b13f53b31d783344061b8551a37b6fb61ef4" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "fork-tree", @@ -7511,7 +7570,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-consensus", @@ -7528,20 +7587,24 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", ] [[package]] name = "sc-network-transactions" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658a81c4a24f874ada1cac70db349ff7983956563e39e1468eb6e8703f07057e" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "futures", "libp2p", "log", "parity-scale-codec", "sc-network", "sc-network-common", + "sc-network-sync", "sc-utils", "sp-consensus", "sp-runtime", @@ -7550,11 +7613,12 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ - "array-bytes 6.1.0", - "bytes 1.5.0", + "array-bytes 6.2.2", + "bytes", "fnv", "futures", "futures-timer", @@ -7566,7 +7630,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network", "sc-network-common", @@ -7584,8 +7648,9 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8dadb2ae5a316e4d08cad6aacd5de1dec792f3bd94e3960795ff7ffd07211c" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7593,8 +7658,9 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", "jsonrpsee", @@ -7604,6 +7670,7 @@ dependencies = [ "sc-block-builder", "sc-chain-spec", "sc-client-api", + "sc-mixnet", "sc-rpc-api", "sc-tracing", "sc-transaction-pool-api", @@ -7624,12 +7691,14 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ "jsonrpsee", "parity-scale-codec", "sc-chain-spec", + "sc-mixnet", "sc-transaction-pool-api", "scale-info", "serde", @@ -7643,12 +7712,17 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ae724afa9862381f77b6d3a205baef5daceec9e584f17069546eb7dfca5400" dependencies = [ + "futures", + "governor", "http", + "hyper", "jsonrpsee", "log", + "pin-project", "serde_json", "substrate-prometheus-endpoint", "tokio", @@ -7658,10 +7732,11 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8599ca0b78580328cafa11fdb2d89d8678ba64e937c957515816492e87066bad" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "futures", "futures-util", "hex", @@ -7669,23 +7744,29 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", + "rand", "sc-chain-spec", "sc-client-api", + "sc-rpc", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", "sp-core", + "sp-rpc", "sp-runtime", "sp-version", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ea0efa7cf58f6cacb04034939e62f12ce7bf2df6a60f67e2d5c2f27fe54999" dependencies = [ "async-trait", "directories", @@ -7697,8 +7778,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", - "sc-block-builder", + "rand", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -7748,8 +7828,9 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "748f92aa2827647932a04685df8e00b9763d4060635ca84eaeb3788822198013" dependencies = [ "log", "parity-scale-codec", @@ -7759,27 +7840,31 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399e72ba964c0394181db8680c34b3503116c217b0fe3564696857ea9ca4aa68" dependencies = [ + "derive_more", "futures", "libc", "log", - "rand 0.8.5", + "rand", "rand_pcg", "regex", "sc-telemetry", "serde", "serde_json", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-std", ] [[package]] name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c6807ebd9f43ab628931842d3aaa9404ddfd07013e9c7027ca603f496939577" dependencies = [ "chrono", "futures", @@ -7787,7 +7872,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "sc-utils", "serde", "serde_json", @@ -7797,15 +7882,17 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7abee1c60e6f55a09ae0b9055093709bc84ff2bb55a3828167d556f724f82cc" dependencies = [ "ansi_term", - "atty", "chrono", + "is-terminal", "lazy_static", "libc", "log", + "parity-scale-codec", "parking_lot 0.12.1", "regex", "rustc-hash", @@ -7826,19 +7913,21 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe004c916f4be7eebf52f05df1d44a240b653cb42c7a6c49692553620b46d5f" dependencies = [ "async-trait", "futures", @@ -7854,6 +7943,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-tracing", "sp-transaction-pool", @@ -7863,8 +7953,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe0eeb21d4f09a9edffee481df544bb6fc83cccc0788c19ceebd760f1afd167" dependencies = [ "async-trait", "futures", @@ -7879,8 +7970,9 @@ dependencies = [ [[package]] name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1863d482be044f4768ef5de6119dc70b5e31e6e9f71ad225c177474d6540e424" dependencies = [ "async-channel", "futures", @@ -7892,14 +7984,81 @@ dependencies = [ "sp-arithmetic", ] +[[package]] +name = "scale-bits" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-decode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" +dependencies = [ + "darling", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-encode" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-encode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-encode-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +dependencies = [ + "darling", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -7908,16 +8067,32 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "scale-value" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" +dependencies = [ + "derive_more", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", +] + [[package]] name = "schannel" version = "0.1.22" @@ -7933,8 +8108,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", - "cfg-if 1.0.0", + "ahash 0.8.8", + "cfg-if", "hashbrown 0.13.2", ] @@ -7947,12 +8122,29 @@ dependencies = [ "arrayref", "arrayvec 0.5.2", "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin", - "rand 0.7.3", + "merlin 2.0.1", "rand_core 0.5.1", "sha2 0.8.2", - "subtle", + "subtle 2.5.0", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead 0.5.2", + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.7", + "subtle 2.5.0", "zeroize", ] @@ -7968,50 +8160,14 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sct" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle", - "zeroize", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -8020,28 +8176,28 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", - "subtle", + "pkcs8", + "subtle 2.5.0", "zeroize", ] [[package]] name = "secp256k1" -version = "0.24.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" dependencies = [ "cc", ] @@ -8113,29 +8269,38 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -8144,25 +8309,13 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha-1" version = "0.9.8" @@ -8170,23 +8323,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.8.2" @@ -8206,7 +8348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -8218,7 +8360,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -8244,9 +8386,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -8257,16 +8399,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.1.0" @@ -8290,6 +8422,12 @@ dependencies = [ "wide", ] +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + [[package]] name = "siphasher" version = "0.3.11" @@ -8313,9 +8451,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snap" @@ -8329,15 +8467,15 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm 0.9.4", - "blake2", + "aes-gcm 0.9.2", + "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.0", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "ring", + "ring 0.16.20", "rustc_version 0.4.0", "sha2 0.10.7", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -8347,14 +8485,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", "windows-sys 0.48.0", @@ -8367,20 +8505,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.5.0", + "bytes", "flate2", "futures", "http", "httparse", "log", - "rand 0.8.5", - "sha-1 0.9.8", + "rand", + "sha-1", ] [[package]] name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298331cb47a948244f6fb4921b5cbeece267d72139fb90760993b6ec37b2212c" dependencies = [ "hash-db", "log", @@ -8391,6 +8530,7 @@ dependencies = [ "sp-externalities", "sp-metadata-ir", "sp-runtime", + "sp-runtime-interface", "sp-state-machine", "sp-std", "sp-trie", @@ -8400,22 +8540,24 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cfbb3ae0216e842dfb805ea8e896e85b07a7c34d432a6c7b7d770924431ed2" dependencies = [ "Inflector", - "blake2", + "blake2 0.10.6", "expander", - "proc-macro-crate", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sp-application-crypto" -version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b4b7b12922cb90cf8dff0cab14087ba0ca25c1f04ba060c7294ce42c78d89ab" dependencies = [ "parity-scale-codec", "scale-info", @@ -8427,8 +8569,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "16.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" dependencies = [ "integer-sqrt", "num-traits", @@ -8441,8 +8584,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b35d0992e2183686215dccb4bcb5003b4eb52feec82d82dabd81db7401d845a" dependencies = [ "sp-api", "sp-inherents", @@ -8452,8 +8596,9 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c24a17e8e5406725ab805ee5cbab4b2a9181b7b8dd93f9c302eed76216c6321a" dependencies = [ "futures", "log", @@ -8470,8 +8615,9 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e3841d5b5929080c92ef846db7e1a8323d6352b981a6b5cbccd0886fdf1a85e" dependencies = [ "async-trait", "futures", @@ -8485,34 +8631,16 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dc8e041fcb128e9e6a0d706c243b7263dae7d45098a9450498a1657abac2f3" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "serde", "sp-api", "sp-application-crypto", "sp-consensus-slots", - "sp-core", "sp-inherents", "sp-runtime", "sp-std", @@ -8521,8 +8649,9 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47109ea7b003030bc7cff2724e785859b9b8e6504866ffa1a3b55380cb11d53" dependencies = [ "finality-grandpa", "log", @@ -8539,8 +8668,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c72408adadb54b6f4eb287729166528cdb83e08c796685edc9bee09571b6474" dependencies = [ "parity-scale-codec", "scale-info", @@ -8551,36 +8681,37 @@ dependencies = [ [[package]] name = "sp-core" -version = "21.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "586e0d5185e4545f465fc9a04fb9c4572d3e294137312496db2b67b0bb579e1f" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", + "bip39", "bitflags 1.3.2", - "blake2", + "blake2 0.10.6", "bounded-collections", - "bs58", + "bs58 0.5.0", "dyn-clonable", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.4.0", - "lazy_static", + "impl-serde", + "itertools 0.10.5", "libsecp256k1", "log", - "merlin", + "merlin 3.0.0", "parity-scale-codec", "parking_lot 0.12.1", "paste", "primitive-types", - "rand 0.8.5", - "regex", + "rand", "scale-info", - "schnorrkel", + "schnorrkel 0.11.4", "secp256k1", "secrecy", "serde", - "sp-core-hashing", + "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -8589,15 +8720,16 @@ dependencies = [ "ss58-registry", "substrate-bip39", "thiserror", - "tiny-bip39", "tracing", + "w3f-bls", "zeroize", ] [[package]] -name = "sp-core-hashing" -version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" dependencies = [ "blake2b_simd", "byteorder", @@ -8608,19 +8740,21 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing-proc-macro" -version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", - "sp-core-hashing", - "syn 2.0.37", + "sp-crypto-hashing", + "syn 2.0.50", ] [[package]] name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8628,29 +8762,44 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sp-externalities" -version = "0.19.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" dependencies = [ "environmental", "parity-scale-codec", "sp-std", - "sp-storage", + "sp-storage", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a862db099e8a799417b63ea79c90079811cdf68fcf3013d81cdceeddcec8f142" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", ] [[package]] name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42eb3c88572c7c80e7ecb6365601a490350b09d11000fcc7839efd304e172177" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8663,18 +8812,19 @@ dependencies = [ [[package]] name = "sp-io" -version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ - "bytes 1.5.0", - "ed25519 1.5.3", - "ed25519-dalek 1.0.1", + "bytes", + "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", "rustversion", "secp256k1", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-keystore", "sp-runtime-interface", @@ -8688,31 +8838,32 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "24.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9c74648e593b45309dfddf34f4edfd0a91816d1d97dd5e0bd93c46e7cdb0d6" dependencies = [ - "lazy_static", "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.27.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd4bf9e5fa486416c92c2bb497b7ce2c43eac80cbdc407ffe2d34b365694ac29" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "sp-core", "sp-externalities", - "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" dependencies = [ "thiserror", "zstd 0.12.4", @@ -8720,8 +8871,9 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -8729,10 +8881,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-mixnet" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a8078f19b1292220b7110115b49f4fcd427324f3b184f6d8dbeb6b4dd40d4d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-std", +] + [[package]] name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f826efe7bdd6d142ced34f5ef1ed9a2070887e78d3146220250edeb67e6791d5" dependencies = [ "sp-api", "sp-core", @@ -8741,8 +8907,9 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" dependencies = [ "backtrace", "lazy_static", @@ -8751,8 +8918,9 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffa9924fc1d0e7b79550493b8b8ac3fa58593cbdb169ee6cf6c1ee3ef25882dd" dependencies = [ "rustc-hash", "serde", @@ -8761,18 +8929,21 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "24.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b28fcf8f53d917e420e783dd27d06fd276f55160301c5bc977cc5898c4130f6f" dependencies = [ + "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", "parity-scale-codec", "paste", - "rand 0.8.5", + "rand", "scale-info", "serde", + "simple-mermaid", "sp-application-crypto", "sp-arithmetic", "sp-core", @@ -8783,12 +8954,14 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "17.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ - "bytes 1.5.0", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", + "polkavm-derive", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -8801,20 +8974,23 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "11.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", - "proc-macro-crate", + "expander", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0399eb885209b51b2999fe35883a579b0848674f0679019ce262f19d0a853325" dependencies = [ "parity-scale-codec", "scale-info", @@ -8828,8 +9004,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48b92f4f66b40cbf7cf00d7808d8eec16e25cb420a29ec4060a74c0e9f7c2938" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8842,14 +9019,15 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.28.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ae47765916d342b53d07be012a71efc4c1377d875ade31340cc4fb784b9921" dependencies = [ "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "smallvec", "sp-core", "sp-externalities", @@ -8863,32 +9041,43 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95ede4523fc978585383465a406289235a71dd6febe7f79e1114794afae5cd0" dependencies = [ + "aes-gcm 0.10.3", + "curve25519-dalek 4.1.2", + "ed25519-dalek", + "hkdf", "parity-scale-codec", + "rand", "scale-info", + "sha2 0.10.7", "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-runtime", "sp-runtime-interface", "sp-std", "thiserror", + "x25519-dalek 2.0.0", ] [[package]] name = "sp-std" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", @@ -8898,8 +9087,9 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee9532c2e4c8fcd7753cb4c741daeb8d9e3ac7cbc15a84c78d4c96492ed20eba" dependencies = [ "async-trait", "parity-scale-codec", @@ -8911,8 +9101,9 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "10.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" dependencies = [ "parity-scale-codec", "sp-std", @@ -8923,8 +9114,9 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8b3208d1c8347ab75b28192dc7354489369ae652f2d9936521c8ccd92ca06" dependencies = [ "sp-api", "sp-runtime", @@ -8932,8 +9124,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa2b7cfb16da80934eab7e37c317969f0a19f31396c530279ce1110b3ecbd95" dependencies = [ "async-trait", "parity-scale-codec", @@ -8947,20 +9140,22 @@ dependencies = [ [[package]] name = "sp-trie" -version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.8", "hash-db", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", + "rand", "scale-info", "schnellru", "sp-core", + "sp-externalities", "sp-std", "thiserror", "tracing", @@ -8970,15 +9165,16 @@ dependencies = [ [[package]] name = "sp-version" -version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973478ac076be7cb8e0a7968ee43cd7c46fb26e323d36020a9f3bb229e033cd2" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -8987,19 +9183,21 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "sp-wasm-interface" -version = "14.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9011,15 +9209,16 @@ dependencies = [ [[package]] name = "sp-weights" -version = "20.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8a9c7a1b64fa7dba38622ad1de26f0b2e595727c0e42c7b109ecb8e7120688" dependencies = [ + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", "sp-arithmetic", - "sp-core", "sp-debug-derive", "sp-std", ] @@ -9031,25 +9230,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spinners" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" -dependencies = [ - "lazy_static", - "maplit", - "strum", -] - -[[package]] -name = "spki" -version = "0.6.0" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" @@ -9058,7 +9242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -9100,7 +9284,7 @@ dependencies = [ "parking_lot 0.11.2", "parking_lot_core 0.8.6", "static_init_macro", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -9128,15 +9312,27 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", ] +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + [[package]] name = "strum_macros" version = "0.24.3" @@ -9151,37 +9347,31 @@ dependencies = [ ] [[package]] -name = "stun" -version = "0.4.4" +name = "strum_macros" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "base64 0.13.1", - "crc 3.0.1", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util", + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.50", ] [[package]] name = "substrate-api-client" -version = "0.12.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.17.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-compose-macros", "ac-node-api", "ac-primitives", "async-trait", "derive_more", - "frame-metadata 15.1.0", + "frame-metadata 16.0.0", "frame-support", - "futures", + "futures-util", "hex", "jsonrpsee", "log", @@ -9190,40 +9380,40 @@ dependencies = [ "serde", "serde_json", "sp-core", + "sp-crypto-hashing", + "sp-inherents", "sp-runtime", "sp-runtime-interface", + "sp-storage", + "sp-version", "url", - "ws", ] [[package]] name = "substrate-bip39" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" dependencies = [ "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", + "pbkdf2", + "schnorrkel 0.9.1", "sha2 0.9.9", "zeroize", ] [[package]] name = "substrate-build-script-utils" -version = "3.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd540ba72520174c2c73ce96bf507eeba3cc8a481f58be92525b69110e1fa645" -dependencies = [ - "platforms 1.1.0", -] +checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-client-keystore" -version = "0.9.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.10.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ - "array-bytes 4.2.0", + "array-bytes 6.2.2", "async-trait", "parking_lot 0.12.1", "sc-keystore", @@ -9237,18 +9427,20 @@ dependencies = [ [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed?tag=polkadot-v1.0.0#df67f97a6db9b40215f105613b381ca82f1e2ff4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e83ba2b4f68f12ec6b0f55bac0a23a5bcaaf2676f1109c7a5ead6121c7f0622" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0", + "substrate-typenum", ] [[package]] name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -9264,10 +9456,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "substrate-geohash" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2aad67d4ac1b37d97338ab6fd18fd5ec79c35a24112028e6feda0d67142e9a" +dependencies = [ + "parity-scale-codec", + "scale-info", + "substrate-fixed", +] + [[package]] name = "substrate-prometheus-endpoint" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8fe06b03b8a291c09507c42f92a2c2c10dd3d62975d02c7f64a92d87bfe09b" dependencies = [ "hyper", "log", @@ -9277,50 +9481,46 @@ dependencies = [ ] [[package]] -name = "substrate-rpc-client" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "substrate-typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f0091e93c2c75b233ae39424c52cb8a662c0811fb68add149e20e5d7e8a788" dependencies = [ - "async-trait", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "sp-runtime", + "parity-scale-codec", + "scale-info", ] [[package]] name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d182ae093d473b5947e32c392b10fb12125318c4470ff8adf32b0cbf2e9e6611" dependencies = [ - "ansi_term", "build-helper", "cargo_metadata", + "console", "filetime", "parity-wasm", + "polkavm-linker", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", - "toml 0.7.8", + "toml 0.8.8", "walkdir", "wasm-opt", ] [[package]] -name = "substring" -version = "1.4.5" +name = "subtle" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -9335,9 +9535,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -9391,14 +9591,14 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand 2.0.0", - "redox_syscall 0.3.5", - "rustix 0.38.13", + "redox_syscall 0.4.1", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -9411,6 +9611,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix 0.38.21", + "windows-sys 0.48.0", +] + [[package]] name = "termtree" version = "0.4.1" @@ -9428,22 +9638,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] @@ -9458,7 +9668,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -9483,9 +9693,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ "deranged", "itoa", @@ -9502,32 +9712,13 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ "time-core", ] -[[package]] -name = "tiny-bip39" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" -dependencies = [ - "anyhow", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", - "rustc-hash", - "sha2 0.10.7", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -9537,16 +9728,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -9564,19 +9745,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes", "libc", - "mio 0.8.8", + "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.3", "tokio-macros", "windows-sys 0.48.0", ] @@ -9589,27 +9770,27 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "pin-project", - "rand 0.8.5", + "rustls 0.21.6", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.7", + "rustls 0.22.2", + "rustls-pki-types", "tokio", ] @@ -9620,7 +9801,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] @@ -9631,11 +9812,11 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ - "bytes 1.5.0", + "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -9651,21 +9832,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -9676,7 +9857,18 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.3", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", @@ -9689,6 +9881,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", "tracing", @@ -9696,18 +9892,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ "bitflags 2.4.0", - "bytes 1.5.0", + "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -9730,9 +9926,9 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] @@ -9745,14 +9941,14 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -9814,9 +10010,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" dependencies = [ "hash-db", "hashbrown 0.13.2", @@ -9841,7 +10037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", - "cfg-if 1.0.0", + "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", @@ -9850,7 +10046,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.9", "thiserror", @@ -9866,7 +10062,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "futures-util", "ipconfig", "lazy_static", @@ -9886,93 +10082,29 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "try-runtime-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-trait", - "clap 4.4.3", - "frame-remote-externalities", - "frame-try-runtime", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-rpc", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights", - "substrate-rpc-client", - "zstd 0.12.4", -] - [[package]] name = "tt-call" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.7", - "rand 0.8.5", + "rand", "static_assertions", ] [[package]] name = "typenum" version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0#4cba9a73f7e94ba38c824616efab93f177c9a556" -dependencies = [ - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "typenum" -version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -10000,9 +10132,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -10027,12 +10159,12 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -10042,17 +10174,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] name = "unsigned-varint" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes", "futures-io", "futures-util", ] @@ -10063,11 +10195,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -10080,15 +10218,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] - [[package]] name = "valuable" version = "0.1.0" @@ -10120,12 +10249,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] -name = "waitgroup" -version = "0.1.2" +name = "w3f-bls" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" dependencies = [ - "atomic-waker", + "ark-bls12-377", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-serialize-derive", + "arrayref", + "constcat", + "digest 0.10.7", + "rand", + "rand_chacha", + "rand_core 0.6.4", + "sha2 0.10.7", + "sha3", + "thiserror", + "zeroize", ] [[package]] @@ -10171,7 +10315,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -10186,7 +10330,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -10196,7 +10340,7 @@ version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -10220,7 +10364,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10233,23 +10377,23 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" dependencies = [ "parity-wasm", ] [[package]] name = "wasm-opt" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" +checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -10258,9 +10402,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" dependencies = [ "anyhow", "cxx", @@ -10270,9 +10414,9 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" dependencies = [ "anyhow", "cc", @@ -10313,7 +10457,7 @@ checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -10339,7 +10483,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -10349,7 +10493,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", @@ -10427,7 +10571,7 @@ dependencies = [ "addr2line 0.19.0", "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "cpp_demangle", "gimli 0.27.3", "log", @@ -10459,7 +10603,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "windows-sys 0.45.0", ] @@ -10472,7 +10616,7 @@ checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -10480,7 +10624,7 @@ dependencies = [ "memfd", "memoffset 0.8.0", "paste", - "rand 0.8.5", + "rand", "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", @@ -10512,22 +10656,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki" -version = "0.22.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -10536,242 +10670,18 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.1", -] - -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.3", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes 1.5.0", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.7", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes 1.5.0", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.2", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.7", - "signature 1.6.4", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc 3.0.1", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.9", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes 1.5.0", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes 1.5.0", - "crc 3.0.1", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes 1.5.0", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1 0.9.8", - "subtle", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes 1.5.0", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi 0.3.9", + "webpki", ] [[package]] name = "which" -version = "4.4.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "home", + "libc", "once_cell", - "rustix 0.38.13", ] [[package]] @@ -10790,12 +10700,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -10806,12 +10710,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -10824,7 +10722,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -10873,6 +10771,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -10903,6 +10810,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -10915,6 +10837,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.34.0" @@ -10933,6 +10861,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.34.0" @@ -10951,6 +10885,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.34.0" @@ -10969,6 +10909,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.34.0" @@ -10987,6 +10933,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -10999,6 +10951,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.34.0" @@ -11017,6 +10975,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.5.15" @@ -11032,39 +10996,10 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] -[[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio 0.6.23", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1 0.8.2", - "slab", - "url", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "wyz" version = "0.5.1" @@ -11091,44 +11026,25 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.1.0", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", "serde", "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", @@ -11144,7 +11060,7 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "static_assertions", ] @@ -11157,6 +11073,26 @@ dependencies = [ "time", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.50", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -11174,7 +11110,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.50", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 52434b2c..48248912 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,139 +11,149 @@ members = [ panic = 'unwind' [workspace.dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { features = ["derive"], version = "1.0.136" } -clap = { version = "4.0.9", features = ["derive"] } -futures = { version = "0.3.21", features = ["thread-pool"] } -log = "0.4.14" -serde_json = "1.0.81" +async-trait = "0.1.68" +clap = { version = "4.5.1", features = ["derive"] } env_logger = "0.9.0" +futures = { version = "0.3.30", features = ["thread-pool"] } geojson = "0.22.2" hex = "0.4.3" -tokio = { version = "1.24", features = ["rt-multi-thread", "macros", "time"] } +log = "0.4.20" +maybe-async = { version = "0.2.7" } +parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] } +scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } +serde = { features = ["derive"], version = "1.0.197" } +serde_json = "1.0.114" +tokio = { version = "1.33", features = ["rt-multi-thread", "macros", "time"] } # encointer deps -encointer-balances-tx-payment = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-balances-tx-payment-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-primitives = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-balances = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-democracy = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-faucet = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-reputation-commitments = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-scheduler = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } +encointer-balances-tx-payment = { default-features = false, version = "7.0.0" } +encointer-balances-tx-payment-rpc = { version = "7.0.0" } +encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "7.0.0" } +encointer-ceremonies-assignment = { version = "7.0.0" } +encointer-primitives = { default-features = false, version = "7.0.0" } +pallet-encointer-balances = { default-features = false, version = "7.0.0" } +pallet-encointer-bazaar = { default-features = false, version = "7.0.0" } +pallet-encointer-bazaar-rpc = { version = "7.0.0" } +pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-ceremonies = { default-features = false, version = "7.0.0" } +pallet-encointer-ceremonies-rpc = { version = "7.0.0" } +pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-communities = { default-features = false, version = "7.0.0" } +pallet-encointer-communities-rpc = { version = "7.0.0" } +pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-democracy = { default-features = false, version = "7.0.0" } +pallet-encointer-faucet = { default-features = false, version = "7.0.0" } +pallet-encointer-reputation-commitments = { default-features = false, version = "7.0.0" } +pallet-encointer-scheduler = { default-features = false, version = "7.0.0" } # substrate deps -frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-try-runtime = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v1.0.0" } -hex-literal = { version = "0.3.4" } -jsonrpsee = { version = "0.16.2", features = ["server"] } -pallet-asset-tx-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-aura = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-proxy = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-scheduler = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-sudo = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-timestamp = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-utility = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-application-crypto = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-block-builder = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus-aura = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-core = { version = "21.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-inherents = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-keyring = { version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-keystore = { version = "0.27.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-offchain = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-rpc = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-runtime = { version = "24.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-session = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-std = { version = "8.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-version = { version = "22.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -try-runtime-cli = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v1.0.0" } - - -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -substrate-build-script-utils = "3.0.0" - -substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v1.0.0-tag-v0.12.0", features = ["ws-client"] } -substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v1.0.0-tag-v0.12.0" } +frame-benchmarking = { default-features = false, version = "30.0.0" } +frame-benchmarking-cli = { version = "34.0.0" } +frame-executive = { default-features = false, version = "30.0.0" } +frame-support = { default-features = false, version = "30.0.0" } +frame-system = { default-features = false, version = "30.0.0" } +frame-system-benchmarking = { default-features = false, version = "30.0.0" } +frame-system-rpc-runtime-api = { default-features = false, version = "28.0.0" } +frame-try-runtime = { default-features = false, version = "0.36.0" } +hex-literal = { version = "0.4.1" } +jsonrpsee = { version = "0.22.0", features = ["server"] } +pallet-asset-tx-payment = { default-features = false, version = "30.0.0" } +pallet-aura = { default-features = false, version = "29.0.0" } +pallet-balances = { default-features = false, version = "30.0.0" } +pallet-grandpa = { default-features = false, version = "30.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, version = "18.0.0" } +pallet-proxy = { default-features = false, version = "30.0.0" } +pallet-scheduler = { default-features = false, version = "31.0.0" } +pallet-sudo = { default-features = false, version = "30.0.0" } +pallet-timestamp = { default-features = false, version = "29.0.0" } +pallet-transaction-payment = { default-features = false, version = "30.0.0" } +pallet-transaction-payment-rpc = { version = "32.0.0" } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = "30.0.0" } +pallet-treasury = { default-features = false, version = "29.0.0" } +pallet-utility = { default-features = false, version = "30.0.0" } +sc-basic-authorship = { version = "0.36.0" } +sc-chain-spec = "29.0.0" +sc-cli = { version = "0.38.0" } +sc-client-api = { version = "30.0.0" } +sc-consensus = { version = "0.35.0" } +sc-consensus-aura = { version = "0.36.0" } +sc-consensus-grandpa = { version = "0.21.0" } +sc-executor = { version = "0.34.0" } +sc-keystore = { version = "27.0.0" } +sc-network = { version = "0.36.0" } +sc-offchain = { version = "31.0.0" } +sc-rpc = "31.0.0" +sc-rpc-api = "0.35.0" +sc-service = { version = "0.37.0" } +sc-telemetry = { version = "17.0.0" } +sc-transaction-pool = { version = "30.0.0" } +sc-transaction-pool-api = { version = "30.0.0" } +sp-api = { default-features = false, version = "28.0.0" } +sp-application-crypto = { default-features = false, version = "32.0.0" } +sp-arithmetic = { default-features = false, version = "25.0.0" } +sp-block-builder = { default-features = false, version = "28.0.0" } +sp-blockchain = "30.0.0" +sp-consensus = { version = "0.34.0" } +sp-consensus-aura = { default-features = false, version = "0.34.0" } +sp-consensus-grandpa = { version = "15.0.0" } +sp-core = { default-features = false, version = "30.0.0" } +sp-genesis-builder = { default-features = false, version = "0.9.0" } +sp-inherents = { default-features = false, version = "28.0.0" } +sp-io = { default-features = false, version = "32.0.0" } +sp-keyring = "33.0.0" +sp-keystore = "0.36.0" +sp-offchain = { default-features = false, version = "28.0.0" } +sp-rpc = "28.0.0" +sp-runtime = { default-features = false, version = "33.0.0" } +sp-session = { default-features = false, version = "29.0.0" } +sp-staking = { default-features = false, version = "28.0.0" } +sp-std = { default-features = false, version = "14.0.0" } +sp-storage = { default-features = false, version = "20.0.0" } +sp-timestamp = { version = "28.0.0" } +sp-transaction-pool = { default-features = false, version = "28.0.0" } +sp-version = { default-features = false, version = "31.0.0" } +substrate-frame-rpc-system = { version = "30.0.0" } +substrate-wasm-builder = "19.0.0" +substrate-build-script-utils = "11.0.0" +substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"] } +substrate-client-keystore = { version = "0.10.0" } #only while debugging -#[patch."https://github.com/encointer/pallets"] -# encointer-balances-tx-payment = { path = "../encointer-pallets/balances-tx-payment" } -# encointer-balances-tx-payment-rpc = { path = "../encointer-pallets/balances-tx-payment/rpc" } -# encointer-balances-tx-payment-rpc-runtime-api = { path = "../encointer-pallets/balances-tx-payment/rpc/runtime-api" } -# encointer-ceremonies-assignment = { path = "../encointer-pallets/ceremonies/assignment" } -# encointer-primitives = { path = "../encointer-pallets/primitives" } -# pallet-encointer-balances = { path = "../encointer-pallets/balances" } -# pallet-encointer-bazaar = { path = "../encointer-pallets/bazaar" } -# pallet-encointer-bazaar-rpc = { path = "../encointer-pallets/bazaar/rpc" } -# pallet-encointer-bazaar-rpc-runtime-api = { path = "../encointer-pallets/bazaar/rpc/runtime-api" } -# pallet-encointer-ceremonies = { path = "../encointer-pallets/ceremonies" } -# pallet-encointer-ceremonies-rpc = { path = "../encointer-pallets/ceremonies/rpc" } -# pallet-encointer-ceremonies-rpc-runtime-api = { path = "../encointer-pallets/ceremonies/rpc/runtime-api" } -# pallet-encointer-communities = { path = "../encointer-pallets/communities" } -# pallet-encointer-communities-rpc = { path = "../encointer-pallets/communities/rpc" } -# pallet-encointer-communities-rpc-runtime-api = { path = "../encointer-pallets/communities/rpc/runtime-api" } -# pallet-encointer-democracy = { path = "../encointer-pallets/democracy" } -# pallet-encointer-faucet = { path = "../encointer-pallets/faucet" } -# pallet-encointer-reputation-commitments = { path = "../encointer-pallets/reputation-commitments" } -# pallet-encointer-scheduler = { path = "../encointer-pallets/scheduler" } - -# [patch."https://github.com/scs/substrate-api-client"] -# substrate-api-client = { path = "../substrate-api-client" } -# substrate-client-keystore = { path = "../substrate-api-client/client-keystore" } +[patch.crates-io] +## api client +# todo: temporary patch until ^0.17.1 is released +ac-compose-macros = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +ac-node-api = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +ac-primitives = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-api-client = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-client-keystore = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +#ac-node-api = { path = "../../substrate-api-client/node-api" } +#ac-primitives = { path = "../../substrate-api-client/primitives" } +#substrate-api-client = { path = "../../substrate-api-client" } +#substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } +## encointer +#encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" } +#encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" } +#encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" } +#encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" } +#encointer-primitives = { path = "../pallets/primitives" } +#pallet-encointer-balances = { path = "../pallets/balances" } +#pallet-encointer-bazaar = { path = "../pallets/bazaar" } +#pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" } +#pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" } +#pallet-encointer-ceremonies = { path = "../pallets/ceremonies" } +#pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" } +#pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" } +#pallet-encointer-communities = { path = "../pallets/communities" } +#pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" } +#pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" } +#pallet-encointer-democracy = { path = "../pallets/democracy" } +#pallet-encointer-faucet = { path = "../pallets/faucet" } +#pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" } +#pallet-encointer-scheduler = { path = "../pallets/scheduler" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/client/Cargo.toml b/client/Cargo.toml index 555f96e3..14bc6d62 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -3,12 +3,14 @@ name = "encointer-client-notee" authors = ["encointer.org "] edition = "2021" #keep with node version. major, minor and patch -version = "1.5.4" +version = "1.8.0" [dependencies] +# todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107 clap = "2.33" clap-nested = "0.4.0" env_logger = { workspace = true } +futures = { workspace = true } geojson = { workspace = true } hex = { workspace = true } log = { workspace = true } diff --git a/client/bootstrap_demo_community.py b/client/bootstrap_demo_community.py index 89aa8d53..cd531a9c 100755 --- a/client/bootstrap_demo_community.py +++ b/client/bootstrap_demo_community.py @@ -111,7 +111,7 @@ def register_participants_and_perform_meetup(client, cid, accounts): def faucet(client, cid, accounts): # charlie has no genesis funds - print('Faucet is dripping...') + print('native (Alice)Faucet is dripping...') client.faucet(accounts, is_faucet=True) blocks_to_wait = 3 @@ -149,7 +149,7 @@ def test_reputation_caching(client, cid, account): # check if the reputation cache was updated rep = client.reputation(account1) print(rep) - if ('1', ' sqm1v79dF6b', 'VerifiedLinked') not in rep or ('2', ' sqm1v79dF6b', 'VerifiedLinked') not in rep or ('3', ' sqm1v79dF6b', 'VerifiedUnlinked') not in rep: + if ('1', ' sqm1v79dF6b', 'VerifiedLinked(2)') not in rep or ('2', ' sqm1v79dF6b', 'VerifiedLinked(3)') not in rep or ('3', ' sqm1v79dF6b', 'VerifiedUnlinked') not in rep: print("wrong reputation") exit(1) @@ -164,7 +164,7 @@ def test_reputation_caching(client, cid, account): rep = client.reputation(account1) print(rep) # after the registration the second reputation should now be linked - if ('3', ' sqm1v79dF6b', 'VerifiedLinked') not in rep: + if ('3', ' sqm1v79dF6b', 'VerifiedLinked(4)') not in rep: print("reputation not linked") exit(1) @@ -213,7 +213,7 @@ def test_unregister_and_upgrade_registration(client, cid): check_participant_count(client, cid, "Newbie", 0) check_participant_count(client, cid, "Reputable", 1) - check_reputation(client, cid, newbie, 6, "VerifiedLinked") + check_reputation(client, cid, newbie, 6, "VerifiedLinked(7)") client.unregister_participant(newbie, cid, cindex=6) client.await_block(3) @@ -261,6 +261,7 @@ def balance(x): def test_faucet(client, cid): + print("Testing the EncointerFaucet") client.set_faucet_reserve_amount("//Alice", balance(3000)) client.await_block(2) balance_bob = client.balance("//Bob") diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 5f6c6a23..9cbce709 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -4,10 +4,14 @@ version = "0.8.2" edition = "2021" [dependencies] +async-trait = { workspace = true } +futures = { workspace = true } log = { workspace = true } +maybe-async = { workspace = true } parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } +tokio = { workspace = true } # encointer deps encointer-ceremonies-assignment = { workspace = true, features = ["std"] } diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 023222d0..64e9a7b3 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -9,9 +9,9 @@ use encointer_primitives::{ }, communities::Location, }; +use futures::stream::{self, StreamExt}; use log::warn; use serde::{Deserialize, Serialize}; - use sp_runtime::AccountId32 as AccountId; use substrate_api_client::{api::error::Error as ApiClientError, GetStorage}; pub type Moment = u64; @@ -21,100 +21,107 @@ pub const ENCOINTER_CEREMONIES: &str = "EncointerCeremonies"; // same as in runtime, but we did not want to import the runtime here. pub const ONE_DAY: Moment = 86_400_000; +#[maybe_async::maybe_async(?Send)] pub trait CeremoniesApi { - fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result; - fn get_assignment_counts( + async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result; + async fn get_assignment_counts( &self, community_ceremony: &CommunityCeremony, ) -> Result; - fn get_bootstrapper( + async fn get_bootstrapper( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_reputable( + async fn get_reputable( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_endorsee( + async fn get_endorsee( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_newbie( + async fn get_newbie( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_registration( + async fn get_registration( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result; - fn get_meetup_count(&self, community_ceremony: &CommunityCeremony) -> Result; + async fn get_meetup_count( + &self, + community_ceremony: &CommunityCeremony, + ) -> Result; - fn get_meetup_index( + async fn get_meetup_index( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result>; - fn get_meetup_location( + async fn get_meetup_location( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result>; - fn get_meetup_participants( + async fn get_meetup_participants( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result>; - fn get_meetup_time_offset(&self) -> Result>; + async fn get_meetup_time_offset(&self) -> Result>; - fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result; + async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result; - fn get_community_ceremony_stats( + async fn get_community_ceremony_stats( &self, community_ceremony: CommunityCeremony, ) -> Result; - fn get_attestees( + async fn get_attestees( &self, community_ceremony: CommunityCeremony, participant_index: ParticipantIndexType, ) -> Result>; - fn get_meetup_participant_count_vote( + async fn get_meetup_participant_count_vote( &self, community_ceremony: CommunityCeremony, account_id: AccountId, ) -> Result; } +#[maybe_async::maybe_async(?Send)] impl CeremoniesApi for Api { - fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { - self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None)? + async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { + self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None) + .await? .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into())) } - fn get_assignment_counts( + async fn get_assignment_counts( &self, community_ceremony: &CommunityCeremony, ) -> Result { - self.get_storage_map(ENCOINTER_CEREMONIES, "AssignmentCounts", community_ceremony, None)? + self.get_storage_map(ENCOINTER_CEREMONIES, "AssignmentCounts", community_ceremony, None) + .await? .ok_or_else(|| ApiClientError::Other("AssignmentCounts not found".into())) } - fn get_bootstrapper( + async fn get_bootstrapper( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -126,9 +133,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_reputable( + async fn get_reputable( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -140,9 +148,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_endorsee( + async fn get_endorsee( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -154,9 +163,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_newbie( + async fn get_newbie( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -168,14 +178,15 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_registration( + async fn get_registration( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result { - let index_query = |storage_key| -> Result> { + let index_query = |storage_key| async move { self.get_storage_double_map( ENCOINTER_CEREMONIES, storage_key, @@ -183,15 +194,16 @@ impl CeremoniesApi for Api { account_id, None, ) + .await }; - if let Some(p_index) = index_query("BootstrapperIndex")? { + if let Some(p_index) = index_query("BootstrapperIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)) - } else if let Some(p_index) = index_query("ReputableIndex")? { + } else if let Some(p_index) = index_query("ReputableIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Reputable)) - } else if let Some(p_index) = index_query("EndorseeIndex")? { + } else if let Some(p_index) = index_query("EndorseeIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Endorsee)) - } else if let Some(p_index) = index_query("NewbieIndex")? { + } else if let Some(p_index) = index_query("NewbieIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Newbie)) } @@ -200,32 +212,38 @@ impl CeremoniesApi for Api { )) } - fn get_meetup_count(&self, community_ceremony: &CommunityCeremony) -> Result { + async fn get_meetup_count( + &self, + community_ceremony: &CommunityCeremony, + ) -> Result { Ok(self - .get_storage_map(ENCOINTER_CEREMONIES, "MeetupCount", community_ceremony, None)? + .get_storage_map(ENCOINTER_CEREMONIES, "MeetupCount", community_ceremony, None) + .await? .unwrap_or(0)) } - fn get_meetup_index( + async fn get_meetup_index( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result> { - let meetup_count = self.get_meetup_count(community_ceremony)?; + let meetup_count = self.get_meetup_count(community_ceremony).await?; if meetup_count == 0 { warn!("Meetup Count is 0."); return Ok(None) } - let assignments = self.get_assignments(community_ceremony)?; + let assignments = self.get_assignments(community_ceremony).await?; // Some helper queries to make below code more readable. - let bootstrapper_count = || -> Result { - Ok(self.get_assignment_counts(community_ceremony)?.bootstrappers) + let bootstrapper_count = || async { + Ok::( + self.get_assignment_counts(community_ceremony).await?.bootstrappers, + ) }; - let registration = self.get_registration(community_ceremony, account_id)?; + let registration = self.get_registration(community_ceremony, account_id).await?; let meetup_index_fn = |p_index, assignment_params| meetup_index(p_index, assignment_params, meetup_count); @@ -236,7 +254,7 @@ impl CeremoniesApi for Api { RegistrationType::Bootstrapper => Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)), RegistrationType::Reputable => Ok(meetup_index_fn( - registration.index - 1 + bootstrapper_count()?, + registration.index - 1 + bootstrapper_count().await?, assignments.bootstrappers_reputables, )), RegistrationType::Endorsee => @@ -246,24 +264,24 @@ impl CeremoniesApi for Api { } } - fn get_meetup_location( + async fn get_meetup_location( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result> { - let locations = self.get_locations(community_ceremony.0)?; - let location_assignment_params = self.get_assignments(community_ceremony)?.locations; + let locations = self.get_locations(community_ceremony.0).await?; + let location_assignment_params = self.get_assignments(community_ceremony).await?.locations; Ok(meetup_location(meetup_index, locations, location_assignment_params)) } - fn get_meetup_participants( + async fn get_meetup_participants( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result> { let meetup_index_zero_based = meetup_index - 1; - let meetup_count = self.get_meetup_count(community_ceremony)?; + let meetup_count = self.get_meetup_count(community_ceremony).await?; if meetup_index_zero_based > meetup_count { return Err(ApiClientError::Other( @@ -274,79 +292,89 @@ impl CeremoniesApi for Api { )) } - let params = self.get_assignments(community_ceremony)?; - let assigned = self.get_assignment_counts(community_ceremony)?; + let params = self.get_assignments(community_ceremony).await?; + let assigned = self.get_assignment_counts(community_ceremony).await?; - let bootstrappers_reputables = assignment_fn_inverse( - meetup_index_zero_based, - params.bootstrappers_reputables, - meetup_count, - assigned.bootstrappers + assigned.reputables, + let bootstrappers_reputables = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.bootstrappers_reputables, + meetup_count, + assigned.bootstrappers + assigned.reputables, + ) + .unwrap_or_default(), ) - .unwrap_or_default() - .into_iter() - .filter_map(|p_index| { + .filter_map(|p_index| async move { get_bootstrapper_or_reputable(self, community_ceremony, p_index, &assigned) + .await .ok() .flatten() }); - let endorsees = assignment_fn_inverse( - meetup_index_zero_based, - params.endorsees, - meetup_count, - assigned.endorsees, + let endorsees = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.endorsees, + meetup_count, + assigned.endorsees, + ) + .unwrap_or_default() + .into_iter() + .filter(|p| p < &assigned.endorsees), ) - .unwrap_or_default() - .into_iter() - .filter(|p| p < &assigned.endorsees) - .filter_map(|p| self.get_endorsee(community_ceremony, &(p + 1)).ok().flatten()); - - let newbies = assignment_fn_inverse( - meetup_index_zero_based, - params.newbies, - meetup_count, - assigned.newbies, + .filter_map(|p| async move { + self.get_endorsee(community_ceremony, &(p + 1)).await.ok().flatten() + }); + + let newbies = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.newbies, + meetup_count, + assigned.newbies, + ) + .unwrap_or_default() + .into_iter() + .filter(|p| p < &assigned.newbies), ) - .unwrap_or_default() - .into_iter() - .filter(|p| p < &assigned.newbies) - .filter_map(|p| self.get_newbie(community_ceremony, &(p + 1)).ok().flatten()); + .filter_map(|p| async move { + self.get_newbie(community_ceremony, &(p + 1)).await.ok().flatten() + }); - Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect()) + Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect().await) } - fn get_meetup_time_offset(&self) -> Result> { - self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None) + async fn get_meetup_time_offset(&self) -> Result> { + self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None).await } - fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { - let attesting_start = self.get_start_of_attesting_phase()?; - let offset = self.get_meetup_time_offset()?.unwrap_or(0); + async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { + let attesting_start = self.get_start_of_attesting_phase().await?; + let offset = self.get_meetup_time_offset().await?.unwrap_or(0); Ok(meetup_time(location, attesting_start, one_day, offset)) } - fn get_community_ceremony_stats( + async fn get_community_ceremony_stats( &self, community_ceremony: CommunityCeremony, ) -> Result { - let assignment = self.get_assignments(&community_ceremony)?; - let assignment_count = self.get_assignment_counts(&community_ceremony)?; - let mcount = self.get_meetup_count(&community_ceremony)?; + let assignment = self.get_assignments(&community_ceremony).await?; + let assignment_count = self.get_assignment_counts(&community_ceremony).await?; + let mcount = self.get_meetup_count(&community_ceremony).await?; let mut meetups = vec![]; // get stats of every meetup for m in 1..=mcount { - let m_location = self.get_meetup_location(&community_ceremony, m)?.unwrap(); - let time = self.get_meetup_time(m_location, ONE_DAY).unwrap_or(0); - let participants = self.get_meetup_participants(&community_ceremony, m)?; + let m_location = self.get_meetup_location(&community_ceremony, m).await?.unwrap(); + let time = self.get_meetup_time(m_location, ONE_DAY).await.unwrap_or(0); + let participants = self.get_meetup_participants(&community_ceremony, m).await?; let mut registrations = vec![]; for p in participants.into_iter() { - let r = self.get_registration(&community_ceremony, &p)?; + let r = self.get_registration(&community_ceremony, &p).await?; registrations.push((p, r)) } @@ -362,7 +390,7 @@ impl CeremoniesApi for Api { )) } - fn get_attestees( + async fn get_attestees( &self, community_ceremony: CommunityCeremony, p_index: ParticipantIndexType, @@ -373,11 +401,12 @@ impl CeremoniesApi for Api { community_ceremony, p_index, None, - )? + ) + .await? .ok_or_else(|| ApiClientError::Other("Attestees don't exist".into())) } - fn get_meetup_participant_count_vote( + async fn get_meetup_participant_count_vote( &self, community_ceremony: CommunityCeremony, account_id: AccountId, @@ -388,21 +417,24 @@ impl CeremoniesApi for Api { community_ceremony, account_id, None, - )? + ) + .await? .ok_or_else(|| ApiClientError::Other("MeetupParticipantCountVote don't exist".into())) } } -fn get_bootstrapper_or_reputable( +async fn get_bootstrapper_or_reputable( api: &Api, community_ceremony: &CommunityCeremony, p_index: ParticipantIndexType, assigned: &AssignmentCount, ) -> Result> { if p_index < assigned.bootstrappers { - return api.get_bootstrapper(community_ceremony, &(p_index + 1)) + return api.get_bootstrapper(community_ceremony, &(p_index + 1)).await } else if p_index < assigned.bootstrappers + assigned.reputables { - return api.get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)) + return api + .get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)) + .await } Ok(None) diff --git a/client/encointer-api-client-extension/src/communities.rs b/client/encointer-api-client-extension/src/communities.rs index f5cf3ea1..c47b4aaf 100644 --- a/client/encointer-api-client-extension/src/communities.rs +++ b/client/encointer-api-client-extension/src/communities.rs @@ -2,15 +2,18 @@ use crate::{Api, Result}; use encointer_primitives::communities::{CommunityIdentifier, Location}; use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request}; +#[maybe_async::maybe_async(?Send)] pub trait CommunitiesApi { - fn get_locations(&self, cid: CommunityIdentifier) -> Result>; + async fn get_locations(&self, cid: CommunityIdentifier) -> Result>; } +#[maybe_async::maybe_async(?Send)] impl CommunitiesApi for Api { - fn get_locations(&self, cid: CommunityIdentifier) -> Result> { + async fn get_locations(&self, cid: CommunityIdentifier) -> Result> { let locations = self .client() - .request::>("encointer_getLocations", rpc_params![cid])?; + .request::>("encointer_getLocations", rpc_params![cid]) + .await?; Ok(locations) } } diff --git a/client/encointer-api-client-extension/src/lib.rs b/client/encointer-api-client-extension/src/lib.rs index cc0af1c0..1cb4b657 100644 --- a/client/encointer-api-client-extension/src/lib.rs +++ b/client/encointer-api-client-extension/src/lib.rs @@ -1,6 +1,5 @@ -use extrinsic_params::CommunityCurrencyTipExtrinsicParams; use substrate_api_client::{ - ac_primitives::{Config, ExtrinsicSigner, SubstrateKitchensinkConfig, WithExtrinsicParams}, + ac_primitives::{AssetRuntimeConfig, Config, ExtrinsicSigner, WithExtrinsicParams}, rpc::JsonrpseeClient, }; @@ -8,13 +7,13 @@ pub use encointer_node_notee_runtime::Runtime; pub use substrate_api_client::{api::error::Error as ApiClientError, Result}; pub type EncointerConfig = WithExtrinsicParams< - SubstrateKitchensinkConfig, - CommunityCurrencyTipExtrinsicParams, + AssetRuntimeConfig, + CommunityCurrencyTipExtrinsicParams, >; pub type Api = substrate_api_client::Api; -pub type ParentchainExtrinsicSigner = ExtrinsicSigner; +pub type ParentchainExtrinsicSigner = ExtrinsicSigner; pub type ExtrinsicAddress = ::Address; pub use ceremonies::*; diff --git a/client/encointer-api-client-extension/src/scheduler.rs b/client/encointer-api-client-extension/src/scheduler.rs index 310337ae..442c443e 100644 --- a/client/encointer-api-client-extension/src/scheduler.rs +++ b/client/encointer-api-client-extension/src/scheduler.rs @@ -2,36 +2,42 @@ use crate::{Api, Moment, Result}; use encointer_primitives::scheduler::CeremonyPhaseType; use substrate_api_client::{api::error::Error as ApiClientError, GetStorage}; +#[maybe_async::maybe_async(?Send)] pub trait SchedulerApi { - fn get_current_phase(&self) -> Result; - fn get_next_phase_timestamp(&self) -> Result; - fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result; - fn get_start_of_attesting_phase(&self) -> Result; + async fn get_current_phase(&self) -> Result; + async fn get_next_phase_timestamp(&self) -> Result; + async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result; + async fn get_start_of_attesting_phase(&self) -> Result; } +#[maybe_async::maybe_async(?Send)] impl SchedulerApi for Api { - fn get_current_phase(&self) -> Result { - self.get_storage("EncointerScheduler", "CurrentPhase", None)? + async fn get_current_phase(&self) -> Result { + self.get_storage("EncointerScheduler", "CurrentPhase", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get CurrentPhase".into())) } - fn get_next_phase_timestamp(&self) -> Result { - self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None)? + async fn get_next_phase_timestamp(&self) -> Result { + self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get NextPhaseTimestamp".into())) } - fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { - self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None)? + async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { + self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get PhaseDuration".into())) } - fn get_start_of_attesting_phase(&self) -> Result { - let next_phase_timestamp = self.get_next_phase_timestamp()?; + async fn get_start_of_attesting_phase(&self) -> Result { + let next_phase_timestamp = self.get_next_phase_timestamp().await?; - match self.get_current_phase()? { + match self.get_current_phase().await? { CeremonyPhaseType::Assigning => Ok(next_phase_timestamp), // - next_phase_timestamp.rem(ONE_DAY), CeremonyPhaseType::Attesting => { self.get_phase_duration(CeremonyPhaseType::Attesting) + .await .map(|dur| next_phase_timestamp - dur) //- next_phase_timestamp.rem(ONE_DAY) }, CeremonyPhaseType::Registering => Err(ApiClientError::Other( diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs new file mode 100644 index 00000000..c4568fa7 --- /dev/null +++ b/client/src/commands/encointer_bazaar.rs @@ -0,0 +1,158 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + utils::{ + ensure_payment, get_chain_api, + keys::{get_accountid_from_str, get_pair_from_str}, + }, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{Api, EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::AccountId; +use encointer_primitives::{ + bazaar::{Business, BusinessIdentifier, OfferingData}, + communities::CommunityIdentifier, +}; +use parity_scale_codec::Encode; +use sp_core::{sr25519 as sr25519_core, Pair}; +use substrate_api_client::{ + ac_compose_macros::{compose_extrinsic, rpc_params}, + rpc::Request, + SubmitAndWatch, XtStatus, +}; + +pub fn create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn update_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn create_offering(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn list_businesses(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let businesses = get_businesses(&api, cid).await.unwrap(); + // only print plain businesses to be able to parse them in python scripts + println!("{businesses:?}"); + Ok(()) + }) + .into() +} +pub fn list_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings(&api, cid).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} + +pub fn list_business_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let account = matches.account_arg().map(get_accountid_from_str).unwrap(); + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings_for_business(&api, cid, account).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} + +#[derive(Clone, Copy, PartialEq, Eq)] +enum BazaarCalls { + CreateBusiness, + UpdateBusiness, + CreateOffering, +} + +impl ToString for BazaarCalls { + fn to_string(&self) -> String { + match self { + BazaarCalls::CreateBusiness => "create_business".to_string(), + BazaarCalls::UpdateBusiness => "update_business".to_string(), + BazaarCalls::CreateOffering => "create_offering".to_string(), + } + } +} + +async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { + let business_owner = matches.account_arg().map(get_pair_from_str).unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( + business_owner.clone(), + ))); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + println!( + "{} for {}. xt-status: '{:?}'", + bazaar_call.to_string(), + business_owner.public(), + report.status + ); + Ok(()) +} +async fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { + api.client() + .request("encointer_bazaarGetBusinesses", rpc_params![cid]) + .await + .expect("Could not find any businesses...") +} + +async fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { + api.client() + .request("encointer_bazaarGetOfferings", rpc_params![cid]) + .await + .expect("Could not find any business offerings...") +} + +async fn get_offerings_for_business( + api: &Api, + cid: CommunityIdentifier, + account_id: AccountId, +) -> Option> { + let b_id = BusinessIdentifier::new(cid, account_id); + api.client() + .request("encointer_bazaarGetOfferingsForBusiness", rpc_params![b_id]) + .await + .expect("Could not find any business offerings...") +} diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs new file mode 100644 index 00000000..749f54f9 --- /dev/null +++ b/client/src/commands/encointer_ceremonies.rs @@ -0,0 +1,923 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{ + encointer_communities::get_cid_names, + encointer_core::{set_api_extrisic_params_builder, verify_cid}, + encointer_scheduler::get_ceremony_index, + }, + exit_code, + utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_chain_api, + get_councillors, into_effective_cindex, + keys::{get_accountid_from_str, get_pair_from_str}, + print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + }, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{ + Api, ApiClientError, CeremoniesApi, EncointerXt, ParentchainExtrinsicSigner, SchedulerApi, + ENCOINTER_CEREMONIES, +}; +use encointer_node_notee_runtime::{AccountId, Hash, Moment, Signature, ONE_DAY}; +use encointer_primitives::{ + ceremonies::{ + CeremonyIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, + MeetupIndexType, ParticipantIndexType, ProofOfAttendance, Reputation, + ReputationLifetimeType, + }, + communities::CommunityIdentifier, + scheduler::CeremonyPhaseType, +}; +use log::{debug, error, info}; +use parity_scale_codec::{Decode, Encode}; +use sp_application_crypto::sr25519; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; +use sp_keyring::AccountKeyring; +use sp_runtime::MultiSignature; +use std::collections::HashMap; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}, + ac_primitives::{Bytes, SignExtrinsic}, + rpc::Request, + GetStorage, SubmitAndWatch, XtStatus, +}; + +pub fn list_participants(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + println!("listing participants for cid {cid} and ceremony nr {cindex}"); + + let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; + + let registries = + vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; + + let mut num_participants: Vec = vec![0, 0, 0, 0]; + for i in 0..registries.len() { + println!("Querying {}", registries[i]); + + let count: ParticipantIndexType = api + .get_storage_map(ENCOINTER_CEREMONIES, counts[i], (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0); + println!("number of participants assigned: {count}"); + num_participants[i] = count; + for p_index in 1..count + 1 { + let accountid: AccountId = api + .get_storage_double_map( + ENCOINTER_CEREMONIES, + registries[i], + (cid, cindex), + p_index, + None, + ) + .await + .unwrap() + .unwrap(); + println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); + } + } + println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", + num_participants[0..=2].iter().sum::(), + num_participants[3], + num_participants[0..=3].iter().sum::() + ); + Ok(()) + }) + .into() +} +pub fn list_meetups(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + println!("listing meetups for cid {cid} and ceremony nr {cindex}"); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + let mut num_assignees = 0u64; + + for meetup in stats.meetups.iter() { + println!( + "MeetupRegistry[{:?}, {}] location is {:?}, {:?}", + &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon + ); + + println!( + "MeetupRegistry[{:?}, {}] meeting time is {:?}", + &community_ceremony, meetup.index, meetup.time + ); + + if !meetup.registrations.is_empty() { + let num = meetup.registrations.len(); + num_assignees += num as u64; + println!( + "MeetupRegistry[{:?}, {}] participants: {}", + &community_ceremony, meetup.index, num + ); + for (participant, _registration) in meetup.registrations.iter() { + println!(" {participant}"); + } + } else { + println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); + } + } + println!("total number of assignees: {num_assignees}"); + Ok(()) + }) + .into() +} + +pub fn print_ceremony_stats(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +pub fn list_attestees(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +pub fn list_reputables(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + + let is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let lifetime = get_reputation_lifetime(&api, at_block).await; + let current_ceremony_index = get_ceremony_index(&api, at_block).await; + + + let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); + let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); + + let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); + + let mut reputables_csv = Vec::new(); + + println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); + for community_id in community_ids { + println!("Community ID: {community_id:?}"); + let mut reputables: HashMap = HashMap::new(); + for ceremony_index in &ceremony_indices { + let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; + println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); + for attendee in attendees { + reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); + *reputables.entry(attendee.clone()).or_insert(0) += 1; + } + } + println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); + } + if is_verbose { + for reputable in reputables_csv { + println!("{reputable}"); + } + } + Ok(()) + + }) + .into() +} +pub fn upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut reputation_cindex = cindex; + if current_phase == CeremonyPhaseType::Registering { + reputation_cindex -= 1; + } + let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::VerifiedUnlinked => + prove_attendance(accountid, cid, reputation_cindex, arg_who), + _ => { + error!("No valid reputation in last ceremony."); + std::process::exit(exit_code::INVALID_REPUTATION); + }, + }; + + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "upgrade_registration", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let rep = get_reputation(&api, &accountid, cid, cindex - 1).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::Unverified => None, + Reputation::UnverifiedReputable => None, // this should never be the case during Registering! + Reputation::VerifiedUnlinked => + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), + Reputation::VerifiedLinked(_) => + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), + }; + debug!("proof: {:x?}", proof.encode()); + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "register_participant", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cc = match matches.ceremony_index_arg() { + Some(cindex_arg) => { + let current_ceremony_index = get_ceremony_index(&api, None).await; + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + Some((cid, cindex)) + }, + None => None, + }; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for unregistering"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "unregister_participant", cid, cc) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // Send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn endorse(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + endorse_newcomers(&mut api, cid, matches).await.unwrap(); + + Ok(()) + }) + .into() +} +pub fn bootstrappers_with_remaining_newbie_tickets( + _args: &str, + matches: &ArgMatches<'_>, +) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let bs_with_tickets: Vec = + get_bootstrappers_with_remaining_newbie_tickets(&api, cid).await.unwrap(); + + info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); + + // transform it to simple tuples, which is easier to parse in python + let bt_vec = bs_with_tickets + .into_iter() + .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)) + .collect::>(); + + println!("{bt_vec:?}"); + Ok(()) + }) + .into() +} +pub fn get_proof_of_attendance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let api = get_chain_api(matches).await; + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + debug!("Getting proof for ceremony index: {:?}", cindex); + let proof = prove_attendance(accountid, cid, cindex, arg_who); + info!("Proof: {:?}\n", &proof); + println!("0x{}", hex::encode(proof.encode())); + + Ok(()) + }) + .into() +} +pub fn attest_attendees(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + + let attestees: Vec<_> = matches + .attestees_arg() + .unwrap() + .into_iter() + .map(get_accountid_from_str) + .collect(); + + let vote = attestees.len() as u32 + 1u32; + + debug!("attestees: {:?}", attestees); + + info!("send attest_attendees by {}", who.public()); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerCeremonies", + "attest_attendees", + cid, + vote, + attestees + ) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); + Ok(()) + }) + .into() +} +pub fn new_claim(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let arg_who = matches.account_arg().unwrap(); + let claimant = get_pair_from_str(arg_who); + + let n_participants = matches.value_of("vote").unwrap().parse::().unwrap(); + + let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; + + println!("{}", hex::encode(claim)); + + Ok(()) + }) + .into() +} +pub fn claim_reward(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => panic!("please specify --signer."), + }; + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer.clone()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let meetup_index_arg = matches.meetup_index_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + if matches.all_flag() { + let mut cindex = get_ceremony_index(&api, None).await; + if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { + cindex -= 1; + } + let meetup_count = api + .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0u64); + let calls: Vec<_> = (1u64..=meetup_count) + .map(|idx| { + compose_call!( + api.metadata(), + ENCOINTER_CEREMONIES, + "claim_rewards", + cid, + Option::::Some(idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg).await; + println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); + } else { + let meetup_index = meetup_index_arg; + let xt: EncointerXt<_> = + compose_extrinsic!(api, ENCOINTER_CEREMONIES, "claim_rewards", cid, meetup_index) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + match meetup_index_arg { + Some(idx) => { + println!( + "Claiming reward for meetup_index {idx}. xt-status: '{:?}'", + report.status + ); + }, + None => { + println!( + "Claiming reward for {}. xt-status: 'ready'", + signer.public_account_id() + ); + }, + } + } + Ok(()) + }) + .into() +} +pub fn reputation(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let account = matches.account_arg().unwrap(); + let account_id = get_accountid_from_str(account); + if let Some(reputation) = get_reputation_history(&api, &account_id).await { + for rep in reputation.iter() { + println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); + } + } else { + error!("could not fetch reputation over rpc"); + std::process::exit(exit_code::RPC_ERROR); + } + Ok(()) + }) + .into() +} + +pub fn set_meetup_time_offset(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); + api.set_signer(signer); + let time_offset = matches.time_offset_arg().unwrap_or(0); + let call = compose_call!( + api.metadata(), + "EncointerCeremonies", + "set_meetup_time_offset", + time_offset + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let privileged_call = if contains_sudo_pallet(api.metadata()) { + let sudo_call = sudo_call(api.metadata(), call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(...)", &sudo_call); + OpaqueCall::from_tuple(&sudo_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_call = collective_propose_call(api.metadata(), threshold, call); + print_raw_call("collective_propose(...)", &propose_call); + OpaqueCall::from_tuple(&propose_call) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt = xt(&api, privileged_call).await; + send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg).await; + Ok(()) + }) + .into() +} + +pub fn purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let sudoer = AccountKeyring::Alice.pair(); + let signer = ParentchainExtrinsicSigner::new(sudoer); + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); + let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); + + let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); + let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); + + if from_cindex > to_cindex { + panic!("'from' <= 'to' ceremony index violated"); + } + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); + + let calls: Vec<_> = (from_cindex..=to_cindex) + .map(|idx| { + compose_call!( + api.metadata(), + "EncointerCeremonies", + "purge_community_ceremony", + (cid, idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + let unsigned_sudo_call = + compose_call!(api.metadata(), "Sudo", "sudo", batch_call.clone()).unwrap(); + info!( + "raw sudo batch call to sign with js/apps {}: 0x{}", + cid, + hex::encode(unsigned_sudo_call.encode()) + ); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt: EncointerXt<_> = compose_extrinsic!(api, "Sudo", "sudo", batch_call).unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); + info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); + Ok(()) + }) + .into() +} + +fn prove_attendance( + prover: AccountId, + cid: CommunityIdentifier, + cindex: CeremonyIndexType, + attendee_str: &str, +) -> ProofOfAttendance { + let msg = (prover.clone(), cindex); + let attendee = get_pair_from_str(attendee_str); + let attendeeid = get_accountid_from_str(attendee_str); + debug!("generating proof of attendance for {} and cindex: {}", prover, cindex); + debug!("signature payload is {:x?}", msg.encode()); + ProofOfAttendance { + prover_public: prover, + community_identifier: cid, + ceremony_index: cindex, + attendee_public: attendeeid, + attendee_signature: Signature::from(sr25519_core::Signature::from( + attendee.sign(&msg.encode()), + )), + } +} + +async fn get_reputation( + api: &Api, + prover: &AccountId, + cid: CommunityIdentifier, + cindex: CeremonyIndexType, +) -> Reputation { + api.get_storage_double_map( + "EncointerCeremonies", + "ParticipantReputation", + (cid, cindex), + prover.clone(), + None, + ) + .await + .unwrap() + .unwrap_or(Reputation::Unverified) +} + +async fn get_reputation_history( + api: &Api, + account_id: &AccountId, +) -> Option> { + api.client() + .request("encointer_getReputations", rpc_params![account_id]) + .await + .expect("Could not query reputation history...") +} + +async fn get_attendees_for_community_ceremony( + api: &Api, + community_ceremony: CommunityCeremony, + at_block: Option, +) -> (Vec, Vec) { + let key_prefix = api + .get_storage_double_map_key_prefix( + "EncointerCeremonies", + "ParticipantReputation", + community_ceremony, + ) + .await + .unwrap(); + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + let mut attendees = Vec::new(); + let mut noshows = Vec::new(); + for storage_key in storage_keys.iter() { + match api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap() { + Reputation::VerifiedUnlinked | Reputation::VerifiedLinked(_) => { + let key_postfix = storage_key.as_ref(); + attendees.push( + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), + ); + }, + Reputation::UnverifiedReputable | Reputation::Unverified => { + let key_postfix = storage_key.as_ref(); + noshows.push( + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), + ); + }, + } + } + (attendees, noshows) +} + +async fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { + api.get_storage("EncointerCeremonies", "ReputationLifetime", at_block) + .await + .unwrap() + .unwrap_or(5) +} + +async fn new_claim_for( + api: &Api, + claimant: &sr25519::Pair, + cid: CommunityIdentifier, + n_participants: u32, +) -> Vec { + let cindex = get_ceremony_index(api, None).await; + let mindex = api + .get_meetup_index(&(cid, cindex), &claimant.public().into()) + .await + .unwrap() + .expect("participant must be assigned to meetup to generate a claim"); + + // implicitly assume that participant meet at the right place at the right time + let mloc = api.get_meetup_location(&(cid, cindex), mindex).await.unwrap().unwrap(); + let mtime = api.get_meetup_time(mloc, ONE_DAY).await.unwrap(); + + info!( + "creating claim for {} at loc {} (lat: {} lon: {}) at time {}, cindex {}", + claimant.public().to_ss58check(), + mindex, + mloc.lat, + mloc.lon, + mtime, + cindex + ); + let claim: ClaimOfAttendance = + ClaimOfAttendance::new_unsigned( + claimant.public().into(), + cindex, + cid, + mindex, + mloc, + mtime, + n_participants, + ) + .sign(claimant); + claim.encode() +} + +async fn endorse_newcomers( + api: &mut Api, + cid: CommunityIdentifier, + matches: &ArgMatches<'_>, +) -> Result<(), ApiClientError> { + let bootstrapper = matches.bootstrapper_arg().map(get_pair_from_str).unwrap(); + let endorsees = matches.endorsees_arg().expect("Please supply at least one endorsee"); + + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(bootstrapper))); + + let mut nonce = api.get_nonce().await?; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(api, tx_payment_cid_arg).await; + + for e in endorsees.into_iter() { + let endorsee = get_accountid_from_str(e); + + let call = + compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee) + .unwrap(); + + let encoded_xt: Bytes = api.compose_extrinsic_offline(call, nonce).encode().into(); + ensure_payment(api, &encoded_xt, tx_payment_cid_arg).await; + let _tx_report = api + .submit_and_watch_opaque_extrinsic_until(&encoded_xt, XtStatus::Ready) + .await + .unwrap(); + + nonce += 1; + } + + Ok(()) +} + +/// Helper type, which is only needed to print the information nicely. +#[derive(Debug)] +struct BootstrapperWithTickets { + bootstrapper: AccountId, + remaining_newbie_tickets: u8, +} + +async fn get_bootstrappers_with_remaining_newbie_tickets( + api: &Api, + cid: CommunityIdentifier, +) -> Result, ApiClientError> { + let total_newbie_tickets: u8 = api + .get_storage("EncointerCeremonies", "EndorsementTicketsPerBootstrapper", None) + .await + .unwrap() + .unwrap(); + + // prepare closure to make below call more readable. + let ticket_query = |bs| async move { + let remaining_tickets = total_newbie_tickets - + api.get_storage_double_map( + "EncointerCeremonies", + "BurnedBootstrapperNewbieTickets", + cid, + bs, + None, + ) + .await? + .unwrap_or(0u8); + + Ok::<_, ApiClientError>(remaining_tickets) + }; + + let bootstrappers: Vec = api + .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None) + .await? + .expect("No bootstrappers found, does the community exist?"); + + let mut bs_with_tickets: Vec = Vec::with_capacity(bootstrappers.len()); + + for bs in bootstrappers.into_iter() { + bs_with_tickets.push(BootstrapperWithTickets { + bootstrapper: bs.clone(), + remaining_newbie_tickets: ticket_query(bs).await?, + }); + } + + Ok(bs_with_tickets) +} diff --git a/client/src/commands/encointer_communities.rs b/client/src/commands/encointer_communities.rs new file mode 100644 index 00000000..ccf3b84e --- /dev/null +++ b/client/src/commands/encointer_communities.rs @@ -0,0 +1,216 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + community_spec::{ + add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, + CommunitySpec, + }, + exit_code, + utils::{ + batch_call, collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, + keys::get_pair_from_str, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, + OpaqueCall, + }, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{ + Api, CommunitiesApi, ParentchainExtrinsicSigner, SchedulerApi, +}; +use encointer_node_notee_runtime::Hash; +use encointer_primitives::{ + communities::{CidName, CommunityIdentifier}, + scheduler::CeremonyPhaseType, +}; +use log::{error, info}; +use parity_scale_codec::{Decode, Encode}; +use sp_application_crypto::Ss58Codec; +use sp_core::Pair; +use sp_keyring::AccountKeyring; +use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request, GetStorage}; + +pub fn new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + let cid = spec.community_identifier(); + + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + let signer = ParentchainExtrinsicSigner::new(signer); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + + // ------- create calls for xt's + let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); + // only the first meetup location has been registered now. register all others one-by-one + let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); + let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); + + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { + let sudo_new_community = sudo_call(api.metadata(), new_community_call); + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(new_community)", &sudo_new_community); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + + (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) + + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); + print_raw_call("collective_propose(new_community)", &propose_new_community); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + + (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) + }; + } + + // ---- send xt's to chain + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()).await; + println!("{cid}"); + + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg).await; + Ok(()) + + }) + .into() +} +pub fn add_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + + let mut api = get_chain_api(matches).await; + if !matches.dryrun_flag() { + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + info!("signer ss58 is {}", signer.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + } + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + + let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; + + let add_location_calls: Vec= spec.locations().into_iter().map(|l| + { + info!("adding location {:?}", l); + add_location_call(api.metadata(), cid, l) + } + ).collect(); + + let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { + [call] => OpaqueCall::from_tuple(call), + _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) + }; + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + OpaqueCall::from_tuple(&sudo_add_location_batch) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + OpaqueCall::from_tuple(&propose_add_location_batch) + }; + } + + if matches.dryrun_flag() { + println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); + } else { + // ---- send xt's to chain + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg).await; + } + Ok(()) + + }) + .into() +} +pub fn list_communities(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let names = get_cid_names(&api).await.unwrap(); + println!("number of communities: {}", names.len()); + for n in names.iter() { + let loc = api.get_locations(n.cid).await.unwrap(); + println!( + "{}: {} locations: {}", + n.cid, + String::from_utf8(n.name.to_vec()).unwrap(), + loc.len() + ); + } + Ok(()) + }) + .into() +} +pub fn list_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let maybe_at = matches.at_block_arg(); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), maybe_at) + .await; + println!("listing locations for cid {cid}"); + let loc = api.get_locations(cid).await.unwrap(); + for l in loc.iter() { + println!( + "lat: {} lon: {} (raw lat: {} lon: {})", + l.lat, + l.lon, + i128::decode(&mut l.lat.encode().as_slice()).unwrap(), + i128::decode(&mut l.lon.encode().as_slice()).unwrap() + ); + } + Ok(()) + }) + .into() +} + +pub async fn get_community_identifiers( + api: &Api, + maybe_at: Option, +) -> Option> { + api.get_storage("EncointerCommunities", "CommunityIdentifiers", maybe_at) + .await + .unwrap() +} + +/// This rpc needs to have offchain indexing enabled in the node. +pub async fn get_cid_names(api: &Api) -> Option> { + api.client().request("encointer_getAllCommunities", rpc_params![]).await.expect( + "No communities returned. Are you running the node with `--enable-offchain-indexing true`?", + ) +} diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs new file mode 100644 index 00000000..594bcf6c --- /dev/null +++ b/client/src/commands/encointer_core.rs @@ -0,0 +1,416 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{encointer_communities::get_community_identifiers, frame::get_block_number}, + exit_code, + utils::{ + ensure_payment, get_chain_api, + keys::{get_accountid_from_str, get_pair_from_str}, + }, +}; +use clap::{value_t, ArgMatches}; +use encointer_api_client_extension::{ + Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, + ParentchainExtrinsicSigner, +}; +use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash, RuntimeEvent}; +use encointer_primitives::balances::{to_U64F64, BalanceEntry, BalanceType, Demurrage}; + +use encointer_primitives::{communities::CommunityIdentifier, fixed::transcendental::exp}; +use log::{debug, error, info}; +use pallet_transaction_payment::FeeDetails; +use parity_scale_codec::Encode; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; + +use sp_rpc::number::NumberOrHex; +use std::str::FromStr; +use substrate_api_client::{ + ac_compose_macros::{compose_extrinsic, rpc_params}, + ac_primitives::Bytes, + extrinsic::BalancesExtrinsics, + rpc::Request, + GetAccountInformation, GetStorage, SubmitAndWatch, SubscribeEvents, XtStatus, +}; + +pub fn balance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let account = matches.account_arg().unwrap(); + let maybe_at = matches.at_block_arg(); + let accountid = get_accountid_from_str(account); + match matches.cid_arg() { + Some(cid_str) => { + let balance = get_community_balance(&api, cid_str, &accountid, maybe_at).await; + println! {"{balance:?}"}; + }, + None => { + if matches.all_flag() { + let community_balances = get_all_balances(&api, &accountid).await.unwrap(); + let bn = get_block_number(&api, maybe_at).await; + for b in community_balances.iter() { + let dr = get_demurrage_per_block(&api, b.0).await; + println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) + } + } + let balance = if let Some(data) = api.get_account_data(&accountid).await.unwrap() { + data.free + } else { + 0 + }; + println!("{balance}"); + }, + }; + Ok(()) + }) + .into() +} +pub fn issuance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let maybe_at = matches.at_block_arg(); + let cid_str = matches.cid_arg().expect("please supply argument --cid"); + let issuance = get_community_issuance(&api, cid_str, maybe_at).await; + println! {"{issuance:?}"}; + Ok(()) + }) + .into() +} +pub fn transfer(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + if !matches.dryrun_flag() { + let from = get_pair_from_str(arg_from); + info!("from ss58 is {}", from.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + } + let to = get_accountid_from_str(arg_to); + info!("to ss58 is {}", to.to_ss58check()); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) + .expect("amount can be converted to fixpoint"); + + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerBalances", + "transfer", + to.clone(), + cid, + amount + ) + .unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + None => { + let amount = matches + .value_of("amount") + .unwrap() + .parse::() + .expect("amount can be converted to u128"); + // todo: use keep_alive instead https://github.com/scs/substrate-api-client/issues/747 + let xt = api.balance_transfer_allow_death(to.clone().into(), amount).await.unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + }; + if let Some(txh) = tx_hash { + info!("[+] Transaction included. Hash: {:?}\n", txh); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + } + Ok(()) + }) + .into() +} +pub fn transfer_all(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + let from = get_pair_from_str(arg_from); + let to = get_accountid_from_str(arg_to); + info!("from ss58 is {}", from.public().to_ss58check()); + info!("to ss58 is {}", to.to_ss58check()); + + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerBalances", "transfer_all", to.clone(), cid) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() + }, + None => { + error!("No cid specified"); + std::process::exit(exit_code::NO_CID_SPECIFIED); + }, + }; + info!("[+] Transaction included. Hash: {:?}\n", tx_hash); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + Ok(()) + }) + .into() +} +pub fn listen_to_events(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + listen(matches).await; + Ok(()) + }) + .into() +} + +pub async fn get_community_balance( + api: &Api, + cid_str: &str, + account_id: &AccountId, + maybe_at: Option, +) -> BalanceType { + let cid = verify_cid(api, cid_str, maybe_at).await; + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; + + if let Some(entry) = api + .get_storage_double_map("EncointerBalances", "Balance", cid, account_id, maybe_at) + .await + .unwrap() + { + apply_demurrage(entry, bn, dr) + } else { + BalanceType::from_num(0) + } +} + +pub async fn get_community_issuance( + api: &Api, + cid_str: &str, + maybe_at: Option, +) -> BalanceType { + let cid = verify_cid(api, cid_str, maybe_at).await; + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; + + if let Some(entry) = api + .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) + .await + .unwrap() + { + apply_demurrage(entry, bn, dr) + } else { + BalanceType::from_num(0) + } +} + +async fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { + let d: Option = api + .get_storage_map("EncointerBalances", "DemurragePerBlock", cid, None) + .await + .unwrap(); + + match d { + Some(d) => { + debug!("Fetched community specific demurrage per block {:?}", &d); + d + }, + None => { + let d = api.get_constant("EncointerBalances", "DefaultDemurrage").await.unwrap(); + debug!("Fetched default demurrage per block {:?}", d); + d + }, + } +} + +async fn get_all_balances( + api: &Api, + account_id: &AccountId, +) -> Option)>> { + api.client() + .request("encointer_getAllBalances", rpc_params![account_id]) + .await + .expect("Could not query all balances...") +} + +pub async fn get_asset_fee_details( + api: &Api, + cid_str: &str, + encoded_xt: &Bytes, +) -> Option> { + let cid = verify_cid(api, cid_str, None).await; + + api.client() + .request("encointer_queryAssetFeeDetails", rpc_params![cid, encoded_xt]) + .await + .expect("Could not query asset fee details") +} +pub fn apply_demurrage( + entry: BalanceEntry, + current_block: BlockNumber, + demurrage_per_block: Demurrage, +) -> BalanceType { + let elapsed_time_block_number = current_block.checked_sub(entry.last_update).unwrap(); + let elapsed_time_u32: u32 = elapsed_time_block_number; + let elapsed_time = Demurrage::from_num(elapsed_time_u32); + let exponent = -demurrage_per_block * elapsed_time; + debug!( + "demurrage per block {}, current_block {}, last {}, elapsed_blocks {}", + demurrage_per_block, current_block, entry.last_update, elapsed_time + ); + let exp_result = exp(exponent).unwrap(); + entry.principal.checked_mul(to_U64F64(exp_result).unwrap()).unwrap() +} + +pub async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { + let cids = get_community_identifiers(api, maybe_at).await.expect("no community registered"); + let cid = CommunityIdentifier::from_str(cid).unwrap(); + if !cids.contains(&cid) { + panic!("cid {cid} does not exist on chain"); + } + cid +} + +async fn listen(matches: &ArgMatches<'_>) { + let api = get_chain_api(matches).await; + debug!("Subscribing to events"); + let mut subscription = api.subscribe_events().await.unwrap(); + let mut count = 0u32; + let mut blocks = 0u32; + loop { + if matches.is_present("events") && + count >= value_t!(matches.value_of("events"), u32).unwrap() + { + return + }; + if matches.is_present("blocks") && + blocks > value_t!(matches.value_of("blocks"), u32).unwrap() + { + return + }; + let event_results = subscription.next_events::().await.unwrap(); + blocks += 1; + match event_results { + Ok(evts) => + for evr in evts { + debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); + match &evr.event { + RuntimeEvent::EncointerCeremonies(ee) => { + count += 1; + info!(">>>>>>>>>> ceremony event: {:?}", ee); + match &ee { + pallet_encointer_ceremonies::Event::ParticipantRegistered( + cid, + participant_type, + accountid, + ) => { + println!( + "Participant registered as {participant_type:?}, for cid: {cid:?}, account: {accountid}, " + ); + }, + _ => println!("Unsupported EncointerCommunities event"), + } + }, + RuntimeEvent::EncointerScheduler(ee) => { + count += 1; + info!(">>>>>>>>>> scheduler event: {:?}", ee); + match &ee { + pallet_encointer_scheduler::Event::PhaseChangedTo(phase) => { + println!("Phase changed to: {phase:?}"); + }, + pallet_encointer_scheduler::Event::CeremonySchedulePushedByOneDay => { + println!("Ceremony schedule was pushed by one day"); + }, + } + }, + RuntimeEvent::EncointerCommunities(ee) => { + count += 1; + info!(">>>>>>>>>> community event: {:?}", ee); + match &ee { + pallet_encointer_communities::Event::CommunityRegistered(cid) => { + println!("Community registered: cid: {cid:?}"); + }, + pallet_encointer_communities::Event::MetadataUpdated(cid) => { + println!("Community metadata updated cid: {cid:?}"); + }, + pallet_encointer_communities::Event::NominalIncomeUpdated( + cid, + income, + ) => { + println!( + "Community metadata updated cid: {cid:?}, value: {income:?}" + ); + }, + pallet_encointer_communities::Event::DemurrageUpdated( + cid, + demurrage, + ) => { + println!( + "Community metadata updated cid: {cid:?}, value: {demurrage:?}" + ); + }, + _ => println!("Unsupported EncointerCommunities event"), + } + }, + RuntimeEvent::EncointerBalances(ee) => { + count += 1; + println!(">>>>>>>>>> encointer balances event: {ee:?}"); + }, + RuntimeEvent::EncointerBazaar(ee) => { + count += 1; + println!(">>>>>>>>>> encointer bazaar event: {ee:?}"); + }, + RuntimeEvent::System(ee) => match ee { + frame_system::Event::ExtrinsicFailed { + dispatch_error: _, + dispatch_info: _, + } => { + error!("ExtrinsicFailed: {ee:?}"); + }, + frame_system::Event::ExtrinsicSuccess { dispatch_info } => { + println!("ExtrinsicSuccess: {dispatch_info:?}"); + }, + _ => debug!("ignoring unsupported system Event"), + }, + _ => debug!("ignoring unsupported module event: {:?}", evr.event), + } + }, + Err(_) => error!("couldn't decode event record list"), + } + } +} + +pub async fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { + let mut tx_params = CommunityCurrencyTipExtrinsicParamsBuilder::new().tip(0); + if let Some(tx_payment_cid) = tx_payment_cid_arg { + tx_params = tx_params.tip( + CommunityCurrencyTip::new(0).of_community(verify_cid(api, tx_payment_cid, None).await), + ); + } + let _ = &api.set_additional_params(tx_params); +} diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs new file mode 100644 index 00000000..d5fa1949 --- /dev/null +++ b/client/src/commands/encointer_democracy.rs @@ -0,0 +1,152 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, +}; + +use crate::utils::{ensure_payment, get_chain_api, keys::get_pair_from_str}; +use clap::ArgMatches; +use encointer_api_client_extension::{EncointerXt, Moment, ParentchainExtrinsicSigner}; +use encointer_primitives::{ + ceremonies::{CeremonyIndexType, CommunityCeremony}, + democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, +}; +use log::error; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{sr25519 as sr25519_core, ConstU32}; +use substrate_api_client::{ + ac_compose_macros::compose_extrinsic, GetStorage, SubmitAndWatch, XtStatus, +}; + +pub fn submit_set_inactivity_timeout_proposal( + _args: &str, + matches: &ArgMatches<'_>, +) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + let inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerDemocracy", + "submit_proposal", + ProposalAction::SetInactivityTimeout(inactivity_timeout) + ) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let _result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + println!("Proposal Submitted: Set inactivity timeout to {inactivity_timeout:?}"); + Ok(()) + }) + .into() +} +pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + let at_block = matches.at_block_arg(); + let key_prefix = + api.get_storage_map_key_prefix("EncointerDemocracy", "Proposals").await.unwrap(); + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + for storage_key in storage_keys.iter() { + let key_postfix = storage_key.as_ref(); + let proposal_id = + ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref()) + .unwrap(); + println!("id: {}", proposal_id); + let proposal: Proposal = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + println!("action: {:?}", proposal.action); + println!("start block: {}", proposal.start); + println!("start cindex: {}", proposal.start_cindex); + println!("state: {:?}", proposal.state); + println!(""); + } + Ok(()) + }) + .into() +} +pub fn vote(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + let proposal_id = matches.proposal_id_arg().unwrap(); + let vote_raw = matches.vote_arg().unwrap(); + let vote = match vote_raw { + "aye" => Vote::Aye, + "nay" => Vote::Nay, + &_ => panic!("invalid vote"), + }; + let reputation_vec: Vec = futures::future::join_all( + matches + .reputation_vec_arg() + .ok_or(clap::Error::with_description( + "missing reputation-vec argument", + clap::ErrorKind::MissingRequiredArgument, + ))? + .into_iter() + .map(|rep| { + let api_local = api.clone(); + async move { + let cc: Vec<_> = rep.split("_").collect(); + ( + verify_cid(&api_local, cc[0], None).await, + cc[1].parse::().unwrap(), + ) + } + }), + ) + .await; + let reputation_bvec = ReputationVec::>::try_from(reputation_vec).unwrap(); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerDemocracy", + "vote", + proposal_id, + vote, + reputation_bvec + ) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let _result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + println!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); + Ok(()) + }) + .into() +} + +pub fn update_proposal_state(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + let proposal_id = matches.proposal_id_arg().unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerDemocracy", "update_proposal_state", proposal_id) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let _result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + println!("Proposal state updated for proposal {proposal_id:?}"); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs new file mode 100644 index 00000000..bdd93456 --- /dev/null +++ b/client/src/commands/encointer_faucet.rs @@ -0,0 +1,310 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_chain_api, + get_councillors, + keys::{get_accountid_from_str, get_pair_from_str}, + print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + }, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::{AccountId, Balance}; +use encointer_primitives::faucet::{Faucet, FaucetNameType, FromStr, WhiteListType}; +use log::{error, info}; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; +use sp_keyring::AccountKeyring; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic}, + GetAccountInformation, GetStorage, SubmitAndWatch, XtStatus, +}; + +pub fn create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + + let faucet_name_raw = matches.faucet_name_arg().unwrap(); + let faucet_balance = matches.faucet_balance_arg().unwrap(); + let drip_amount = matches.faucet_drip_amount_arg().unwrap(); + + let api2 = api.clone(); + let whitelist = if let Some(wl) = matches.whitelist_arg() { + let whitelist_vec: Vec<_> = futures::future::join_all(wl.into_iter().map(|c| { + let api_local = api2.clone(); + async move { verify_cid(&api_local, c, None).await } + })) + .await; + Some(WhiteListType::try_from(whitelist_vec).unwrap()) + } else { + None + }; + + let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerFaucet", + "create_faucet", + faucet_name, + faucet_balance, + whitelist, + drip_amount + ) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + + let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + + match result { + Ok(report) => + for event in report.events.unwrap().iter() { + if event.pallet_name() == "EncointerFaucet" && + event.variant_name() == "FaucetCreated" + { + println!( + "{}", + AccountId::decode(&mut event.field_bytes()[0..32].as_ref()) + .unwrap() + .to_ss58check() + ); + } + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +pub fn drip_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cindex = matches.cindex_arg().unwrap(); + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerFaucet", "drip", faucet_account, cid, cindex) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + + let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + + match result { + Ok(_report) => { + println!("Faucet dripped to {}", who.public()); + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +pub fn dissolve_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let dissolve_faucet_call = compose_call!( + api.metadata(), + "EncointerFaucet", + "dissolve_faucet", + faucet_account.clone(), + beneficiary + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { + let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); + + OpaqueCall::from_tuple(&dissolve_faucet_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_dissolve_faucet = + collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); + print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); + + OpaqueCall::from_tuple(&propose_dissolve_faucet) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg) + .await; + + println!("Faucet dissolved: {faucet_account:?}"); + Ok(()) + }) + .into() +} +pub fn close_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who))); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerFaucet", "close_faucet", faucet_account.clone()) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); + Ok(()) + }) + .into() +} +pub fn set_faucet_reserve_amount(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let set_reserve_amount_call = + compose_call!(api.metadata(), "EncointerFaucet", "set_reserve_amount", reserve_amount) + .unwrap(); + // return calls as `OpaqueCall`s to get the same return type in both branches + let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { + let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); + + OpaqueCall::from_tuple(&set_reserve_amount_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_set_reserve_amount = + collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); + print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); + + OpaqueCall::from_tuple(&propose_set_reserve_amount) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block( + &api, + xt(&api, set_reserve_amount_call).await, + tx_payment_cid_arg, + ) + .await; + + println!("Reserve amount set: {reserve_amount:?}"); + Ok(()) + }) + .into() +} +pub fn list_faucets(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + + let is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let key_prefix = + api.get_storage_map_key_prefix("EncointerFaucet", "Faucets").await.unwrap(); + + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + + for storage_key in storage_keys.iter() { + let key_postfix = storage_key.as_ref(); + let faucet_address = + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); + let faucet: Faucet = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + + if is_verbose { + println!("address: {}", faucet_address.to_ss58check()); + println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); + println!( + "creator: {}", + AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check() + ); + println!( + "balance: {}", + api.get_account_data(&faucet_address).await.unwrap().unwrap().free + ); + println!("drip amount: {}", faucet.drip_amount); + if let Some(whitelist) = faucet.whitelist { + println!("whitelist:"); + for cid in whitelist.to_vec() { + println!("{}", cid); + } + } else { + println!("whitelist: None"); + } + println!(""); + } else { + println! {"{}", faucet_address}; + } + } + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_scheduler.rs b/client/src/commands/encointer_scheduler.rs new file mode 100644 index 00000000..a6570b35 --- /dev/null +++ b/client/src/commands/encointer_scheduler.rs @@ -0,0 +1,87 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{encointer_core::set_api_extrisic_params_builder, frame::get_block_number}, + utils::{ + collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, + keys::get_pair_from_str, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, + OpaqueCall, + }, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{Api, ParentchainExtrinsicSigner, SchedulerApi}; +use encointer_node_notee_runtime::{Hash, Moment}; +use encointer_primitives::ceremonies::CeremonyIndexType; +use log::{debug, info}; + +use sp_keyring::AccountKeyring; +use substrate_api_client::{ac_compose_macros::compose_call, GetStorage}; + +pub fn get_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + + // >>>> add some debug info as well + let bn = get_block_number(&api, None).await; + debug!("block number: {}", bn); + let cindex = get_ceremony_index(&api, None).await; + info!("ceremony index: {}", cindex); + let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); + debug!("next phase timestamp: {}", tnext); + // <<<< + + let phase = api.get_current_phase().await.unwrap(); + println!("{phase:?}"); + Ok(()) + }) + .into() +} +pub fn next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + let next_phase_call = + compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let next_phase_call = if contains_sudo_pallet(api.metadata()) { + let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(next_phase)", &sudo_next_phase_call); + + OpaqueCall::from_tuple(&sudo_next_phase_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_next_phase = + collective_propose_call(api.metadata(), threshold, next_phase_call); + print_raw_call("collective_propose(next_phase)", &propose_next_phase); + + OpaqueCall::from_tuple(&propose_next_phase) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; + + let phase = api.get_current_phase().await.unwrap(); + println!("Phase is now: {phase:?}"); + Ok(()) + }) + .into() +} + +pub async fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { + api.get_storage("EncointerScheduler", "CurrentCeremonyIndex", at_block) + .await + .unwrap() + .unwrap() +} diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs new file mode 100644 index 00000000..2e11619f --- /dev/null +++ b/client/src/commands/frame.rs @@ -0,0 +1,94 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::set_api_extrisic_params_builder, + utils::{ensure_payment, get_chain_api, keys::get_accountid_from_str}, + PREFUNDING_NR_OF_TRANSFER_EXTRINSICS, +}; +use clap::ArgMatches; +use encointer_api_client_extension::{ + Api, EncointerXt, ExtrinsicAddress, ParentchainExtrinsicSigner, +}; +use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash}; +use log::{debug, info}; +use parity_scale_codec::{Compact, Encode}; +use sp_keyring::AccountKeyring; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic_offline}, + extrinsic::BalancesExtrinsics, + GetBalance, GetChainInfo, GetTransactionPayment, SubmitAndWatch, XtStatus, +}; + +pub fn print_metadata(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); + Ok(()) + }) + .into() +} + +pub fn faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); + let accounts = matches.fundees_arg().unwrap(); + + let existential_deposit = api.get_existential_deposit().await.unwrap(); + info!("Existential deposit is = {:?}", existential_deposit); + + let mut nonce = api.get_nonce().await.unwrap(); + + let amount = reasonable_native_balance(&api).await; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + for account in accounts.into_iter() { + let to = get_accountid_from_str(account); + let call = compose_call!( + api.metadata(), + "Balances", + "transfer_keep_alive", + ExtrinsicAddress::from(to.clone()), + Compact(amount) + ) + .unwrap(); + let xt: EncointerXt<_> = compose_extrinsic_offline!( + api.clone().signer().unwrap(), + call.clone(), + api.extrinsic_params(nonce) + ); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + println!("Alice-Faucet drips {amount} to {to} (Alice's nonce={nonce})"); + let _blockh = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + nonce += 1; + } + Ok(()) + }) + .into() +} + +pub async fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { + let hdr = api.get_header(maybe_at).await.unwrap().unwrap(); + debug!("decoded: {:?}", hdr); + //let hdr: Header= Decode::decode(&mut .as_bytes()).unwrap(); + hdr.number +} + +async fn reasonable_native_balance(api: &Api) -> u128 { + let alice: AccountId = AccountKeyring::Alice.into(); + let xt = api.balance_transfer_allow_death(alice.into(), 9999).await.unwrap(); + let fee = api + .get_fee_details(&xt.encode().into(), None) + .await + .unwrap() + .unwrap() + .inclusion_fee + .unwrap() + .base_fee; + let ed = api.get_existential_deposit().await.unwrap(); + ed + fee * PREFUNDING_NR_OF_TRANSFER_EXTRINSICS +} diff --git a/client/src/commands/keystore.rs b/client/src/commands/keystore.rs new file mode 100644 index 00000000..ca3ccce8 --- /dev/null +++ b/client/src/commands/keystore.rs @@ -0,0 +1,40 @@ +use crate::{ + cli_args::EncointerArgsExtractor, + utils::keys::{KEYSTORE_PATH, SR25519}, +}; +use clap::ArgMatches; +use log::info; +use sp_application_crypto::{ed25519, sr25519, Ss58Codec}; +use sp_keystore::Keystore; +use std::path::PathBuf; +use substrate_client_keystore::{KeystoreExt, LocalKeystore}; + +pub fn new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + + // This does not place the key into the keystore if we have a seed, but it does + // place it into the keystore if the seed is none. + let key = store.sr25519_generate_new(SR25519, matches.seed_arg()).unwrap(); + + if let Some(suri) = matches.seed_arg() { + store.insert(SR25519, suri, &key.0).unwrap(); + } + + drop(store); + println!("{}", key.to_ss58check()); + Ok(()) +} + +pub fn list_accounts(_args: &str, _matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + info!("sr25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + info!("ed25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + drop(store); + Ok(()) +} diff --git a/client/src/commands/mod.rs b/client/src/commands/mod.rs new file mode 100644 index 00000000..97197276 --- /dev/null +++ b/client/src/commands/mod.rs @@ -0,0 +1,9 @@ +pub mod encointer_bazaar; +pub mod encointer_ceremonies; +pub mod encointer_communities; +pub mod encointer_core; +pub mod encointer_democracy; +pub mod encointer_faucet; +pub mod encointer_scheduler; +pub mod frame; +pub mod keystore; diff --git a/client/src/community_spec.rs b/client/src/community_spec.rs index 51c6eb2d..823a89a2 100644 --- a/client/src/community_spec.rs +++ b/client/src/community_spec.rs @@ -185,6 +185,7 @@ pub fn new_community_call(spec: &T, metadata: &Metadata) -> Ne maybe_demurrage, maybe_income ) + .unwrap() } pub type AddLocationCall = ([u8; 2], CommunityIdentifier, Location); @@ -195,5 +196,5 @@ pub fn add_location_call( cid: CommunityIdentifier, loc: Location, ) -> AddLocationCall { - compose_call!(metadata, "EncointerCommunities", "add_location", cid, loc) + compose_call!(metadata, "EncointerCommunities", "add_location", cid, loc).unwrap() } diff --git a/client/src/main.rs b/client/src/main.rs index ef96b80f..5a54137b 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -20,67 +20,15 @@ //! mod cli_args; +mod commands; mod community_spec; mod utils; -use crate::{ - community_spec::{ - add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, - CommunitySpec, - }, - utils::{ - batch_call, collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, - into_effective_cindex, - keys::{get_accountid_from_str, get_pair_from_str, KEYSTORE_PATH, SR25519}, - print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, - }, -}; -use clap::{value_t, AppSettings, Arg, ArgMatches}; +use clap::{AppSettings, Arg}; use clap_nested::{Command, Commander}; -use cli_args::{EncointerArgs, EncointerArgsExtractor}; -use encointer_api_client_extension::{ - Api, AttestationState, CeremoniesApi, CommunitiesApi, CommunityCurrencyTip, - CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, ExtrinsicAddress, - ParentchainExtrinsicSigner, SchedulerApi, ENCOINTER_CEREMONIES, -}; -use encointer_node_notee_runtime::{ - AccountId, Balance, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, - Signature, ONE_DAY, -}; -use encointer_primitives::{ - balances::{to_U64F64, Demurrage}, - bazaar::{Business, BusinessIdentifier, OfferingData}, - ceremonies::{ - AttestationIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, - MeetupIndexType, ParticipantIndexType, ProofOfAttendance, Reputation, - ReputationLifetimeType, - }, - communities::{CidName, CommunityIdentifier}, - democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, - faucet::{Faucet, FaucetNameType, FromStr as FaucetNameFromStr, WhiteListType}, - fixed::transcendental::exp, - scheduler::{CeremonyIndexType, CeremonyPhaseType}, -}; -use log::*; -use pallet_transaction_payment::FeeDetails; -use parity_scale_codec::{Compact, Decode, Encode}; -use sp_application_crypto::{ed25519, sr25519}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; -use sp_keyring::AccountKeyring; -use sp_keystore::Keystore; -use sp_rpc::number::NumberOrHex; -use sp_runtime::MultiSignature; -use std::{collections::HashMap, path::PathBuf, str::FromStr}; -use substrate_api_client::{ - ac_compose_macros::{compose_call, compose_extrinsic, compose_extrinsic_offline, rpc_params}, - ac_primitives::{Bytes, SignExtrinsic}, - api::error::Error as ApiClientError, - extrinsic::BalancesExtrinsics, - rpc::{JsonrpseeClient, Request}, - GetAccountInformation, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, - Result as ApiResult, SubmitAndWatch, SubmitAndWatchUntilSuccess, SubscribeEvents, XtStatus, -}; -use substrate_client_keystore::{KeystoreExt, LocalKeystore}; +use cli_args::EncointerArgs; + +use encointer_node_notee_runtime::BalanceType; const PREFUNDING_NR_OF_TRANSFER_EXTRINSICS: u128 = 1000; const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -93,2567 +41,552 @@ mod exit_code { pub const NO_CID_SPECIFIED: i32 = 70; } -#[tokio::main] -async fn main() { +fn main() { env_logger::init(); Commander::new() - .options(|app| { - app.arg( - Arg::with_name("node-url") - .short("u") - .long("node-url") - .global(true) - .takes_value(true) - .value_name("STRING") - .default_value("ws://127.0.0.1") - .help("node url"), - ) - .arg( - Arg::with_name("node-port") - .short("p") - .long("node-port") - .global(true) - .takes_value(true) - .value_name("STRING") - .default_value("9944") - .help("node port"), - ) - .optional_cid_arg() - .tx_payment_cid_arg() - .name("encointer-client-notee") - .version(VERSION) - .author("Encointer Association ") - .about("interact with encointer-node-notee") - .after_help("") - .setting(AppSettings::ColoredHelp) - }) - .args(|_args, _matches| "") - .add_cmd( - Command::new("new-account") - .description("Imports account into the key store. Either creates a new account or with the supplied seed.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .seed_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - - // This does not place the key into the keystore if we have a seed, but it does - // place it into the keystore if the seed is none. - let key = store.sr25519_generate_new( - SR25519, - matches.seed_arg(), - ).unwrap(); - - if let Some(suri) = matches.seed_arg() { - store.insert(SR25519, suri, &key.0).unwrap(); - } - - drop(store); - println!("{}", key.to_ss58check()); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-accounts") - .description("lists all accounts in keystore") - .runner(|_args: &str, _matches: &ArgMatches<'_>| { - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - info!("sr25519 keys:"); - for pubkey in store.public_keys::() - .unwrap() - .into_iter() - { - println!("{}", pubkey.to_ss58check()); - } - info!("ed25519 keys:"); - for pubkey in store.public_keys::() - .unwrap() - .into_iter() - { - println!("{}", pubkey.to_ss58check()); - } - drop(store); - Ok(()) - }), - ) - .add_cmd( - Command::new("print-metadata") - .description("query node metadata and print it as json to stdout") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); - Ok(()) - }), - ) - .add_cmd( - Command::new("faucet") - .description("send some bootstrapping funds to supplied account(s)") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .fundees_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); - api - .set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); - let accounts = matches.fundees_arg().unwrap(); - - let existential_deposit = api.get_existential_deposit().unwrap(); - info!("Existential deposit is = {:?}", existential_deposit); - - let mut nonce = api.get_nonce().unwrap(); - - let amount = reasonable_native_balance(&api); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - for account in accounts.into_iter() { - let to = get_accountid_from_str(account); - let call = compose_call!( - api.metadata(), - "Balances", - "transfer_keep_alive", - ExtrinsicAddress::from(to.clone()), - Compact(amount) - ); - let xt: EncointerXt<_> = compose_extrinsic_offline!( - api.clone().signer().unwrap(), - call.clone(), - api.extrinsic_params(nonce) - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); - let _blockh = api - .submit_and_watch_extrinsic_until(xt, XtStatus::Ready) - .unwrap(); - nonce += 1; - } - Ok(()) - }), - ) - .add_cmd( - Command::new("balance") - .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .all_flag() - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let account = matches.account_arg().unwrap(); - let maybe_at = matches.at_block_arg(); - let accountid = get_accountid_from_str(account); - match matches.cid_arg() { - Some(cid_str) => { - let balance = get_community_balance(&api, cid_str, &accountid, maybe_at); - println!{"{balance:?}"}; - } - None => { - if matches.all_flag() { - let community_balances = get_all_balances(&api, &accountid).unwrap(); - let bn = get_block_number(&api, maybe_at); - for b in community_balances.iter() { - let dr = get_demurrage_per_block(&api, b.0); - println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) - } - } - let balance = if let Some(data) = api.get_account_data(&accountid).unwrap() { - data.free - } else { - 0 - }; - println!("{balance}"); - } - }; - Ok(()) - }), - ) - .add_cmd( - Command::new("issuance") - .description("query total issuance for community. must supply --cid") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let maybe_at = matches.at_block_arg(); - let cid_str = matches.cid_arg().expect("please supply argument --cid"); - let issuance = get_community_issuance(&api, cid_str, maybe_at); - println!{"{issuance:?}"}; - Ok(()) - }), - ) - .add_cmd( - Command::new("transfer") - .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .dryrun_flag() - .arg( - Arg::with_name("from") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("sender's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("to") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("recipient's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("amount") - .takes_value(true) - .required(true) - .value_name("U128") - .help("amount to be transferred"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - if !matches.dryrun_flag() { - let from = get_pair_from_str(arg_from); - info!("from ss58 is {}", from.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - } - let to = get_accountid_from_str(arg_to); - info!("to ss58 is {}", to.to_ss58check()); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None); - let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) - .expect("amount can be converted to fixpoint"); - - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerBalances", - "transfer", - to.clone(), - cid, - amount - ); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap()) - } - }, - None => { - let amount = matches.value_of("amount").unwrap().parse::() - .expect("amount can be converted to u128"); - let xt = api.balance_transfer_allow_death( - to.clone().into(), - amount - ); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap()) - } - } - }; - if let Some(txh) = tx_hash { - info!("[+] Transaction included. Hash: {:?}\n", txh); - let result = api.get_account_data(&to).unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("transfer_all") - .description("transfer all available funds from one account to another for a community specified with --cid.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("from") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("sender's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("to") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("recipient's AccountId in ss58check format"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - let from = get_pair_from_str(arg_from); - let to = get_accountid_from_str(arg_to); - info!("from ss58 is {}", from.public().to_ss58check()); - info!("to ss58 is {}", to.to_ss58check()); - - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerBalances", - "transfer_all", - to.clone(), - cid - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap() - }, - None => { - error!("No cid specified"); - std::process::exit(exit_code::NO_CID_SPECIFIED); - } - }; - info!("[+] Transaction included. Hash: {:?}\n", tx_hash); - let result = api.get_account_data(&to).unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - Ok(()) - - }), - ) - .add_cmd( - Command::new("listen") - .description("listen to on-chain events") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("events") - .short("e") - .long("await-events") - .takes_value(true) - .help("exit after given number of encointer events"), - ) - .arg( - Arg::with_name("blocks") - .short("b") - .long("await-blocks") - .takes_value(true) - .help("exit after given number of blocks"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - listen(matches); - Ok(()) - }), - ) - // start encointer stuff - .add_cmd( - Command::new("new-community") - .description("Register new community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("specfile") - .takes_value(true) - .required(true) - .help("enhanced geojson file that specifies a community"), - ) - .signer_arg("account with necessary privileges") - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - let cid = spec.community_identifier(); - - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let mut api = get_chain_api(matches); - api.set_signer(signer); - - - // ------- create calls for xt's - let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); - // only the first meetup location has been registered now. register all others one-by-one - let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); - let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); - - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { - let sudo_new_community = sudo_call(api.metadata(), new_community_call); - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(new_community)", &sudo_new_community); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - - (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); - print_raw_call("collective_propose(new_community)", &propose_new_community); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - - (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) - }; - } - - // ---- send xt's to chain - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, new_community_call), matches.tx_payment_cid_arg()); - println!("{cid}"); - - if api.get_current_phase().unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call), tx_payment_cid_arg); - Ok(()) - }), - ) - .add_cmd( - Command::new("add-locations") - .description("Register new locations for a community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges") - .dryrun_flag() - .arg( - Arg::with_name("specfile") - .takes_value(true) - .required(true) - .help("geojson file that specifies locations to add as points"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - - let mut api = get_chain_api(matches); - if !matches.dryrun_flag() { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - info!("signer ss58 is {}", signer.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - } - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - - let cid = verify_cid(&api, matches.cid_arg().unwrap(), None); - - let add_location_calls: Vec= spec.locations().into_iter().map(|l| - { - info!("adding location {:?}", l); - add_location_call(api.metadata(), cid, l) - } - ).collect(); - - let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { - [call] => OpaqueCall::from_tuple(call), - _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) - }; - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - OpaqueCall::from_tuple(&sudo_add_location_batch) - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - OpaqueCall::from_tuple(&propose_add_location_batch) - }; - } - - if matches.dryrun_flag() { - println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); - } else { - // ---- send xt's to chain - if api.get_current_phase().unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call), tx_payment_cid_arg); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("list-communities") - .description("list all registered communities") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let names = get_cid_names(&api).unwrap(); - println!("number of communities: {}", names.len()); - for n in names.iter() { - let loc = api.get_locations(n.cid).unwrap(); - println!("{}: {} locations: {}", n.cid, String::from_utf8(n.name.to_vec()).unwrap(), loc.len()); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("list-locations") - .description("list all meetup locations for a community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let maybe_at = matches.at_block_arg(); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - maybe_at - ); - println!("listing locations for cid {cid}"); - let loc = api.get_locations(cid).unwrap(); - for l in loc.iter() { - println!("lat: {} lon: {} (raw lat: {} lon: {})", l.lat, l.lon, - i128::decode(&mut l.lat.encode().as_slice()).unwrap(), - i128::decode(&mut l.lon.encode().as_slice()).unwrap() - ); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("get-phase") - .description("read current ceremony phase from chain") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - - // >>>> add some debug info as well - let bn = get_block_number(&api, None); - debug!("block number: {}", bn); - let cindex = get_ceremony_index(&api, None); - info!("ceremony index: {}", cindex); - let tnext: Moment = api.get_next_phase_timestamp().unwrap(); - debug!("next phase timestamp: {}", tnext); - // <<<< - - let phase = api.get_current_phase().unwrap(); - println!("{phase:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("next-phase") - .description("Advance ceremony state machine to next phase by ROOT call") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - - let mut api = get_chain_api(matches); - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - let next_phase_call = compose_call!( - api.metadata(), - "EncointerScheduler", - "next_phase" - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let next_phase_call = if contains_sudo_pallet(api.metadata()) { - let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(next_phase)", &sudo_next_phase_call); - - OpaqueCall::from_tuple(&sudo_next_phase_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_next_phase = collective_propose_call(api.metadata(), threshold, next_phase_call); - print_raw_call("collective_propose(next_phase)", &propose_next_phase); - - OpaqueCall::from_tuple(&propose_next_phase) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, next_phase_call), tx_payment_cid_arg); - - let phase = api.get_current_phase().unwrap(); - println!("Phase is now: {phase:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-participants") - .description("list all registered participants supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - println!("listing participants for cid {cid} and ceremony nr {cindex}"); - - let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None); - - let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None); - - let mut num_participants: Vec = vec![0, 0, 0, 0]; - for i in 0..registries.len() { - println!("Querying {}", registries[i]); - - let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - println!("number of participants assigned: {count}"); - num_participants[i] = count; - for p_index in 1..count +1 { - let accountid: AccountId = account_query(i, p_index)?.unwrap(); - println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); - } - } - println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", - num_participants[0..=2].iter().sum::(), - num_participants[3], - num_participants[0..=3].iter().sum::() - ); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-meetups") - .description("list all assigned meetups for supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - let community_ceremony = (cid, cindex); - - println!("listing meetups for cid {cid} and ceremony nr {cindex}"); - - let stats = api.get_community_ceremony_stats(community_ceremony).unwrap(); - - let mut num_assignees = 0u64; - - for meetup in stats.meetups.iter() { - println!("MeetupRegistry[{:?}, {}] location is {:?}, {:?}", &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon); - - println!("MeetupRegistry[{:?}, {}] meeting time is {:?}", &community_ceremony, meetup.index, meetup.time); - - if !meetup.registrations.is_empty() { - let num = meetup.registrations.len(); - num_assignees += num as u64; - println!("MeetupRegistry[{:?}, {}] participants: {}", &community_ceremony, meetup.index, num); - for (participant, _registration) in meetup.registrations.iter() { - println!(" {participant}"); - } - } else { - println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); - } - } - println!("total number of assignees: {num_assignees}"); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("print-ceremony-stats") - .description("pretty prints all information for a community ceremony") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - let community_ceremony = (cid, cindex); - - let stats = api.get_community_ceremony_stats(community_ceremony).unwrap(); - - // serialization prints the the account id better than `debug` - println!("{}", serde_json::to_string_pretty(&stats).unwrap()); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-attestees") - .description("list all attestees for participants for supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - println!("listing attestees for cid {cid} and ceremony nr {cindex}"); - - let wcount = get_attestee_count(&api, (cid, cindex)); - println!("number of attestees: {wcount}"); - - println!("listing participants for cid {cid} and ceremony nr {cindex}"); - - let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None); - - let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None); - - let mut participants_windex = HashMap::new(); - - for (i, item) in registries.iter().enumerate() { - println!("Querying {item}"); - - let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - println!("number of participants assigned: {count}"); - - for p_index in 1..count +1 { - let accountid: AccountId = account_query(i, p_index)?.unwrap(); - - match get_participant_attestation_index(&api, (cid, cindex), &accountid) { - Some(windex) => { - participants_windex.insert(windex as AttestationIndexType, accountid) - } - _ => continue, - }; - } - } - - let mut attestation_states = Vec::with_capacity(wcount as usize); - - for w in 1..wcount + 1 { - let attestor = participants_windex[&w].clone(); - let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).unwrap().unwrap(); - let attestees = api.get_attestees((cid, cindex), w).unwrap(); - let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).unwrap(); - let attestation_state = AttestationState::new( - (cid, cindex), - meetup_index, - vote, - w, - attestor, - attestees, - ); - - attestation_states.push(attestation_state); - } - - // Group attestation states by meetup index - attestation_states.sort_by(|a, b| a.meetup_index.partial_cmp(&b.meetup_index).unwrap()); - - for a in attestation_states.iter() { - println!("{a:?}"); - } - - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-reputables") - .description("list all reputables for all cycles within the current reputation-lifetime for all communities") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - .verbose_flag() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - - let is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let lifetime = get_reputation_lifetime(&api, at_block); - let current_ceremony_index = get_ceremony_index(&api, at_block); - - - let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); - let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); - - let community_ids = get_cid_names(&api).unwrap().into_iter().map(|names| names.cid); - - let mut reputables_csv = Vec::new(); - - println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); - for community_id in community_ids { - println!("Community ID: {community_id:?}"); - let mut reputables: HashMap = HashMap::new(); - for ceremony_index in &ceremony_indices { - let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block); - println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); - for attendee in attendees { - reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); - *reputables.entry(attendee.clone()).or_insert(0) += 1; - } - } - println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); - } - if is_verbose { - for reputable in reputables_csv { - println!("{reputable}"); - } - } - Ok(()) - }), - ) - .add_cmd( - Command::new("register-participant") - .description("Register encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches); - let cindex = get_ceremony_index(&api, None); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ); - let rep = get_reputation(&api, &accountid, cid, cindex -1); - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::Unverified => None, - Reputation::UnverifiedReputable => None, // this should never by the case during Registering! - Reputation::VerifiedUnlinked => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), - Reputation::VerifiedLinked => { - error!("reputation of {} has already been linked! Not registering again", accountid); - std::process::exit(exit_code::INVALID_REPUTATION); - }, - }; - debug!("proof: {:x?}", proof.encode()); - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "register_participant", - cid, - proof - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("upgrade-registration") - .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches); - let cindex = get_ceremony_index(&api, None); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ); - - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut reputation_cindex = cindex; - if current_phase == CeremonyPhaseType::Registering { - reputation_cindex -= 1; - } - let rep = get_reputation(&api, &accountid, cid, reputation_cindex); - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::VerifiedUnlinked => prove_attendance(accountid, cid, reputation_cindex, arg_who), - _ => { - error!("No valid reputation in last ceremony."); - std::process::exit(exit_code::INVALID_REPUTATION); - }, - }; - - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "upgrade_registration", - cid, - proof - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("unregister-participant") - .description("Unregister encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - .ceremony_index_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches); - - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ); - - - let cc = match matches.ceremony_index_arg() { - Some(cindex_arg) => { - let current_ceremony_index = get_ceremony_index(&api, None); - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - Some((cid, cindex)) - }, - None => None, - }; - - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for unregistering"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "unregister_participant", - cid, - cc - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // Send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("endorse-newcomers") - .description("Endorse newbies with a bootstrapper account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .bootstrapper_arg() - .endorsees_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - - extract_and_execute( - matches, |mut api, cid| endorse_newcomers(&mut api, cid, matches) - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("get-bootstrappers-with-remaining-newbie-tickets") - .description("Get the bootstrappers along with the remaining newbie tickets") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let bs_with_tickets : Vec = extract_and_execute( - matches, |api, cid| get_bootstrappers_with_remaining_newbie_tickets(&api, cid) - ).unwrap(); - - info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); - - // transform it to simple tuples, which is easier to parse in python - let bt_vec = bs_with_tickets.into_iter() - .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)).collect::>(); - - println!("{bt_vec:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("get-proof-of-attendance") - .description("creates a proof of ProofOfAttendances for an for the given ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .account_arg() - .ceremony_index_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let api = get_chain_api(matches); - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - - let cid = verify_cid( - &api, - matches.cid_arg().expect("please supply argument --cid"), - None - ); - - debug!("Getting proof for ceremony index: {:?}", cindex); - let proof = prove_attendance(accountid, cid, cindex, arg_who); - info!("Proof: {:?}\n", &proof); - println!("0x{}", hex::encode(proof.encode())); - - Ok(()) - }), - ) - .add_cmd( - Command::new("attest-attendees") - .description("Register encointer ceremony claim of attendances for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .optional_cid_arg() - .attestees_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - - let attestees: Vec<_> = matches.attestees_arg().unwrap() - .into_iter() - .map(get_accountid_from_str) - .collect(); - - let vote = attestees.len() as u32 + 1u32; - - debug!("attestees: {:?}", attestees); - - info!("send attest_attendees by {}", who.public()); - - let mut api = - get_chain_api(matches); - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "attest_attendees", - cid, - vote, - attestees - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - - println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("new-claim") - .description("create a fresh claim of attendance for account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .arg( - Arg::with_name("vote") - .takes_value(true) - .required(true) - .value_name("VOTE") - .help("participant's vote on the number of people present at meetup time"), - ) - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - let arg_who = matches.account_arg().unwrap(); - let claimant = get_pair_from_str(arg_who); - - let n_participants = matches - .value_of("vote") - .unwrap() - .parse::() - .unwrap(); - - let claim = new_claim_for(&api, &claimant.into(), cid, n_participants); - - println!("{}", hex::encode(claim)); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("claim-reward") - .description("Claim the rewards for all meetup participants of the last ceremony.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("Account which signs the tx.") - .meetup_index_arg() - .all_flag() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - - extract_and_execute( - matches, |api, cid| { - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => panic!("please specify --signer.") - }; - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer.clone()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let meetup_index_arg = matches.meetup_index_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - if matches.all_flag() { - let mut cindex = get_ceremony_index(&api, None); - if api.get_current_phase().unwrap() == CeremonyPhaseType::Registering { - cindex -= 1; - } - let meetup_count = api - .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) - .unwrap().unwrap_or(0u64); - let calls: Vec<_> = (1u64..=meetup_count) - .map(|idx| compose_call!( - api.metadata(), - ENCOINTER_CEREMONIES, - "claim_rewards", - cid, - Option::::Some(idx) - )) - .collect(); - let batch_call = compose_call!( - api.metadata(), - "Utility", - "batch", - calls - ); - send_and_wait_for_in_block(&api, xt(&api, batch_call), tx_payment_cid_arg); - println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); - } else { - let meetup_index = meetup_index_arg; - let xt: EncointerXt<_> = compose_extrinsic!( - api, - ENCOINTER_CEREMONIES, - "claim_rewards", - cid, - meetup_index - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - match meetup_index_arg { - Some(idx)=>{println!("Claiming reward for meetup_index {idx}. xt-status: '{:?}'", report.status);} - None=>{println!("Claiming reward for {}. xt-status: 'ready'", signer.public_account_id());} - } - } - } - ); - - Ok(()) - }), - ) - .add_cmd( - Command::new("reputation") - .description("List reputation history for an account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg()}) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let account = matches.account_arg().unwrap(); - let account_id = get_accountid_from_str(account); - if let Some(reputation) = get_reputation_history(&api, &account_id) { - for rep in reputation.iter() { - println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); - } - } else { - error!("could not fetch reputation over rpc"); - std::process::exit(exit_code::RPC_ERROR); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("create-business") - .description("Register a community business on behalf of the account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("update-business") - .description("Update an already existing community business on behalf of the account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("create-offering") - .description("Create an offering for the business belonging to account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::CreateOffering).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-businesses") - .description("List businesses for a community") - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - - let businesses = extract_and_execute( - matches, |api, cid| get_businesses(&api, cid).unwrap() - ); - // only print plain businesses to be able to parse them in python scripts - println!("{businesses:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-offerings") - .description("List offerings for a community") - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let offerings = extract_and_execute( - matches, |api, cid| get_offerings(&api, cid).unwrap() - ); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-business-offerings") - .description("List offerings for a business") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let account = matches.account_arg().map(get_accountid_from_str).unwrap(); - - let offerings = extract_and_execute( - matches, |api, cid| get_offerings_for_business(&api, cid, account).unwrap() - ); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("purge-community-ceremony") - .description("purge all history within the provided ceremony index range for the specified community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .from_cindex_arg() - .to_cindex_arg() - - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let sudoer = AccountKeyring::Alice.pair(); - let signer = ParentchainExtrinsicSigner::new(sudoer); - let mut api = get_chain_api(matches); - api.set_signer(signer); - - let current_ceremony_index = get_ceremony_index(&api, None); - - let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); - let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); - - let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); - let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); - - if from_cindex > to_cindex { - panic!("'from' <= 'to' ceremony index violated"); - } - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ); - println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); - - let calls: Vec<_> = (from_cindex..=to_cindex) - .map(|idx| compose_call!( - api.metadata(), - "EncointerCeremonies", - "purge_community_ceremony", - (cid, idx) - )) - .collect(); - let batch_call = compose_call!( - api.metadata(), - "Utility", - "batch", - calls - ); - let unsigned_sudo_call = compose_call!( - api.metadata(), - "Sudo", - "sudo", - batch_call.clone() - ); - info!("raw sudo batch call to sign with js/apps {}: 0x{}", cid, hex::encode(unsigned_sudo_call.encode())); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "Sudo", - "sudo", - batch_call - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap(); - info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); - Ok(()) - }), - ) - .add_cmd( - Command::new("set-meetup-time-offset") - .description("signed value to offset the ceremony meetup time relative to solar noon") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .time_offset_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); - let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); - api - .set_signer(signer); - let time_offset = matches.time_offset_arg().unwrap_or(0); - let call = compose_call!( - api.metadata(), - "EncointerCeremonies", - "set_meetup_time_offset", - time_offset - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let privileged_call = if contains_sudo_pallet(api.metadata()) { - let sudo_call = sudo_call(api.metadata(), call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(...)", &sudo_call); - OpaqueCall::from_tuple(&sudo_call) - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_call = collective_propose_call(api.metadata(), threshold, call); - print_raw_call("collective_propose(...)", &propose_call); - OpaqueCall::from_tuple(&propose_call) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt = xt(&api, privileged_call); - send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); - Ok(()) - }), - ) - .add_cmd( - Command::new("create-faucet") - .description("Create faucet") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_name_arg() - .faucet_balance_arg() - .faucet_drip_amount_arg() - .whitelist_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - - let faucet_name_raw = matches.faucet_name_arg().unwrap(); - let faucet_balance = matches.faucet_balance_arg().unwrap(); - let drip_amount = matches.faucet_drip_amount_arg().unwrap(); - - let whitelist = matches.whitelist_arg().map(|wl| { - let whitelist_vec: Vec<_> = wl - .into_iter() - .map(|c| verify_cid(&api, - c, - None)) - .collect(); - WhiteListType::try_from(whitelist_vec).unwrap() - }); - - let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "create_faucet", - faucet_name, - faucet_balance, - whitelist, - drip_amount - ); - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - - - let result = api.submit_and_watch_extrinsic_until_success(xt, false); - - match result { - Ok(report) => { - for event in report.events.unwrap().iter() { - if event.pallet_name() == "EncointerFaucet" && event.variant_name() == "FaucetCreated" { - println!("{}", AccountId::decode(&mut event.field_bytes()[0..32].as_ref()).unwrap().to_ss58check()); - } - } - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }), - ) - .add_cmd( - Command::new("drip-faucet") - .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - .cindex_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); - - let cindex = matches.cindex_arg().unwrap(); - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "drip", - faucet_account, - cid, - cindex - ); - - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - - let result = api.submit_and_watch_extrinsic_until_success(xt, false); - - match result { - Ok(_report) => { - println!("Faucet dripped to {}", who.public()); - - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }), - ) - .add_cmd( - Command::new("dissolve-faucet") - .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_account_arg() - .faucet_beneficiary_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); - - let mut api = get_chain_api(matches); - api.set_signer(signer); - - - let dissolve_faucet_call = compose_call!( - api.metadata(), - "EncointerFaucet", - "dissolve_faucet", - faucet_account.clone(), - beneficiary - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { - let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); - - OpaqueCall::from_tuple(&dissolve_faucet_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_dissolve_faucet = collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); - print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); - - OpaqueCall::from_tuple(&propose_dissolve_faucet) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call), tx_payment_cid_arg); - - println!("Faucet dissolved: {faucet_account:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("close-faucet") - .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who, - ))); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "close_faucet", - faucet_account.clone() - ); - - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - - println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("set-faucet-reserve-amount") - .description("Set faucet pallet reserve amount") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_reserve_amount_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); - - let mut api = get_chain_api(matches); - api.set_signer(signer); - - - let set_reserve_amount_call = compose_call!( - api.metadata(), - "EncointerFaucet", - "set_reserve_amount", - reserve_amount - ); - // return calls as `OpaqueCall`s to get the same return type in both branches - let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { - let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); - - OpaqueCall::from_tuple(&set_reserve_amount_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_set_reserve_amount = collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); - print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); - - OpaqueCall::from_tuple(&propose_set_reserve_amount) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, set_reserve_amount_call), tx_payment_cid_arg); - - println!("Reserve amount set: {reserve_amount:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-faucets") - .description("list all faucets. use -v to get faucet details.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - .verbose_flag() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - - let is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let key_prefix = api - .get_storage_map_key_prefix( - "EncointerFaucet", - "Faucets", - ) - .unwrap(); - - let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); - - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - - for storage_key in storage_keys.iter() { - let key_postfix = storage_key.as_ref(); - let faucet_address = AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); - let faucet: Faucet = api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap(); - - if is_verbose { - println!("address: {}", faucet_address.to_ss58check()); - println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); - println!("creator: {}", AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check()); - println!("balance: {}", api.get_account_data(&faucet_address).unwrap().unwrap().free); - println!("drip amount: {}", faucet.drip_amount); - if let Some(whitelist) = faucet.whitelist { - println!("whitelist:"); - for cid in whitelist.to_vec() { - println!("{}", cid); - } - } else { - println!("whitelist: None"); - } - println!(""); - } else { - println!{"{}", faucet_address}; - } - - } - Ok(()) - }), - ) - .add_cmd( - Command::new("submit-set-inactivity-timeout-proposal") - .description("Submit set inactivity timeout proposal") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .inactivity_timeout_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - let inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "submit_proposal", - ProposalAction::SetInactivityTimeout(inactivity_timeout) - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); - println!("Proposal Submitted: Set inactivity timeout to {inactivity_timeout:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-proposals") - .description("list all proposals.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); - let at_block = matches.at_block_arg(); - let key_prefix = api - .get_storage_map_key_prefix( - "EncointerDemocracy", - "Proposals", - ) - .unwrap(); - let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - for storage_key in storage_keys.iter() { - let key_postfix = storage_key.as_ref(); - let proposal_id = ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref()).unwrap(); - let proposal: Proposal = api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap(); - println!("id: {}", proposal_id); - println!("action: {:?}", proposal.action); - println!("start block: {}", proposal.start); - println!("start cindex: {}", proposal.start_cindex); - println!("state: {:?}", proposal.state); - println!(""); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("vote") - .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .proposal_id_arg() - .vote_arg() - .reputation_vec_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - let proposal_id = matches.proposal_id_arg().unwrap(); - let vote_raw = matches.vote_arg().unwrap(); - let vote = match vote_raw { - "aye" => Vote::Aye, - "nay" => Vote::Nay, - &_ => panic!("invalid vote") - }; - let reputation_vec: ReputationVec> = matches.reputation_vec_arg().map(|rv| { - let reputations: Vec<(CommunityIdentifier, CeremonyIndexType)> = rv - .into_iter() - .map(|rep| { - let cc: Vec<_> = rep.split("_").collect(); - (verify_cid(&api,cc[0],None), cc[1].parse().unwrap()) - }).collect(); - ReputationVec::try_from(reputations).unwrap() - }).unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "vote", - proposal_id, - vote, - reputation_vec - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); - println!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("update-proposal-state") - .description("Update proposal state") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .proposal_id_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - let proposal_id = matches.proposal_id_arg().unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "update_proposal_state", - proposal_id - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); - println!("Proposal state updated for proposal {proposal_id:?}"); - Ok(()) - }), - ) - // To handle when no subcommands match - .no_cmd(|_args, _matches| { - println!("No subcommand matched"); - Ok(()) - }) - .run(); -} - -fn get_chain_api(matches: &ArgMatches<'_>) -> Api { - let url = format!( - "{}:{}", - matches.value_of("node-url").unwrap(), - matches.value_of("node-port").unwrap() - ); - debug!("connecting to {}", url); - let client = JsonrpseeClient::new(&url).expect("node URL is incorrect"); - Api::new(client).unwrap() -} - -fn reasonable_native_balance(api: &Api) -> u128 { - let alice: AccountId = AccountKeyring::Alice.into(); - let xt = api.balance_transfer_allow_death(alice.into(), 9999); - let fee = api - .get_fee_details(xt.encode().into(), None) - .unwrap() - .unwrap() - .inclusion_fee - .unwrap() - .base_fee; - let ed = api.get_existential_deposit().unwrap(); - ed + fee * PREFUNDING_NR_OF_TRANSFER_EXTRINSICS -} - -fn listen(matches: &ArgMatches<'_>) { - let api = get_chain_api(matches); - debug!("Subscribing to events"); - let mut subscription = api.subscribe_events().unwrap(); - let mut count = 0u32; - let mut blocks = 0u32; - loop { - if matches.is_present("events") && - count >= value_t!(matches.value_of("events"), u32).unwrap() - { - return - }; - if matches.is_present("blocks") && - blocks > value_t!(matches.value_of("blocks"), u32).unwrap() - { - return - }; - let event_results = subscription.next_events::().unwrap(); - blocks += 1; - match event_results { - Ok(evts) => - for evr in evts { - debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); - match &evr.event { - RuntimeEvent::EncointerCeremonies(ee) => { - count += 1; - info!(">>>>>>>>>> ceremony event: {:?}", ee); - match &ee { - pallet_encointer_ceremonies::Event::ParticipantRegistered( - cid, - participant_type, - accountid, - ) => { - println!( - "Participant registered as {participant_type:?}, for cid: {cid:?}, account: {accountid}, " - ); - }, - _ => println!("Unsupported EncointerCommunities event"), - } - }, - RuntimeEvent::EncointerScheduler(ee) => { - count += 1; - info!(">>>>>>>>>> scheduler event: {:?}", ee); - match &ee { - pallet_encointer_scheduler::Event::PhaseChangedTo(phase) => { - println!("Phase changed to: {phase:?}"); - }, - pallet_encointer_scheduler::Event::CeremonySchedulePushedByOneDay => { - println!("Ceremony schedule was pushed by one day"); - }, - } - }, - RuntimeEvent::EncointerCommunities(ee) => { - count += 1; - info!(">>>>>>>>>> community event: {:?}", ee); - match &ee { - pallet_encointer_communities::Event::CommunityRegistered(cid) => { - println!("Community registered: cid: {cid:?}"); - }, - pallet_encointer_communities::Event::MetadataUpdated(cid) => { - println!("Community metadata updated cid: {cid:?}"); - }, - pallet_encointer_communities::Event::NominalIncomeUpdated( - cid, - income, - ) => { - println!( - "Community metadata updated cid: {cid:?}, value: {income:?}" - ); - }, - pallet_encointer_communities::Event::DemurrageUpdated( - cid, - demurrage, - ) => { - println!( - "Community metadata updated cid: {cid:?}, value: {demurrage:?}" - ); - }, - _ => println!("Unsupported EncointerCommunities event"), - } - }, - RuntimeEvent::EncointerBalances(ee) => { - count += 1; - println!(">>>>>>>>>> encointer balances event: {ee:?}"); - }, - RuntimeEvent::EncointerBazaar(ee) => { - count += 1; - println!(">>>>>>>>>> encointer bazaar event: {ee:?}"); - }, - RuntimeEvent::System(ee) => match ee { - frame_system::Event::ExtrinsicFailed { - dispatch_error: _, - dispatch_info: _, - } => { - error!("ExtrinsicFailed: {ee:?}"); - }, - frame_system::Event::ExtrinsicSuccess { dispatch_info } => { - println!("ExtrinsicSuccess: {dispatch_info:?}"); - }, - _ => debug!("ignoring unsupported system Event"), - }, - _ => debug!("ignoring unsupported module event: {:?}", evr.event), - } - }, - Err(_) => error!("couldn't decode event record list"), - } - } -} - -/// Extracts api and cid from `matches` and execute the given `closure` with them. -fn extract_and_execute( - matches: &ArgMatches<'_>, - closure: impl FnOnce(Api, CommunityIdentifier) -> T, -) -> T { - let api = get_chain_api(matches); - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); - closure(api, cid) -} - -fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { - let cids = get_community_identifiers(api, maybe_at).expect("no community registered"); - let cid = CommunityIdentifier::from_str(cid).unwrap(); - if !cids.contains(&cid) { - panic!("cid {cid} does not exist on chain"); - } - cid -} - -fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { - let hdr = api.get_header(maybe_at).unwrap().unwrap(); - debug!("decoded: {:?}", hdr); - //let hdr: Header= Decode::decode(&mut .as_bytes()).unwrap(); - hdr.number -} - -pub fn get_community_balance( - api: &Api, - cid_str: &str, - account_id: &AccountId, - maybe_at: Option, -) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at); - let bn = get_block_number(api, maybe_at); - let dr = get_demurrage_per_block(api, cid); - - if let Some(entry) = api - .get_storage_double_map("EncointerBalances", "Balance", cid, account_id, maybe_at) - .unwrap() - { - apply_demurrage(entry, bn, dr) - } else { - BalanceType::from_num(0) - } -} - -pub fn get_community_issuance(api: &Api, cid_str: &str, maybe_at: Option) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at); - let bn = get_block_number(api, maybe_at); - let dr = get_demurrage_per_block(api, cid); - - if let Some(entry) = api - .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) - .unwrap() - { - apply_demurrage(entry, bn, dr) - } else { - BalanceType::from_num(0) - } -} - -fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { - let d: Option = api - .get_storage_map("EncointerBalances", "DemurragePerBlock", cid, None) - .unwrap(); - - match d { - Some(d) => { - debug!("Fetched community specific demurrage per block {:?}", &d); - d - }, - None => { - let d = api.get_constant("EncointerBalances", "DefaultDemurrage").unwrap(); - debug!("Fetched default demurrage per block {:?}", d); - d - }, - } -} - -fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { - api.get_storage("EncointerScheduler", "CurrentCeremonyIndex", at_block) - .unwrap() - .unwrap() -} - -fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { - api.get_storage_map("EncointerCeremonies", "AttestationCount", key, None) - .unwrap() - .unwrap_or(0) -} - -fn get_attendees_for_community_ceremony( - api: &Api, - community_ceremony: CommunityCeremony, - at_block: Option, -) -> (Vec, Vec) { - let key_prefix = api - .get_storage_double_map_key_prefix( - "EncointerCeremonies", - "ParticipantReputation", - community_ceremony, + .options(|app| { + app.arg( + Arg::with_name("node-url") + .short("u") + .long("node-url") + .global(true) + .takes_value(true) + .value_name("STRING") + .default_value("ws://127.0.0.1") + .help("node url"), + ) + .arg( + Arg::with_name("node-port") + .short("p") + .long("node-port") + .global(true) + .takes_value(true) + .value_name("STRING") + .default_value("9944") + .help("node port"), + ) + .optional_cid_arg() + .tx_payment_cid_arg() + .name("encointer-client-notee") + .version(VERSION) + .author("Encointer Association ") + .about("interact with encointer-node-notee") + .after_help("") + .setting(AppSettings::ColoredHelp) + }) + .args(|_args, _matches| "") + .add_cmd( + Command::new("new-account") + .description("Imports account into the key store. Either creates a new account or with the supplied seed.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .seed_arg() + }) + .runner(commands::keystore::new_account), ) - .unwrap(); - let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); - - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - let mut attendees = Vec::new(); - let mut noshows = Vec::new(); - for storage_key in storage_keys.iter() { - match api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap() { - Reputation::VerifiedUnlinked | Reputation::VerifiedLinked => { - let key_postfix = storage_key.as_ref(); - attendees.push( - AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), - ); - }, - Reputation::UnverifiedReputable | Reputation::Unverified => { - let key_postfix = storage_key.as_ref(); - noshows.push( - AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), - ); - }, - } - } - (attendees, noshows) -} - -fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { - api.get_storage("EncointerCeremonies", "ReputationLifetime", at_block) - .unwrap() - .unwrap_or(5) -} - -fn get_participant_attestation_index( - api: &Api, - key: CommunityCeremony, - accountid: &AccountId, -) -> Option { - api.get_storage_double_map("EncointerCeremonies", "AttestationIndex", key, accountid, None) - .unwrap() -} - -fn new_claim_for( - api: &Api, - claimant: &sr25519::Pair, - cid: CommunityIdentifier, - n_participants: u32, -) -> Vec { - let cindex = get_ceremony_index(api, None); - let mindex = api - .get_meetup_index(&(cid, cindex), &claimant.public().into()) - .unwrap() - .expect("participant must be assigned to meetup to generate a claim"); - - // implicitly assume that participant meet at the right place at the right time - let mloc = api.get_meetup_location(&(cid, cindex), mindex).unwrap().unwrap(); - let mtime = api.get_meetup_time(mloc, ONE_DAY).unwrap(); - - info!( - "creating claim for {} at loc {} (lat: {} lon: {}) at time {}, cindex {}", - claimant.public().to_ss58check(), - mindex, - mloc.lat, - mloc.lon, - mtime, - cindex - ); - let claim: ClaimOfAttendance = - ClaimOfAttendance::new_unsigned( - claimant.public().into(), - cindex, - cid, - mindex, - mloc, - mtime, - n_participants, + .add_cmd( + Command::new("list-accounts") + .description("lists all accounts in keystore") + .runner(commands::keystore::list_accounts), ) - .sign(claimant); - claim.encode() -} - -fn get_community_identifiers( - api: &Api, - maybe_at: Option, -) -> Option> { - api.get_storage("EncointerCommunities", "CommunityIdentifiers", maybe_at) - .unwrap() -} - -/// This rpc needs to have offchain indexing enabled in the node. -fn get_cid_names(api: &Api) -> Option> { - api.client().request("encointer_getAllCommunities", rpc_params![]).expect( - "No communities returned. Are you running the node with `--enable-offchain-indexing true`?", - ) -} - -fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { - api.client() - .request("encointer_bazaarGetBusinesses", rpc_params![cid]) - .expect("Could not find any businesses...") -} - -fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { - api.client() - .request("encointer_bazaarGetOfferings", rpc_params![cid]) - .expect("Could not find any business offerings...") -} - -fn get_offerings_for_business( - api: &Api, - cid: CommunityIdentifier, - account_id: AccountId, -) -> Option> { - let b_id = BusinessIdentifier::new(cid, account_id); - api.client() - .request("encointer_bazaarGetOfferingsForBusiness", rpc_params![b_id]) - .expect("Could not find any business offerings...") -} - -fn get_reputation_history( - api: &Api, - account_id: &AccountId, -) -> Option> { - api.client() - .request("encointer_getReputations", rpc_params![account_id]) - .expect("Could not query reputation history...") -} - -fn get_all_balances( - api: &Api, - account_id: &AccountId, -) -> Option)>> { - api.client() - .request("encointer_getAllBalances", rpc_params![account_id]) - .expect("Could not query all balances...") -} - -fn get_asset_fee_details( - api: &Api, - cid_str: &str, - encoded_xt: &Bytes, -) -> Option> { - let cid = verify_cid(api, cid_str, None); - - api.client() - .request("encointer_queryAssetFeeDetails", rpc_params![cid, encoded_xt]) - .expect("Could not query asset fee details") -} - -fn prove_attendance( - prover: AccountId, - cid: CommunityIdentifier, - cindex: CeremonyIndexType, - attendee_str: &str, -) -> ProofOfAttendance { - let msg = (prover.clone(), cindex); - let attendee = get_pair_from_str(attendee_str); - let attendeeid = get_accountid_from_str(attendee_str); - debug!("generating proof of attendance for {} and cindex: {}", prover, cindex); - debug!("signature payload is {:x?}", msg.encode()); - ProofOfAttendance { - prover_public: prover, - community_identifier: cid, - ceremony_index: cindex, - attendee_public: attendeeid, - attendee_signature: Signature::from(sr25519_core::Signature::from( - attendee.sign(&msg.encode()), - )), - } -} - -fn get_reputation( - api: &Api, - prover: &AccountId, - cid: CommunityIdentifier, - cindex: CeremonyIndexType, -) -> Reputation { - api.get_storage_double_map( - "EncointerCeremonies", - "ParticipantReputation", - (cid, cindex), - prover.clone(), - None, - ) - .unwrap() - .unwrap_or(Reputation::Unverified) -} - -fn apply_demurrage( - entry: BalanceEntry, - current_block: BlockNumber, - demurrage_per_block: Demurrage, -) -> BalanceType { - let elapsed_time_block_number = current_block.checked_sub(entry.last_update).unwrap(); - let elapsed_time_u32: u32 = elapsed_time_block_number; - let elapsed_time = Demurrage::from_num(elapsed_time_u32); - let exponent = -demurrage_per_block * elapsed_time; - debug!( - "demurrage per block {}, current_block {}, last {}, elapsed_blocks {}", - demurrage_per_block, current_block, entry.last_update, elapsed_time - ); - let exp_result = exp(exponent).unwrap(); - entry.principal.checked_mul(to_U64F64(exp_result).unwrap()).unwrap() -} - -fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { - let business_owner = matches.account_arg().map(get_pair_from_str).unwrap(); - - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - business_owner.clone(), - ))); - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); - let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = - compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); - println!( - "{} for {}. xt-status: '{:?}'", - bazaar_call.to_string(), - business_owner.public(), - report.status - ); - Ok(()) -} - -fn endorse_newcomers( - api: &mut Api, - cid: CommunityIdentifier, - matches: &ArgMatches<'_>, -) -> Result<(), ApiClientError> { - let bootstrapper = matches.bootstrapper_arg().map(get_pair_from_str).unwrap(); - let endorsees = matches.endorsees_arg().expect("Please supply at least one endorsee"); - - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(bootstrapper))); - - let mut nonce = api.get_nonce()?; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(api, tx_payment_cid_arg); - - for e in endorsees.into_iter() { - let endorsee = get_accountid_from_str(e); - - let call = - compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee); - - let encoded_xt: Bytes = api.compose_extrinsic_offline(call, nonce).encode().into(); - ensure_payment(api, &encoded_xt, tx_payment_cid_arg); - let _tx_report = api - .submit_and_watch_opaque_extrinsic_until(encoded_xt, XtStatus::Ready) - .unwrap(); - - nonce += 1; - } - - Ok(()) -} - -/// Helper type, which is only needed to print the information nicely. -#[derive(Debug)] -struct BootstrapperWithTickets { - bootstrapper: AccountId, - remaining_newbie_tickets: u8, -} - -fn get_bootstrappers_with_remaining_newbie_tickets( - api: &Api, - cid: CommunityIdentifier, -) -> Result, ApiClientError> { - let total_newbie_tickets: u8 = api - .get_storage("EncointerCeremonies", "EndorsementTicketsPerBootstrapper", None) - .unwrap() - .unwrap(); - - // prepare closure to make below call more readable. - let ticket_query = |bs| -> Result { - let remaining_tickets = total_newbie_tickets - - api.get_storage_double_map( - "EncointerCeremonies", - "BurnedBootstrapperNewbieTickets", - cid, - bs, - None, - )? - .unwrap_or(0u8); - - Ok(remaining_tickets) - }; - - let bootstrappers: Vec = api - .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None)? - .expect("No bootstrappers found, does the community exist?"); - - let mut bs_with_tickets: Vec = Vec::with_capacity(bootstrappers.len()); - - for bs in bootstrappers.into_iter() { - bs_with_tickets.push(BootstrapperWithTickets { - bootstrapper: bs.clone(), - remaining_newbie_tickets: ticket_query(bs)?, - }); - } - - Ok(bs_with_tickets) -} - -#[derive(Clone, Copy, PartialEq, Eq)] -enum BazaarCalls { - CreateBusiness, - UpdateBusiness, - CreateOffering, -} - -impl ToString for BazaarCalls { - fn to_string(&self) -> String { - match self { - BazaarCalls::CreateBusiness => "create_business".to_string(), - BazaarCalls::UpdateBusiness => "update_business".to_string(), - BazaarCalls::CreateOffering => "create_offering".to_string(), - } - } -} - -fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { - let mut tx_params = CommunityCurrencyTipExtrinsicParamsBuilder::new().tip(0); - if let Some(tx_payment_cid) = tx_payment_cid_arg { - tx_params = tx_params.tip(CommunityCurrencyTip::new(0).of_community(verify_cid( - api, - tx_payment_cid, - None, - ))); - } - let _ = &api.set_additional_params(tx_params); + .add_cmd( + Command::new("print-metadata") + .description("query node metadata and print it as json to stdout") + .runner(commands::frame::print_metadata), + ) + .add_cmd( + Command::new("faucet") + .description("send some bootstrapping funds to supplied account(s)") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .fundees_arg() + }) + .runner(commands::frame::faucet), + ) + .add_cmd( + Command::new("balance") + .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .all_flag() + .at_block_arg() + }) + .runner(commands::encointer_core::balance), + ) + .add_cmd( + Command::new("issuance") + .description("query total issuance for community. must supply --cid") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(commands::encointer_core::issuance), + ) + .add_cmd( + Command::new("transfer") + .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .dryrun_flag() + .arg( + Arg::with_name("from") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("sender's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("to") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("recipient's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("amount") + .takes_value(true) + .required(true) + .value_name("U128") + .help("amount to be transferred"), + ) + }) + .runner(commands::encointer_core::transfer), + ) + .add_cmd( + Command::new("transfer_all") + .description("transfer all available funds from one account to another for a community specified with --cid.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("from") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("sender's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("to") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("recipient's AccountId in ss58check format"), + ) + }) + .runner(commands::encointer_core::transfer_all), + ) + .add_cmd( + Command::new("listen") + .description("listen to on-chain events") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("events") + .short("e") + .long("await-events") + .takes_value(true) + .help("exit after given number of encointer events"), + ) + .arg( + Arg::with_name("blocks") + .short("b") + .long("await-blocks") + .takes_value(true) + .help("exit after given number of blocks"), + ) + }) + .runner(commands::encointer_core::listen_to_events), + ) + .add_cmd( + Command::new("new-community") + .description("Register new community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("specfile") + .takes_value(true) + .required(true) + .help("enhanced geojson file that specifies a community"), + ) + .signer_arg("account with necessary privileges") + }) + .runner(commands::encointer_communities::new_community), + ) + .add_cmd( + Command::new("add-locations") + .description("Register new locations for a community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges") + .dryrun_flag() + .arg( + Arg::with_name("specfile") + .takes_value(true) + .required(true) + .help("geojson file that specifies locations to add as points"), + ) + }) + .runner(commands::encointer_communities::add_locations), + ) + .add_cmd( + Command::new("list-communities") + .description("list all registered communities") + .runner(commands::encointer_communities::list_communities), + ) + .add_cmd( + Command::new("list-locations") + .description("list all meetup locations for a community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(commands::encointer_communities::list_locations), + ) + .add_cmd( + Command::new("get-phase") + .description("read current ceremony phase from chain") + .runner(commands::encointer_scheduler::get_phase), + ) + .add_cmd( + Command::new("next-phase") + .description("Advance ceremony state machine to next phase by ROOT call") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + }) + .runner(commands::encointer_scheduler::next_phase), + ) + .add_cmd( + Command::new("list-participants") + .description("list all registered participants supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::list_participants), + ) + .add_cmd( + Command::new("list-meetups") + .description("list all assigned meetups for supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::list_meetups), + ) + .add_cmd( + Command::new("print-ceremony-stats") + .description("pretty prints all information for a community ceremony") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::print_ceremony_stats), + ) + .add_cmd( + Command::new("list-attestees") + .description("list all attestees for participants for supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::list_attestees), + ) + .add_cmd( + Command::new("list-reputables") + .description("list all reputables for all cycles within the current reputation-lifetime for all communities") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + .verbose_flag() + }) + .runner(commands::encointer_ceremonies::list_reputables), + ) + .add_cmd( + Command::new("register-participant") + .description("Register encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + }) + .runner(commands::encointer_ceremonies::register_participant), + ) + .add_cmd( + Command::new("upgrade-registration") + .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + }) + .runner(commands::encointer_ceremonies::upgrade_registration), + ) + .add_cmd( + Command::new("unregister-participant") + .description("Unregister encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::unregister_participant), + ) + .add_cmd( + Command::new("endorse-newcomers") + .description("Endorse newbies with a bootstrapper account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .bootstrapper_arg() + .endorsees_arg() + }) + .runner(commands::encointer_ceremonies::endorse), + ) + .add_cmd( + Command::new("get-bootstrappers-with-remaining-newbie-tickets") + .description("Get the bootstrappers along with the remaining newbie tickets") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + }) + .runner(commands::encointer_ceremonies::bootstrappers_with_remaining_newbie_tickets), + ) + .add_cmd( + Command::new("get-proof-of-attendance") + .description("creates a proof of ProofOfAttendances for an for the given ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .account_arg() + .ceremony_index_arg() + }) + .runner(commands::encointer_ceremonies::get_proof_of_attendance), + ) + .add_cmd( + Command::new("attest-attendees") + .description("Register encointer ceremony claim of attendances for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .optional_cid_arg() + .attestees_arg() + }) + .runner(commands::encointer_ceremonies::attest_attendees), + ) + .add_cmd( + Command::new("new-claim") + .description("create a fresh claim of attendance for account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .arg( + Arg::with_name("vote") + .takes_value(true) + .required(true) + .value_name("VOTE") + .help("participant's vote on the number of people present at meetup time"), + ) + }) + .runner(commands::encointer_ceremonies::new_claim), + ) + .add_cmd( + Command::new("claim-reward") + .description("Claim the rewards for all meetup participants of the last ceremony.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("Account which signs the tx.") + .meetup_index_arg() + .all_flag() + }) + .runner(commands::encointer_ceremonies::claim_reward), + ) + .add_cmd( + Command::new("reputation") + .description("List reputation history for an account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg()}) + .runner(commands::encointer_ceremonies::reputation), + ) + .add_cmd( + Command::new("purge-community-ceremony") + .description("purge all history within the provided ceremony index range for the specified community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .from_cindex_arg() + .to_cindex_arg() + + }) + .runner(commands::encointer_ceremonies::purge_community_ceremony), + ) + .add_cmd( + Command::new("set-meetup-time-offset") + .description("signed value to offset the ceremony meetup time relative to solar noon") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .time_offset_arg() + }) + .runner(commands::encointer_ceremonies::set_meetup_time_offset), + ) + .add_cmd( + Command::new("create-business") + .description("Register a community business on behalf of the account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(commands::encointer_bazaar::create_business), + ) + .add_cmd( + Command::new("update-business") + .description("Update an already existing community business on behalf of the account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(commands::encointer_bazaar::update_business), + ) + .add_cmd( + Command::new("create-offering") + .description("Create an offering for the business belonging to account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(commands::encointer_bazaar::create_offering), + ) + .add_cmd( + Command::new("list-businesses") + .description("List businesses for a community") + .runner(commands::encointer_bazaar::list_businesses), + ) + .add_cmd( + Command::new("list-offerings") + .description("List offerings for a community") + .runner(commands::encointer_bazaar::list_offerings), + ) + .add_cmd( + Command::new("list-business-offerings") + .description("List offerings for a business") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + }) + .runner(commands::encointer_bazaar::list_business_offerings), + ) + .add_cmd( + Command::new("create-faucet") + .description("Create faucet") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_name_arg() + .faucet_balance_arg() + .faucet_drip_amount_arg() + .whitelist_arg() + }) + .runner(commands::encointer_faucet::create_faucet), + ) + .add_cmd( + Command::new("drip-faucet") + .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + .cindex_arg() + }) + .runner(commands::encointer_faucet::drip_faucet), + ) + .add_cmd( + Command::new("dissolve-faucet") + .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_account_arg() + .faucet_beneficiary_arg() + }) + .runner(commands::encointer_faucet::dissolve_faucet), + ) + .add_cmd( + Command::new("close-faucet") + .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + }) + .runner(commands::encointer_faucet::close_faucet), + ) + .add_cmd( + Command::new("set-faucet-reserve-amount") + .description("Set faucet pallet reserve amount") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_reserve_amount_arg() + }) + .runner(commands::encointer_faucet::set_faucet_reserve_amount), + ) + .add_cmd( + Command::new("list-faucets") + .description("list all faucets. use -v to get faucet details.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + .verbose_flag() + }) + .runner(commands::encointer_faucet::list_faucets) + ) + .add_cmd( + Command::new("submit-set-inactivity-timeout-proposal") + .description("Submit set inactivity timeout proposal") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .inactivity_timeout_arg() + }) + .runner(commands::encointer_democracy::submit_set_inactivity_timeout_proposal), + ) + .add_cmd( + Command::new("list-proposals") + .description("list all proposals.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(commands::encointer_democracy::list_proposals), + ) + .add_cmd( + Command::new("vote") + .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .proposal_id_arg() + .vote_arg() + .reputation_vec_arg() + }) + .runner(commands::encointer_democracy::vote), + ) + .add_cmd( + Command::new("update-proposal-state") + .description("Update proposal state") + .options(|app| { + app.setting(AppSettings::ColoredHelp).account_arg().proposal_id_arg() + }) + .runner(commands::encointer_democracy::update_proposal_state), + ) + // To handle when no subcommands match + .no_cmd(|_args, _matches| { + println!("No subcommand matched"); + Ok(()) + }) + .run(); } diff --git a/client/src/utils.rs b/client/src/utils.rs index 2f83421e..0e2cd052 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -1,4 +1,8 @@ -use crate::{exit_code, get_asset_fee_details, get_community_balance, BalanceType}; +use crate::{ + commands::encointer_core::{get_asset_fee_details, get_community_balance}, + exit_code, BalanceType, +}; +use clap::ArgMatches; use encointer_api_client_extension::{Api, EncointerXt}; use encointer_node_notee_runtime::AccountId; use encointer_primitives::{balances::EncointerBalanceConverter, scheduler::CeremonyIndexType}; @@ -11,25 +15,37 @@ use substrate_api_client::{ ac_node_api::Metadata, ac_primitives::Bytes, api::{error::Error as ApiClientError, rpc_api::state::GetStorage}, + rpc::JsonrpseeClient, GetAccountInformation, GetBalance, GetTransactionPayment, Result, SubmitAndWatch, XtStatus, }; +pub async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { + let url = format!( + "{}:{}", + matches.value_of("node-url").unwrap(), + matches.value_of("node-port").unwrap() + ); + debug!("connecting to {}", url); + let client = JsonrpseeClient::new(&url).await.expect("node URL is incorrect"); + Api::new(client).await.unwrap() +} + /// Creates a signed extrinsic from a call /// /// Panics if no signer is set. -pub fn xt(api: &Api, call: C) -> EncointerXt { - let nonce = api.get_nonce().unwrap(); +pub async fn xt(api: &Api, call: C) -> EncointerXt { + let nonce = api.get_nonce().await.unwrap(); api.compose_extrinsic_offline(call, nonce) } /// Wraps the supplied call in a sudo call pub fn sudo_call(metadata: &Metadata, call: C) -> ([u8; 2], C) { - compose_call!(metadata, "Sudo", "sudo", call) + compose_call!(metadata, "Sudo", "sudo", call).unwrap() } /// Wraps the supplied calls in a batch call pub fn batch_call(metadata: &Metadata, calls: Vec) -> ([u8; 2], Vec) { - compose_call!(metadata, "Utility", "batch", calls) + compose_call!(metadata, "Utility", "batch", calls).unwrap() } /// ([pallet_index, call_index], threshold, Proposal,length_bound) @@ -53,19 +69,21 @@ pub fn collective_propose_call( proposal, Compact(length_bound) ) + .unwrap() } -pub fn get_councillors(api: &Api) -> Result> { - api.get_storage("Membership", "Members", None)? +pub async fn get_councillors(api: &Api) -> Result> { + api.get_storage("Membership", "Members", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get councillors".into())) } -pub fn send_and_wait_for_in_block( +pub async fn send_and_wait_for_in_block( api: &Api, xt: EncointerXt, tx_payment_cid: Option<&str>, ) -> Option { - ensure_payment(api, &xt.encode().into(), tx_payment_cid); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap(); + ensure_payment(api, &xt.encode().into(), tx_payment_cid).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); info!("[+] Transaction got included in Block: {:?}\n", report.block_hash.unwrap()); Some(report.extrinsic_hash) } @@ -80,7 +98,7 @@ pub fn print_raw_call(name: &str, call: &Call) { /// This will implicitly distinguish between solo-chain (sudo exists) and parachain /// (sudo doesn't exist). pub fn contains_sudo_pallet(metadata: &Metadata) -> bool { - if metadata.pallet("Sudo").is_ok() { + if metadata.pallet_by_name("Sudo").is_some() { info!("'Sudo' pallet found on chain. Will send privileged xt's as sudo"); true } else { @@ -90,19 +108,20 @@ pub fn contains_sudo_pallet(metadata: &Metadata) -> bool { } /// Checks if the account has sufficient funds. Exits the process if not. -pub fn ensure_payment(api: &Api, encoded_xt: &Bytes, tx_payment_cid: Option<&str>) { +pub async fn ensure_payment(api: &Api, encoded_xt: &Bytes, tx_payment_cid: Option<&str>) { if let Some(cid_str) = tx_payment_cid { - ensure_payment_cc(api, cid_str, encoded_xt); + ensure_payment_cc(api, cid_str, encoded_xt).await; } else { - ensure_payment_native(api, encoded_xt); + ensure_payment_native(api, encoded_xt).await; } } -fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { +async fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { let balance: BalanceType = - get_community_balance(api, cid_str, api.signer_account().unwrap(), None); + get_community_balance(api, cid_str, api.signer_account().unwrap(), None).await; let fee: BalanceType = get_asset_fee_details(api, cid_str, encoded_xt) + .await .unwrap() .inclusion_fee .map(|details| details.base_fee.into_u256().as_u128()) @@ -116,8 +135,8 @@ fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { debug!("account can pay fees in CC: fee: {} bal: {}", fee, balance); } -fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { - let signer_balance = match api.get_account_data(api.signer_account().unwrap()).unwrap() { +async fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { + let signer_balance = match api.get_account_data(api.signer_account().unwrap()).await.unwrap() { Some(bal) => bal.free, None => { error!("account does not exist on chain"); @@ -125,12 +144,13 @@ fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { }, }; let fee = api - .get_fee_details(encoded_xt.clone(), None) + .get_fee_details(encoded_xt, None) + .await .unwrap() .unwrap() .inclusion_fee .map_or_else(|| 0, |details| details.base_fee); - let ed = api.get_existential_deposit().unwrap(); + let ed = api.get_existential_deposit().await.unwrap(); if signer_balance < fee + ed { error!("insufficient funds: fee: {} ed: {} bal: {:?}", fee, ed, signer_balance); std::process::exit(exit_code::FEE_PAYMENT_FAILED); diff --git a/client/test-data/test-locations-mediterranean.json b/client/test-data/test-locations-mediterranean.json index 4404d823..e1884119 100644 --- a/client/test-data/test-locations-mediterranean.json +++ b/client/test-data/test-locations-mediterranean.json @@ -4,7 +4,7 @@ "meta": { "name": "Mediterranea", "symbol": "MTA", - "assets": "QmP2fzfikh7VqTu8pvzd2G2vAd4eK7EaazXTEgqGN6AWoD", + "assets": "QmaRYgDkmmsza2A1zyxy7H7fFE3bELPA535KvCHzEf2kee", "announcementSigner": null, "rules": "loCo" }, diff --git a/node/Cargo.toml b/node/Cargo.toml index f6e2e51e..cd662c2e 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -8,10 +8,10 @@ license = "GPL-3.0" name = "encointer-node-notee" repository = "https://github.com/encointer/encointer-node" # Note the following for the versioning: -# * Align minor version with the runtime. +# * Align major and minor version with polkadot-sdk major.minor. # * Bump patch version for new releases, and make it the release tag. # * The client should follow this version. -version = "1.5.4" +version = "1.8.0" [[bin]] name = "encointer-node-notee" @@ -20,7 +20,7 @@ name = "encointer-node-notee" targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] -substrate-build-script-utils = "3.0.0" +substrate-build-script-utils = { workspace = true } [dependencies] clap = { workspace = true } @@ -54,9 +54,10 @@ sp-runtime = { workspace = true, features = ["std"] } sp-timestamp = { workspace = true, features = ["std"] } # These dependencies are used for the node's RPCs -jsonrpsee = { version = "0.16.2", features = ["server"] } +jsonrpsee = { workspace = true } pallet-transaction-payment-rpc = { workspace = true } sc-basic-authorship = { workspace = true } +sc-chain-spec = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sp-api = { workspace = true, features = ["std"] } @@ -82,8 +83,6 @@ pallet-encointer-communities-rpc-runtime-api = { workspace = true, features = [" # CLI-specific dependencies frame-try-runtime = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } - [features] default = [] @@ -96,9 +95,4 @@ runtime-benchmarks = [ # in the near future. Todo: implement try runtime for encointer-pallets try-runtime = [ "encointer-node-notee-runtime/try-runtime", - "try-runtime-cli/try-runtime", -] - -cli = [ - 'try-runtime-cli', ] diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index 9bbe72e1..b0a75303 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -1,23 +1,6 @@ -// This file is part of Substrate. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Contains code to setup the command invocations in [`super::command`] which would -//! otherwise bloat that module. +//! Setup code for [`super::command`] which would otherwise bloat that module. +//! +//! Should only be used for benchmarking as it may break in other contexts. use crate::service::FullClient; @@ -108,6 +91,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { Ok(extrinsic) } } + /// Create a transaction using the given `call`. /// /// Note: Should only be used for benchmarking. @@ -171,6 +155,6 @@ pub fn inherent_benchmark_data() -> Result { let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) - .map_err(|e| format!("creating inherent data: {e:?}"))?; + .map_err(|e| format!("creating inherent data: {:?}", e))?; Ok(inherent_data) } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 22b6caba..f1cd2a89 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,15 +1,11 @@ use encointer_node_notee_runtime::{ - AccountId, AuraConfig, BalanceType, BalancesConfig, CeremonyPhaseType, EncointerBalancesConfig, - EncointerCeremoniesConfig, EncointerCommunitiesConfig, EncointerDemocracyConfig, - EncointerFaucetConfig, EncointerSchedulerConfig, GrandpaConfig, RuntimeGenesisConfig, - Signature, SudoConfig, SystemConfig, WASM_BINARY, + AccountId, BalanceType, CeremonyPhaseType, RuntimeGenesisConfig, Signature, WASM_BINARY, }; use sc_service::{ChainType, Properties}; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519, Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; - // The URL for the telemetry server. // const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; @@ -38,180 +34,130 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { (get_from_seed::(s), get_from_seed::(s)) } -fn properties() -> Option { - serde_json::from_str( - r#"{ - "ss58Format": 42, - "tokenDecimals": 12, - "tokenSymbol": "ERT" - }"#, - ) - .ok() +fn gesell_properties() -> Properties { + let mut properties = sc_chain_spec::Properties::new(); + properties.insert("tokenSymbol".into(), "ERT".into()); + properties.insert("tokenDecimals".into(), 12.into()); + properties.insert("ss58Format".into(), 2.into()); + properties } pub fn development_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Development", - // ID - "dev", - ChainType::Development, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![authority_keys_from_seed("Alice")], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - ], - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Arbitrary string. Nodes will only synchronize with other nodes that have the same value - // in their `fork_id`. This can be used in order to segregate nodes in cases when multiple - // chains have the same genesis hash. - None, - // Properties - properties(), - // Extensions + Ok(ChainSpec::builder( + WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?, None, + ) + .with_name("Development") + .with_id("dev") + .with_chain_type(ChainType::Development) + .with_properties(gesell_properties()) + .with_genesis_config_patch(testnet_genesis( + // Initial PoA authorities + vec![authority_keys_from_seed("Alice")], + // Sudo account + get_account_id_from_seed::("Alice"), + // Pre-funded accounts + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + ], + true, )) + .build()) } pub fn local_testnet_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Local Testnet", - // ID - "local_testnet", - ChainType::Local, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - ], - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Arbitrary string. Nodes will only synchronize with other nodes that have the same value - // in their `fork_id`. This can be used in order to segregate nodes in cases when multiple - // chains have the same genesis hash. - None, - // Properties - properties(), - // Extensions + Ok(ChainSpec::builder( + WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?, None, + ) + .with_name("Local Testnet") + .with_id("local_testnet") + .with_chain_type(ChainType::Local) + .with_properties(gesell_properties()) + .with_genesis_config_patch(testnet_genesis( + // Initial PoA authorities + vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")], + // Sudo account + get_account_id_from_seed::("Alice"), + // Pre-funded accounts + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + true, )) + .build()) } /// Configure initial storage state for FRAME modules. fn testnet_genesis( - wasm_binary: &[u8], initial_authorities: Vec<(AuraId, GrandpaId)>, root_key: AccountId, endowed_accounts: Vec, _enable_println: bool, -) -> RuntimeGenesisConfig { - RuntimeGenesisConfig { - system: SystemConfig { - // Add Wasm runtime to storage. - code: wasm_binary.to_vec(), - _config: Default::default(), - }, - balances: BalancesConfig { +) -> serde_json::Value { + serde_json::json!({ + "balances": { // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + "balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::>(), }, - aura: AuraConfig { - authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), + "aura": { + "authorities": initial_authorities.iter().map(|x| (x.0.clone())).collect::>(), }, - grandpa: GrandpaConfig { - authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), - _config: Default::default(), + "grandpa": { + "authorities": initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect::>(), }, - sudo: SudoConfig { + "sudo": { // Assign network admin rights. - key: Some(root_key), + "key": Some(root_key), }, - transaction_payment: Default::default(), - encointer_scheduler: EncointerSchedulerConfig { - current_phase: CeremonyPhaseType::Registering, - current_ceremony_index: 1, - phase_durations: vec![ - (CeremonyPhaseType::Registering, 57600000), - (CeremonyPhaseType::Assigning, 28800000), - (CeremonyPhaseType::Attesting, 172800000), + "encointerScheduler": { + "currentPhase": CeremonyPhaseType::Registering, + "currentCeremonyIndex": 1, + "phaseDurations": vec![ + (CeremonyPhaseType::Registering, 604800000u64), // 7d + (CeremonyPhaseType::Assigning, 86400000u64), // 1d + (CeremonyPhaseType::Attesting, 172800000u64), // 2d ], - _config: Default::default(), - }, - encointer_ceremonies: EncointerCeremoniesConfig { - ceremony_reward: BalanceType::from_num(1), - time_tolerance: 600_000, // +-10min - location_tolerance: 1_000, // [m] - endorsement_tickets_per_bootstrapper: 5, - reputation_lifetime: 337, // 7.02 days at 30min ceremony cycle - inactivity_timeout: 168500, // 10 years at 30min ceremony cycle - meetup_time_offset: 0, - endorsement_tickets_per_reputable: 5, - _config: Default::default(), }, - encointer_communities: EncointerCommunitiesConfig { - min_solar_trip_time_s: 1, // [s] - max_speed_mps: 1, // [m/s] suggested would be 83m/s, - _config: Default::default(), + "encointerCeremonies": { + "ceremonyReward": BalanceType::from_num(1), + "timeTolerance": 600_000u64, // +-10min + "locationTolerance": 1_000, // [m] + "endorsementTicketsPerBootstrapper": 5, + "endorsementTicketsPerReputable": 5, + "reputationLifetime": 337, + "inactivityTimeout": 168500, // idle ceremonies before purging community + "meetupTimeOffset": 0, }, - encointer_balances: EncointerBalancesConfig { - // Lower values lead to lower fees in CC proportionally. - // Translates to 0.01 CC-fee per 5muKSM fee at 20 CC nominal income - fee_conversion_factor: 100_000, - _config: Default::default(), + "encointerCommunities": { + "minSolarTripTimeS": 1, // [s] + "maxSpeedMps": 1, // [m/s] suggested would be 83m/s for security, }, - encointer_faucet: EncointerFaucetConfig { - reserve_amount: 100_000_000_000_000, - _config: Default::default(), + "encointerBalances": { + // for relative adjustment. + // 100_000 translates 5uKSM to 0.01 CC if ceremony reward is 20 CC + // lower values lead to lower fees in CC proportionally + "feeConversionFactor": 100_000u32, }, - encointer_democracy: EncointerDemocracyConfig { - proposal_count: 0, - _config: Default::default(), + "encointerFaucet": { + "reserveAmount": 10_000_000_000_000u128, }, - } + "encointerDemocracy": { + "proposalCount": 0 + } + }) } diff --git a/node/src/cli.rs b/node/src/cli.rs index 4ab4d342..98037eb8 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -2,7 +2,7 @@ use sc_cli::RunCmd; #[derive(Debug, clap::Parser)] pub struct Cli { - #[clap(subcommand)] + #[command(subcommand)] pub subcommand: Option, #[clap(flatten)] @@ -10,9 +10,10 @@ pub struct Cli { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Subcommand { /// Key management cli utilities - #[clap(subcommand)] + #[command(subcommand)] Key(sc_cli::KeySubcommand), /// Build a chain specification. @@ -37,15 +38,12 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Sub-commands concerned with benchmarking. - #[clap(subcommand)] + #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Try some command against runtime state. - #[cfg(feature = "try-runtime")] - TryRuntime(try_runtime_cli::TryRuntimeCmd), - - /// Try some command against runtime state. Note: `try-runtime` feature must be enabled. - #[cfg(not(feature = "try-runtime"))] + /// Try-runtime has migrated to a standalone CLI + /// (). The subcommand exists as a stub and + /// deprecation notice. It will be removed entirely some time after Janurary 2024. TryRuntime, /// Db meta columns information. diff --git a/node/src/command.rs b/node/src/command.rs index 5d5d68af..470af2ad 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -27,9 +27,6 @@ use sc_cli::SubstrateCli; use sc_service::PartialComponents; use sp_keyring::Sr25519Keyring; -#[cfg(feature = "try-runtime")] -use try_runtime_cli::block_building_info::timestamp_with_aura_info; - impl SubstrateCli for Cli { fn impl_name() -> String { "Encointer Node noTEE".into() @@ -137,7 +134,7 @@ pub fn run() -> sc_cli::Result<()> { ) } - cmd.run::(config) + cmd.run::, ()>(config) }, BenchmarkCmd::Block(cmd) => { let PartialComponents { client, .. } = service::new_partial(&config)?; @@ -188,33 +185,8 @@ pub fn run() -> sc_cli::Result<()> { } }) }, - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime(cmd)) => { - use crate::service::ExecutorDispatch; - use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - // we don't need any of the components of new_partial, just a runtime, or a task - // manager to do `async_run`. - let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(config.tokio_handle.clone(), registry) - .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; - let info_provider = timestamp_with_aura_info(6000); - - Ok(( - cmd.run::::ExtendHostFunctions, - >, _>(Some(info_provider)), - task_manager, - )) - }) - }, - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ - You can enable it with `--features try-runtime`." - .into()), + Some(Subcommand::TryRuntime) => + Err("TryRuntime is deprecated. use standalone cli instead".into()), Some(Subcommand::ChainInfo(cmd)) => { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run::(&config)) diff --git a/node/src/main.rs b/node/src/main.rs index 426cbabb..8918dd43 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,13 +1,12 @@ //! Substrate Node Template CLI library. #![warn(missing_docs)] -mod chain_spec; -#[macro_use] -mod service; mod benchmarking; +mod chain_spec; mod cli; mod command; mod rpc; +mod service; fn main() -> sc_cli::Result<()> { command::run() diff --git a/node/src/service.rs b/node/src/service.rs index 256c933b..9d0ab8aa 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -5,62 +5,38 @@ use futures::FutureExt; use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use sc_consensus_grandpa::SharedVoterState; -pub use sc_executor::NativeElseWasmExecutor; -use sc_executor::{HeapAllocStrategy, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; -// Our native executor instance. -pub struct ExecutorDispatch; - -impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { - /// Only enable the benchmarking host functions when we actually want to benchmark. - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - /// Otherwise we only use the default Substrate host functions. - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = (); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - encointer_node_notee_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - encointer_node_notee_runtime::native_version() - } -} - -pub(crate) type FullClient = - sc_service::TFullClient>; +pub(crate) type FullClient = sc_service::TFullClient< + Block, + RuntimeApi, + sc_executor::WasmExecutor, +>; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; -#[allow(clippy::type_complexity)] -pub fn new_partial( - config: &Configuration, -) -> Result< - sc_service::PartialComponents< - FullClient, - FullBackend, - FullSelectChain, - sc_consensus::DefaultImportQueue, - sc_transaction_pool::FullPool, - ( - sc_consensus_grandpa::GrandpaBlockImport< - FullBackend, - Block, - FullClient, - FullSelectChain, - >, - sc_consensus_grandpa::LinkHalf, - Option, - ), - >, - ServiceError, -> { +/// The minimum period of blocks on which justifications will be +/// imported and generated. +const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; + +pub type Service = sc_service::PartialComponents< + FullClient, + FullBackend, + FullSelectChain, + sc_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + ( + sc_consensus_grandpa::GrandpaBlockImport, + sc_consensus_grandpa::LinkHalf, + Option, + ), +>; + +pub fn new_partial(config: &Configuration) -> Result { let telemetry = config .telemetry_endpoints .clone() @@ -72,19 +48,7 @@ pub fn new_partial( }) .transpose()?; - let heap_pages = config - .default_heap_pages - .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); - - let executor = sc_executor::WasmExecutor::builder() - .with_execution_method(config.wasm_method) - .with_max_runtime_instances(config.max_runtime_instances) - .with_runtime_cache_size(config.runtime_cache_size) - .with_onchain_heap_alloc_strategy(heap_pages) - .with_offchain_heap_alloc_strategy(heap_pages) - .build(); - let executor = NativeElseWasmExecutor::::new_with_wasm_executor(executor); - + let executor = sc_service::new_wasm_executor::(config); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( config, @@ -110,7 +74,8 @@ pub fn new_partial( let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), - &(client.clone() as Arc<_>), + GRANDPA_JUSTIFICATION_PERIOD, + &client, select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; @@ -171,10 +136,9 @@ pub fn new_full(config: Configuration) -> Result { &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), &config.chain_spec, ); - - net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( - grandpa_protocol_name.clone(), - )); + let (grandpa_protocol_config, grandpa_notification_service) = + sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()); + net_config.add_notification_protocol(grandpa_protocol_config); let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), @@ -191,7 +155,8 @@ pub fn new_full(config: Configuration) -> Result { spawn_handle: task_manager.spawn_handle(), import_queue, block_announce_validator_builder: None, - warp_sync_params: Some(sc_service::WarpSyncParams::WithProvider(warp_sync)), + warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), + block_relay: None, })?; if config.offchain_worker.enabled { @@ -243,17 +208,17 @@ pub fn new_full(config: Configuration) -> Result { }; let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { - rpc_builder: rpc_extensions_builder, + network: network.clone(), client: client.clone(), - transaction_pool: transaction_pool.clone(), - task_manager: &mut task_manager, - config, keystore: keystore_container.keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_builder: rpc_extensions_builder, backend, - network: network.clone(), - sync_service: sync_service.clone(), system_rpc_tx, tx_handler_controller, + sync_service: sync_service.clone(), + config, telemetry: telemetry.as_mut(), })?; @@ -313,7 +278,7 @@ pub fn new_full(config: Configuration) -> Result { let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), - justification_period: 512, + justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, name: Some(name), observer_enabled: false, keystore, @@ -333,6 +298,7 @@ pub fn new_full(config: Configuration) -> Result { link: grandpa_link, network, sync: Arc::new(sync_service), + notification_service: grandpa_notification_service, voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state: SharedVoterState::empty(), diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 9f95edf6..475f59be 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -7,7 +7,7 @@ name = "encointer-node-notee-runtime" repository = "https://github.com/encointer/encointer-node/" # minor revision must match node/client # patch revision must match runtime spec_version -version = "1.5.30" +version = "1.8.31" [dependencies] parity-scale-codec = { workspace = true } @@ -50,18 +50,18 @@ sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } sp-core = { workspace = true } +sp-genesis-builder = { workspace = true } sp-inherents = { workspace = true } sp-offchain = { workspace = true } sp-runtime = { workspace = true } sp-session = { workspace = true } sp-staking = { workspace = true } sp-std = { workspace = true } +sp-storage = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } frame-try-runtime = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } - # Used for the node's RPCs frame-system-rpc-runtime-api = { workspace = true } @@ -116,6 +116,7 @@ std = [ "sp-block-builder/std", "sp-consensus-aura/std", "sp-core/std", + "sp-genesis-builder/std", "sp-inherents/std", "sp-offchain/std", "sp-runtime/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5bbc02b8..755256a8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -5,10 +5,10 @@ // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - use frame_support::{ + derive_impl, + genesis_builder_helper::{build_config, create_default_config}, traits::{tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter}, - RuntimeDebug, }; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, @@ -20,9 +20,9 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, ConstU32, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Verify}, + traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, MultiSignature, + ApplyExtrinsicResult, MultiSignature, RuntimeDebug, }; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -67,8 +67,12 @@ pub use encointer_primitives::{ communities::{CommunityIdentifier, Location}, scheduler::CeremonyPhaseType, }; -use frame_support::traits::ConstBool; +use frame_support::traits::{ + tokens::{ConversionFromAssetBalance, PayFromAccount}, + ConstBool, +}; use frame_system::{EnsureRoot, EnsureSigned}; +use sp_runtime::traits::IdentityLookup; mod weights; @@ -132,7 +136,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("encointer-node-notee"), impl_name: create_runtime_str!("encointer-node-notee"), authoring_version: 0, - spec_version: 30, + spec_version: 31, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 5, @@ -254,7 +258,7 @@ parameter_types! { } // Configure FRAME pallets to include in runtime. - +#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = frame_support::traits::Everything; @@ -266,42 +270,20 @@ impl frame_system::Config for Runtime { type BlockLength = BlockLength; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. type Nonce = Index; /// The type for hashing blocks and tries. type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// The weight of database operations that the runtime can invoke. type DbWeight = RocksDbWeight; /// Version of the runtime. type Version = Version; - /// Converts a module to the index of the module in `construct_runtime!`. - /// - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// What to do if a new account is created. - type OnNewAccount = (); - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); /// The data to be stored in an account. type AccountData = pallet_balances::AccountData; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; - /// The set code logic, just the default since we're not a parachain. - type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } @@ -323,13 +305,11 @@ impl pallet_aura::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type KeyOwnerProof = <() as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof; - type EquivocationReportSystem = (); - type WeightInfo = (); // grandpa has default non-zero implementations for `()` type MaxAuthorities = MaxAuthorities; + type MaxNominators = ConstU32<0>; type MaxSetIdSessionEntries = MaxSetIdSessionEntries; } @@ -365,8 +345,8 @@ impl pallet_balances::Config for Runtime { type WeightInfo = pallet_balances::weights::SubstrateWeight; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; + type RuntimeFreezeReason = (); } parameter_types! { @@ -487,9 +467,21 @@ parameter_types! { pub const ProposalBondMinimum: Balance = 100 * MILLICENTS; pub const ProposalBondMaximum: Balance = 500 * CENTS; pub const SpendPeriod: BlockNumber = 6 * DAYS; + pub const PayoutSpendPeriod: BlockNumber = 6 * DAYS; pub const Burn: Permill = Permill::from_percent(1); pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); pub const MaxApprovals: u32 = 10; + pub TreasuryAccount: AccountId = Treasury::account_id(); +} + +pub struct NoConversion; +impl ConversionFromAssetBalance for NoConversion { + type Error = (); + fn from_asset_balance(balance: Balance, _asset_id: ()) -> Result { + return Ok(balance) + } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(_: ()) {} } impl pallet_treasury::Config for Runtime { @@ -509,6 +501,14 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = MaxApprovals; type WeightInfo = weights::pallet_treasury::WeightInfo; type SpendOrigin = frame_support::traits::NeverEnsureOrigin; //No spend, no bounty + type AssetKind = (); + type Beneficiary = AccountId; + type BeneficiaryLookup = IdentityLookup; + type Paymaster = PayFromAccount; + type BalanceConverter = NoConversion; + type PayoutPeriod = PayoutSpendPeriod; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); } impl pallet_encointer_reputation_commitments::Config for Runtime { @@ -526,15 +526,14 @@ impl pallet_encointer_faucet::Config for Runtime { parameter_types! { pub const ConfirmationPeriod:BlockNumber = 20; - pub const ProposalLifetime: BlockNumber = 40; + pub const ProposalLifetime: Moment = 20 * 60 * 1000; // [ms] } impl pallet_encointer_democracy::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxReputationVecLength = ConstU32<1024>; + type MaxReputationVecLength = ConstU32<64>; type ConfirmationPeriod = ConfirmationPeriod; type ProposalLifetime = ProposalLifetime; - type ProposalLifetimeCycles = ConstU32<1>; type MinTurnout = ConstU128<1>; type WeightInfo = weights::pallet_encointer_democracy::WeightInfo; } @@ -711,6 +710,16 @@ impl_runtime_apis! { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + build_config::(config) + } + } + impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { opaque::SessionKeys::generate(seed) @@ -878,7 +887,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use sp_storage::TrackedStorageKey; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; diff --git a/runtime/src/weights/pallet_treasury.rs b/runtime/src/weights/pallet_treasury.rs index 1d1872cc..52b59a25 100644 --- a/runtime/src/weights/pallet_treasury.rs +++ b/runtime/src/weights/pallet_treasury.rs @@ -17,24 +17,22 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-04-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-09-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 +//! HOSTNAME: `a3dce7bd4066`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("spec-kusama.json")`, DB CACHE: 1024 // Executed Command: -// ./target/production/polkadot +// /builds/polkadot-sdk/target/production/polkadot // benchmark // pallet -// --chain=kusama-dev -// --steps=50 -// --repeat=20 +// --chain=spec-kusama.json // --pallet=pallet_treasury -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --extrinsic= +// --output=/builds/runtimes/relay/kusama/src/weights +// --header=/builds/bench/header.txt +// --no-median-slopes +// --no-min-squares #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,105 +45,167 @@ use core::marker::PhantomData; /// Weight functions for `pallet_treasury`. pub struct WeightInfo(PhantomData); impl pallet_treasury::WeightInfo for WeightInfo { - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - fn spend() -> Weight { + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn spend_local() -> Weight { // Proof Size summary in bytes: // Measured: `6` // Estimated: `1887` - // Minimum execution time: 14_692_000 picoseconds. - Weight::from_parts(15_059_000, 0) + // Minimum execution time: 7_563_000 picoseconds. + Weight::from_parts(7_868_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn propose_spend() -> Weight { // Proof Size summary in bytes: // Measured: `107` // Estimated: `1489` - // Minimum execution time: 26_358_000 picoseconds. - Weight::from_parts(26_761_000, 0) + // Minimum execution time: 16_827_000 picoseconds. + Weight::from_parts(17_262_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Treasury Proposals (r:1 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn reject_proposal() -> Weight { // Proof Size summary in bytes: // Measured: `265` // Estimated: `3593` - // Minimum execution time: 39_586_000 picoseconds. - Weight::from_parts(40_113_000, 0) + // Minimum execution time: 25_789_000 picoseconds. + Weight::from_parts(26_398_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Treasury Proposals (r:1 w:0) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:0) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. fn approve_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `433 + p * (8 ±0)` // Estimated: `3573` - // Minimum execution time: 9_225_000 picoseconds. - Weight::from_parts(11_898_418, 0) + // Minimum execution time: 5_353_000 picoseconds. + Weight::from_parts(8_423_989, 0) .saturating_add(Weight::from_parts(0, 3573)) - // Standard Error: 888 - .saturating_add(Weight::from_parts(30_177, 0).saturating_mul(p.into())) + // Standard Error: 1_120 + .saturating_add(Weight::from_parts(45_883, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn remove_approval() -> Weight { // Proof Size summary in bytes: // Measured: `90` // Estimated: `1887` - // Minimum execution time: 6_896_000 picoseconds. - Weight::from_parts(7_093_000, 0) + // Minimum execution time: 4_075_000 picoseconds. + Weight::from_parts(4_286_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Treasury Deactivated (r:1 w:1) - /// Proof: Treasury Deactivated (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Balances InactiveIssuance (r:1 w:1) - /// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:100 w:100) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: System Account (r:201 w:201) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Bounties BountyApprovals (r:1 w:1) - /// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// The range of component `p` is `[0, 100]`. + /// Storage: `Treasury::Deactivated` (r:1 w:1) + /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:99 w:99) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:199 w:199) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. fn on_initialize_proposals(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `264 + p * (251 ±0)` + // Measured: `294 + p * (251 ±0)` // Estimated: `3593 + p * (5206 ±0)` - // Minimum execution time: 62_552_000 picoseconds. - Weight::from_parts(65_526_861, 0) + // Minimum execution time: 34_895_000 picoseconds. + Weight::from_parts(40_046_318, 0) .saturating_add(Weight::from_parts(0, 3593)) - // Standard Error: 20_034 - .saturating_add(Weight::from_parts(37_730_613, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Standard Error: 6_188 + .saturating_add(Weight::from_parts(25_772_314, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into())) } + /// Storage: `Treasury::SpendCount` (r:1 w:1) + /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Spends` (r:0 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1489` + // Minimum execution time: 8_598_000 picoseconds. + Weight::from_parts(8_937_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) + /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) + /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::Queries` (r:0 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `251` + // Estimated: `5318` + // Minimum execution time: 29_981_000 picoseconds. + Weight::from_parts(30_787_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::Queries` (r:1 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `5318` + // Minimum execution time: 15_985_000 picoseconds. + Weight::from_parts(16_431_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn void_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `5318` + // Minimum execution time: 8_515_000 picoseconds. + Weight::from_parts(8_795_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index be534184..b01d6494 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,13 @@ [toolchain] -channel = "nightly-2023-05-22" -targets = ["wasm32-unknown-unknown"] +channel = "stable" profile = "default" # include rustfmt, clippy +components = [ + "cargo", + "clippy", + "rust-analyzer", + "rust-src", + "rust-std", + "rustc", + "rustfmt", +] +targets = ["wasm32-unknown-unknown"]