From ba427d5615d442933976e1e3f21ce2f1840323e9 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 12 Dec 2023 17:52:00 +0100 Subject: [PATCH] chore(deps): bump subxt, subxt-signer, scale-value (#726) * chore(deps): bump subxt, subxt-signer, scale-value * bump rustc 1.74 * switch docker image for CI * Update .gitlab-ci.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> --------- Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- Cargo.lock | 392 +++++++++++------------------ Cargo.toml | 8 +- src/client.rs | 17 +- src/commands/dry_run.rs | 3 +- src/commands/emergency_solution.rs | 18 +- src/commands/monitor.rs | 34 ++- 7 files changed, 191 insertions(+), 283 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba7179fae..3350e5534 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ default: - api_failure variables: - CI_IMAGE: "paritytech/ci-linux:production" + CI_IMAGE: "paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204" # BUILDAH_IMAGE is defined in group variables BUILDAH_COMMAND: "buildah --storage-driver overlay2" diff --git a/Cargo.lock b/Cargo.lock index 38432e9a8..73a782f43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,31 +46,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" version = "0.7.7" @@ -104,6 +79,12 @@ 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" @@ -555,10 +536,10 @@ dependencies = [ ] [[package]] -name = "atomic" -version = "0.5.3" +name = "atomic-take" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" [[package]] name = "atomic-waker" @@ -866,19 +847,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - [[package]] name = "chrono" version = "0.4.31" @@ -899,7 +867,6 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", - "zeroize", ] [[package]] @@ -1133,15 +1100,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "curve25519-dalek" version = "2.1.3" @@ -1196,19 +1154,6 @@ dependencies = [ "syn 2.0.39", ] -[[package]] -name = "curve25519-dalek-ng" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.6.4", - "subtle-ng", - "zeroize", -] - [[package]] name = "darling" version = "0.14.4" @@ -1478,6 +1423,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.1", + "ed25519", + "hashbrown 0.14.3", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" version = "1.9.0" @@ -1667,7 +1627,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std 12.0.0", + "sp-std", "sp-storage", "static_assertions", ] @@ -1699,7 +1659,7 @@ dependencies = [ "sp-core", "sp-npos-elections", "sp-runtime", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -1760,7 +1720,7 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std 12.0.0", + "sp-std", "sp-tracing", "sp-weights", "static_assertions", @@ -1783,7 +1743,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "sp-core-hashing 13.0.0", + "sp-core-hashing", "syn 2.0.39", ] @@ -1826,7 +1786,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std 12.0.0", + "sp-std", "sp-version", "sp-weights", ] @@ -2014,13 +1974,13 @@ dependencies = [ ] [[package]] -name = "ghash" -version = "0.5.0" +name = "getrandom_or_panic" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "opaque-debug 0.3.0", - "polyval", + "rand 0.8.5", + "rand_core 0.6.4", ] [[package]] @@ -2109,6 +2069,8 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ + "ahash 0.8.6", + "allocator-api2", "serde", ] @@ -2385,12 +2347,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "intx" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -2670,9 +2626,12 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" +checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" +dependencies = [ + "hashbrown 0.14.3", +] [[package]] name = "mach" @@ -3049,7 +3008,7 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std 12.0.0", + "sp-std", "strum", ] @@ -3065,7 +3024,7 @@ dependencies = [ "parity-scale-codec", "sp-npos-elections", "sp-runtime", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -3294,18 +3253,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "polyval" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3745,12 +3692,12 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ruzstd" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" dependencies = [ "byteorder", - "thiserror-core", + "derive_more", "twox-hash", ] @@ -3791,9 +3738,9 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" +checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" dependencies = [ "derive_more", "parity-scale-codec", @@ -3806,9 +3753,9 @@ dependencies = [ [[package]] name = "scale-decode-derive" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" +checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ "darling 0.14.4", "proc-macro-crate", @@ -3873,9 +3820,9 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6538d1cc1af9c0baf401c57da8a6d4730ef582db0d330d2efa56ec946b5b0283" +checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" dependencies = [ "base58", "blake2", @@ -3931,18 +3878,20 @@ dependencies = [ [[package]] name = "schnorrkel" -version = "0.10.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ + "aead", "arrayref", "arrayvec 0.7.4", - "curve25519-dalek-ng", + "curve25519-dalek 4.1.1", + "getrandom_or_panic", "merlin 3.0.0", "rand_core 0.6.4", "serde_bytes", - "sha2 0.9.9", - "subtle-ng", + "sha2 0.10.8", + "subtle", "zeroize", ] @@ -3987,11 +3936,11 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ - "secp256k1-sys 0.8.1", + "secp256k1-sys 0.9.1", ] [[package]] @@ -4005,9 +3954,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "4dd97a086ec737e30053fd5c46f097465d25bb81dd3608825f65298c4c98be83" dependencies = [ "cc", ] @@ -4201,9 +4150,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "54ac45299ccbd390721be55b412d41931911f654fa99e2cb8bfb57184b2061fe" [[package]] name = "slab" @@ -4239,29 +4188,31 @@ dependencies = [ [[package]] name = "smoldot" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cce5e2881b30bad7ef89f383a816ad0b22c45915911f28499026de4a76d20ee" +checksum = "eca99148e026936bbc444c3708748207033968e4ef1c33bfc885660ae4d44d21" dependencies = [ "arrayvec 0.7.4", - "async-lock 2.8.0", - "atomic", + "async-lock 3.1.2", + "atomic-take", "base64 0.21.5", "bip39", "blake2-rfc", "bs58", + "chacha20", "crossbeam-queue", "derive_more", - "ed25519-zebra", + "ed25519-zebra 4.0.3", "either", - "event-listener 2.5.3", + "event-listener 3.1.0", "fnv", - "futures-channel", + "futures-lite 2.0.1", "futures-util", "hashbrown 0.14.3", "hex", "hmac 0.12.1", - "itertools 0.10.5", + "itertools 0.11.0", + "libm", "libsecp256k1", "merlin 3.0.0", "no-std-net", @@ -4271,67 +4222,59 @@ dependencies = [ "num-traits", "pbkdf2 0.12.2", "pin-project", + "poly1305", "rand 0.8.5", "rand_chacha 0.3.1", "ruzstd", - "schnorrkel 0.10.2", + "schnorrkel 0.11.4", "serde", "serde_json", "sha2 0.10.8", + "sha3", "siphasher", "slab", "smallvec", - "smol", - "snow", "soketto", - "tiny-keccak", "twox-hash", "wasmi", + "x25519-dalek", + "zeroize", ] [[package]] name = "smoldot-light" -version = "0.6.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2f7b4687b83ff244ef6137735ed5716ad37dcdf3ee16c4eb1a32fb9808fa47" +checksum = "0e6f1898682b618b81570047b9d870b3faaff6ae1891b468eddd94d7f903c2fe" dependencies = [ - "async-lock 2.8.0", + "async-channel 2.1.1", + "async-lock 3.1.2", + "base64 0.21.5", "blake2-rfc", "derive_more", "either", - "event-listener 2.5.3", + "event-listener 3.1.0", "fnv", "futures-channel", + "futures-lite 2.0.1", "futures-util", "hashbrown 0.14.3", "hex", - "itertools 0.10.5", + "itertools 0.11.0", "log", "lru", + "no-std-net", "parking_lot", + "pin-project", "rand 0.8.5", + "rand_chacha 0.3.1", "serde", "serde_json", "siphasher", "slab", "smol", "smoldot", -] - -[[package]] -name = "snow" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" -dependencies = [ - "aes-gcm", - "blake2", - "chacha20poly1305", - "curve25519-dalek 4.1.1", - "rand_core 0.6.4", - "rustc_version", - "sha2 0.10.8", - "subtle", + "zeroize", ] [[package]] @@ -4385,7 +4328,7 @@ dependencies = [ "sp-metadata-ir", "sp-runtime", "sp-state-machine", - "sp-std 12.0.0", + "sp-std", "sp-trie", "sp-version", "thiserror", @@ -4417,7 +4360,7 @@ dependencies = [ "serde", "sp-core", "sp-io", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4431,7 +4374,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std 12.0.0", + "sp-std", "static_assertions", ] @@ -4448,7 +4391,7 @@ dependencies = [ "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "futures", "hash-db", "hash256-std-hasher", @@ -4469,11 +4412,11 @@ dependencies = [ "secp256k1 0.24.3", "secrecy", "serde", - "sp-core-hashing 13.0.0", + "sp-core-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std 12.0.0", + "sp-std", "sp-storage", "ss58-registry", "substrate-bip39", @@ -4483,21 +4426,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee599a8399448e65197f9a6cee338ad192e9023e35e31f22382964c3c174c68" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3", - "sp-std 8.0.0", - "twox-hash", -] - [[package]] name = "sp-core-hashing" version = "13.0.0" @@ -4519,7 +4447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ce3e6931303769197da81facefa86159fa1085dcd96ecb7e7407b5b93582a0" dependencies = [ "quote", - "sp-core-hashing 13.0.0", + "sp-core-hashing", "syn 2.0.39", ] @@ -4542,7 +4470,7 @@ checksum = "884d05160bc89d0943d1c9fb8006c3d44b80f37f8af607aeff8d4d9cc82e279a" dependencies = [ "environmental", "parity-scale-codec", - "sp-std 12.0.0", + "sp-std", "sp-storage", ] @@ -4555,7 +4483,7 @@ dependencies = [ "serde_json", "sp-api", "sp-runtime", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4569,7 +4497,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std 12.0.0", + "sp-std", "thiserror", ] @@ -4591,7 +4519,7 @@ dependencies = [ "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std 12.0.0", + "sp-std", "sp-tracing", "sp-trie", "tracing", @@ -4620,7 +4548,7 @@ dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4635,7 +4563,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4668,7 +4596,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std 12.0.0", + "sp-std", "sp-weights", ] @@ -4684,7 +4612,7 @@ dependencies = [ "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std 12.0.0", + "sp-std", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -4716,7 +4644,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4734,19 +4662,13 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std 12.0.0", + "sp-std", "sp-trie", "thiserror", "tracing", "trie-db", ] -[[package]] -name = "sp-std" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" - [[package]] name = "sp-std" version = "12.0.0" @@ -4764,7 +4686,7 @@ dependencies = [ "ref-cast", "serde", "sp-debug-derive", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4774,7 +4696,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d727cb5265641ffbb7d4e42c18b63e29f6cfdbd240aae3bcf093c3d6eb29a19" dependencies = [ "parity-scale-codec", - "sp-std 12.0.0", + "sp-std", "tracing", "tracing-core", "tracing-subscriber 0.2.25", @@ -4798,7 +4720,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", - "sp-std 12.0.0", + "sp-std", "thiserror", "tracing", "trie-db", @@ -4818,7 +4740,7 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std 12.0.0", + "sp-std", "sp-version-proc-macro", "thiserror", ] @@ -4845,7 +4767,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std 12.0.0", + "sp-std", "wasmtime", ] @@ -4862,7 +4784,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-debug-derive", - "sp-std 12.0.0", + "sp-std", ] [[package]] @@ -4955,17 +4877,11 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "subtle-ng" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" - [[package]] name = "subxt" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "588b8ce92699eeb06290f4fb02dad4f7e426c4e6db4d53889c6bcbc808cf24ac" +checksum = "f7cf683962113b84ce5226bdf6f27d7f92a7e5bb408a5231f6c205407fbb20df" dependencies = [ "async-trait", "base58", @@ -4986,7 +4902,7 @@ dependencies = [ "scale-value", "serde", "serde_json", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "subxt-lightclient", "subxt-macro", "subxt-metadata", @@ -4996,9 +4912,9 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98f5a534c8d475919e9c845d51fc2316da4fcadd04fe17552d932d2106de930e" +checksum = "12800ad6128b4bfc93d2af89b7d368bff7ea2f6604add35f96f6a8c06c7f9abf" dependencies = [ "frame-metadata 16.0.0", "heck", @@ -5016,9 +4932,9 @@ dependencies = [ [[package]] name = "subxt-lightclient" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10fd0ac9b091211f962b6ae19e26cd08e0b86efa064dfb7fac69c8f79f122329" +checksum = "243765099b60d97dc7fc80456ab951758a07ed0decb5c09283783f06ca04fc69" dependencies = [ "futures", "futures-util", @@ -5033,11 +4949,12 @@ dependencies = [ [[package]] name = "subxt-macro" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e8be9ab6fe88b8c13edbe15911e148482cfb905a8b8d5b8d766a64c54be0bd" +checksum = "d5086ce2a90e723083ff19b77f06805d00e732eac3e19c86f6cd643d4255d334" dependencies = [ "darling 0.20.3", + "parity-scale-codec", "proc-macro-error", "subxt-codegen", "syn 2.0.39", @@ -5045,22 +4962,22 @@ dependencies = [ [[package]] name = "subxt-metadata" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6898275765d36a37e5ef564358e0341cf41b5f3a91683d7d8b859381b65ac8a" +checksum = "19dc60f779bcab44084053e12d4ad5ac18ee217dbe8e26c919e7086fc0228d30" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "thiserror", ] [[package]] name = "subxt-signer" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82e5abb896d5f5a6581d5b86a5e7f015e318122498d8163211e8f61f83b54d2" +checksum = "05cc81461f8262b62acf7bfe178a45f22a40336a6ace6a3093bd3e22d7012ba3" dependencies = [ "bip39", "hex", @@ -5068,11 +4985,11 @@ dependencies = [ "parity-scale-codec", "pbkdf2 0.12.2", "regex", - "schnorrkel 0.10.2", - "secp256k1 0.27.0", + "schnorrkel 0.11.4", + "secp256k1 0.28.0", "secrecy", "sha2 0.10.8", - "sp-core-hashing 9.0.0", + "sp-core-hashing", "subxt", "thiserror", "zeroize", @@ -5136,26 +5053,6 @@ dependencies = [ "thiserror-impl", ] -[[package]] -name = "thiserror-core" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" -dependencies = [ - "thiserror-core-impl", -] - -[[package]] -name = "thiserror-core-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - [[package]] name = "thiserror-impl" version = "1.0.50" @@ -5694,11 +5591,10 @@ checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasmi" -version = "0.30.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51fb5c61993e71158abf5bb863df2674ca3ec39ed6471c64f07aeaf751d67b4" +checksum = "acfc1e384a36ca532d070a315925887247f3c7e23567e23e0ac9b1c5d6b8bf76" dependencies = [ - "intx", "smallvec", "spin", "wasmi_arena", @@ -5714,9 +5610,9 @@ checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", "libm", @@ -6141,6 +6037,18 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek 4.1.1", + "rand_core 0.6.4", + "serde", + "zeroize", +] + [[package]] name = "yap" version = "0.11.0" diff --git a/Cargo.toml b/Cargo.toml index 1841de50b..9d0bdf348 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "polkadot-staking-miner" version = "1.2.0" authors = ["Parity Technologies "] edition = "2021" -rust-version = "1.70.0" +rust-version = "1.74.0" license = "GPL-3.0" repository = "https://github.com/paritytech/polkadot-staking-miner" homepage = "https://www.parity.io/" @@ -23,9 +23,9 @@ tokio = { version = "1.35", features = ["macros", "rt-multi-thread", "sync", "si pin-project-lite = "0.2" # subxt -scale-value = "0.12.0" -subxt = "0.32.1" -subxt-signer = { version = "0.32.1", features = ["subxt"] } +scale-value = "0.13" +subxt = "0.33" +subxt-signer = { version = "0.33", features = ["subxt"] } # polkadot-sdk frame-election-provider-support = "26.0.0" diff --git a/src/client.rs b/src/client.rs index d0a20a120..e8733f20c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -9,8 +9,6 @@ pub struct Client { rpc: RpcClient, /// Access to chain APIs such as storage, events etc. chain_api: ChainClient, - /// Raw RPC client. - raw_rpc: RawRpcClient, } impl Client { @@ -39,7 +37,7 @@ impl Client { let chain_api = ChainClient::from_rpc_client(rpc.clone()).await?; - Ok(Self { rpc: RpcClient::new(rpc.clone()), raw_rpc: rpc, chain_api }) + Ok(Self { rpc: RpcClient::new(rpc), chain_api }) } /// Get a reference to the RPC interface exposed by subxt. @@ -51,17 +49,4 @@ impl Client { pub fn chain_api(&self) -> &ChainClient { &self.chain_api } - - // This is exposed until a new version of subxt is released. - pub async fn rpc_system_account_next_index( - &self, - account_id: &T, - ) -> Result - where - T: serde::Serialize, - { - self.raw_rpc - .request("system_accountNextIndex", subxt::rpc_params![&account_id]) - .await - } } diff --git a/src/commands/dry_run.rs b/src/commands/dry_run.rs index 663e2f6a0..77bd1a6bf 100644 --- a/src/commands/dry_run.rs +++ b/src/commands/dry_run.rs @@ -112,7 +112,8 @@ where log::info!(target: LOG_TARGET, "Loaded account {}, {:?}", signer.public_key().to_account_id(), account_info); let nonce = client - .rpc_system_account_next_index(&signer.public_key().to_account_id()) + .rpc() + .system_account_next_index(&signer.public_key().to_account_id()) .await?; let tx = epm::signed_solution(raw_solution)?; let xt = client.chain_api().tx().create_signed_with_nonce( diff --git a/src/commands/emergency_solution.rs b/src/commands/emergency_solution.rs index ef21a3b6d..581a9f3c0 100644 --- a/src/commands/emergency_solution.rs +++ b/src/commands/emergency_solution.rs @@ -22,7 +22,6 @@ use crate::{ use clap::Parser; use codec::Encode; use sp_core::hexdisplay::HexDisplay; -use sp_npos_elections::Support; use std::io::Write; use subxt::tx::TxPayload; @@ -74,22 +73,7 @@ where let ready_solution = miner_solution.feasibility_check()?; let encoded_size = ready_solution.encoded_size(); let score = ready_solution.score; - - // subxt doesn't implement `scale_info::TypeInfo` for AccountId32 - // that's why all AccountId32's below are converted to the inner array. - let mut supports: Vec<_> = ready_solution - .supports - .into_inner() - .into_iter() - .map(|(a, s)| { - let supports = Support { - voters: s.voters.into_iter().map(|(a, w)| (a.0, w)).collect(), - total: s.total, - }; - - (a.0, supports) - }) - .collect(); + let mut supports: Vec<_> = ready_solution.supports.into_inner(); // maybe truncate. if let Some(force_winner_count) = config.force_winner_count { diff --git a/src/commands/monitor.rs b/src/commands/monitor.rs index 235563ff5..834f0ade6 100644 --- a/src/commands/monitor.rs +++ b/src/commands/monitor.rs @@ -35,6 +35,7 @@ use subxt::{ backend::{legacy::rpc_methods::DryRunResult, rpc::RpcSubscription}, config::Header as _, error::RpcError, + tx::{TxInBlock, TxProgress}, Error as SubxtError, }; use tokio::sync::Mutex; @@ -270,7 +271,8 @@ where // submitting twice. Because once a solution has been accepted on chain // the "next transaction" at a later block but with the same nonce will be rejected let nonce = client - .rpc_system_account_next_index(&signer.public_key().to_account_id()) + .rpc() + .system_account_next_index(&signer.public_key().to_account_id()) .await?; ensure_signed_phase(client.chain_api(), block_hash) @@ -549,7 +551,7 @@ async fn submit_and_watch_solution( match listen { Listen::Head => { - let in_block = tx_progress.wait_for_in_block().await?; + let in_block = wait_for_in_block(tx_progress).await?; let events = in_block.fetch_events().await.expect("events should exist"); let solution_stored = events @@ -648,6 +650,34 @@ async fn dry_run_works(rpc: &RpcClient) -> Result<(), Error> { Ok(()) } +/// Wait for the transaction to be in a block. +/// +/// **Note:** transaction statuses like `Invalid`/`Usurped`/`Dropped` indicate with some +/// probability that the transaction will not make it into a block but there is no guarantee +/// that this is true. In those cases the stream is closed however, so you currently have no way to find +/// out if they finally made it into a block or not. +async fn wait_for_in_block(mut tx: TxProgress) -> Result, subxt::Error> +where + T: subxt::Config, + C: subxt::client::OnlineClientT, +{ + use subxt::{error::TransactionError, tx::TxStatus}; + + while let Some(status) = tx.next().await { + match status? { + // Finalized or otherwise in a block! Return. + TxStatus::InBestBlock(s) | TxStatus::InFinalizedBlock(s) => return Ok(s), + // Error scenarios; return the error. + TxStatus::Error { message } => return Err(TransactionError::Error(message).into()), + TxStatus::Invalid { message } => return Err(TransactionError::Invalid(message).into()), + TxStatus::Dropped { message } => return Err(TransactionError::Dropped(message).into()), + // Ignore anything else and wait for next status event: + _ => continue, + } + } + Err(RpcError::SubscriptionDropped.into()) +} + #[cfg(test)] mod tests { use super::*;