diff --git a/.circleci/config.yml b/.circleci/config.yml index c61393b5e6..8a3ef3ae34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,11 +39,11 @@ executors: auth: *dockerconfig rust-base: docker: - - image: ghcr.io/chainflip-io/chainflip-backend/rust-base:nightly-2021-11-16 + - image: ghcr.io/chainflip-io/chainflip-backend/rust-base:nightly-2022-08-08 auth: *dockerconfig rust-base-ci: docker: - - image: ghcr.io/chainflip-io/chainflip-backend/rust-base:nightly-2021-11-16 + - image: ghcr.io/chainflip-io/chainflip-backend/rust-base:nightly-2022-08-08 auth: *dockerconfig user: ci java-executor: diff --git a/.github/workflows/.docker-build.yaml b/.github/workflows/.docker-build.yaml index 75bcc28340..27e28812d1 100644 --- a/.github/workflows/.docker-build.yaml +++ b/.github/workflows/.docker-build.yaml @@ -4,7 +4,7 @@ on: inputs: nightly_version: type: string - default: nightly-2021-11-16 + default: nightly-2022-08-08 description: Toolchain version you want to build required: true diff --git a/Cargo.lock b/Cargo.lock index e8d1650e39..8f0a28f2c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,7 +44,7 @@ checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if 1.0.0", "cipher", - "cpufeatures 0.2.2", + "cpufeatures", "opaque-debug 0.3.0", ] @@ -200,7 +200,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.4", + "socket2", "waker-fn", "winapi 0.3.9", ] @@ -214,6 +214,23 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-process" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2c06e30a24e8c78a3987d07f0930edf76ef35e027e7bdb063fccafdad1f60c" +dependencies = [ + "async-io", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi 0.3.9", +] + [[package]] name = "async-std" version = "1.12.0" @@ -224,6 +241,7 @@ dependencies = [ "async-global-executor", "async-io", "async-lock", + "async-process", "crossbeam-utils 0.8.11", "futures-channel", "futures-core", @@ -242,15 +260,16 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.20.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf3e776afdf3a2477ef4854b85ba0dff3bd85792f685fb3c68948b4d304e4f0" +checksum = "0f2f8a4a203be3325981310ab243a28e6e4ea55b6519bffce05d41ab60e09ad8" dependencies = [ "async-std", "async-trait", "futures-io", "futures-util", "pin-utils", + "socket2", "trust-dns-resolver", ] @@ -271,19 +290,6 @@ dependencies = [ "syn", ] -[[package]] -name = "asynchronous-codec" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" -dependencies = [ - "bytes 1.2.1", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite 0.2.9", -] - [[package]] name = "asynchronous-codec" version = "0.6.0" @@ -469,17 +475,6 @@ dependencies = [ "wyz 0.5.0", ] -[[package]] -name = "blake2" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "blake2" version = "0.10.4" @@ -501,39 +496,37 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "0.5.11" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +checksum = "72936ee4afc7f8f736d1c38383b56480b5497b4617b4a77bdbf1d2ababc76127" dependencies = [ "arrayref", - "arrayvec 0.5.2", + "arrayvec 0.7.2", "constant_time_eq", ] [[package]] name = "blake2s_simd" -version = "0.5.11" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4" dependencies = [ "arrayref", - "arrayvec 0.5.2", + "arrayvec 0.7.2", "constant_time_eq", ] [[package]] name = "blake3" -version = "0.3.8" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" dependencies = [ "arrayref", - "arrayvec 0.5.2", + "arrayvec 0.7.2", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "constant_time_eq", - "crypto-mac 0.8.0", - "digest 0.9.0", ] [[package]] @@ -885,21 +878,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chacha20" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee7ad89dc1128635074c268ee661f90c3f7e83d9fd12910608c36b47d6c3412" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if 1.0.0", "cipher", - "cpufeatures 0.1.5", + "cpufeatures", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1580317203210c517b6d44794abfbe600698276db18127e37ad3e69bf5e848e5" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ "aead", "chacha20", @@ -920,6 +913,7 @@ dependencies = [ "config", "futures 0.3.21", "hex", + "jsonrpsee", "pallet-cf-environment", "pallet-cf-staking", "pallet-cf-threshold-signature", @@ -969,10 +963,7 @@ dependencies = [ "httparse", "ipc-channel", "itertools", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-http-server", - "jsonrpc-ws-server", + "jsonrpsee", "lazy_format", "lazy_static", "libp2p", @@ -1046,9 +1037,7 @@ dependencies = [ "futures 0.3.21", "hex", "hex-literal", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpsee", "multisig-p2p-transport", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -1101,13 +1090,15 @@ dependencies = [ [[package]] name = "cid" -version = "0.6.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" +checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ + "core2", "multibase", - "multihash 0.13.2", - "unsigned-varint 0.5.1", + "multihash", + "serde", + "unsigned-varint", ] [[package]] @@ -1189,6 +1180,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "comfy-table" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e" +dependencies = [ + "strum", + "strum_macros", + "unicode-width", +] + [[package]] name = "concurrent-queue" version = "1.2.4" @@ -1252,21 +1254,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] -name = "cpp_demangle" -version = "0.3.5" +name = "core2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" dependencies = [ - "cfg-if 1.0.0", + "memchr", ] [[package]] -name = "cpufeatures" -version = "0.1.5" +name = "cpp_demangle" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "libc", + "cfg-if 1.0.0", ] [[package]] @@ -1512,15 +1514,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct 0.6.1", -] - [[package]] name = "ctor" version = "0.1.22" @@ -1578,15 +1571,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4033478fbf70d6acf2655ac70da91ee65852d69daf7a67bf7a2f518fb47aafcf" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.3", + "subtle", + "zeroize", +] + [[package]] name = "custom-rpc" version = "0.1.0" dependencies = [ "cf-chains", "hex", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpsee", "pallet-cf-governance", "sc-client-api", "serde", @@ -1759,17 +1763,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" -dependencies = [ - "libc", - "redox_users 0.3.5", - "winapi 0.3.9", -] - [[package]] name = "dirs-sys" version = "0.3.7" @@ -1777,7 +1770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", - "redox_users 0.4.3", + "redox_users", "winapi 0.3.9", ] @@ -1788,7 +1781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users 0.4.3", + "redox_users", "winapi 0.3.9", ] @@ -1806,7 +1799,7 @@ checksum = "53ecafc952c4528d9b51a458d1a8904b81783feff9fde08ab6ed2545ff396872" dependencies = [ "cfg-if 1.0.0", "libc", - "socket2 0.4.4", + "socket2", "winapi 0.3.9", ] @@ -1834,9 +1827,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "0.4.8" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +checksum = "c6053ff46b5639ceb91756a85a4c8914668393a03170efd79c8884a529d80656" [[package]] name = "dyn-clonable" @@ -1924,12 +1917,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - [[package]] name = "encoding_rs" version = "0.8.31" @@ -1957,6 +1944,18 @@ dependencies = [ "syn", ] +[[package]] +name = "enum-as-inner" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "env_logger" version = "0.8.4" @@ -2142,7 +2141,8 @@ dependencies = [ [[package]] name = "finality-grandpa" version = "0.16.0" -source = "git+https://github.com/chainflip-io/finality-grandpa.git?tag=chainflip-v0.16.0#b48bf13c0f76f24014ad5a926182629f4cc815c9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b22349c6a11563a202d95772a68e0fcf56119e74ea8a2a19cf2301460fcd0df5" dependencies = [ "either", "futures 0.3.21", @@ -2150,7 +2150,7 @@ dependencies = [ "log 0.4.17", "num-traits", "parity-scale-codec", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "scale-info", ] @@ -2216,7 +2216,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", ] @@ -2240,7 +2240,7 @@ checksum = "85dcb89d2b10c5f6133de2efd8c11959ce9dbb46a2f7a4cab208c4eeda6ce1ab" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -2262,11 +2262,12 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "Inflector", "chrono", "clap", + "comfy-table", "frame-benchmarking", "frame-support", "frame-system", @@ -2280,7 +2281,6 @@ dependencies = [ "log 0.4.17", "memory-db", "parity-scale-codec", - "prettytable-rs", "rand 0.8.5", "rand_pcg 0.3.1", "sc-block-builder", @@ -2312,7 +2312,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -2340,7 +2340,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "bitflags", "frame-metadata", @@ -2370,7 +2370,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2382,10 +2382,10 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -2394,7 +2394,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "proc-macro2", "quote", @@ -2404,7 +2404,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "log 0.4.17", @@ -2421,7 +2421,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -2436,7 +2436,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "sp-api", @@ -2445,7 +2445,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "sp-api", @@ -2598,13 +2598,13 @@ dependencies = [ [[package]] name = "futures-rustls" -version = "0.21.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" +checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.19.1", - "webpki 0.21.4", + "rustls", + "webpki", ] [[package]] @@ -2624,6 +2624,10 @@ name = "futures-timer" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +dependencies = [ + "gloo-timers", + "send_wrapper", +] [[package]] name = "futures-util" @@ -2745,6 +2749,26 @@ dependencies = [ "regex", ] +[[package]] +name = "gloo-net" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351e6f94c76579cc9f9323a15f209086fc7bd428bff4288723d3a417851757b2" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project 1.0.11", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "gloo-timers" version = "0.2.4" @@ -2757,6 +2781,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "929c53c913bb7a88d75d9dc3e9705f963d8c2b9001510b25ddaf671b9fb7049d" +dependencies = [ + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "group" version = "0.11.0" @@ -2816,15 +2851,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -3019,7 +3045,7 @@ dependencies = [ "httpdate", "itoa 1.0.3", "pin-project-lite 0.2.9", - "socket2 0.4.4", + "socket2", "tokio", "tower-service", "tracing", @@ -3028,19 +3054,18 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ - "ct-logs", - "futures-util", + "http", "hyper 0.14.20", "log 0.4.17", - "rustls 0.19.1", - "rustls-native-certs 0.5.0", + "rustls", + "rustls-native-certs", "tokio", - "tokio-rustls 0.22.0", - "webpki 0.21.4", + "tokio-rustls", + "webpki-roots", ] [[package]] @@ -3100,39 +3125,30 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.6.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2273e421f7c4f0fc99e1934fe4776f59d8df2972f4199d703fc0da9f2a9f73de" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ - "if-addrs-sys", "libc", "winapi 0.3.9", ] -[[package]] -name = "if-addrs-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79ea" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "if-watch" -version = "0.2.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" +checksum = "015a7df1eb6dda30df37f34b63ada9b7b352984b0e84de2a20ed526345000791" dependencies = [ "async-io", + "core-foundation", + "fnv", "futures 0.3.21", - "futures-lite", "if-addrs", "ipnet", - "libc", "log 0.4.17", - "winapi 0.3.9", + "rtnetlink", + "system-configuration", + "windows", ] [[package]] @@ -3180,7 +3196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg 1.1.0", - "hashbrown 0.12.3", + "hashbrown", "serde", ] @@ -3244,14 +3260,14 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" dependencies = [ - "socket2 0.3.19", + "socket2", "widestring", "winapi 0.3.9", - "winreg 0.6.2", + "winreg 0.7.0", ] [[package]] @@ -3310,25 +3326,6 @@ dependencies = [ "serde", ] -[[package]] -name = "jsonrpc-client-transports" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" -dependencies = [ - "derive_more", - "futures 0.3.21", - "hyper 0.14.20", - "jsonrpc-core", - "jsonrpc-pubsub", - "log 0.4.17", - "serde", - "serde_json", - "tokio", - "url 1.7.2", - "websocket", -] - [[package]] name = "jsonrpc-core" version = "18.0.0" @@ -3345,169 +3342,121 @@ dependencies = [ ] [[package]] -name = "jsonrpc-core-client" -version = "18.0.0" +name = "jsonrpsee" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" +checksum = "a1f2ab5a60e558e74ea93bcf5164ebc47939a7fff8938fa9b5233bbc63e16061" dependencies = [ - "futures 0.3.21", - "jsonrpc-client-transports", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-http-server", + "jsonrpsee-proc-macros", + "jsonrpsee-types", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client", + "jsonrpsee-ws-server", + "tracing", ] [[package]] -name = "jsonrpc-derive" -version = "18.0.0" +name = "jsonrpsee-client-transport" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" +checksum = "26d682f4a55081a2be3e639280c640523070e4aeb8ee2fd8dd9168fdae57a9db" dependencies = [ - "proc-macro-crate 0.1.5", - "proc-macro2", - "quote", - "syn", + "anyhow", + "futures-channel", + "futures-timer", + "futures-util", + "gloo-net", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project 1.0.11", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util 0.7.3", + "tracing", + "webpki-roots", ] [[package]] -name = "jsonrpc-http-server" -version = "18.0.0" +name = "jsonrpsee-core" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" +checksum = "6e27462b21279edf9a6a91f46ffbe125e9cdc58b901d2e08bf59b31a47d7d0ab" dependencies = [ - "futures 0.3.21", + "anyhow", + "arrayvec 0.7.2", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", "hyper 0.14.20", - "jsonrpc-core", - "jsonrpc-server-utils", - "log 0.4.17", - "net2", - "parking_lot 0.11.2", - "unicase 2.6.0", -] - -[[package]] -name = "jsonrpc-ipc-server" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" -dependencies = [ - "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-server-utils", - "log 0.4.17", - "parity-tokio-ipc", - "parking_lot 0.11.2", - "tower-service", -] - -[[package]] -name = "jsonrpc-pubsub" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" -dependencies = [ - "futures 0.3.21", - "jsonrpc-core", - "lazy_static", - "log 0.4.17", - "parking_lot 0.11.2", - "rand 0.7.3", + "jsonrpsee-types", + "parking_lot 0.12.1", + "rand 0.8.5", + "rustc-hash", "serde", -] - -[[package]] -name = "jsonrpc-server-utils" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" -dependencies = [ - "bytes 1.2.1", - "futures 0.3.21", - "globset", - "jsonrpc-core", - "lazy_static", - "log 0.4.17", + "serde_json", + "soketto", + "thiserror", "tokio", - "tokio-stream", - "tokio-util 0.6.10", - "unicase 2.6.0", -] - -[[package]] -name = "jsonrpc-ws-server" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946" -dependencies = [ - "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-server-utils", - "log 0.4.17", - "parity-ws", - "parking_lot 0.11.2", - "slab", -] - -[[package]] -name = "jsonrpsee" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91dc760c341fa81173f9a434931aaf32baad5552b0230cc6c93e8fb7eaad4c19" -dependencies = [ - "jsonrpsee-core", - "jsonrpsee-proc-macros", - "jsonrpsee-types", - "jsonrpsee-ws-client", + "tracing", + "wasm-bindgen-futures", ] [[package]] -name = "jsonrpsee-client-transport" -version = "0.10.1" +name = "jsonrpsee-http-client" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765f7a36d5087f74e3b3b47805c2188fef8eb54afcb587b078d9f8ebfe9c7220" +checksum = "1da5ba164b7bb9d2780672be409f8b9f8001bd6fdd80880dc17feb7d309a8d64" dependencies = [ - "futures 0.3.21", - "http", + "async-trait", + "hyper 0.14.20", + "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", - "pin-project 1.0.11", - "rustls-native-certs 0.6.2", - "soketto", + "rustc-hash", + "serde", + "serde_json", "thiserror", "tokio", - "tokio-rustls 0.23.4", - "tokio-util 0.7.3", "tracing", - "webpki-roots 0.22.4", ] [[package]] -name = "jsonrpsee-core" -version = "0.10.1" +name = "jsonrpsee-http-server" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ef77ecd20c2254d54f5da8c0738eacca61e6b6511268a8f2753e3148c6c706" +checksum = "7178f16eabd7154c094e24d295b9ee355ec1e5f24c328759c56255ff7bbd4548" dependencies = [ - "anyhow", - "arrayvec 0.7.2", - "async-trait", - "beef", "futures-channel", "futures-util", + "globset", "hyper 0.14.20", + "jsonrpsee-core", "jsonrpsee-types", - "rustc-hash", - "serde", + "lazy_static", "serde_json", - "soketto", - "thiserror", "tokio", "tracing", + "unicase 2.6.0", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7291c72805bc7d413b457e50d8ef3e87aa554da65ecbbc278abb7dfc283e7f0" +checksum = "8b8d7f449cab3b747f12c3efc27f5cad537f3b597c6a3838b0fac628f4bf730a" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -3515,9 +3464,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b6aa52f322cbf20c762407629b8300f39bcc0cf0619840d9252a2f65fd2dd9" +checksum = "8fd11763134104122ddeb0f97e4bbe393058017dfb077db63fbf44b4dd0dd86e" dependencies = [ "anyhow", "beef", @@ -3527,17 +3476,45 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-wasm-client" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128e3bfeb362bccff6ba9526a8354b943c84a38eb5ba92297e6aef846d165004" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + [[package]] name = "jsonrpsee-ws-client" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd66d18bab78d956df24dd0d2e41e4c00afbb818fda94a98264bdd12ce8506ac" +checksum = "76f15180afb3761c7a3a32c0a8b680788176dcfdfe725b24c1758c90b1d1595b" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", ] +[[package]] +name = "jsonrpsee-ws-server" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb6c21556c551582b56e4e8e6e6249b0bbdb69bb7fa39efe9b9a6b54af9f206" +dependencies = [ + "futures-channel", + "futures-util", + "jsonrpsee-core", + "jsonrpsee-types", + "serde_json", + "soketto", + "tokio", + "tokio-util 0.7.3", + "tracing", +] + [[package]] name = "k256" version = "0.10.4" @@ -3622,9 +3599,9 @@ checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" [[package]] name = "lazy_format" -version = "1.10.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05662be9cd63006934464f935195ae936460edb75de7b9a07e0509795afbdc3" +checksum = "2c20af27ff47d964ba51ed586b8e84695261ff364922ad40bcf5a8080e99954d" [[package]] name = "lazy_static" @@ -3672,14 +3649,18 @@ checksum = "da83a57f3f5ba3680950aa3cbc806fc297bc0b289d42e8942ed528ace71b8145" [[package]] name = "libp2p" -version = "0.40.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bec54343492ba5940a6c555e512c6721139835d28c59bc22febece72dfd0d9d" +checksum = "475ce2ac4a9727e53a519f6ee05b38abfcba8f0d39c4d24f103d184e36fd5b0f" dependencies = [ "atomic", "bytes 1.2.1", "futures 0.3.21", + "futures-timer", + "getrandom 0.2.7", + "instant", "lazy_static", + "libp2p-autonat", "libp2p-core", "libp2p-deflate", "libp2p-dns", @@ -3705,17 +3686,36 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "multiaddr", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "pin-project 1.0.11", + "rand 0.7.3", "smallvec 1.9.0", - "wasm-timer", +] + +[[package]] +name = "libp2p-autonat" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13b690e65046af6a09c0b27bd9508fa1cab0efce889de74b0b643b9d2a98f9a" +dependencies = [ + "async-trait", + "futures 0.3.21", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-request-response", + "libp2p-swarm", + "log 0.4.17", + "prost 0.9.0", + "prost-build", + "rand 0.8.5", ] [[package]] name = "libp2p-core" -version = "0.30.2" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86aad7d54df283db817becded03e611137698a6509d4237a96881976a162340c" +checksum = "db5b02602099fb75cb2d16f9ea860a320d6eb82ce41e95ab680912c454805cd5" dependencies = [ "asn1_der", "bs58", @@ -3729,28 +3729,28 @@ dependencies = [ "libsecp256k1", "log 0.4.17", "multiaddr", - "multihash 0.14.0", + "multihash", "multistream-select", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "pin-project 1.0.11", - "prost", + "prost 0.9.0", "prost-build", "rand 0.8.5", "ring", "rw-stream-sink", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec 1.9.0", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint", "void", "zeroize", ] [[package]] name = "libp2p-deflate" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51a800adb195f33de63f4b17b63fe64cfc23bf2c6a0d3d0d5321328664e65197" +checksum = "6b1d37f042f748e224f04785d0e987ae09a2aa518d6401d82d412dad83e360ed" dependencies = [ "flate2", "futures 0.3.21", @@ -3759,9 +3759,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.30.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8f89d15cb6e3c5bc22afff7513b11bab7856f2872d3cfba86f7f63a06bc498" +checksum = "066e33e854e10b5c93fc650458bf2179c7e0d143db260b0963e44a94859817f1" dependencies = [ "async-std-resolver", "futures 0.3.21", @@ -3773,9 +3773,9 @@ dependencies = [ [[package]] name = "libp2p-floodsub" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3d7210901ea51b7bae2b581aa34521797af8c4ec738c980bda4a06434067f" +checksum = "733d3ea6ebe7a7a85df2bc86678b93f24b015fae5fe3b3acc4c400e795a55d2d" dependencies = [ "cuckoofilter", "fnv", @@ -3783,7 +3783,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost", + "prost 0.9.0", "prost-build", "rand 0.7.3", "smallvec 1.9.0", @@ -3791,78 +3791,82 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.33.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfeead619eb5dac46e65acc78c535a60aaec803d1428cca6407c3a4fc74d698d" +checksum = "a90c989a7c0969c2ab63e898da9bc735e3be53fb4f376e9c045ce516bcc9f928" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "base64 0.13.0", "byteorder", "bytes 1.2.1", "fnv", "futures 0.3.21", "hex_fmt", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost", + "prometheus-client", + "prost 0.9.0", "prost-build", "rand 0.7.3", "regex", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec 1.9.0", - "unsigned-varint 0.7.1", + "unsigned-varint", "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca1275574183f288ff8b72d535d5ffa5ea9292ef7829af8b47dcb197c7b0dcd" +checksum = "c5ef5a5b57904c7c33d6713ef918d239dc6b7553458f3475d87f8a18e9c651c8" dependencies = [ "futures 0.3.21", + "futures-timer", "libp2p-core", "libp2p-swarm", "log 0.4.17", - "lru 0.6.6", - "prost", + "lru", + "prost 0.9.0", "prost-build", "smallvec 1.9.0", - "wasm-timer", ] [[package]] name = "libp2p-kad" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2297dc0ca285f3a09d1368bde02449e539b46f94d32d53233f53f6625bcd3ba" +checksum = "564e6bd64d177446399ed835b9451a8825b07929d6daa6a94e6405592974725e" dependencies = [ "arrayvec 0.5.2", - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bytes 1.2.1", "either", "fnv", "futures 0.3.21", + "futures-timer", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost", + "prost 0.9.0", "prost-build", "rand 0.7.3", - "sha2 0.9.9", + "sha2 0.10.2", "smallvec 1.9.0", + "thiserror", "uint", - "unsigned-varint 0.7.1", + "unsigned-varint", "void", - "wasm-timer", ] [[package]] name = "libp2p-mdns" -version = "0.32.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c864b64bdc8a84ff3910a0df88e6535f256191a450870f1e7e10cbf8e64d45" +checksum = "611ae873c8e280ccfab0d57c7a13cac5644f364529e233114ff07863946058b0" dependencies = [ "async-io", "data-encoding", @@ -3875,47 +3879,49 @@ dependencies = [ "log 0.4.17", "rand 0.8.5", "smallvec 1.9.0", - "socket2 0.4.4", + "socket2", "void", ] [[package]] name = "libp2p-metrics" -version = "0.1.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4af432fcdd2f8ba4579b846489f8f0812cfd738ced2c0af39df9b1c48bbb6ab2" +checksum = "985be799bb3796e0c136c768208c3c06604a38430571906a13dcfeda225a3b9d" dependencies = [ "libp2p-core", + "libp2p-gossipsub", "libp2p-identify", "libp2p-kad", "libp2p-ping", + "libp2p-relay", "libp2p-swarm", - "open-metrics-client", + "prometheus-client", ] [[package]] name = "libp2p-mplex" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2cd64ef597f40e14bfce0497f50ecb63dd6d201c61796daeb4227078834fbf" +checksum = "442eb0c9fff0bf22a34f015724b4143ce01877e079ed0963c722d94c07c72160" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bytes 1.2.1", "futures 0.3.21", "libp2p-core", "log 0.4.17", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "rand 0.7.3", "smallvec 1.9.0", - "unsigned-varint 0.7.1", + "unsigned-varint", ] [[package]] name = "libp2p-noise" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8772c7a99088221bb7ca9c5c0574bf55046a7ab4c319f3619b275f28c8fb87a" +checksum = "9dd7e0c94051cda67123be68cf6b65211ba3dde7277be9068412de3e7ffd63ef" dependencies = [ "bytes 1.2.1", "curve25519-dalek 3.2.0", @@ -3923,10 +3929,10 @@ dependencies = [ "lazy_static", "libp2p-core", "log 0.4.17", - "prost", + "prost 0.9.0", "prost-build", "rand 0.8.5", - "sha2 0.9.9", + "sha2 0.10.2", "snow", "static_assertions", "x25519-dalek", @@ -3935,33 +3941,34 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ef7b0ec5cf06530d9eb6cf59ae49d46a2c45663bde31c25a12f682664adbcf" +checksum = "bf57a3c2e821331dda9fe612d4654d676ab6e33d18d9434a18cced72630df6ad" dependencies = [ "futures 0.3.21", + "futures-timer", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", "rand 0.7.3", "void", - "wasm-timer", ] [[package]] name = "libp2p-plaintext" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba1a6ff33e4a274c89a3b1d78b9f34f32af13265cc5c46c16938262d4e945a" +checksum = "962c0fb0e7212fb96a69b87f2d09bcefd317935239bdc79cda900e7a8897a3fe" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bytes 1.2.1", "futures 0.3.21", "libp2p-core", "log 0.4.17", - "prost", + "prost 0.9.0", "prost-build", - "unsigned-varint 0.7.1", + "unsigned-varint", "void", ] @@ -3981,89 +3988,96 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.4.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2852b61c90fa8ce3c8fcc2aba76e6cefc20d648f9df29157d6b3a916278ef3e3" +checksum = "3aa754cb7bccef51ebc3c458c6bbcef89d83b578a9925438389be841527d408f" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bytes 1.2.1", + "either", "futures 0.3.21", "futures-timer", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", "pin-project 1.0.11", - "prost", + "prost 0.9.0", "prost-build", - "rand 0.7.3", + "rand 0.8.5", "smallvec 1.9.0", - "unsigned-varint 0.7.1", + "static_assertions", + "thiserror", + "unsigned-varint", "void", - "wasm-timer", ] [[package]] name = "libp2p-rendezvous" -version = "0.1.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a6d2b9e7677eff61dc3d2854876aaf3976d84a01ef6664b610c77a0c9407c5" +checksum = "bbd0baab894c5b84da510b915d53264d566c3c35889f09931fe9edbd2a773bee" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bimap", "futures 0.3.21", + "futures-timer", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost", + "prost 0.9.0", "prost-build", "rand 0.8.5", - "sha2 0.9.9", + "sha2 0.10.2", "thiserror", - "unsigned-varint 0.7.1", + "unsigned-varint", "void", - "wasm-timer", ] [[package]] name = "libp2p-request-response" -version = "0.13.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a877a4ced6d46bf84677e1974e8cf61fb434af73b2e96fb48d6cb6223a4634d8" +checksum = "b5e6a6fc6c9ad95661f46989473b34bd2993d14a4de497ff3b2668a910d4b869" dependencies = [ "async-trait", "bytes 1.2.1", "futures 0.3.21", + "instant", "libp2p-core", "libp2p-swarm", "log 0.4.17", - "lru 0.7.8", "rand 0.7.3", "smallvec 1.9.0", - "unsigned-varint 0.7.1", - "wasm-timer", + "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5184a508f223bc100a12665517773fb8730e9f36fc09eefb670bf01b107ae9" +checksum = "8f0c69ad9e8f7c5fc50ad5ad9c7c8b57f33716532a2b623197f69f93e374d14c" dependencies = [ "either", + "fnv", "futures 0.3.21", + "futures-timer", + "instant", "libp2p-core", "log 0.4.17", + "pin-project 1.0.11", "rand 0.7.3", "smallvec 1.9.0", + "thiserror", "void", - "wasm-timer", ] [[package]] name = "libp2p-swarm-derive" -version = "0.25.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072c290f727d39bdc4e9d6d1c847978693d25a673bd757813681e33e5f6c00c2" +checksum = "4f693c8c68213034d472cbb93a379c63f4f307d97c06f1c41e4985de481687a5" dependencies = [ "quote", "syn", @@ -4071,9 +4085,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7399c5b6361ef525d41c11fcf51635724f832baf5819b30d3d873eabb4fbae4b" +checksum = "193447aa729c85aac2376828df76d171c1a589c9e6b58fcc7f9d9a020734122c" dependencies = [ "async-io", "futures 0.3.21", @@ -4083,14 +4097,14 @@ dependencies = [ "libc", "libp2p-core", "log 0.4.17", - "socket2 0.4.4", + "socket2", ] [[package]] name = "libp2p-uds" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7563e46218165dfd60f64b96f7ce84590d75f53ecbdc74a7dd01450dc5973" +checksum = "24bdab114f7f2701757d6541266e1131b429bbae382008f207f2114ee4222dcb" dependencies = [ "async-std", "futures 0.3.21", @@ -4100,9 +4114,9 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1008a302b73c5020251f9708c653f5ed08368e530e247cc9cd2f109ff30042cf" +checksum = "4f6ea0f84a967ef59a16083f222c18115ae2e91db69809dce275df62e101b279" dependencies = [ "futures 0.3.21", "js-sys", @@ -4114,9 +4128,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.31.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e12df82d1ed64969371a9e65ea92b91064658604cc2576c2757f18ead9a1cf" +checksum = "c932834c3754501c368d1bf3d0fb458487a642b90fc25df082a3a2f3d3b32e37" dependencies = [ "either", "futures 0.3.21", @@ -4127,18 +4141,18 @@ dependencies = [ "rw-stream-sink", "soketto", "url 2.2.2", - "webpki-roots 0.21.1", + "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" +checksum = "be902ebd89193cd020e89e89107726a38cfc0d16d18f613f4a37d046e92c7517" dependencies = [ "futures 0.3.21", "libp2p-core", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "thiserror", "yamux", ] @@ -4286,22 +4300,13 @@ dependencies = [ "value-bag", ] -[[package]] -name = "lru" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" -dependencies = [ - "hashbrown 0.11.2", -] - [[package]] name = "lru" version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -4384,6 +4389,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memfd" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6627dc657574b49d6ad27105ed671822be56e0d2547d413bfbf3e8d8fa92e7a" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.2.3" @@ -4418,7 +4432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "parity-util-mem", ] @@ -4501,18 +4515,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log 0.4.17", - "mio 0.6.23", - "slab", -] - [[package]] name = "miow" version = "0.2.2" @@ -4560,27 +4562,27 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "multiaddr" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ee4ea82141951ac6379f964f71b20876d43712bea8faf6dd1a375e08a46499" +checksum = "3c580bfdd8803cce319b047d239559a22f809094aaea4ac13902a1fdcfcd4261" dependencies = [ "arrayref", "bs58", "byteorder", "data-encoding", - "multihash 0.14.0", + "multihash", "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint 0.7.1", + "unsigned-varint", "url 2.2.2", ] [[package]] name = "multibase" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" dependencies = [ "base-x", "data-encoding", @@ -4589,41 +4591,28 @@ dependencies = [ [[package]] name = "multihash" -version = "0.13.2" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" +checksum = "e3db354f401db558759dfc1e568d010a5d4146f4d3f637be1275ec4a3cf09689" dependencies = [ "blake2b_simd", "blake2s_simd", "blake3", - "digest 0.9.0", - "generic-array 0.14.6", - "multihash-derive", - "sha2 0.9.9", - "sha3 0.9.1", - "unsigned-varint 0.5.1", -] - -[[package]] -name = "multihash" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" -dependencies = [ - "digest 0.9.0", - "generic-array 0.14.6", + "core2", + "digest 0.10.3", "multihash-derive", - "sha2 0.9.9", - "unsigned-varint 0.7.1", + "sha2 0.10.2", + "sha3 0.10.2", + "unsigned-varint", ] [[package]] name = "multihash-derive" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro-error", "proc-macro2", "quote", @@ -4647,9 +4636,7 @@ dependencies = [ "bs58", "futures 0.3.21", "ipc-channel", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpsee", "log 0.4.17", "mockall", "predicates", @@ -4668,16 +4655,16 @@ dependencies = [ [[package]] name = "multistream-select" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" +checksum = "363a84be6453a70e63513660f4894ef815daf88e3356bffcda9ca27d810ce83b" dependencies = [ "bytes 1.2.1", "futures 0.3.21", "log 0.4.17", "pin-project 1.0.11", "smallvec 1.9.0", - "unsigned-varint 0.7.1", + "unsigned-varint", ] [[package]] @@ -4753,6 +4740,72 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes 1.2.1", + "futures 0.3.21", + "log 0.4.17", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" +dependencies = [ + "async-io", + "bytes 1.2.1", + "futures 0.3.21", + "libc", + "log 0.4.17", +] + [[package]] name = "nibble_vec" version = "0.1.0" @@ -4762,6 +4815,17 @@ dependencies = [ "smallvec 1.9.0", ] +[[package]] +name = "nix" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -4942,29 +5006,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "open-metrics-client" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7337d80c23c2d8b1349563981bc4fb531220733743ba8115454a67b181173f0d" -dependencies = [ - "dtoa", - "itoa 0.4.8", - "open-metrics-client-derive-text-encode", - "owning_ref", -] - -[[package]] -name = "open-metrics-client-derive-text-encode" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "openssl" version = "0.10.41" @@ -5017,7 +5058,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" dependencies = [ "dlv-list", - "hashbrown 0.12.3", + "hashbrown", ] [[package]] @@ -5038,7 +5079,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -5054,7 +5095,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -5353,7 +5394,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -5376,7 +5417,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -5390,7 +5431,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", @@ -5411,7 +5452,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -5429,14 +5470,13 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", "serde", - "smallvec 1.9.0", "sp-core", "sp-io", "sp-runtime", @@ -5446,11 +5486,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -5463,7 +5501,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5473,9 +5511,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.3.12" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e73cd0b0a78045276b19eaae8eaaa20e44a1da9a0217ff934a810d9492ae701" +checksum = "2bb474d0ed0836e185cb998a6b140ed1073d1fbf27d690ecf9ede8030289382c" dependencies = [ "blake2-rfc", "crc32fast", @@ -5510,7 +5548,7 @@ version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -5522,20 +5560,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" -[[package]] -name = "parity-tokio-ipc" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" -dependencies = [ - "futures 0.3.21", - "libc", - "log 0.4.17", - "rand 0.7.3", - "tokio", - "winapi 0.3.9", -] - [[package]] name = "parity-util-mem" version = "0.11.0" @@ -5543,7 +5567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.12.3", + "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot 0.12.1", @@ -5578,24 +5602,6 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" -[[package]] -name = "parity-ws" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5983d3929ad50f12c3eb9a6743f19d691866ecd44da74c0a3308c3f8a56df0c6" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log 0.4.17", - "mio 0.6.23", - "mio-extras", - "rand 0.7.3", - "sha-1 0.8.2", - "slab", - "url 2.2.2", -] - [[package]] name = "parking" version = "2.0.0" @@ -5867,7 +5873,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ - "cpufeatures 0.2.2", + "cpufeatures", "opaque-debug 0.3.0", "universal-hash", ] @@ -5879,7 +5885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures", "opaque-debug 0.3.0", "universal-hash", ] @@ -5920,20 +5926,6 @@ dependencies = [ "termtree", ] -[[package]] -name = "prettytable-rs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd04b170004fa2daccf418a7f8253aaf033c27760b5f225889024cf66d7ac2e" -dependencies = [ - "atty", - "csv", - "encode_unicode", - "lazy_static", - "term", - "unicode-width", -] - [[package]] name = "primitive-types" version = "0.11.1" @@ -5948,15 +5940,6 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.2.0" @@ -6015,6 +5998,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prometheus-client" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a896938cc6018c64f279888b8c7559d3725210d5db9a3a1ee6bc7188d51d34" +dependencies = [ + "dtoa", + "itoa 1.0.3", + "owning_ref", + "prometheus-client-derive-text-encode", +] + +[[package]] +name = "prometheus-client-derive-text-encode" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e12d01b9d66ad9eb4529c57666b6263fc1993cb30261d83ead658fdd932652" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost" version = "0.9.0" @@ -6022,7 +6028,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes 1.2.1", - "prost-derive", + "prost-derive 0.9.0", +] + +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes 1.2.1", + "prost-derive 0.10.1", ] [[package]] @@ -6038,7 +6054,7 @@ dependencies = [ "log 0.4.17", "multimap", "petgraph", - "prost", + "prost 0.9.0", "prost-types", "regex", "tempfile", @@ -6058,6 +6074,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.9.0" @@ -6065,7 +6094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes 1.2.1", - "prost", + "prost 0.9.0", ] [[package]] @@ -6095,7 +6124,7 @@ dependencies = [ "tracing", "tracing-futures", "trust-dns-client", - "trust-dns-proto", + "trust-dns-proto 0.20.4", ] [[package]] @@ -6428,17 +6457,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" -dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", - "rust-argon2", -] - [[package]] name = "redox_users" version = "0.4.3" @@ -6522,7 +6540,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -6677,15 +6695,18 @@ dependencies = [ ] [[package]] -name = "rust-argon2" -version = "0.8.3" +name = "rtnetlink" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "base64 0.13.0", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils 0.8.11", + "async-global-executor", + "futures 0.3.21", + "log 0.4.17", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", ] [[package]] @@ -6725,15 +6746,6 @@ dependencies = [ "semver 0.9.0", ] -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - [[package]] name = "rustc_version" version = "0.4.0" @@ -6757,41 +6769,16 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.0", - "log 0.4.17", - "ring", - "sct 0.6.1", - "webpki 0.21.4", -] - [[package]] name = "rustls" version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ - "log 0.4.17", - "ring", - "sct 0.7.0", - "webpki 0.22.0", -] - -[[package]] -name = "rustls-native-certs" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" -dependencies = [ - "openssl-probe", - "rustls 0.19.1", - "schannel", - "security-framework", + "log 0.4.17", + "ring", + "sct", + "webpki", ] [[package]] @@ -6874,7 +6861,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "sp-core", @@ -6885,7 +6872,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "futures-timer", @@ -6908,7 +6895,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6924,7 +6911,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.5", @@ -6941,9 +6928,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -6952,7 +6939,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "chrono", "clap", @@ -6991,7 +6978,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "fnv", "futures 0.3.21", @@ -7019,7 +7006,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "hash-db", "kvdb", @@ -7044,7 +7031,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures 0.3.21", @@ -7068,7 +7055,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures 0.3.21", @@ -7097,7 +7084,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures 0.3.21", @@ -7122,10 +7109,10 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "lazy_static", - "lru 0.7.8", + "lru", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", @@ -7149,7 +7136,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "environmental", "parity-scale-codec", @@ -7166,7 +7153,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "parity-scale-codec", @@ -7181,7 +7168,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "cfg-if 1.0.0", "libc", @@ -7199,7 +7186,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "ahash", "async-trait", @@ -7239,14 +7226,11 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "finality-grandpa", "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "jsonrpsee", "log 0.4.17", "parity-scale-codec", "sc-client-api", @@ -7263,7 +7247,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "ansi_term", "futures 0.3.21", @@ -7280,7 +7264,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "hex", @@ -7295,10 +7279,10 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", - "asynchronous-codec 0.5.0", + "asynchronous-codec", "bitflags", "bytes 1.2.1", "cid", @@ -7313,16 +7297,19 @@ dependencies = [ "linked-hash-map", "linked_hash_set", "log 0.4.17", - "lru 0.7.8", + "lru", "parity-scale-codec", "parking_lot 0.12.1", "pin-project 1.0.11", - "prost", + "prost 0.10.4", "prost-build", "rand 0.7.3", "sc-block-builder", "sc-client-api", "sc-consensus", + "sc-network-common", + "sc-network-light", + "sc-network-sync", "sc-peerset", "sc-utils", "serde", @@ -7336,32 +7323,94 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", - "unsigned-varint 0.6.0", + "unsigned-varint", "void", "zeroize", ] +[[package]] +name = "sc-network-common" +version = "0.10.0-dev" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" +dependencies = [ + "futures 0.3.21", + "libp2p", + "parity-scale-codec", + "prost-build", + "sc-peerset", + "smallvec 1.9.0", +] + [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "ahash", "futures 0.3.21", "futures-timer", "libp2p", "log 0.4.17", - "lru 0.7.8", + "lru", "sc-network", "sp-runtime", "substrate-prometheus-endpoint", "tracing", ] +[[package]] +name = "sc-network-light" +version = "0.10.0-dev" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" +dependencies = [ + "futures 0.3.21", + "libp2p", + "log 0.4.17", + "parity-scale-codec", + "prost 0.10.4", + "prost-build", + "sc-client-api", + "sc-network-common", + "sc-peerset", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sc-network-sync" +version = "0.10.0-dev" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" +dependencies = [ + "bitflags", + "either", + "fork-tree", + "futures 0.3.21", + "libp2p", + "log 0.4.17", + "lru", + "parity-scale-codec", + "prost 0.10.4", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network-common", + "sc-peerset", + "smallvec 1.9.0", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-finality-grandpa", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "bytes 1.2.1", "fnv", @@ -7389,7 +7438,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "libp2p", @@ -7402,7 +7451,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "substrate-prometheus-endpoint", @@ -7411,12 +7460,11 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpsee", "lazy_static", "log 0.4.17", "parity-scale-codec", @@ -7438,18 +7486,16 @@ dependencies = [ "sp-runtime", "sp-session", "sp-version", + "tokio", ] [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-pubsub", + "jsonrpsee", "log 0.4.17", "parity-scale-codec", "parking_lot 0.12.1", @@ -7469,14 +7515,10 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-http-server", - "jsonrpc-ipc-server", - "jsonrpc-pubsub", - "jsonrpc-ws-server", + "jsonrpsee", "log 0.4.17", "serde_json", "substrate-prometheus-endpoint", @@ -7486,7 +7528,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "directories", @@ -7494,8 +7536,7 @@ dependencies = [ "futures 0.3.21", "futures-timer", "hash-db", - "jsonrpc-core", - "jsonrpc-pubsub", + "jsonrpsee", "log 0.4.17", "parity-scale-codec", "parity-util-mem", @@ -7511,6 +7552,7 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", + "sc-network-common", "sc-offchain", "sc-rpc", "sc-rpc-server", @@ -7551,7 +7593,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "parity-scale-codec", @@ -7565,7 +7607,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "libc", @@ -7584,7 +7626,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "chrono", "futures 0.3.21", @@ -7602,7 +7644,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "ansi_term", "atty", @@ -7633,9 +7675,9 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -7644,7 +7686,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "futures-timer", @@ -7671,7 +7713,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "log 0.4.17", @@ -7684,7 +7726,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "futures-timer", @@ -7714,7 +7756,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50e334bb10a245e28e5fd755cabcafd96cfcd167c99ae63a46924ca8d8703a3c" dependencies = [ - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -7754,16 +7796,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[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" @@ -7853,7 +7885,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" dependencies = [ - "semver-parser 0.7.0", + "semver-parser", ] [[package]] @@ -7862,16 +7894,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0", -] - -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] @@ -7890,13 +7913,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] -name = "semver-parser" -version = "0.10.2" +name = "send_wrapper" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" @@ -7950,18 +7970,6 @@ 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" @@ -7970,7 +7978,7 @@ checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -7982,7 +7990,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures", "digest 0.10.3", ] @@ -8021,7 +8029,7 @@ checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -8033,7 +8041,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures", "digest 0.10.3", ] @@ -8074,6 +8082,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +[[package]] +name = "signal-hook" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -8180,31 +8198,19 @@ checksum = "45456094d1983e2ee2a18fdfebce3189fa451699d0502cb8e3b49dba5ba41451" [[package]] name = "snow" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6142f7c25e94f6fd25a32c3348ec230df9109b463f59c8c7acc4bd34936babb7" +checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" dependencies = [ "aes-gcm", - "blake2 0.9.2", + "blake2", "chacha20poly1305", - "rand 0.8.5", + "curve25519-dalek 4.0.0-pre.1", "rand_core 0.6.3", "ring", - "rustc_version 0.3.3", - "sha2 0.9.9", + "rustc_version 0.4.0", + "sha2 0.10.2", "subtle", - "x25519-dalek", -] - -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "winapi 0.3.9", ] [[package]] @@ -8236,7 +8242,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "hash-db", "log 0.4.17", @@ -8253,10 +8259,10 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ - "blake2 0.10.4", - "proc-macro-crate 1.2.0", + "blake2", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -8265,7 +8271,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -8278,7 +8284,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "integer-sqrt", "num-traits", @@ -8293,7 +8299,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "parity-scale-codec", @@ -8305,7 +8311,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "sp-api", @@ -8317,11 +8323,11 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "log 0.4.17", - "lru 0.7.8", + "lru", "parity-scale-codec", "parking_lot 0.12.1", "sp-api", @@ -8335,7 +8341,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures 0.3.21", @@ -8354,7 +8360,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "parity-scale-codec", @@ -8372,7 +8378,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -8386,7 +8392,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "base58", "bitflags", @@ -8432,9 +8438,9 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ - "blake2 0.10.4", + "blake2", "byteorder", "digest 0.10.3", "sha2 0.10.2", @@ -8446,7 +8452,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "proc-macro2", "quote", @@ -8457,7 +8463,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8466,7 +8472,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "proc-macro2", "quote", @@ -8476,7 +8482,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "environmental", "parity-scale-codec", @@ -8487,7 +8493,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "finality-grandpa", "log 0.4.17", @@ -8505,7 +8511,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8519,7 +8525,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures 0.3.21", "hash-db", @@ -8544,7 +8550,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "lazy_static", "sp-core", @@ -8555,7 +8561,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures 0.3.21", @@ -8572,7 +8578,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "thiserror", "zstd", @@ -8581,7 +8587,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "sp-api", "sp-core", @@ -8591,7 +8597,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "backtrace", "lazy_static", @@ -8601,7 +8607,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "rustc-hash", "serde", @@ -8611,7 +8617,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "either", "hash256-std-hasher", @@ -8633,7 +8639,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8650,10 +8656,10 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "Inflector", - "proc-macro-crate 1.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -8662,7 +8668,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "parity-scale-codec", @@ -8676,7 +8682,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "serde", "serde_json", @@ -8685,7 +8691,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -8699,7 +8705,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -8710,7 +8716,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "hash-db", "log 0.4.17", @@ -8732,12 +8738,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8750,7 +8756,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "log 0.4.17", "sp-core", @@ -8763,7 +8769,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "futures-timer", @@ -8779,7 +8785,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "sp-std", @@ -8791,7 +8797,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "sp-api", "sp-runtime", @@ -8800,7 +8806,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "async-trait", "log 0.4.17", @@ -8816,7 +8822,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "hash-db", "memory-db", @@ -8832,7 +8838,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8849,7 +8855,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -8860,7 +8866,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "impl-trait-for-tuples", "log 0.4.17", @@ -9024,7 +9030,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "platforms", ] @@ -9032,18 +9038,17 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.21", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", + "jsonrpsee", "log 0.4.17", "parity-scale-codec", "sc-client-api", "sc-rpc-api", "sc-transaction-pool-api", + "serde_json", "sp-api", "sp-block-builder", "sp-blockchain", @@ -9054,7 +9059,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "futures-util", "hyper 0.14.20", @@ -9067,7 +9072,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "ansi_term", "build-helper", @@ -9109,6 +9114,27 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "system-configuration" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -9141,17 +9167,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "term" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42" -dependencies = [ - "byteorder", - "dirs", - "winapi 0.3.9", -] - [[package]] name = "termcolor" version = "1.1.3" @@ -9317,7 +9332,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite 0.2.9", "signal-hook-registry", - "socket2 0.4.4", + "socket2", "tokio-macros", "winapi 0.3.9", ] @@ -9394,26 +9409,15 @@ dependencies = [ "tokio-sync", ] -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls 0.19.1", - "tokio", - "webpki 0.21.4", -] - [[package]] name = "tokio-rustls" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.6", + "rustls", "tokio", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -9561,7 +9565,7 @@ dependencies = [ "ahash", "lazy_static", "log 0.4.17", - "lru 0.7.8", + "lru", "tracing-core", ] @@ -9585,7 +9589,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot 0.9.0", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -9611,7 +9615,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown", "log 0.4.17", "rustc-hex", "smallvec 1.9.0", @@ -9653,7 +9657,7 @@ dependencies = [ "thiserror", "time 0.3.12", "tokio", - "trust-dns-proto", + "trust-dns-proto 0.20.4", ] [[package]] @@ -9665,7 +9669,7 @@ dependencies = [ "async-trait", "cfg-if 1.0.0", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.3.4", "futures-channel", "futures-io", "futures-util", @@ -9681,11 +9685,35 @@ dependencies = [ "url 2.2.2", ] +[[package]] +name = "trust-dns-proto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner 0.4.0", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "log 0.4.17", + "rand 0.8.5", + "smallvec 1.9.0", + "thiserror", + "tinyvec", + "url 2.2.2", +] + [[package]] name = "trust-dns-resolver" -version = "0.20.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" dependencies = [ "cfg-if 1.0.0", "futures-util", @@ -9693,11 +9721,11 @@ dependencies = [ "lazy_static", "log 0.4.17", "lru-cache", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "resolv-conf", "smallvec 1.9.0", "thiserror", - "trust-dns-proto", + "trust-dns-proto 0.21.2", ] [[package]] @@ -9709,7 +9737,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-05#cb364678f66ec3fe6b5e7bb75e73e6c9ecb4e4fd" +source = "git+https://github.com/chainflip-io/substrate.git?tag=chainflip-monthly-2022-06#9c5b278463e401a402b997a432a8d8edf509b3e5" dependencies = [ "clap", "jsonrpsee", @@ -9743,9 +9771,9 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.3", - "rand 0.6.5", + "rand 0.8.5", "static_assertions", ] @@ -9846,31 +9874,13 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsigned-varint" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" - -[[package]] -name = "unsigned-varint" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" -dependencies = [ - "asynchronous-codec 0.5.0", - "bytes 1.2.1", - "futures-io", - "futures-util", -] - [[package]] name = "unsigned-varint" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ - "asynchronous-codec 0.6.0", + "asynchronous-codec", "bytes 1.2.1", "futures-io", "futures-util", @@ -9912,8 +9922,6 @@ dependencies = [ "anyhow", "futures 0.3.21", "hex", - "jsonrpc-core", - "jsonrpc-core-client", "mockall", "predicates", "tokio", @@ -10020,6 +10028,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if 1.0.0", + "serde", + "serde_json", "wasm-bindgen-macro", ] @@ -10289,6 +10299,7 @@ dependencies = [ "libc", "log 0.4.17", "mach", + "memfd", "memoffset", "more-asserts", "rand 0.8.5", @@ -10369,16 +10380,6 @@ dependencies = [ "url 2.2.2", ] -[[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.0" @@ -10389,22 +10390,13 @@ dependencies = [ "untrusted", ] -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki 0.21.4", -] - [[package]] name = "webpki-roots" version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" dependencies = [ - "webpki 0.22.0", + "webpki", ] [[package]] @@ -10470,9 +10462,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" [[package]] name = "winapi" @@ -10517,43 +10509,86 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + [[package]] name = "windows-sys" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -10562,9 +10597,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winreg" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ "winapi 0.3.9", ] @@ -10625,14 +10660,14 @@ dependencies = [ [[package]] name = "yamux" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" +checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ "futures 0.3.21", "log 0.4.17", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot 0.12.1", "rand 0.8.5", "static_assertions", ] diff --git a/engine/Cargo.toml b/engine/Cargo.toml index d766c6363b..c1d4b49ad7 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -35,11 +35,8 @@ chrono = "0.4.19" rand_legacy = { package = "rand", version = "0.6" } ipc-channel = "0.16.0" -# Same version of jsonrpc as substrate -jsonrpc-core = {version = "18.0.0"} -jsonrpc-core-client = {version = "18.0.0", default-features = false, features = ["http", "ws"]} -jsonrpc-http-server = "18.0.0" -jsonrpc-ws-server = "18.0.0" +# Same version of jsonrpsee as substrate +jsonrpsee = { version = "0.13.0", features = ["full"] } websocket = "0.24" ethbloom = "0.12.1" @@ -64,12 +61,12 @@ num-traits = "0.2" num-derive = "0.3" web3 = {git = 'https://github.com/tomusdrw/rust-web3.git', rev = '8796c88', features = ['signing']} zeroize = "1.5.4" -libp2p = "0.40" -# Required so that we can create a web3-compatilble secret key. +libp2p = "0.44" +# Required so that we can create a web3-compatible secret key. web3-secp256k1 = {package = 'secp256k1', version = '0.21'} generic-array= "0.14" public-ip = "0.2.2" -lazy_format = "1.10.0" +lazy_format = "2.0" # We will update curve25519-dalek when we can update schnorrkel curve25519-dalek = {version = "2.1", features = ["serde"]} typenum = "1.15" @@ -125,39 +122,39 @@ version = "15.0.0" [dependencies.frame-support] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sc-rpc-api] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-keyring] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-rpc] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-version] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] env_logger = "0.9.0" -log = "0.4.14" +log = "0.4.16" mockall = "0.11.0" rand = "0.8.4" csv = "1.1.6" diff --git a/engine/cli/Cargo.toml b/engine/cli/Cargo.toml index 764430eaca..dc9d1194fc 100644 --- a/engine/cli/Cargo.toml +++ b/engine/cli/Cargo.toml @@ -16,6 +16,7 @@ slog = {version = "2.7.0", features = ["max_level_trace", "release_max_level_tra tokio = {version = "1.13.1", features = ["full"]} utilities = {path = "../../utilities"} web3 = {git = 'https://github.com/tomusdrw/rust-web3.git', rev = '8796c88'} +jsonrpsee = {version = "0.13.0", features = ["client"]} # State chain cf-chains = {path = "../../state-chain/chains"} @@ -27,6 +28,6 @@ pallet-cf-validator = {path = "../../state-chain/pallets/cf-validator"} state-chain-runtime = {path = "../../state-chain/runtime"} # Substrate key types -sp-consensus-aura = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-05'} -sp-core = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-05'} -sp-finality-grandpa = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-05'} +sp-consensus-aura = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-06'} +sp-core = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-06'} +sp-finality-grandpa = {git = 'https://github.com/chainflip-io/substrate.git', tag = 'chainflip-monthly-2022-06'} diff --git a/engine/src/eth/event.rs b/engine/src/eth/event.rs index 2420c38d9b..012cc764c0 100644 --- a/engine/src/eth/event.rs +++ b/engine/src/eth/event.rs @@ -8,7 +8,7 @@ use web3::{ }; /// Type for storing common (i.e. tx_hash) and specific event information -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct Event { /// The transaction hash of the transaction that emitted this event pub tx_hash: H256, diff --git a/engine/src/eth/key_manager.rs b/engine/src/eth/key_manager.rs index e05bc62eb9..be55be776d 100644 --- a/engine/src/eth/key_manager.rs +++ b/engine/src/eth/key_manager.rs @@ -144,7 +144,7 @@ impl Tokenizable for SigData { // The following events need to reflect the events emitted in the key contract: // https://github.com/chainflip-io/chainflip-eth-contracts/blob/master/contracts/KeyManager.sol -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum KeyManagerEvent { AggKeyNonceConsumersSet { addrs: Vec, diff --git a/engine/src/eth/mod.rs b/engine/src/eth/mod.rs index acf875c6dc..114e51ba7c 100644 --- a/engine/src/eth/mod.rs +++ b/engine/src/eth/mod.rs @@ -65,7 +65,7 @@ use event::Event; use async_trait::async_trait; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct EthNumberBloom { pub block_number: U64, pub logs_bloom: H2048, @@ -296,7 +296,7 @@ where } // Used to zip on the streams, so we know which stream is returning -#[derive(Clone, PartialEq, Debug, Copy)] +#[derive(Clone, PartialEq, Eq, Debug, Copy)] pub enum TransportProtocol { Http, Ws, @@ -321,7 +321,7 @@ pub struct BlockWithDecodedEvents { /// Just contains an empty vec if there are no events #[derive(Debug)] -#[cfg_attr(test, derive(PartialEq))] +#[cfg_attr(test, derive(PartialEq, Eq))] pub struct BlockWithEvents { pub block_number: u64, pub events: Vec>, diff --git a/engine/src/eth/rpc.rs b/engine/src/eth/rpc.rs index 2f7c868e80..1a4faa9938 100644 --- a/engine/src/eth/rpc.rs +++ b/engine/src/eth/rpc.rs @@ -510,43 +510,12 @@ mod tests { use cf_chains::eth::{verify_transaction, UnsignedTransaction}; use ethereum::{LegacyTransaction, LegacyTransactionMessage, TransactionV2}; - use futures::future::BoxFuture; use rand::{prelude::StdRng, Rng, SeedableRng}; - use web3::{signing::Key, Transport}; - - // The web3 test transport is not Send, so we create this just to satisfy the EthRpc. - // We don't actually need to make any RPC calls (if the necessary parameters are supplied when `sign_transaction` - // is called) so we just use this dummy - #[derive(Debug, Clone, Default)] - struct DummyTransport {} - - impl EthTransport for DummyTransport { - fn transport_protocol() -> TransportProtocol { - // arbitrary value, doesn't matter for these tests - TransportProtocol::Http - } - } - - impl Transport for DummyTransport { - type Out = BoxFuture<'static, std::result::Result>; - - fn prepare( - &self, - _method: &str, - _params: Vec, - ) -> (web3::RequestId, jsonrpc_core::Call) { - panic!("You did not supply the appropriate parameters. Unnecessary RPC calls were attempted.") - } - - fn send(&self, _id: web3::RequestId, _request: jsonrpc_core::Call) -> Self::Out { - panic!("You did not supply the appropriate parameters. Unnecessary RPC calls were attempted.") - } - } + use web3::{signing::Key, transports::Http}; - type TestEthRpcClient = EthRpcClient; - impl TestEthRpcClient { - fn new() -> Self { - let web3 = web3::Web3::new(DummyTransport::default()); + impl EthHttpRpcClient { + fn mock() -> Self { + let web3 = web3::Web3::new(Http::new("http://mock.com").unwrap()); Self { web3 } } } @@ -585,7 +554,7 @@ mod tests { let key = SecretKey::from_slice(&arr[..]).unwrap(); let address = web3::signing::SecretKeyRef::new(&key).address(); - let test_eth_rpc_client = TestEthRpcClient::new(); + let test_eth_rpc_client = EthHttpRpcClient::mock(); let signed_tx = test_eth_rpc_client .sign_transaction(tx_params.clone(), &key) .await diff --git a/engine/src/main.rs b/engine/src/main.rs index 2f15295212..75cdc342c8 100644 --- a/engine/src/main.rs +++ b/engine/src/main.rs @@ -27,7 +27,6 @@ use pallet_cf_validator::SemVer; use sp_core::U256; use utilities::print_chainflip_ascii_art; -#[allow(clippy::eval_order_dependence)] fn main() -> anyhow::Result<()> { print_chainflip_ascii_art(); use_chainflip_account_id_encoding(); diff --git a/engine/src/multisig/client/signing/frost.rs b/engine/src/multisig/client/signing/frost.rs index 734542684f..53da3f0528 100644 --- a/engine/src/multisig/client/signing/frost.rs +++ b/engine/src/multisig/client/signing/frost.rs @@ -47,7 +47,7 @@ impl SecretNoncePair

{ /// Public components of the single-use nonces generated by /// a single party at signer index `index`. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub struct SigningCommitment { #[serde(bound = "")] diff --git a/engine/src/multisig/client/utils.rs b/engine/src/multisig/client/utils.rs index b6d948a1e9..d0ffa5ae47 100644 --- a/engine/src/multisig/client/utils.rs +++ b/engine/src/multisig/client/utils.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; /// Mappings from signer_idx to Validator Id and back /// for the corresponding ceremony -#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct PartyIdxMapping { id_to_idx: HashMap, // TODO: create SortedVec and use it here: diff --git a/engine/src/multisig/crypto/curve25519_ristretto.rs b/engine/src/multisig/crypto/curve25519_ristretto.rs index 74010c2f1a..59096dfb21 100644 --- a/engine/src/multisig/crypto/curve25519_ristretto.rs +++ b/engine/src/multisig/crypto/curve25519_ristretto.rs @@ -5,10 +5,10 @@ use super::{ECPoint, ECScalar}; type SK = curve25519_dalek::scalar::Scalar; type PK = curve25519_dalek::ristretto::RistrettoPoint; -#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Point(PK); -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Scalar(SK); mod point_impls { diff --git a/engine/src/multisig/crypto/eth.rs b/engine/src/multisig/crypto/eth.rs index 5ada7119c1..d2c5b576ec 100644 --- a/engine/src/multisig/crypto/eth.rs +++ b/engine/src/multisig/crypto/eth.rs @@ -9,7 +9,7 @@ use super::{ChainTag, CryptoScheme, ECPoint}; pub use super::secp256k1::{Point, Scalar}; use serde::{Deserialize, Serialize}; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct EthSchnorrSignature { /// Scalar component pub s: [u8; 32], diff --git a/engine/src/multisig/crypto/polkadot.rs b/engine/src/multisig/crypto/polkadot.rs index 05eb737b2f..f1c5046b28 100644 --- a/engine/src/multisig/crypto/polkadot.rs +++ b/engine/src/multisig/crypto/polkadot.rs @@ -8,7 +8,7 @@ pub struct PolkadotSigning {} // Polkadot seems to be using this generic "substrate" context for signing const SIGNING_CTX: &[u8] = b"substrate"; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct PolkadotSignature(schnorrkel::Signature); impl Serialize for PolkadotSignature { diff --git a/engine/src/multisig/crypto/secp256k1.rs b/engine/src/multisig/crypto/secp256k1.rs index e7f60950cc..4693d343cc 100644 --- a/engine/src/multisig/crypto/secp256k1.rs +++ b/engine/src/multisig/crypto/secp256k1.rs @@ -8,11 +8,11 @@ type PK = secp256k1::PublicKey; // Wrapping in `Option` to make it easier to keep track // of "zero" scalars which often need special treatment -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Scalar(Option); // None if it is a "point at infinity" -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Point(Option); const GENERATOR_COMPRESSED: [u8; 33] = [ diff --git a/engine/src/multisig/db/persistent.rs b/engine/src/multisig/db/persistent.rs index aaa1f668a9..0695678814 100644 --- a/engine/src/multisig/db/persistent.rs +++ b/engine/src/multisig/db/persistent.rs @@ -186,7 +186,7 @@ impl PersistentKeyDB { let key_id: KeyId = KeyId(key_id[PREFIX_SIZE..].into()); // deserialize the `KeygenResultInfo` - match bincode::deserialize::>(&*key_info) { + match bincode::deserialize::>(&key_info) { Ok(keygen_result_info) => { slog::debug!( self.logger, diff --git a/engine/src/multisig_p2p.rs b/engine/src/multisig_p2p.rs index f3de080bdb..0802254697 100644 --- a/engine/src/multisig_p2p.rs +++ b/engine/src/multisig_p2p.rs @@ -8,13 +8,14 @@ use std::{ use anyhow::{anyhow, Context, Result}; use futures::stream::StreamExt; use itertools::Itertools; +use jsonrpsee::ws_client::WsClientBuilder; use lazy_format::lazy_format; use multisig_p2p_transport::{PeerId, PeerIdTransferable}; use slog::o; use sp_core::{storage::StorageKey, H256}; use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender}; -pub use multisig_p2p_transport::P2PRpcClient; +pub use multisig_p2p_transport::P2PValidatorNetworkNodeRpcApiClient; use state_chain_runtime::AccountId; use codec::Encode; @@ -30,7 +31,7 @@ use crate::{ state_chain_observer::client::{StateChainClient, StateChainRpcApi}, }; -use utilities::{make_periodic_tick, rpc_error_into_anyhow_error, Port}; +use utilities::{make_periodic_tick, Port}; #[derive(Debug)] pub enum AccountPeerMappingChange { @@ -39,7 +40,7 @@ pub enum AccountPeerMappingChange { } // TODO: Consider if this should be removed, particularly once we no longer use Substrate for peering -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum OutgoingMultisigStageMessages { Broadcast(Vec, Vec), Private(Vec<(AccountId, Vec)>), @@ -218,14 +219,12 @@ pub async fn start( ) -> Result<()> { let logger = logger.new(o!(COMPONENT_KEY => "P2PClient")); - // Use StateChainClient's RpcChannel - let client = jsonrpc_core_client::transports::ws::connect::( - &url::Url::parse(settings.state_chain.ws_endpoint.as_str()).with_context(|| { - format!("Invalid ws endpoint: {}", settings.state_chain.ws_endpoint) - })?, - ) - .await - .map_err(rpc_error_into_anyhow_error)?; + // TODO: Use StateChainClient's RpcChannel + let client = WsClientBuilder::default() + // TODO: consider adding something like this + // .max_request_body_size(TEN_MB_SIZE_BYTES * X) + .build(settings.state_chain.ws_endpoint.as_str()) + .await?; let mut account_to_peer_mapping_on_chain = state_chain_client .get_storage_pairs::<(AccountId, sp_core::ed25519::Public, Port, pallet_cf_validator::Ipv6Addr)>( @@ -293,7 +292,6 @@ pub async fn start( .collect(), ) .await - .map_err(rpc_error_into_anyhow_error) .with_context(|| { format!( "Failed to add peers to reserved set: {:?}", @@ -390,7 +388,7 @@ pub async fn start( entry.insert(account_id.clone()); account_to_peer_mapping_on_chain.insert(account_id, (peer_id, port, ip_address)); if peer_id_from_cfe_config != peer_id { - if let Err(error) = client.add_peer(PeerIdTransferable::from(&peer_id), port, ip_address).await.map_err(rpc_error_into_anyhow_error) { + if let Err(error) = client.add_peer(PeerIdTransferable::from(&peer_id), port, ip_address).await { slog::error!(logger, "Couldn't add peer {} to reserved set: {}", peer_id, error); } else { slog::info!(logger, "Added peer {} to reserved set", peer_id); @@ -405,7 +403,7 @@ pub async fn start( account_to_peer_mapping_on_chain.remove(&account_id); peer_to_account_mapping_on_chain.remove(&peer_id); if peer_id_from_cfe_config != peer_id { - if let Err(error) = client.remove_peer(PeerIdTransferable::from(&peer_id)).await.map_err(rpc_error_into_anyhow_error) { + if let Err(error) = client.remove_peer(PeerIdTransferable::from(&peer_id)).await { slog::error!(logger, "Couldn't remove peer {} to reserved set: {}", peer_id, error); } else { slog::info!(logger, "Removed peer {} to reserved set", peer_id); diff --git a/engine/src/settings.rs b/engine/src/settings.rs index 15a50b7f9e..bd5ffdf275 100644 --- a/engine/src/settings.rs +++ b/engine/src/settings.rs @@ -54,7 +54,7 @@ impl Eth { } } -#[derive(Debug, Deserialize, Clone, Default, PartialEq)] +#[derive(Debug, Deserialize, Clone, Default, PartialEq, Eq)] pub struct HealthCheck { pub hostname: String, pub port: Port, diff --git a/engine/src/state_chain_observer/client.rs b/engine/src/state_chain_observer/client.rs index 9090d5c329..44cb8de11e 100644 --- a/engine/src/state_chain_observer/client.rs +++ b/engine/src/state_chain_observer/client.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, bail, Context, Result}; use cf_chains::ChainAbi; use cf_traits::{ChainflipAccountData, EpochIndex}; use codec::{Decode, Encode, FullCodec}; -use custom_rpc::CustomClient; +use custom_rpc::CustomApiClient; use frame_metadata::RuntimeMetadata; use frame_support::metadata::RuntimeMetadataPrefixed; use frame_support::pallet_prelude::InvalidTransaction; @@ -10,8 +10,11 @@ use frame_support::storage::storage_prefix; use frame_support::storage::types::QueryKindTrait; use frame_system::Phase; use futures::{Stream, StreamExt, TryStreamExt}; -use jsonrpc_core::{Error, ErrorCode, Value}; -use jsonrpc_core_client::{RpcChannel, RpcError}; +use jsonrpsee::core::client::{ClientT, SubscriptionClientT}; +use jsonrpsee::core::{Error as RpcError, RpcResult}; +use jsonrpsee::types::error::CallError; +use jsonrpsee::types::{ErrorObject, ErrorObjectOwned}; +use jsonrpsee::ws_client::WsClientBuilder; use libp2p::multiaddr::Protocol; use libp2p::Multiaddr; use multisig_p2p_transport::PeerId; @@ -40,7 +43,7 @@ use crate::common::{read_clean_and_decode_hex_str_file, EngineTryStreamExt}; use crate::constants::MAX_EXTRINSIC_RETRY_ATTEMPTS; use crate::logging::COMPONENT_KEY; use crate::settings; -use utilities::{context, rpc_error_into_anyhow_error, Port}; +use utilities::{context, Port}; mod signer; @@ -49,19 +52,10 @@ use mockall::automock; use async_trait::async_trait; -type AuthorRpcClient = sc_rpc_api::author::AuthorClient< - state_chain_runtime::Hash, - ::Hash, ->; -type ChainRpcClient = sc_rpc_api::chain::ChainClient< - state_chain_runtime::BlockNumber, - state_chain_runtime::Hash, - state_chain_runtime::Header, - state_chain_runtime::SignedBlock, ->; -type StateRpcClient = sc_rpc_api::state::StateClient; -type SystemRpcClient = - sc_rpc_api::system::SystemClient; +use sc_rpc_api::author::AuthorApiClient; +use sc_rpc_api::chain::ChainApiClient; +use sc_rpc_api::state::StateApiClient; +use sc_rpc_api::system::SystemApiClient; pub type EventInfo = ( Phase, @@ -71,13 +65,44 @@ pub type EventInfo = ( ); //////////////////// +/// +pub trait ChainflipClient: + CustomApiClient + + SystemApiClient + + StateApiClient + + AuthorApiClient< + state_chain_runtime::Hash, + ::Hash, + > + ChainApiClient< + state_chain_runtime::BlockNumber, + state_chain_runtime::Hash, + state_chain_runtime::Header, + state_chain_runtime::SignedBlock, + > +{ +} + +impl< + T: SubscriptionClientT + + ClientT + + CustomApiClient + + SystemApiClient + + StateApiClient + + AuthorApiClient< + state_chain_runtime::Hash, + ::Hash, + > + ChainApiClient< + state_chain_runtime::BlockNumber, + state_chain_runtime::Hash, + state_chain_runtime::Header, + state_chain_runtime::SignedBlock, + >, + > ChainflipClient for T +{ +} -pub struct StateChainRpcClient { - author_rpc_client: AuthorRpcClient, - state_rpc_client: StateRpcClient, - chain_rpc_client: ChainRpcClient, - system_rpc_client: SystemRpcClient, - custom_rpc_client: CustomClient, +pub struct StateChainRpcClient { + rpc_client: Arc, } /// Wraps the substrate client library methods @@ -87,7 +112,7 @@ pub trait StateChainRpcApi { async fn submit_extrinsic_rpc( &self, extrinsic: state_chain_runtime::UncheckedExtrinsic, - ) -> Result; + ) -> RpcResult; async fn storage( &self, @@ -125,12 +150,15 @@ pub trait StateChainRpcApi { } #[async_trait] -impl StateChainRpcApi for StateChainRpcClient { +impl StateChainRpcApi for StateChainRpcClient +where + C: ChainflipClient + Send + Sync, +{ async fn submit_extrinsic_rpc( &self, extrinsic: state_chain_runtime::UncheckedExtrinsic, - ) -> Result { - self.author_rpc_client + ) -> RpcResult { + self.rpc_client .submit_extrinsic(Bytes::from(extrinsic.encode())) .await } @@ -139,19 +167,17 @@ impl StateChainRpcApi for StateChainRpcClient { &self, block_hash: state_chain_runtime::Hash, ) -> Result> { - self.chain_rpc_client + self.rpc_client .block(Some(block_hash)) .await - .map_err(rpc_error_into_anyhow_error) .context("get_block RPC API failed") } async fn latest_block_hash(&self) -> Result { Ok(self - .chain_rpc_client + .rpc_client .header(None) .await - .map_err(rpc_error_into_anyhow_error) .context("latest_block_hash RPC API failed")? .expect("Latest block hash could not be fetched") .hash()) @@ -162,10 +188,9 @@ impl StateChainRpcApi for StateChainRpcClient { block_hash: state_chain_runtime::Hash, storage_key: StorageKey, ) -> Result> { - self.state_rpc_client + self.rpc_client .storage(storage_key, Some(block_hash)) .await - .map_err(rpc_error_into_anyhow_error) .context("storage RPC API failed") } @@ -174,18 +199,16 @@ impl StateChainRpcApi for StateChainRpcClient { block_hash: Option, storage_key: StorageKey, ) -> Result>> { - self.state_rpc_client + self.rpc_client .query_storage_at(vec![storage_key], block_hash) .await - .map_err(rpc_error_into_anyhow_error) .context("storage_events_at RPC API failed") } async fn rotate_keys(&self) -> Result { - self.author_rpc_client + self.rpc_client .rotate_keys() .await - .map_err(rpc_error_into_anyhow_error) .context("rotate_keys RPC API failed") } @@ -194,18 +217,16 @@ impl StateChainRpcApi for StateChainRpcClient { block_hash: state_chain_runtime::Hash, storage_key: StorageKey, ) -> Result> { - self.state_rpc_client + self.rpc_client .storage_pairs(storage_key, Some(block_hash)) .await - .map_err(rpc_error_into_anyhow_error) .context("storage_pairs RPC API failed") } async fn local_listen_addresses(&self) -> Result> { - self.system_rpc_client + self.rpc_client .system_local_listen_addresses() .await - .map_err(rpc_error_into_anyhow_error) .context("system_local_listen_addresses RPC API failed") } @@ -213,18 +234,16 @@ impl StateChainRpcApi for StateChainRpcClient { &self, block_hash: state_chain_runtime::Hash, ) -> Result { - self.state_rpc_client + self.rpc_client .runtime_version(Some(block_hash)) .await - .map_err(rpc_error_into_anyhow_error) .context("fetch_runtime_version RPC API failed") } async fn is_auction_phase(&self) -> Result { - self.custom_rpc_client + self.rpc_client .cf_is_auction_phase(None) .await - .map_err(rpc_error_into_anyhow_error) .context("cf_is_auction_phase RPC API failed") } } @@ -393,6 +412,14 @@ mod storage_traits { } } +fn invalid_err_obj(invalid_reason: InvalidTransaction) -> ErrorObjectOwned { + ErrorObject::owned( + 1010, + "Invalid Transaction", + Some(<&'static str>::from(invalid_reason)), + ) +} + impl StateChainClient { fn create_and_sign_extrinsic( &self, @@ -474,11 +501,7 @@ impl StateChainClient { Err(rpc_err) => match rpc_err { // This occurs when a transaction with the same nonce is in the transaction pool (and the priority is // <= priority of that existing tx) - RpcError::JsonRpcError(Error { - // this is the error returned when the "priority is too low" i.e. nonce is too low - code: ErrorCode::ServerError(1014), - .. - }) => { + RpcError::Call(CallError::Custom(ref obj)) if obj.code() == 1014 => { slog::error!( logger, "Extrinsic submission failed with nonce: {}. Error: {:?}", @@ -488,13 +511,8 @@ impl StateChainClient { } // This occurs when the nonce has already been *consumed* i.e a transaction with that nonce // is in a block - RpcError::JsonRpcError(Error { - // this is the error returned when the "transaction is outdated" i.e. nonce is too low - code: ErrorCode::ServerError(1010), - data: Some(Value::String(ref invalid_transaction)), - .. - }) if invalid_transaction - == <&'static str>::from(InvalidTransaction::Stale) => + RpcError::Call(CallError::Custom(ref obj)) + if obj == &invalid_err_obj(InvalidTransaction::Stale) => { slog::error!( logger, @@ -503,14 +521,8 @@ impl StateChainClient { rpc_err ); } - RpcError::JsonRpcError(Error { - // this is the error returned when the "transaction has bad signature" -> when the runtime is updated, since the - // runtime version and/or metadata is now incorrect - code: ErrorCode::ServerError(1010), - data: Some(Value::String(ref invalid_transaction)), - .. - }) if invalid_transaction - == <&'static str>::from(InvalidTransaction::BadProof) => + RpcError::Call(CallError::Custom(ref obj)) + if obj == &invalid_err_obj(InvalidTransaction::BadProof) => { slog::error!( logger, @@ -546,7 +558,6 @@ impl StateChainClient { // don't `return`, therefore go back to the top of the loop and retry sending the transaction } err => { - let err = rpc_error_into_anyhow_error(err); slog::error!( logger, "Extrinsic failed with error: {}. Extrinsic: {:?}", @@ -554,7 +565,7 @@ impl StateChainClient { &call, ); self.nonce.fetch_sub(1, Ordering::Relaxed); - return Err(err); + return Err(err.into()); } }, } @@ -594,26 +605,28 @@ impl StateChainClient { } Err(rpc_err) => { match rpc_err { - RpcError::JsonRpcError(ref e) - // POOL_ALREADY_IMPORTED error occurs when the transaction is already in the pool - // More than one node can submit the same unsigned extrinsic. E.g. in the case of - // a threshold signature success. Thus, if we get a "Transaction already in pool" "error" - // we know that this particular extrinsic has already been submitted. And so we can - // ignore the error and return the transaction hash - if e.code == ErrorCode::ServerError(1013) => - { - slog::trace!(logger, "Unsigned extrinsic {:?} with tx_hash {:#x} already in pool.", &call, expected_hash); + // POOL_ALREADY_IMPORTED error occurs when the transaction is already in the pool + // More than one node can submit the same unsigned extrinsic. E.g. in the case of + // a threshold signature success. Thus, if we get a "Transaction already in pool" "error" + // we know that this particular extrinsic has already been submitted. And so we can + // ignore the error and return the transaction hash + RpcError::Call(CallError::Custom(ref obj)) if obj.code() == 1013 => { + slog::trace!( + logger, + "Unsigned extrinsic {:?} with tx_hash {:#x} already in pool.", + &call, + expected_hash + ); Ok(expected_hash) } _ => { - let anyhow_error = rpc_error_into_anyhow_error(rpc_err); slog::error!( logger, "Unsigned extrinsic failed with error: {}. Extrinsic: {:?}", - anyhow_error, + rpc_err, &call ); - Err(anyhow_error) + Err(rpc_err.into()) } } } @@ -732,7 +745,7 @@ impl StateChainClient { .storage_events_at(Some(block_hash), storage_key) .await? .into_iter() - .map(|storage_change_set| { + .flat_map(|storage_change_set| { let StorageChangeSet { block: _, changes } = storage_change_set; changes .into_iter() @@ -741,7 +754,6 @@ impl StateChainClient { .map(|data| context!(StorageType::decode(&mut &data.0[..])).unwrap()) }) }) - .flatten() .collect()) } @@ -910,14 +922,13 @@ pub async fn connect_to_state_chain( ) -> Result<( H256, impl Stream>, - Arc>, + Arc>>, )> { inner_connect_to_state_chain(state_chain_settings, wait_for_staking, logger) .await .context("Failed to connect to state chain node") } -#[allow(clippy::eval_order_dependence)] async fn inner_connect_to_state_chain( state_chain_settings: &settings::StateChain, wait_for_staking: bool, @@ -925,7 +936,7 @@ async fn inner_connect_to_state_chain( ) -> Result<( H256, impl Stream>, - Arc>, + Arc>>, )> { let logger = logger.new(o!(COMPONENT_KEY => "StateChainConnector")); let signer = signer::PairSigner::::new( @@ -952,18 +963,17 @@ async fn inner_connect_to_state_chain( // https://substrate.stackexchange.com/questions/3667/api-rpc-chain-subscribefinalizedheads-missing-blocks // https://arxiv.org/abs/2007.01560 let mut sparse_finalized_block_header_stream = state_chain_rpc_client - .chain_rpc_client + .rpc_client .subscribe_finalized_heads() - .map_err(rpc_error_into_anyhow_error)? - .map_err(rpc_error_into_anyhow_error) - .chain(futures::stream::once(std::future::ready(Err(anyhow!( - "sparse_finalized_block_header_stream unexpectedly ended" - ))))); + .await? + .map_err(Into::into) + .chain(futures::stream::once(std::future::ready(Err( + anyhow::anyhow!("sparse_finalized_block_header_stream unexpectedly ended"), + )))); - let mut latest_finalized_header = + let mut latest_finalized_header: state_chain_runtime::Header = sparse_finalized_block_header_stream.next().await.unwrap()?; - - let chain_rpc_client = state_chain_rpc_client.chain_rpc_client.clone(); + let rpc_client = state_chain_rpc_client.rpc_client.clone(); ( latest_finalized_header.clone(), @@ -977,33 +987,27 @@ async fn inner_connect_to_state_chain( next_finalized_header.clone(), ); - let chain_rpc_client = chain_rpc_client.clone(); + let rpc_client = rpc_client.clone(); async move { + let rpc_client = &rpc_client; let intervening_headers: Vec<_> = futures::stream::iter( prev_finalized_header.number + 1..next_finalized_header.number, ) - .then(|block_number| { - let chain_rpc_client = &chain_rpc_client; - async move { - let block_hash = try_unwrap_value( - chain_rpc_client - .block_hash(Some(sp_rpc::list::ListOrValue::Value( - block_number.into(), - ))) - .await - .map_err(rpc_error_into_anyhow_error)?, - anyhow!("Finalized block missing hash"), - ) - .unwrap(); - let block_header = chain_rpc_client - .header(Some(block_hash)) - .await - .map_err(rpc_error_into_anyhow_error)? - .unwrap(); - assert_eq!(block_header.hash(), block_hash); - assert_eq!(block_header.number, block_number); - Result::<_, anyhow::Error>::Ok((block_hash, block_header)) - } + .then(|block_number| async move { + let block_hash = try_unwrap_value( + rpc_client + .block_hash(Some(sp_rpc::list::ListOrValue::Value( + block_number.into(), + ))) + .await?, + anyhow!("Finalized block missing hash"), + ) + .unwrap(); + let block_header = + rpc_client.header(Some(block_hash)).await?.unwrap(); + assert_eq!(block_header.hash(), block_hash); + assert_eq!(block_header.number, block_number); + Result::<_, anyhow::Error>::Ok((block_hash, block_header)) }) .try_collect() .await?; @@ -1037,26 +1041,20 @@ async fn inner_connect_to_state_chain( // Often `finalized_header` returns a significantly newer latest block than the stream returns // so we move the stream forward to this block let (mut latest_block_hash, mut latest_block_number) = { - let finalised_header_hash = state_chain_rpc_client - .chain_rpc_client - .finalized_head() - .await - .map_err(rpc_error_into_anyhow_error)?; - let finalised_header_number = state_chain_rpc_client.chain_rpc_client + let finalised_header_hash = state_chain_rpc_client.rpc_client.finalized_head().await?; + let finalised_header = state_chain_rpc_client.rpc_client .header(Some(finalised_header_hash)) - .await - .map_err(rpc_error_into_anyhow_error)? - .expect("We have the hash from the chain, so there should definitely be a header for this block") - .number; + .await? + .expect("We have the hash from the chain, so there should definitely be a header for this block"); - if first_finalized_block_header.number < finalised_header_number { - for block_number in first_finalized_block_header.number + 1..=finalised_header_number { + if first_finalized_block_header.number < finalised_header.number { + for block_number in first_finalized_block_header.number + 1..=finalised_header.number { assert_eq!( finalized_block_header_stream.next().await.unwrap()?.number, block_number ); } - (finalised_header_hash, finalised_header_number) + (finalised_header_hash, finalised_header.number) } else { ( first_finalized_block_header.hash(), @@ -1066,16 +1064,15 @@ async fn inner_connect_to_state_chain( }; let (latest_block_hash, latest_block_number, account_nonce) = { - async fn get_account_nonce( - state_rpc_client: &StateRpcClient, + async fn get_account_nonce( + state_rpc_client: &C, account_storage_key: &StorageKey, block_hash: state_chain_runtime::Hash, ) -> Result> { Ok( if let Some(encoded_account_info) = state_rpc_client .storage(account_storage_key.clone(), Some(block_hash)) - .await - .map_err(rpc_error_into_anyhow_error)? + .await? { let account_info: frame_system::AccountInfo< state_chain_runtime::Index, @@ -1088,8 +1085,10 @@ async fn inner_connect_to_state_chain( ) } + let rpc_client = state_chain_rpc_client.rpc_client.as_ref(); + let account_nonce = match get_account_nonce( - &state_chain_rpc_client.state_rpc_client, + rpc_client, &account_storage_key, latest_block_hash, ) @@ -1099,12 +1098,9 @@ async fn inner_connect_to_state_chain( None => { if wait_for_staking { loop { - if let Some(nonce) = get_account_nonce( - &state_chain_rpc_client.state_rpc_client, - &account_storage_key, - latest_block_hash, - ) - .await? + if let Some(nonce) = + get_account_nonce(rpc_client, &account_storage_key, latest_block_hash) + .await? { break nonce; } else { @@ -1135,10 +1131,9 @@ async fn inner_connect_to_state_chain( let RuntimeMetadataPrefixed(metadata_prefix, metadata) = context!(RuntimeMetadataPrefixed::decode( &mut &state_chain_rpc_client - .state_rpc_client + .rpc_client .metadata(Some(latest_block_hash)) - .await - .map_err(rpc_error_into_anyhow_error)?[..], + .await?[..], ))?; if metadata_prefix != frame_metadata::META_RESERVED { bail!( @@ -1164,10 +1159,9 @@ async fn inner_connect_to_state_chain( ), genesis_hash: try_unwrap_value( state_chain_rpc_client - .chain_rpc_client + .rpc_client .block_hash(Some(sp_rpc::number::NumberOrHex::from(0u64).into())) - .await - .map_err(rpc_error_into_anyhow_error)?, + .await?, anyhow!("Genesis block doesn't exist?"), )?, signer: signer.clone(), @@ -1192,35 +1186,23 @@ async fn inner_connect_to_state_chain( )) } -#[allow(clippy::eval_order_dependence)] pub async fn connect_to_state_chain_without_signer( state_chain_settings: &settings::StateChain, -) -> Result { +) -> Result> { let ws_endpoint = state_chain_settings.ws_endpoint.as_str(); - let rpc_client = - jsonrpc_core_client::transports::ws::connect::(&url::Url::parse(ws_endpoint)?) + let rpc_client = Arc::new( + WsClientBuilder::default() + .build(&url::Url::parse(ws_endpoint)?) .await - .map_err(rpc_error_into_anyhow_error) .with_context(|| { format!( "Failed to establish rpc connection to substrate node '{}'", ws_endpoint ) - })?; - - let author_rpc_client: AuthorRpcClient = rpc_client.clone().into(); - let chain_rpc_client: ChainRpcClient = rpc_client.clone().into(); - let state_rpc_client: StateRpcClient = rpc_client.clone().into(); - let system_rpc_client: SystemRpcClient = rpc_client.clone().into(); - let custom_rpc_client: CustomClient = rpc_client.into(); - - Ok(StateChainRpcClient { - system_rpc_client, - author_rpc_client, - state_rpc_client, - chain_rpc_client, - custom_rpc_client, - }) + })?, + ); + + Ok(StateChainRpcClient { rpc_client }) } #[cfg(test)] @@ -1361,11 +1343,10 @@ mod tests { .expect_submit_extrinsic_rpc() .times(MAX_EXTRINSIC_RETRY_ATTEMPTS) .returning(move |_| { - Err(RpcError::JsonRpcError(Error { - code: ErrorCode::ServerError(1014), - message: "Priority too low".to_string(), - data: None, - })) + Err( + CallError::Custom(ErrorObject::owned::<()>(1014, "Priority too low", None)) + .into(), + ) }); let state_chain_client = @@ -1395,13 +1376,12 @@ mod tests { .expect_submit_extrinsic_rpc() .times(MAX_EXTRINSIC_RETRY_ATTEMPTS) .returning(move |_| { - Err(RpcError::JsonRpcError(Error { - code: ErrorCode::ServerError(1010), - message: "Invalid Transaction".to_string(), - data: Some(Value::String( - <&'static str>::from(InvalidTransaction::Stale).into(), - )), - })) + Err(CallError::Custom(ErrorObject::owned( + 1010, + "Invalid Transaction", + Some(<&'static str>::from(InvalidTransaction::Stale)), + )) + .into()) }); let state_chain_client = @@ -1430,13 +1410,12 @@ mod tests { .expect_submit_extrinsic_rpc() .times(1) .returning(move |_ext: state_chain_runtime::UncheckedExtrinsic| { - Err(RpcError::JsonRpcError(Error { - code: ErrorCode::ServerError(1010), - message: "Invalid Transaction".to_string(), - data: Some(Value::String( - <&'static str>::from(InvalidTransaction::BadProof).into(), - )), - })) + Err(CallError::Custom(ErrorObject::owned( + 1010, + "Invalid Transaction", + Some(<&'static str>::from(InvalidTransaction::BadProof)), + )) + .into()) }); // Second time called, should succeed @@ -1500,7 +1479,7 @@ mod tests { mock_state_chain_rpc_client .expect_submit_extrinsic_rpc() .times(1) - .returning(move |_| Err(RpcError::Timeout)); + .returning(move |_| Err(RpcError::RequestTimeout)); let state_chain_client = StateChainClient::create_test_sc_client(mock_state_chain_rpc_client); @@ -1540,11 +1519,10 @@ mod tests { .expect_submit_extrinsic_rpc() .times(1) .returning(move |_| { - Err(RpcError::JsonRpcError(Error { - code: ErrorCode::ServerError(1014), - message: "Priority too low".to_string(), - data: None, - })) + Err( + CallError::Custom(ErrorObject::owned::<()>(1014, "Priority too low", None)) + .into(), + ) }); mock_state_chain_rpc_client diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1bd3a2e282..71321a43d3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2021-11-16" +channel = "nightly-2022-08-08" components = ["cargo", "rustfmt", "clippy"] targets = [ "wasm32-unknown-unknown"] diff --git a/state-chain/cf-integration-tests/Cargo.toml b/state-chain/cf-integration-tests/Cargo.toml index 9ca2481606..746d52afb7 100644 --- a/state-chain/cf-integration-tests/Cargo.toml +++ b/state-chain/cf-integration-tests/Cargo.toml @@ -36,11 +36,11 @@ pallet-cf-environment = { path = '../pallets/cf-environment'} # Additional FRAME pallets [dev-dependencies.pallet-authorship] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-session] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' features = ['historical'] # Substrate dependencies @@ -52,88 +52,88 @@ version = '3.0.0' [dev-dependencies.frame-executive] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.frame-support] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.frame-system] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.frame-system-rpc-runtime-api] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.hex-literal] version = '0.3.1' [dev-dependencies.pallet-aura] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-grandpa] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-randomness-collective-flip] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-timestamp] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-transaction-payment] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.scale-info] features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dev-dependencies.sp-block-builder] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-consensus-aura] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' version = '0.10.0-dev' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-inherents] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-offchain] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-runtime] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-session] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-std] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-transaction-pool] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-version] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-finality-grandpa] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' diff --git a/state-chain/cf-integration-tests/src/network.rs b/state-chain/cf-integration-tests/src/network.rs index acd7efca1b..bfdcc7149b 100644 --- a/state-chain/cf-integration-tests/src/network.rs +++ b/state-chain/cf-integration-tests/src/network.rs @@ -96,7 +96,7 @@ impl KeyComponents { // just use the same signature nonce for every ceremony in tests let k: [u8; 32] = StdRng::seed_from_u64(200).gen(); let k = SecretKey::parse(&k).unwrap(); - let signature = self.agg_key.sign(&(*message).into(), &self.secret, &k); + let signature = self.agg_key.sign(message.as_fixed_bytes(), &self.secret, &k); let k_times_g_address = to_ethereum_address(PublicKey::from_secret_key(&k)); SchnorrVerificationComponents { s: signature, k_times_g_address } @@ -216,7 +216,7 @@ impl Engine { Event::Validator( // A new epoch pallet_cf_validator::Event::NewEpoch(_epoch_index)) => { - (&*self.threshold_signer).borrow_mut().use_proposed_key(); + self.threshold_signer.borrow_mut().use_proposed_key(); }, Event::EthereumThresholdSigner( // A signature request @@ -233,7 +233,7 @@ impl Engine { Origin::none(), *ceremony_id, // Sign with current key - (&*self.threshold_signer).borrow().key_components.sign(payload), + self.threshold_signer.borrow().key_components.sign(payload), ).expect("should be able to submit threshold signature for Ethereum"); } }; }, @@ -245,7 +245,7 @@ impl Engine { state_chain_runtime::Witnesser::witness( Origin::signed(self.node_id.clone()), Box::new(pallet_cf_vaults::Call::vault_key_rotated { - new_public_key: (&*self.threshold_signer).borrow_mut().proposed_public_key(), + new_public_key: self.threshold_signer.borrow_mut().proposed_public_key(), block_number: 100, tx_hash: [1u8; 32].into(), }.into()), @@ -268,8 +268,8 @@ impl Engine { // A keygen request has been made pallet_cf_vaults::Event::KeygenRequest(ceremony_id, authorities)) => { if authorities.contains(&self.node_id) { - (&*self.threshold_signer).borrow_mut().propose_new_public_key(); - let threshold_signer = (&*self.threshold_signer).borrow(); + self.threshold_signer.borrow_mut().propose_new_public_key(); + let threshold_signer = self.threshold_signer.borrow(); let proposed_key_components = threshold_signer.proposed_key_components.as_ref().expect("should have propposed key"); let payload: H256 = proposed_key_components.agg_key.pub_key_x.into(); let sig = proposed_key_components.sign(&payload); diff --git a/state-chain/cf-session-benchmarking/Cargo.toml b/state-chain/cf-session-benchmarking/Cargo.toml index a188a395b8..594dc299f5 100644 --- a/state-chain/cf-session-benchmarking/Cargo.toml +++ b/state-chain/cf-session-benchmarking/Cargo.toml @@ -18,33 +18,33 @@ rand = { version = '0.7.2', default-features = false } [dependencies.pallet-session] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' features = ['historical'] [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/chains/Cargo.toml b/state-chain/chains/Cargo.toml index 8978d57a85..402ee97ccb 100644 --- a/state-chain/chains/Cargo.toml +++ b/state-chain/chains/Cargo.toml @@ -20,7 +20,7 @@ rlp = {default-features = false, version = '0.5'} hex = {default-features = false, version = '0.4'} hex-literal = {optional = true, version = '0.3'} serde = {optional = true, version = '1.0.126', features = ['derive']} -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Substrate packages [dependencies.codec] @@ -32,28 +32,28 @@ version = '3.0.0' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false optional = true git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] diff --git a/state-chain/chains/src/eth.rs b/state-chain/chains/src/eth.rs index 5264c3c443..164f266fb0 100644 --- a/state-chain/chains/src/eth.rs +++ b/state-chain/chains/src/eth.rs @@ -646,7 +646,7 @@ pub fn verify_transaction( #[allow(clippy::ptr_arg)] signed: &RawSignedTransaction, address: &Address, ) -> Result { - let decoded_tx: ethereum::TransactionV2 = match signed.get(0) { + let decoded_tx: ethereum::TransactionV2 = match signed.first() { Some(0x01) => rlp::decode(&signed[1..]).map(ethereum::TransactionV2::EIP2930), Some(0x02) => rlp::decode(&signed[1..]).map(ethereum::TransactionV2::EIP1559), _ => rlp::decode(&signed[..]).map(ethereum::TransactionV2::Legacy), diff --git a/state-chain/custom-rpc/Cargo.toml b/state-chain/custom-rpc/Cargo.toml index 6d42e2972f..95b5c3f2c5 100644 --- a/state-chain/custom-rpc/Cargo.toml +++ b/state-chain/custom-rpc/Cargo.toml @@ -9,9 +9,7 @@ edition = '2021' path = '../runtime' [dependencies] -jsonrpc-derive = '18.0.0' -jsonrpc-core = '18.0.0' -jsonrpc-core-client = '18.0.0' +jsonrpsee = { version = "0.13.0", features = ["full"] } serde = { version = '1.0', features = ['derive'] } cf-chains = { path = '../chains' } cf-utilities = { package = 'utilities', path = '../../utilities' } @@ -20,16 +18,16 @@ hex = '0.4.3' [dependencies.sp-runtime] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-api] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-rpc] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sc-client-api] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' diff --git a/state-chain/custom-rpc/src/lib.rs b/state-chain/custom-rpc/src/lib.rs index 6c19ce4bb7..523e4d2c43 100644 --- a/state-chain/custom-rpc/src/lib.rs +++ b/state-chain/custom-rpc/src/lib.rs @@ -1,10 +1,8 @@ -pub use self::gen_client::Client as CustomClient; use cf_chains::eth::SigData; -use cf_utilities::JsonResultExt; -use jsonrpc_core::serde::{Deserialize, Serialize}; -use jsonrpc_derive::rpc; +use jsonrpsee::{core::RpcResult, proc_macros::rpc, types::error::CallError}; use pallet_cf_governance::GovCallHash; use sc_client_api::HeaderBackend; +use serde::{Deserialize, Serialize}; use sp_api::BlockT; use sp_rpc::number::NumberOrHex; use sp_runtime::AccountId32; @@ -44,120 +42,89 @@ pub struct RpcPenalty { type RpcSuspensions = Vec<(Offence, Vec<(u32, AccountId32)>)>; -#[rpc] +#[rpc(server, client, namespace = "cf")] /// The custom RPC endpoints for the state chain node. pub trait CustomApi { /// Returns true if the current phase is the auction phase. - #[rpc(name = "cf_is_auction_phase")] - fn cf_is_auction_phase( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_eth_key_manager_address")] + #[method(name = "is_auction_phase")] + fn cf_is_auction_phase(&self, at: Option) -> RpcResult; + #[method(name = "eth_key_manager_address")] fn cf_eth_key_manager_address( &self, at: Option, - ) -> Result; - #[rpc(name = "cf_eth_stake_manager_address")] + ) -> RpcResult; + #[method(name = "eth_stake_manager_address")] fn cf_eth_stake_manager_address( &self, at: Option, - ) -> Result; - #[rpc(name = "cf_eth_flip_token_address")] - fn cf_eth_flip_token_address( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_eth_chain_id")] - fn cf_eth_chain_id( - &self, - at: Option, - ) -> Result; + ) -> RpcResult; + #[method(name = "eth_flip_token_address")] + fn cf_eth_flip_token_address(&self, at: Option) + -> RpcResult; + #[method(name = "eth_chain_id")] + fn cf_eth_chain_id(&self, at: Option) -> RpcResult; /// Returns the eth vault in the form [agg_key, active_from_eth_block] - #[rpc(name = "cf_eth_vault")] - fn cf_eth_vault( - &self, - at: Option, - ) -> Result<(String, u32), jsonrpc_core::Error>; - #[rpc(name = "cf_tx_fee_multiplier")] - fn cf_tx_fee_multiplier( - &self, - at: Option, - ) -> Result; + #[method(name = "eth_vault")] + fn cf_eth_vault(&self, at: Option) -> RpcResult<(String, u32)>; + #[method(name = "tx_fee_multiplier")] + fn cf_tx_fee_multiplier(&self, at: Option) -> RpcResult; // Returns the Auction params in the form [min_set_size, max_set_size] - #[rpc(name = "cf_auction_parameters")] - fn cf_auction_parameters( - &self, - at: Option, - ) -> Result<(u32, u32), jsonrpc_core::Error>; - #[rpc(name = "cf_min_stake")] - fn cf_min_stake( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_current_epoch")] - fn cf_current_epoch( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_epoch_duration")] - fn cf_epoch_duration( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_current_epoch_started_at")] - fn cf_current_epoch_started_at( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_authority_emission_per_block")] + #[method(name = "auction_parameters")] + fn cf_auction_parameters(&self, at: Option) + -> RpcResult<(u32, u32)>; + #[method(name = "min_stake")] + fn cf_min_stake(&self, at: Option) -> RpcResult; + #[method(name = "current_epoch")] + fn cf_current_epoch(&self, at: Option) -> RpcResult; + #[method(name = "epoch_duration")] + fn cf_epoch_duration(&self, at: Option) -> RpcResult; + #[method(name = "current_epoch_started_at")] + fn cf_current_epoch_started_at(&self, at: Option) -> RpcResult; + #[method(name = "authority_emission_per_block")] fn cf_authority_emission_per_block( &self, at: Option, - ) -> Result; - #[rpc(name = "cf_backup_emission_per_block")] + ) -> RpcResult; + #[method(name = "backup_emission_per_block")] fn cf_backup_emission_per_block( &self, at: Option, - ) -> Result; - #[rpc(name = "cf_flip_supply")] + ) -> RpcResult; + #[method(name = "flip_supply")] fn cf_flip_supply( &self, at: Option, - ) -> Result<(NumberOrHex, NumberOrHex), jsonrpc_core::Error>; - #[rpc(name = "cf_accounts")] + ) -> RpcResult<(NumberOrHex, NumberOrHex)>; + #[method(name = "accounts")] fn cf_accounts( &self, at: Option, - ) -> Result, jsonrpc_core::Error>; - #[rpc(name = "cf_account_info")] + ) -> RpcResult>; + #[method(name = "account_info")] fn cf_account_info( &self, account_id: AccountId32, at: Option, - ) -> Result; - #[rpc(name = "cf_pending_claim")] + ) -> RpcResult; + #[method(name = "pending_claim")] fn cf_pending_claim( &self, account_id: AccountId32, at: Option, - ) -> Result, jsonrpc_core::Error>; - #[rpc(name = "cf_penalties")] + ) -> RpcResult>; + #[method(name = "penalties")] fn cf_penalties( &self, at: Option, - ) -> Result, jsonrpc_core::Error>; - #[rpc(name = "cf_suspensions")] - fn cf_suspensions( - &self, - at: Option, - ) -> Result; - #[rpc(name = "cf_generate_gov_key_call_hash")] + ) -> RpcResult>; + #[method(name = "suspensions")] + fn cf_suspensions(&self, at: Option) -> RpcResult; + #[method(name = "generate_gov_key_call_hash")] fn cf_generate_gov_key_call_hash( &self, call: Vec, at: Option, - ) -> Result; + ) -> RpcResult; } /// An RPC extension for the state chain node. @@ -177,170 +144,137 @@ where } } -impl CustomApi for CustomRpc +fn to_rpc_error(e: E) -> jsonrpsee::core::Error { + CallError::from_std_error(e).into() +} + +impl CustomApiServer for CustomRpc where B: sp_runtime::traits::Block, C: sp_api::ProvideRuntimeApi + Send + Sync + 'static + HeaderBackend, C::Api: CustomRuntimeApi, { - fn cf_is_auction_phase( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_is_auction_phase(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_is_auction_phase(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } - fn cf_eth_flip_token_address( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_eth_flip_token_address(&self, at: Option<::Hash>) -> RpcResult { let eth_flip_token_address = self .client .runtime_api() .cf_eth_flip_token_address(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(hex::encode(eth_flip_token_address)) } - fn cf_eth_stake_manager_address( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_eth_stake_manager_address(&self, at: Option<::Hash>) -> RpcResult { let eth_stake_manager_address = self .client .runtime_api() .cf_eth_stake_manager_address(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(hex::encode(eth_stake_manager_address)) } - fn cf_eth_key_manager_address( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_eth_key_manager_address(&self, at: Option<::Hash>) -> RpcResult { let eth_key_manager_address = self .client .runtime_api() .cf_eth_key_manager_address(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(hex::encode(eth_key_manager_address)) } - fn cf_eth_chain_id(&self, at: Option<::Hash>) -> Result { + fn cf_eth_chain_id(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_eth_chain_id(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } - fn cf_eth_vault( - &self, - at: Option<::Hash>, - ) -> Result<(String, u32), jsonrpc_core::Error> { - let eth_vault = self - .client + fn cf_eth_vault(&self, at: Option<::Hash>) -> RpcResult<(String, u32)> { + self.client .runtime_api() .cf_eth_vault(&self.query_block_id(at)) - .expect("The runtime API should not return error."); - - Ok((hex::encode(eth_vault.0), eth_vault.1)) + .map(|(public_key, active_from_block)| (hex::encode(public_key), active_from_block)) + .map_err(to_rpc_error) } // FIXME: Respect the block hash argument here - fn cf_tx_fee_multiplier( - &self, - _at: Option<::Hash>, - ) -> Result { - Ok(TX_FEE_MULTIPLIER - .try_into() - .expect("We never set a fee multiplier greater than u64::MAX")) + fn cf_tx_fee_multiplier(&self, _at: Option<::Hash>) -> RpcResult { + Ok(TX_FEE_MULTIPLIER as u64) } - fn cf_auction_parameters( - &self, - at: Option<::Hash>, - ) -> Result<(u32, u32), jsonrpc_core::Error> { + fn cf_auction_parameters(&self, at: Option<::Hash>) -> RpcResult<(u32, u32)> { self.client .runtime_api() .cf_auction_parameters(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } - fn cf_min_stake( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_min_stake(&self, at: Option<::Hash>) -> RpcResult { let min_stake = self .client .runtime_api() .cf_min_stake(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(min_stake.into()) } - fn cf_current_epoch( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_current_epoch(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_current_epoch(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } - fn cf_epoch_duration( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_epoch_duration(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_epoch_duration(&self.query_block_id(at)) - .map_err(|_| jsonrpc_core::Error::new(jsonrpc_core::ErrorCode::ServerError(0))) + .map_err(to_rpc_error) } - fn cf_current_epoch_started_at( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_current_epoch_started_at(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_current_epoch_started_at(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } fn cf_authority_emission_per_block( &self, at: Option<::Hash>, - ) -> Result { + ) -> RpcResult { let authority_emission_per_block = self .client .runtime_api() .cf_authority_emission_per_block(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(authority_emission_per_block.into()) } fn cf_backup_emission_per_block( &self, at: Option<::Hash>, - ) -> Result { + ) -> RpcResult { let backup_emission_per_block = self .client .runtime_api() .cf_backup_emission_per_block(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(backup_emission_per_block.into()) } fn cf_flip_supply( &self, at: Option<::Hash>, - ) -> Result<(NumberOrHex, NumberOrHex), jsonrpc_core::Error> { + ) -> RpcResult<(NumberOrHex, NumberOrHex)> { let (issuance, offchain) = self .client .runtime_api() .cf_flip_supply(&self.query_block_id(at)) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok((issuance.into(), offchain.into())) } fn cf_accounts( &self, at: Option<::Hash>, - ) -> Result, jsonrpc_core::Error> { + ) -> RpcResult> { Ok(self .client .runtime_api() .cf_accounts(&self.query_block_id(at)) - .map_to_json_error()? + .map_err(to_rpc_error)? .into_iter() .map(|(account_id, vanity_name_bytes)| { // we can use from_utf8_lossy here because we're guaranteed utf8 when we @@ -353,12 +287,12 @@ where &self, account_id: AccountId32, at: Option<::Hash>, - ) -> Result { + ) -> RpcResult { let account_info = self .client .runtime_api() .cf_account_info(&self.query_block_id(at), account_id) - .map_to_json_error()?; + .map_err(to_rpc_error)?; Ok(RpcAccountInfo { stake: account_info.stake.into(), @@ -376,12 +310,12 @@ where &self, account_id: AccountId32, at: Option<::Hash>, - ) -> Result, jsonrpc_core::Error> { + ) -> RpcResult> { let pending_claim = match self .client .runtime_api() .cf_pending_claim(&self.query_block_id(at), account_id) - .map_to_json_error()? + .map_err(to_rpc_error)? { Some(pending_claim) => pending_claim, None => return Ok(None), @@ -397,12 +331,12 @@ where fn cf_penalties( &self, at: Option<::Hash>, - ) -> Result, jsonrpc_core::Error> { + ) -> RpcResult> { Ok(self .client .runtime_api() .cf_penalties(&self.query_block_id(at)) - .map_to_json_error()? + .map_err(to_rpc_error)? .iter() .map(|(offence, runtime_api_penalty)| { ( @@ -415,24 +349,21 @@ where }) .collect()) } - fn cf_suspensions( - &self, - at: Option<::Hash>, - ) -> Result { + fn cf_suspensions(&self, at: Option<::Hash>) -> RpcResult { self.client .runtime_api() .cf_suspensions(&self.query_block_id(at)) - .map_to_json_error() + .map_err(to_rpc_error) } fn cf_generate_gov_key_call_hash( &self, call: Vec, at: Option<::Hash>, - ) -> Result { + ) -> RpcResult { self.client .runtime_api() .cf_generate_gov_key_call_hash(&self.query_block_id(at), call) - .map_to_json_error() + .map_err(to_rpc_error) } } diff --git a/state-chain/multisig-p2p-transport/Cargo.toml b/state-chain/multisig-p2p-transport/Cargo.toml index d712368d90..cc2b95395b 100644 --- a/state-chain/multisig-p2p-transport/Cargo.toml +++ b/state-chain/multisig-p2p-transport/Cargo.toml @@ -8,10 +8,8 @@ edition = '2021' anyhow = '1.0' bincode = '1.3.3' serde = {version = '1.0.125', features = ['derive']} -log = '0.4.14' -jsonrpc-core = '18.0.0' -jsonrpc-core-client = '18.0.0' -jsonrpc-derive = '18.0.0' +log = '0.4.16' +jsonrpsee = { version = "0.13.0", features = ["full"] } serde_json = '1.0.68' bs58 = '0.4.0' futures = { version = '0.3.4', features = ['compat'] } @@ -24,25 +22,25 @@ cf-utilities = { package = 'utilities', path = '../../utilities' } [dependencies.sp-runtime] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sc-network] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sc-rpc] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' features = ['test-helpers'] [dependencies.sc-service] features = ['wasmtime'] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] predicates = '2.1.1' diff --git a/state-chain/multisig-p2p-transport/src/lib.rs b/state-chain/multisig-p2p-transport/src/lib.rs index cb8f250908..c92378af13 100644 --- a/state-chain/multisig-p2p-transport/src/lib.rs +++ b/state-chain/multisig-p2p-transport/src/lib.rs @@ -6,17 +6,13 @@ //! messages and sends them to any Rpc subscribers we have (Our local CFE). use anyhow::{anyhow, Context}; -use cf_utilities::{ - make_periodic_tick, new_json_error, rpc_error_into_anyhow_error, JsonResultExt, Port, -}; -pub use gen_client::Client as P2PRpcClient; +use cf_utilities::{make_periodic_tick, Port}; use ipc_channel::ipc::TryRecvError; pub use sc_network::PeerId; use async_trait::async_trait; use futures::{stream, Stream, StreamExt}; -use jsonrpc_core::Result; -use jsonrpc_derive::rpc; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; use sc_network::{multiaddr, Event, ExHashT, NetworkService}; use serde::{self, Deserialize, Serialize}; use sp_runtime::{sp_std::sync::Arc, traits::Block as BlockT}; @@ -64,10 +60,10 @@ pub fn p2p_peers_set_config() -> sc_network::config::NonDefaultSetConfig { pub struct PeerIdTransferable(Vec); impl TryInto for PeerIdTransferable { - type Error = jsonrpc_core::Error; + type Error = anyhow::Error; fn try_into(self) -> std::result::Result { - PeerId::from_bytes(&self.0[..]).map_to_json_error() + PeerId::from_bytes(&self.0[..]).map_err(Into::into) } } @@ -77,12 +73,11 @@ impl From<&PeerId> for PeerIdTransferable { } } -pub struct RpcRequestHandler { +pub struct RpcRequestHandler { message_sender_spawner: sc_service::SpawnTaskHandle, shared_state: Arc, p2p_network_service: Arc, retry_send_period: Duration, - _phantom: std::marker::PhantomData, } type ReservedPeers = BTreeMap>)>; @@ -158,32 +153,30 @@ impl PeerNetwork for NetworkService { } } -#[rpc] +#[rpc(client, server, namespace = "p2p")] pub trait P2PValidatorNetworkNodeRpcApi { - /// RPC Metadata - type Metadata; - /// Connect to authorities and disconnect from old authorities - #[rpc(name = "p2p_set_peers")] - fn set_peers(&self, peers: Vec<(PeerIdTransferable, Port, Ipv6Addr)>) -> Result; + #[method(name = "set_peers")] + fn set_peers(&self, peers: Vec<(PeerIdTransferable, Port, Ipv6Addr)>) -> RpcResult; /// Connect to a authority - #[rpc(name = "p2p_add_peer")] - fn add_peer(&self, peer_id: PeerIdTransferable, port: Port, address: Ipv6Addr) -> Result; + #[method(name = "add_peer")] + fn add_peer( + &self, + peer_id: PeerIdTransferable, + port: Port, + address: Ipv6Addr, + ) -> RpcResult; /// Disconnect from a authority - #[rpc(name = "p2p_remove_peer")] - fn remove_peer(&self, peer_id: PeerIdTransferable) -> Result; + #[method(name = "remove_peer")] + fn remove_peer(&self, peer_id: PeerIdTransferable) -> RpcResult; - #[rpc(name = "p2p_setup_ipc_connections")] - fn setup_ipc_connections(&self, server_name: String) -> Result; + #[method(name = "setup_ipc_connections")] + fn setup_ipc_connections(&self, server_name: String) -> RpcResult; } -impl< - MetaData: jsonrpc_core::Metadata + Send + Sync + 'static, - PN: PeerNetwork + Send + Sync + 'static, - > RpcRequestHandler -{ +impl RpcRequestHandler { fn update_peer_mapping( &self, reserved_peers: &mut std::sync::MutexGuard, @@ -258,35 +251,28 @@ pub fn new_ipc_stream( ) } -pub fn new_p2p_network_node< - MetaData: jsonrpc_core::Metadata + Send + Sync + 'static, - PN: PeerNetwork + Send + Sync + 'static, ->( +pub fn new_p2p_network_node( p2p_network_service: Arc, message_sender_spawner: sc_service::SpawnTaskHandle, retry_send_period: Duration, -) -> (RpcRequestHandler, impl futures::Future) { +) -> (Arc>, impl futures::Future) { let shared_state = Arc::new(SharedState::default()); ( // RPC Request Handler { - impl< - MetaData: jsonrpc_core::Metadata + Send + Sync + 'static, - PN: PeerNetwork + Send + Sync + 'static, - > P2PValidatorNetworkNodeRpcApi for RpcRequestHandler + impl P2PValidatorNetworkNodeRpcApiServer + for Arc> { - type Metadata = MetaData; - /// Connect to authorities fn set_peers( &self, peers: Vec<(PeerIdTransferable, Port, Ipv6Addr)>, - ) -> Result { + ) -> RpcResult { let peers = peers .into_iter() .map(|(peer_id, port, address)| { - Result::Ok((peer_id.try_into()?, (port, address))) + RpcResult::Ok((peer_id.try_into()?, (port, address))) }) .collect::, _>>()?; @@ -321,7 +307,7 @@ pub fn new_p2p_network_node< peer_id: PeerIdTransferable, port: Port, ip_address: Ipv6Addr, - ) -> Result { + ) -> RpcResult { let peer_id: PeerId = peer_id.try_into()?; let mut reserved_peers = self.shared_state.reserved_peers.lock().unwrap(); if self.update_peer_mapping(&mut reserved_peers, peer_id, port, ip_address) { @@ -333,15 +319,16 @@ pub fn new_p2p_network_node< ); Ok(200) } else { - Err(new_json_error(format!( + Err(anyhow::anyhow!( "Tried to add peer {} which is already reserved", peer_id - ))) + ) + .into()) } } /// Disconnect from an authority - fn remove_peer(&self, peer_id: PeerIdTransferable) -> Result { + fn remove_peer(&self, peer_id: PeerIdTransferable) -> RpcResult { let peer_id: PeerId = peer_id.try_into()?; let mut reserved_peers = self.shared_state.reserved_peers.lock().unwrap(); if reserved_peers.remove(&peer_id).is_some() { @@ -354,29 +341,26 @@ pub fn new_p2p_network_node< ); Ok(200) } else { - Err(new_json_error(format!( + Err(anyhow::anyhow!( "Tried to remove peer {} which is not reserved", peer_id - ))) + ) + .into()) } } - fn setup_ipc_connections(&self, server_name: String) -> Result { + fn setup_ipc_connections(&self, server_name: String) -> RpcResult { let (incoming_ipc_sender, incoming_ipc_receiver) = ipc_channel::ipc::channel::<(PeerIdTransferable, Vec)>() - .context("Failed to create incoming p2p message IPC channel") - .map_to_json_error()?; + .context("Failed to create incoming p2p message IPC channel")?; let (outgoing_ipc_sender, outgoing_ipc_receiver) = ipc_channel::ipc::channel::<(Vec, Vec)>() - .context("Failed to create outgoing p2p message IPC channel") - .map_to_json_error()?; + .context("Failed to create outgoing p2p message IPC channel")?; ipc_channel::ipc::IpcSender::connect(server_name) - .context("Failed to connect to oneshot IPC channel") - .map_to_json_error()? + .context("Failed to connect to oneshot IPC channel")? .send((outgoing_ipc_sender, incoming_ipc_receiver)) - .context("Failed to setup IPC channels") - .map_to_json_error()?; + .context("Failed to setup IPC channels")?; *self.shared_state.ipc_state.lock().unwrap() = Some({ let ( @@ -446,13 +430,12 @@ pub fn new_p2p_network_node< } } - RpcRequestHandler { + Arc::new(RpcRequestHandler { message_sender_spawner: message_sender_spawner.clone(), shared_state: shared_state.clone(), p2p_network_service: p2p_network_service.clone(), retry_send_period, - _phantom: std::marker::PhantomData::::default(), - } + }) }, // P2P Event Handler { @@ -532,15 +515,12 @@ pub fn new_p2p_network_node< type OutgoingSender = ipc_channel::ipc::IpcSender<(Vec, Vec)>; -pub async fn setup_ipc_connections( - client: &P2PRpcClient, +pub async fn setup_ipc_connections( + client: &C, ) -> anyhow::Result<(OutgoingSender, impl futures::Stream)>)> { let (server, server_name) = ipc_channel::ipc::IpcOneShotServer::new()?; - client - .setup_ipc_connections(server_name) - .await - .map_err(rpc_error_into_anyhow_error)?; + client.setup_ipc_connections(server_name).await?; let (ipc_outgoing_sender, ipc_incoming_receiver) = server.accept()?.1; @@ -554,8 +534,10 @@ mod tests { use super::*; use cf_utilities::mockall_utilities::eq; use futures::Future; - use jsonrpc_core::MetaIoHandler; - use jsonrpc_core_client::transports::local; + use jsonrpsee::{ + ws_client::{WsClient, WsClientBuilder}, + ws_server::WsServerBuilder, + }; use mockall::Sequence; use tokio::sync::{Mutex, MutexGuard}; @@ -586,7 +568,7 @@ mod tests { async fn new_p2p_network_node_with_test_probes() -> ( tokio::sync::mpsc::UnboundedSender, - P2PRpcClient, + Arc, Arc, Arc, sc_service::TaskManager, @@ -611,18 +593,19 @@ mod tests { let shared_state = rpc_request_handler.shared_state.clone(); - let (client, server) = local::connect_with_pubsub::(Arc::new({ - let mut io = MetaIoHandler::default(); - io.extend_with(P2PValidatorNetworkNodeRpcApi::to_delegate(rpc_request_handler)); - io - })); + let server = WsServerBuilder::default().build("127.0.0.1:0").await.unwrap(); + let addr = format!("ws://{}", server.local_addr().unwrap()); + server + .start(P2PValidatorNetworkNodeRpcApiServer::into_rpc(rpc_request_handler)) + .unwrap(); + + let client = WsClientBuilder::default().build(addr).await.unwrap(); - tokio::runtime::Handle::current().spawn(server); tokio::runtime::Handle::current().spawn(p2p_message_handler_future); network_expectations.lock().checkpoint(); - (event_sender, client, shared_state, network_expectations, task_manager) + (event_sender, Arc::new(client), shared_state, network_expectations, task_manager) } async fn expect_reserve_peer_changes_during_closure F>( @@ -961,7 +944,7 @@ mod tests { let message = vec![4, 5, 6, 7, 8]; let (ipc_outgoing_sender, _ipc_incoming_stream) = - setup_ipc_connections(&client).await.unwrap(); + setup_ipc_connections(client.as_ref()).await.unwrap(); network_expectations.lock().expect_reserve_peer().times(2).return_const(()); client @@ -1060,7 +1043,7 @@ mod tests { let other_message = vec![2, 3, 4, 5, 6]; let (_ipc_outgoing_sender, mut ipc_incoming_stream) = - setup_ipc_connections(&client).await.unwrap(); + setup_ipc_connections(client.as_ref()).await.unwrap(); // Tests diff --git a/state-chain/node/Cargo.toml b/state-chain/node/Cargo.toml index f0a0ffd100..c5863adcaf 100644 --- a/state-chain/node/Cargo.toml +++ b/state-chain/node/Cargo.toml @@ -31,55 +31,53 @@ custom-rpc = {path = '../custom-rpc'} futures = {version = '0.3.4'} hex = '0.4' hex-literal = '0.3.1' -jsonrpc-core-client = '18.0.0' -jsonrpc-derive = '18.0.0' # Substrate-node-template dependencies -clap = { version = "3.1.6", features = ["derive"] } +clap = { version = "3.1.18", features = ["derive"] } -sc-cli = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05", features = ["wasmtime"] } -sp-core = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-executor = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05", features = ["wasmtime"] } -sc-service = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05", features = ["wasmtime"] } -sc-telemetry = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-keystore = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-transaction-pool = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-transaction-pool-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-consensus-aura = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-consensus-aura = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-consensus = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-consensus = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-finality-grandpa = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-finality-grandpa-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-finality-grandpa = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-client-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-runtime = { version = "6.0.0", git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-timestamp = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-inherents = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-keyring = { version = "6.0.0", git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -frame-system = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -pallet-transaction-payment = { default-features = false, git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } +sc-cli = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06", features = ["wasmtime"] } +sp-core = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-executor = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06", features = ["wasmtime"] } +sc-service = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06", features = ["wasmtime"] } +sc-telemetry = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-keystore = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-transaction-pool = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-transaction-pool-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-consensus-aura = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-consensus-aura = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-consensus = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-consensus = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-finality-grandpa = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-finality-grandpa-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-finality-grandpa = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-client-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-runtime = { version = "6.0.0", git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-timestamp = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-inherents = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-keyring = { version = "6.0.0", git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +frame-system = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +pallet-transaction-payment = { default-features = false, git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } # These dependencies are used for the node template's RPCs -jsonrpc-core = "18.0.0" -sc-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-rpc-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-blockchain = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sp-block-builder = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -sc-basic-authorship = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -pallet-transaction-payment-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } +jsonrpsee = { version = "0.13.0", features = ["full"] } +sc-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-rpc-api = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-blockchain = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sp-block-builder = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +sc-basic-authorship = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +substrate-frame-rpc-system = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +pallet-transaction-payment-rpc = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } # These dependencies are used for runtime benchmarking -frame-benchmarking = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } -frame-benchmarking-cli = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } +frame-benchmarking = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } +frame-benchmarking-cli = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } # CLI-specific dependencies -try-runtime-cli = { optional = true, git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } +try-runtime-cli = { optional = true, git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-05" } +substrate-build-script-utils = { git = "https://github.com/chainflip-io/substrate.git", tag = "chainflip-monthly-2022-06" } [features] default = [] diff --git a/state-chain/node/src/service.rs b/state-chain/node/src/service.rs index ffb5fcead2..9a0273a40a 100644 --- a/state-chain/node/src/service.rs +++ b/state-chain/node/src/service.rs @@ -1,7 +1,7 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. -use custom_rpc::{CustomApi, CustomRpc}; -use jsonrpc_core::MetaIoHandler; +use custom_rpc::{CustomApiServer, CustomRpc}; +use jsonrpsee::RpcModule; use sc_client_api::{BlockBackend, ExecutorProvider}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; pub use sc_executor::NativeElseWasmExecutor; @@ -167,7 +167,7 @@ fn remote_keystore(_url: &str) -> Result, &'static str> { /// Builds a new service for a full client. pub fn new_full(mut config: Configuration) -> Result { - use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler}; + use sc_finality_grandpa_rpc::{Grandpa, GrandpaApiServer}; let sc_service::PartialComponents { client, @@ -180,27 +180,18 @@ pub fn new_full(mut config: Configuration) -> Result other: (block_import, grandpa_link, mut telemetry), } = new_partial(&config)?; - let ( - shared_voter_state, - shared_authority_set, - justification_stream, - subscription_executor, - finality_provider, - ) = { - let (_grandpa_block_import, grandpa_link) = - sc_finality_grandpa::block_import_with_authority_set_hard_forks( - client.clone(), - &(client.clone() as Arc<_>), - select_chain.clone(), - Vec::new(), - telemetry.as_ref().map(|x| x.handle()), - )?; + let (shared_voter_state, shared_authority_set, justification_stream, finality_provider) = { + let (_grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + client.clone(), + &(client.clone() as Arc<_>), + select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), + )?; ( sc_finality_grandpa::SharedVoterState::empty(), grandpa_link.shared_authority_set().clone(), grandpa_link.justification_stream(), - sc_rpc::SubscriptionTaskExecutor::new(task_manager.spawn_handle()), sc_finality_grandpa::FinalityProofProvider::new_for_service( backend.clone(), Some(grandpa_link.shared_authority_set().clone()), @@ -268,43 +259,50 @@ pub fn new_full(mut config: Configuration) -> Result multisig_p2p_transport::RETRY_SEND_INTERVAL, ); - let rpc_extensions_builder = { - let mut io = MetaIoHandler::default(); - io.extend_with(multisig_p2p_transport::P2PValidatorNetworkNodeRpcApi::to_delegate( - rpc_request_handler, - )); - + let rpc_builder = { let client = client.clone(); let pool = transaction_pool.clone(); - Box::new(move |deny_unsafe, _| { - let mut io = io.clone(); - io.extend_with(substrate_frame_rpc_system::SystemApi::to_delegate( - substrate_frame_rpc_system::FullSystem::new( - client.clone(), - pool.clone(), - deny_unsafe, - ), - )); - - io.extend_with(pallet_transaction_payment_rpc::TransactionPaymentApi::to_delegate( - pallet_transaction_payment_rpc::TransactionPayment::new(client.clone()), - )); - - io.extend_with(GrandpaApi::to_delegate(GrandpaRpcHandler::new( - shared_authority_set.clone(), - shared_voter_state.clone(), - justification_stream.clone(), - subscription_executor.clone(), - finality_provider.clone(), - ))); - - // Implement custom RPC extensions - io.extend_with(CustomApi::to_delegate(CustomRpc { - client: client.clone(), - _phantom: PhantomData::default(), - })); - - Ok(io) + + Box::new(move |deny_unsafe, subscription_executor| { + let build = || { + let mut module = RpcModule::new(()); + module.merge( + multisig_p2p_transport::P2PValidatorNetworkNodeRpcApiServer::into_rpc( + rpc_request_handler.clone(), + ), + )?; + + module.merge(substrate_frame_rpc_system::SystemApiServer::into_rpc( + substrate_frame_rpc_system::System::new( + client.clone(), + pool.clone(), + deny_unsafe, + ), + ))?; + + module.merge( + pallet_transaction_payment_rpc::TransactionPaymentApiServer::into_rpc( + pallet_transaction_payment_rpc::TransactionPayment::new(client.clone()), + ), + )?; + + module.merge(GrandpaApiServer::into_rpc(Grandpa::new( + subscription_executor, + shared_authority_set.clone(), + shared_voter_state.clone(), + justification_stream.clone(), + finality_provider.clone(), + )))?; + + // Implement custom RPC extensions + module.merge(CustomApiServer::into_rpc(CustomRpc { + client: client.clone(), + _phantom: PhantomData::default(), + }))?; + + Ok(module) + }; + build().map_err(sc_service::Error::Application) }) }; @@ -314,7 +312,7 @@ pub fn new_full(mut config: Configuration) -> Result keystore: keystore_container.sync_keystore(), task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), - rpc_extensions_builder, + rpc_builder, backend, system_rpc_tx, config, diff --git a/state-chain/pallets/cf-auction/Cargo.toml b/state-chain/pallets/cf-auction/Cargo.toml index 8a8de2729d..115cee50c6 100644 --- a/state-chain/pallets/cf-auction/Cargo.toml +++ b/state-chain/pallets/cf-auction/Cargo.toml @@ -17,7 +17,7 @@ targets = ['x86_64-unknown-linux-gnu'] cf-traits = { path = '../../traits', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } [dependencies.codec] default-features = false @@ -28,33 +28,33 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] assert_matches = { version = '1.5.0' } @@ -62,11 +62,11 @@ cf-test-utilities = { path = '../../test-utilities' } [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] diff --git a/state-chain/pallets/cf-auction/src/lib.rs b/state-chain/pallets/cf-auction/src/lib.rs index 066212a1a2..5cc6cadce3 100644 --- a/state-chain/pallets/cf-auction/src/lib.rs +++ b/state-chain/pallets/cf-auction/src/lib.rs @@ -90,7 +90,7 @@ pub mod pallet { parameters: SetSizeParameters, ) -> DispatchResultWithPostInfo { T::EnsureGovernance::ensure_origin(origin)?; - let _ok = Self::try_update_auction_parameters(parameters)?; + Self::try_update_auction_parameters(parameters)?; Self::deposit_event(Event::AuctionParametersChanged(parameters)); Ok(().into()) } diff --git a/state-chain/pallets/cf-broadcast/Cargo.toml b/state-chain/pallets/cf-broadcast/Cargo.toml index 76a23b5520..1eba0a81b8 100644 --- a/state-chain/pallets/cf-broadcast/Cargo.toml +++ b/state-chain/pallets/cf-broadcast/Cargo.toml @@ -18,7 +18,7 @@ cf-chains = { path = '../../chains', default-features = false } cf-traits = { path = '../../traits', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -30,44 +30,44 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies.sp-io] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-chain-tracking/Cargo.toml b/state-chain/pallets/cf-chain-tracking/Cargo.toml index 5d181c5df9..f0730bef77 100644 --- a/state-chain/pallets/cf-chain-tracking/Cargo.toml +++ b/state-chain/pallets/cf-chain-tracking/Cargo.toml @@ -18,7 +18,7 @@ cf-traits = { path = '../../traits', default-features = false } cf-chains = { path = '../../chains', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -30,43 +30,43 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-io] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false optional = true git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] diff --git a/state-chain/pallets/cf-emissions/Cargo.toml b/state-chain/pallets/cf-emissions/Cargo.toml index b380530725..33613e108e 100644 --- a/state-chain/pallets/cf-emissions/Cargo.toml +++ b/state-chain/pallets/cf-emissions/Cargo.toml @@ -18,7 +18,7 @@ cf-traits = { path = '../../traits', default-features = false } cf-chains = {path = '../../chains', default-features = false} cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -30,49 +30,49 @@ version = '3.0.0' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-arithmetic] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] pallet-cf-flip = { path = '../cf-flip' } [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-environment/Cargo.toml b/state-chain/pallets/cf-environment/Cargo.toml index 09b8cd59e6..1afec67629 100644 --- a/state-chain/pallets/cf-environment/Cargo.toml +++ b/state-chain/pallets/cf-environment/Cargo.toml @@ -27,42 +27,42 @@ version = '3.0.0' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-flip/Cargo.toml b/state-chain/pallets/cf-flip/Cargo.toml index d6dc65f3be..a672ef4af7 100644 --- a/state-chain/pallets/cf-flip/Cargo.toml +++ b/state-chain/pallets/cf-flip/Cargo.toml @@ -27,47 +27,47 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-transaction-payment] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] quickcheck = '1' diff --git a/state-chain/pallets/cf-flip/src/lib.rs b/state-chain/pallets/cf-flip/src/lib.rs index 376672b4bb..98b5695f12 100644 --- a/state-chain/pallets/cf-flip/src/lib.rs +++ b/state-chain/pallets/cf-flip/src/lib.rs @@ -29,9 +29,7 @@ use frame_support::{ use codec::{Decode, Encode, MaxEncodedLen}; use sp_runtime::{ - traits::{ - AtLeast32BitUnsigned, MaybeSerializeDeserialize, Saturating, UniqueSaturatedInto, Zero, - }, + traits::{AtLeast32BitUnsigned, MaybeSerializeDeserialize, Saturating, UniqueSaturatedInto}, DispatchError, RuntimeDebug, }; use sp_std::{fmt::Debug, marker::PhantomData, prelude::*}; @@ -210,6 +208,7 @@ pub mod pallet { #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { + use sp_runtime::traits::Zero; Self { total_issuance: Zero::zero() } } } diff --git a/state-chain/pallets/cf-governance/Cargo.toml b/state-chain/pallets/cf-governance/Cargo.toml index 4653a77533..ec50c84179 100644 --- a/state-chain/pallets/cf-governance/Cargo.toml +++ b/state-chain/pallets/cf-governance/Cargo.toml @@ -25,43 +25,43 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-version] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] cf-test-utilities = { path = '../../test-utilities'} @@ -69,7 +69,7 @@ cf-test-utilities = { path = '../../test-utilities'} # Dev dependencies [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-governance/src/lib.rs b/state-chain/pallets/cf-governance/src/lib.rs index f20e7346ab..3646e86897 100644 --- a/state-chain/pallets/cf-governance/src/lib.rs +++ b/state-chain/pallets/cf-governance/src/lib.rs @@ -17,14 +17,6 @@ mod benchmarking; pub mod weights; pub use weights::WeightInfo; -mod old_storage { - frame_support::generate_storage_alias!(Governance, ProposalCount => Value); - - pub fn take_old_id() -> Option { - ProposalCount::take() - } -} - /// Hash over (call, nonce, runtime_version) pub type GovCallHash = [u8; 32]; @@ -155,13 +147,6 @@ pub mod pallet { let execution_weight = Self::execute_proposals(); active_proposal_weight + execution_weight } - - fn on_runtime_upgrade() -> frame_support::weights::Weight { - if let Some(old) = crate::old_storage::take_old_id() { - ProposalIdCounter::::put(old); - } - 0 - } } #[pallet::event] diff --git a/state-chain/pallets/cf-reputation/Cargo.toml b/state-chain/pallets/cf-reputation/Cargo.toml index 9caf921785..4f872a3795 100644 --- a/state-chain/pallets/cf-reputation/Cargo.toml +++ b/state-chain/pallets/cf-reputation/Cargo.toml @@ -15,7 +15,7 @@ targets = ['x86_64-unknown-linux-gnu'] cf-traits = { path = '../../traits', default-features = false } cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -27,38 +27,38 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-staking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -66,15 +66,15 @@ serde = { version = '1.0.126', features = ['derive'] } [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.pallet-grandpa] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] diff --git a/state-chain/pallets/cf-reputation/src/tests.rs b/state-chain/pallets/cf-reputation/src/tests.rs index a98b769557..d6f994b6da 100644 --- a/state-chain/pallets/cf-reputation/src/tests.rs +++ b/state-chain/pallets/cf-reputation/src/tests.rs @@ -351,7 +351,7 @@ fn non_validators_should_not_appear_in_network_state() { let current_epoch = MockEpochInfo::epoch_index(); println!("The current epoch is: {}", current_epoch); assert!( - !MockEpochInfo::authority_index(current_epoch, &BOB).is_some(), + MockEpochInfo::authority_index(current_epoch, &BOB).is_none(), "Bob should not be an authority" ); diff --git a/state-chain/pallets/cf-staking/Cargo.toml b/state-chain/pallets/cf-staking/Cargo.toml index fcb42be3eb..523fe1ee84 100644 --- a/state-chain/pallets/cf-staking/Cargo.toml +++ b/state-chain/pallets/cf-staking/Cargo.toml @@ -19,7 +19,7 @@ cf-chains = {path = '../../chains', default-features = false} cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', default-features = false } # Non-substrate external deps -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -31,38 +31,38 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -71,7 +71,7 @@ cf-test-utilities = { path = '../../test-utilities' } [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-staking/src/tests.rs b/state-chain/pallets/cf-staking/src/tests.rs index 671b03fd16..7d76870383 100644 --- a/state-chain/pallets/cf-staking/src/tests.rs +++ b/state-chain/pallets/cf-staking/src/tests.rs @@ -591,7 +591,7 @@ fn test_check_withdrawal_address() { ); let stake_attempts = FailedStakeAttempts::::get(ALICE); assert_eq!(stake_attempts.len(), 1); - let stake_attempt = stake_attempts.get(0); + let stake_attempt = stake_attempts.first(); assert_eq!(stake_attempt.unwrap().0, DIFFERENT_ETH_ADDR); assert_eq!(stake_attempt.unwrap().1, STAKE); for e in System::events().into_iter().map(|e| e.event) { diff --git a/state-chain/pallets/cf-threshold-signature/Cargo.toml b/state-chain/pallets/cf-threshold-signature/Cargo.toml index a3c78925b4..ba6fd16b02 100644 --- a/state-chain/pallets/cf-threshold-signature/Cargo.toml +++ b/state-chain/pallets/cf-threshold-signature/Cargo.toml @@ -16,7 +16,7 @@ targets = ['x86_64-unknown-linux-gnu'] cf-traits = { path = '../../traits', default-features = false } cf-chains = { path = '../../chains', default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Required for bechmarking pallet-cf-validator = { path = '../cf-validator', optional = true, default-features = false } @@ -32,33 +32,33 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -66,11 +66,11 @@ hex-literal = { version = '0.3' } [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-tokenholder-governance/Cargo.toml b/state-chain/pallets/cf-tokenholder-governance/Cargo.toml index 0190a8eb57..f2703d0e1b 100644 --- a/state-chain/pallets/cf-tokenholder-governance/Cargo.toml +++ b/state-chain/pallets/cf-tokenholder-governance/Cargo.toml @@ -26,38 +26,38 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies] cf-test-utilities = { path = '../../test-utilities'} @@ -66,7 +66,7 @@ pallet-cf-flip = { path = '../cf-flip' } # Dev dependencies [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-validator/Cargo.toml b/state-chain/pallets/cf-validator/Cargo.toml index e8d6df2d88..5f7a17e998 100644 --- a/state-chain/pallets/cf-validator/Cargo.toml +++ b/state-chain/pallets/cf-validator/Cargo.toml @@ -22,7 +22,7 @@ pallet-cf-staking = { path = '../cf-staking', optional = true, default-features pallet-cf-reputation = { path = '../cf-reputation', optional = true, default-features = false } pallet-cf-vaults = { path = '../cf-vaults', optional = true, default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -34,49 +34,49 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-application-crypto] default-features = false optional = true git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-session] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -85,11 +85,11 @@ simple_logger = '2.1.0' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-validator/src/benchmarking.rs b/state-chain/pallets/cf-validator/src/benchmarking.rs index 85ac80bd90..71222caad4 100644 --- a/state-chain/pallets/cf-validator/src/benchmarking.rs +++ b/state-chain/pallets/cf-validator/src/benchmarking.rs @@ -12,7 +12,7 @@ use sp_runtime::{Digest, DigestItem}; use cf_traits::AuctionOutcome; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; -use frame_support::{assert_ok, dispatch::UnfilteredDispatchable}; +use frame_support::{assert_ok, dispatch::UnfilteredDispatchable, storage_alias}; use frame_system::{pallet_prelude::OriginFor, Pallet as SystemPallet, RawOrigin}; mod p2p_crypto { @@ -22,9 +22,8 @@ mod p2p_crypto { } // For accessing missed aura slot tracking. -frame_support::generate_storage_alias!( - AuraSlotExtraction, LastSeenSlot => Value -); +#[storage_alias] +type LastSeenSlot = StorageValue; pub trait RuntimeConfig: Config + StakingConfig + SessionConfig + ReputationConfig {} diff --git a/state-chain/pallets/cf-vaults/Cargo.toml b/state-chain/pallets/cf-vaults/Cargo.toml index 7098def502..d48dd000e6 100644 --- a/state-chain/pallets/cf-vaults/Cargo.toml +++ b/state-chain/pallets/cf-vaults/Cargo.toml @@ -19,7 +19,7 @@ cf-runtime-upgrade-utilities = { path = '../../runtime-upgrade-utilities', defau cf-traits = {path = '../../traits', default-features = false} utilities = {path = '../../../utilities', default-features = false} -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } # Parity deps [dependencies.codec] @@ -31,33 +31,33 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -66,11 +66,11 @@ cf-test-utilities = { path = '../../test-utilities' } [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-vaults/src/lib.rs b/state-chain/pallets/cf-vaults/src/lib.rs index 07f173bba3..69cf7dd85d 100644 --- a/state-chain/pallets/cf-vaults/src/lib.rs +++ b/state-chain/pallets/cf-vaults/src/lib.rs @@ -138,7 +138,10 @@ impl, I: 'static> KeygenResponseStatus { // If and only if *all* candidates agree on the same key, return success. if let Some((key, votes)) = self.success_votes.iter().next() { if *votes == self.candidate_count { - SuccessVoters::::remove_all(None); + // This *should* be safe since it's bounded by the number of candidates. + // We may want to revise. + // See https://github.com/paritytech/substrate/pull/11490 + let _ignored = SuccessVoters::::clear(u32::MAX, None); return Ok(*key) } } @@ -159,7 +162,7 @@ impl, I: 'static> KeygenResponseStatus { { FailureVoters::::kill(); } else { - SuccessVoters::::remove_all(None); + let _empty = SuccessVoters::::clear(u32::MAX, None); FailureVoters::::kill(); IncompatibleVoters::::kill(); log::warn!("Unable to determine a consensus outcome for keygen."); diff --git a/state-chain/pallets/cf-witnesser/Cargo.toml b/state-chain/pallets/cf-witnesser/Cargo.toml index 19885a0972..10e47be8f0 100644 --- a/state-chain/pallets/cf-witnesser/Cargo.toml +++ b/state-chain/pallets/cf-witnesser/Cargo.toml @@ -33,33 +33,33 @@ version = '3.0.0' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Dev dependencies [dev-dependencies] @@ -67,11 +67,11 @@ cf-test-utilities = { path = '../../test-utilities' } [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/pallets/cf-witnesser/src/lib.rs b/state-chain/pallets/cf-witnesser/src/lib.rs index a3175c47b1..8601dee87e 100644 --- a/state-chain/pallets/cf-witnesser/src/lib.rs +++ b/state-chain/pallets/cf-witnesser/src/lib.rs @@ -356,9 +356,9 @@ impl cf_traits::EpochTransitionHandler for Pallet { /// Purge the pallet storage of stale entries. This is prevent the storage from growing /// indefinitely. fn on_expired_epoch(expired: EpochIndex) { - Votes::::remove_prefix(expired, None); - ExtraCallData::::remove_prefix(expired, None); - CallHashExecuted::::remove_prefix(expired, None); + let _empty = Votes::::clear_prefix(expired, u32::MAX, None); + let _empty = ExtraCallData::::clear_prefix(expired, u32::MAX, None); + let _empty = CallHashExecuted::::clear_prefix(expired, u32::MAX, None); } } diff --git a/state-chain/runtime-upgrade-utilities/Cargo.toml b/state-chain/runtime-upgrade-utilities/Cargo.toml index 230d6259af..6dfbfd8d29 100644 --- a/state-chain/runtime-upgrade-utilities/Cargo.toml +++ b/state-chain/runtime-upgrade-utilities/Cargo.toml @@ -6,21 +6,21 @@ authors = ['Chainflip '] description = 'Chainflip utilities for runtime upgrades.' [dependencies] -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/runtime-upgrade-utilities/src/lib.rs b/state-chain/runtime-upgrade-utilities/src/lib.rs index 33c56d7257..e890107d45 100644 --- a/state-chain/runtime-upgrade-utilities/src/lib.rs +++ b/state-chain/runtime-upgrade-utilities/src/lib.rs @@ -26,15 +26,14 @@ pub struct VersionedMigration< #[cfg(feature = "try-runtime")] mod try_runtime_helpers { - use frame_support::{traits::PalletInfoAccess, Twox64Concat}; + use frame_support::{storage_alias, traits::PalletInfoAccess, Twox64Concat}; use sp_std::{ cmp::{max, min}, vec::Vec, }; - frame_support::generate_storage_alias!( - RuntimeUpgradeUtils, MigrationBounds => Map<(Twox64Concat, Vec), (u16, u16)> - ); + #[storage_alias] + type MigrationBounds = StorageMap, (u16, u16)>; pub fn update_migration_bounds() { MigrationBounds::mutate(T::name().as_bytes(), |bounds| { diff --git a/state-chain/runtime-utilities/Cargo.toml b/state-chain/runtime-utilities/Cargo.toml index 3d2e397f85..79a87b5b1d 100644 --- a/state-chain/runtime-utilities/Cargo.toml +++ b/state-chain/runtime-utilities/Cargo.toml @@ -6,7 +6,7 @@ authors = ['Chainflip '] description = 'Utilities for interacting with substrate runtimes.' [dependencies] -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } cf-runtime-macros = { path = './macros', optional = true, default-features = false } [dependencies.codec] @@ -18,23 +18,23 @@ version = '3.0.0' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' # Not used in this crate but required in order to import sp-io without conflicts. [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-io] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/runtime-utilities/src/lib.rs b/state-chain/runtime-utilities/src/lib.rs index 757ce00426..5a879b0eab 100644 --- a/state-chain/runtime-utilities/src/lib.rs +++ b/state-chain/runtime-utilities/src/lib.rs @@ -64,10 +64,10 @@ where mod test { use super::*; use codec::{Decode, Encode}; + use frame_support::storage_alias; - frame_support::generate_storage_alias!( - Test, Store => Value - ); + #[storage_alias] + type Store = StorageValue; #[derive(Clone, Debug, PartialEq, Eq, Encode, Decode)] enum MyEnumType { @@ -91,11 +91,10 @@ mod test { mod test_derive { use super::*; use codec::{Decode, Encode}; - use frame_support::Twox64Concat; + use frame_support::{storage_alias, Twox64Concat}; - frame_support::generate_storage_alias!( - Test, ValueStore => Value - ); + #[storage_alias] + type ValueStore = StorageValue; trait Config { type Inner: FullCodec; @@ -107,9 +106,8 @@ mod test_derive { type Inner = u32; } - frame_support::generate_storage_alias!( - Test, MapStore => Map<(Twox64Concat, u32), MyGenericEnumType> - ); + #[storage_alias] + type MapStore = StorageMap>; #[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, EnumVariant)] enum MyEnumType { diff --git a/state-chain/runtime/Cargo.toml b/state-chain/runtime/Cargo.toml index f48ea46b75..07169e6cd9 100644 --- a/state-chain/runtime/Cargo.toml +++ b/state-chain/runtime/Cargo.toml @@ -13,14 +13,14 @@ targets = ['x86_64-unknown-linux-gnu'] [build-dependencies.substrate-wasm-builder] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies] # Required to get wasm to compile. # See https://docs.rs/getrandom/#webassembly-support getrandom = { version = '0.2', features = ['js'], default-features = false } -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } nanorand = { version = '0.6', default-features = false, features = ['wyrand']} serde = { version = '1.0.126', optional = true, features = ['derive'] } @@ -53,12 +53,12 @@ scale-info = { version = '2.0.1', default-features = false, features = ['derive' [dependencies.pallet-authorship] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-session] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' features = ['historical'] # Substrate dependencies @@ -66,28 +66,28 @@ features = ['historical'] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-executive] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-system-benchmarking] default-features = false git = 'https://github.com/chainflip-io/substrate.git' optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.hex-literal] optional = true @@ -96,87 +96,87 @@ version = '0.3.4' [dependencies.pallet-aura] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-grandpa] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-randomness-collective-flip] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-timestamp] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-transaction-payment] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-api] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-block-builder] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-consensus-aura] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' version = '0.10.0-dev' [dependencies.sp-core] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-inherents] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-offchain] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-session] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-transaction-pool] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-version] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-try-runtime] optional = true -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' default-features = false git = 'https://github.com/chainflip-io/substrate.git' @@ -184,12 +184,12 @@ git = 'https://github.com/chainflip-io/substrate.git' [dependencies.frame-system-rpc-runtime-api] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.pallet-transaction-payment-rpc-runtime-api] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/runtime/src/chainflip/missed_authorship_slots.rs b/state-chain/runtime/src/chainflip/missed_authorship_slots.rs index eadf79611f..a5513a9011 100644 --- a/state-chain/runtime/src/chainflip/missed_authorship_slots.rs +++ b/state-chain/runtime/src/chainflip/missed_authorship_slots.rs @@ -1,13 +1,13 @@ use cf_traits::MissedAuthorshipSlots; use codec::Decode; +use frame_support::storage_alias; use sp_consensus_aura::{Slot, AURA_ENGINE_ID}; use sp_runtime::DigestItem; use crate::System; -frame_support::generate_storage_alias!( - AuraSlotExtraction, LastSeenSlot => Value -); +#[storage_alias] +type LastSeenSlot = StorageValue; fn extract_slot_from_digest_item(item: &DigestItem) -> Option { item.as_pre_runtime().and_then(|(id, mut data)| { diff --git a/state-chain/runtime/src/lib.rs b/state-chain/runtime/src/lib.rs index 75a4f496d6..b3c3297c66 100644 --- a/state-chain/runtime/src/lib.rs +++ b/state-chain/runtime/src/lib.rs @@ -1,8 +1,6 @@ #![cfg_attr(not(feature = "std"), no_std)] // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit = "256"] -#![feature(iter_zip)] -#![feature(int_abs_diff)] pub mod chainflip; pub mod constants; pub mod runtime_apis; diff --git a/state-chain/test-utilities/Cargo.toml b/state-chain/test-utilities/Cargo.toml index ed40761d56..923fbac0ab 100644 --- a/state-chain/test-utilities/Cargo.toml +++ b/state-chain/test-utilities/Cargo.toml @@ -11,4 +11,4 @@ version = '3.0.0' [dependencies.frame-system] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' diff --git a/state-chain/traits/Cargo.toml b/state-chain/traits/Cargo.toml index d74e06f9ad..98bb81adae 100644 --- a/state-chain/traits/Cargo.toml +++ b/state-chain/traits/Cargo.toml @@ -6,7 +6,7 @@ authors = ['Chainflip '] description = 'Common traits used in the Chainflip runtime' [dependencies] -log = { version = '0.4.14', default-features = false } +log = { version = '0.4.16', default-features = false } serde = { optional = true, version = '1.0.126', features = ['derive'] } # Internal @@ -22,41 +22,41 @@ version = '3.0.0' [dependencies.scale-info] default-features = false features = ['derive'] -version = '2.0.1' +version = '2.1.1' [dependencies.frame-system] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-support] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-runtime] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.sp-std] default-features = false git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dependencies.frame-benchmarking] default-features = false optional = true git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-core] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [dev-dependencies.sp-io] git = 'https://github.com/chainflip-io/substrate.git' -tag = 'chainflip-monthly-2022-05' +tag = 'chainflip-monthly-2022-06' [features] default = ['std'] diff --git a/state-chain/traits/src/lib.rs b/state-chain/traits/src/lib.rs index afd9e59af8..8a3716c3cd 100644 --- a/state-chain/traits/src/lib.rs +++ b/state-chain/traits/src/lib.rs @@ -407,14 +407,14 @@ impl> ChainflipAccou fn set_current_authority(account_id: &Self::AccountId) { log::debug!("Setting current authority {:?}", account_id); frame_system::Pallet::::mutate(account_id, |account_data| { - (*account_data).state = ChainflipAccountState::CurrentAuthority; + account_data.state = ChainflipAccountState::CurrentAuthority; }) .unwrap_or_else(|e| log::error!("Mutating account state failed {:?}", e)); } fn set_historical_authority(account_id: &Self::AccountId) { frame_system::Pallet::::mutate(account_id, |account_data| { - (*account_data).state = ChainflipAccountState::HistoricalAuthority; + account_data.state = ChainflipAccountState::HistoricalAuthority; }) .unwrap_or_else(|e| log::error!("Mutating account state failed {:?}", e)); } @@ -422,7 +422,7 @@ impl> ChainflipAccou fn from_historical_to_backup(account_id: &Self::AccountId) { frame_system::Pallet::::mutate(account_id, |account_data| match account_data.state { ChainflipAccountState::HistoricalAuthority => { - (*account_data).state = ChainflipAccountState::Backup; + account_data.state = ChainflipAccountState::Backup; }, _ => { const ERROR_MESSAGE: &str = "Attempted to transition to backup from historical, on a non-historical authority"; diff --git a/state-chain/traits/src/mocks/chainflip_account.rs b/state-chain/traits/src/mocks/chainflip_account.rs index b77e44a545..9dcf5d217e 100644 --- a/state-chain/traits/src/mocks/chainflip_account.rs +++ b/state-chain/traits/src/mocks/chainflip_account.rs @@ -37,7 +37,7 @@ impl ChainflipAccount for MockChainflipAccount { ); }, Some(item) => { - (*item).state = ChainflipAccountState::CurrentAuthority; + item.state = ChainflipAccountState::CurrentAuthority; }, } }); diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 5d0ff0ab22..3ebcf193a3 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -11,8 +11,6 @@ version = '0.1.0' [dependencies] hex = {version = "0.4.3", default-features = false} anyhow = {version = '1.0', optional = true} -jsonrpc-core = {version = "18.0.0", optional = true} -jsonrpc-core-client = {version = '18.0.0', optional = true} predicates = {version = "2.1.1", optional = true} mockall = {version = "0.11.0", optional = true} futures = {version = "0.3.14", optional = true} @@ -22,8 +20,6 @@ tokio = {version = "1.13.1", features = ["full"], optional = true} default = ['std'] std = [ 'anyhow', - 'jsonrpc-core', - 'jsonrpc-core-client', 'predicates', 'mockall', 'futures', diff --git a/utilities/src/with_std.rs b/utilities/src/with_std.rs index c30e39b1de..656dd93ae3 100644 --- a/utilities/src/with_std.rs +++ b/utilities/src/with_std.rs @@ -1,5 +1,4 @@ -use anyhow::anyhow; -use core::{fmt::Display, time::Duration}; +use core::time::Duration; use futures::{stream, Stream}; #[macro_export] @@ -139,33 +138,6 @@ mod tests_periodic_tick_stream { } } -// Needed due to the jsonrpc maintainer's not definitely unquestionable decision to impl their error types without the Sync trait -pub fn rpc_error_into_anyhow_error(error: jsonrpc_core_client::RpcError) -> anyhow::Error { - anyhow!(error.to_string()) -} - -pub trait JsonResultExt { - type T; - - fn map_to_json_error(self) -> jsonrpc_core::Result; -} - -pub fn new_json_error(error: E) -> jsonrpc_core::Error { - jsonrpc_core::Error { - code: jsonrpc_core::ErrorCode::ServerError(0), - message: error.to_string(), - data: None, - } -} - -impl JsonResultExt for std::result::Result { - type T = T; - - fn map_to_json_error(self) -> jsonrpc_core::Result { - self.map_err(new_json_error) - } -} - pub mod mockall_utilities { use mockall::Predicate; use predicates::reflection::PredicateReflection;