From 3a307f04e0fb6e8f2966f376efb9c29de8be329a Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 26 Jan 2022 11:12:54 +0100 Subject: [PATCH 01/20] bump sp-runtime, sp-keyring to v4.1.0-dev --- balances/Cargo.toml | 2 +- bazaar/rpc/Cargo.toml | 2 +- ceremonies/Cargo.toml | 2 +- ceremonies/assignment/Cargo.toml | 2 +- ceremonies/rpc/Cargo.toml | 2 +- communities/Cargo.toml | 2 +- communities/rpc/Cargo.toml | 2 +- personhood-oracle/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- primitives/core/Cargo.toml | 2 +- scheduler/Cargo.toml | 2 +- sybil-gate-template/Cargo.toml | 2 +- test-utils/Cargo.toml | 4 ++-- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/balances/Cargo.toml b/balances/Cargo.toml index 8d42225b..c8f87cc8 100644 --- a/balances/Cargo.toml +++ b/balances/Cargo.toml @@ -17,7 +17,7 @@ encointer-communities = { package = "pallet-encointer-communities", path = "../c frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] approx = "0.5.0" diff --git a/bazaar/rpc/Cargo.toml b/bazaar/rpc/Cargo.toml index b4114410..e932ded5 100644 --- a/bazaar/rpc/Cargo.toml +++ b/bazaar/rpc/Cargo.toml @@ -20,4 +20,4 @@ sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } diff --git a/ceremonies/Cargo.toml b/ceremonies/Cargo.toml index 94b7d652..a230281b 100644 --- a/ceremonies/Cargo.toml +++ b/ceremonies/Cargo.toml @@ -20,7 +20,7 @@ encointer-scheduler = { package = "pallet-encointer-scheduler", path = "../sched frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] diff --git a/ceremonies/assignment/Cargo.toml b/ceremonies/assignment/Cargo.toml index ad7e7784..0e245057 100644 --- a/ceremonies/assignment/Cargo.toml +++ b/ceremonies/assignment/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" encointer-primitives = { path = "../../primitives", default-features = false } # substrate deps -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] diff --git a/ceremonies/rpc/Cargo.toml b/ceremonies/rpc/Cargo.toml index 40b5c3c5..d732d829 100644 --- a/ceremonies/rpc/Cargo.toml +++ b/ceremonies/rpc/Cargo.toml @@ -20,4 +20,4 @@ sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } diff --git a/communities/Cargo.toml b/communities/Cargo.toml index cdc3c3fa..a0a46bff 100644 --- a/communities/Cargo.toml +++ b/communities/Cargo.toml @@ -20,7 +20,7 @@ frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/su frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-io = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] approx = "0.5.0" diff --git a/communities/rpc/Cargo.toml b/communities/rpc/Cargo.toml index f7a175c5..92654c82 100644 --- a/communities/rpc/Cargo.toml +++ b/communities/rpc/Cargo.toml @@ -20,7 +20,7 @@ sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } [dev-dependencies] sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } \ No newline at end of file diff --git a/personhood-oracle/Cargo.toml b/personhood-oracle/Cargo.toml index aa475093..eaf5a4df 100644 --- a/personhood-oracle/Cargo.toml +++ b/personhood-oracle/Cargo.toml @@ -21,7 +21,7 @@ frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/sub frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } # polkadot deps polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 4157ed40..3d46c67d 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -20,7 +20,7 @@ ep-core = { path = "core", default-features = false } # substrate deps sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-io = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } # polkadot deps diff --git a/primitives/core/Cargo.toml b/primitives/core/Cargo.toml index c8744bcf..f529b4b2 100644 --- a/primitives/core/Cargo.toml +++ b/primitives/core/Cargo.toml @@ -13,7 +13,7 @@ serde = { version = "1.0.101", optional = true, default-features = false, featur sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] serde_json = "1.0.72" diff --git a/scheduler/Cargo.toml b/scheduler/Cargo.toml index aeaa9bd7..72c2749a 100644 --- a/scheduler/Cargo.toml +++ b/scheduler/Cargo.toml @@ -17,7 +17,7 @@ frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/su frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } [dev-dependencies] sp-io = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } diff --git a/sybil-gate-template/Cargo.toml b/sybil-gate-template/Cargo.toml index 3f26f161..c5d34a38 100644 --- a/sybil-gate-template/Cargo.toml +++ b/sybil-gate-template/Cargo.toml @@ -16,7 +16,7 @@ encointer-primitives = { path = "../primitives", default-features = false, featu frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", default-features = false, branch = "master" } # polkadot deps diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index e259d0ae..f0218b31 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -24,9 +24,9 @@ pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech sp-core = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-io = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-keyring = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-keyring = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } sp-std = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } -sp-runtime = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } +sp-runtime = { version = "4.1.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "master" } # polkadot deps xcm = { git = "https://github.com/paritytech/polkadot", branch = "master" } From 7e9e6a8f4d93b7e6931c945c3b49c9503eca6617 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 26 Jan 2022 11:13:56 +0100 Subject: [PATCH 02/20] bump rust-toolchain: 2022-01-26 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4773f866..5eff294d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2021-12-10" +channel = "nightly-2022-01-26" targets = ["wasm32-unknown-unknown"] profile = "default" # include rustfmt, clippy \ No newline at end of file From ecea8bb46facaddd7dbb5fbb2cc5df6509cf479d Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 26 Jan 2022 11:14:12 +0100 Subject: [PATCH 03/20] cargo update --- Cargo.lock | 611 ++++++++++++++++++++++++++++------------------------- 1 file changed, 325 insertions(+), 286 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47495e5b..12a4a770 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -68,7 +68,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", "once_cell", "version_check", ] @@ -93,15 +93,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.51" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "approx" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" dependencies = [ "num-traits", ] @@ -194,7 +194,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.2", + "socket2 0.4.3", "waker-fn", "winapi 0.3.9", ] @@ -256,7 +256,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "pin-utils", "slab", "wasm-bindgen-futures", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.0.3" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" +checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8" [[package]] name = "async-trait" @@ -303,7 +303,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", ] [[package]] @@ -316,7 +316,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", ] [[package]] @@ -386,9 +386,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bimap" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50ae17cabbc8a38a1e3e4c1a6a664e9a09672dc14d0896fa8d865d3a5a446b07" +checksum = "bc0455254eb5c6964c4545d8bac815e1a1be4f3afe0ae695ea539c12d728d44b" [[package]] name = "bitflags" @@ -485,7 +485,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.4", + "generic-array 0.14.5", +] + +[[package]] +name = "block-buffer" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +dependencies = [ + "generic-array 0.14.5", ] [[package]] @@ -534,9 +543,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.8.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byte-slice-cast" @@ -654,7 +663,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", ] [[package]] @@ -724,18 +733,18 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" +checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" dependencies = [ "cfg-if 1.0.0", "lazy_static", @@ -747,13 +756,22 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-common" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +dependencies = [ + "generic-array 0.14.5", +] + [[package]] name = "crypto-mac" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", "subtle", ] @@ -763,7 +781,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", "subtle", ] @@ -894,7 +912,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", +] + +[[package]] +name = "digest" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +dependencies = [ + "block-buffer 0.10.0", + "crypto-common", + "generic-array 0.14.5", ] [[package]] @@ -965,7 +994,7 @@ dependencies = [ "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.8", + "sha2 0.9.9", "zeroize", ] @@ -1069,9 +1098,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" [[package]] name = "fake-simd" @@ -1081,9 +1110,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" dependencies = [ "instant", ] @@ -1118,9 +1147,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "flate2" @@ -1144,7 +1173,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", ] @@ -1162,7 +1191,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support", "frame-system", @@ -1195,7 +1224,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "bitflags", "frame-metadata", @@ -1224,7 +1253,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1236,7 +1265,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.0", @@ -1248,7 +1277,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "proc-macro2", "quote", @@ -1258,7 +1287,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -1281,7 +1310,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support", "frame-system", @@ -1292,7 +1321,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support", "log", @@ -1394,7 +1423,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "waker-fn", ] @@ -1452,7 +1481,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "pin-utils", "slab", ] @@ -1463,16 +1492,16 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.15.0", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ - "typenum 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.15.0", "version_check", ] @@ -1501,9 +1530,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1639,7 +1668,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "hmac 0.8.1", ] @@ -1656,13 +1685,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes 1.1.0", "fnv", - "itoa 0.4.8", + "itoa 1.0.1", ] [[package]] @@ -1673,7 +1702,7 @@ checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ "bytes 1.1.0", "http", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", ] [[package]] @@ -1703,8 +1732,8 @@ dependencies = [ "httparse", "httpdate", "itoa 0.4.8", - "pin-project-lite 0.2.7", - "socket2 0.4.2", + "pin-project-lite 0.2.8", + "socket2 0.4.3", "tokio", "tower-service", "tracing", @@ -1810,9 +1839,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", "hashbrown", @@ -1901,9 +1930,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" dependencies = [ "wasm-bindgen", ] @@ -2089,9 +2118,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.112" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" +checksum = "b0005d08a8f7b65fb8073cb697aa0b12b631ed251ce73d862ce50eeb52ce3b50" [[package]] name = "libm" @@ -2135,7 +2164,7 @@ dependencies = [ "libp2p-yamux", "multiaddr", "parking_lot", - "pin-project 1.0.8", + "pin-project 1.0.10", "smallvec", "wasm-timer", ] @@ -2160,13 +2189,13 @@ dependencies = [ "multihash 0.14.0", "multistream-select", "parking_lot", - "pin-project 1.0.8", + "pin-project 1.0.10", "prost", "prost-build", "rand 0.8.4", "ring", "rw-stream-sink", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "thiserror", "unsigned-varint 0.7.1", @@ -2237,7 +2266,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "unsigned-varint 0.7.1", "wasm-timer", @@ -2278,7 +2307,7 @@ dependencies = [ "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.8", + "sha2 0.9.9", "smallvec", "uint", "unsigned-varint 0.7.1", @@ -2303,7 +2332,7 @@ dependencies = [ "log", "rand 0.8.4", "smallvec", - "socket2 0.4.2", + "socket2 0.4.3", "void", ] @@ -2354,7 +2383,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.4", - "sha2 0.9.8", + "sha2 0.9.9", "snow", "static_assertions", "x25519-dalek", @@ -2401,7 +2430,7 @@ checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ "futures 0.3.19", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "rand 0.7.3", "salsa20", "sha3", @@ -2420,7 +2449,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "prost", "prost-build", "rand 0.7.3", @@ -2445,7 +2474,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.4", - "sha2 0.9.8", + "sha2 0.9.9", "thiserror", "unsigned-varint 0.7.1", "void", @@ -2464,7 +2493,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "lru 0.7.1", + "lru 0.7.2", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -2511,7 +2540,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.2", + "socket2 0.4.3", ] [[package]] @@ -2586,8 +2615,8 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand 0.8.4", "serde", - "sha2 0.9.8", - "typenum 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.9.9", + "typenum 1.15.0", ] [[package]] @@ -2685,9 +2714,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469898e909a1774d844793b347135a0cd344ca2f69d082013ecb8061a2229a3a" +checksum = "274353858935c992b13c0ca408752e2121da852d07dec7ce5f108c77dfa14d1f" dependencies = [ "hashbrown", ] @@ -2739,18 +2768,18 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4647a11b578fead29cdbb34d4adef8dd3dc35b876c9c6d5240d83f205abfe96e" +checksum = "fe3179b85e1fd8b14447cbebadb75e45a1002f541b925f0bfec366d56a81c56d" dependencies = [ "libc", ] [[package]] name = "memory-db" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de006e09d04fc301a5f7e817b75aa49801c4479a8af753764416b085337ddcc5" +checksum = "d505169b746dacf02f7d14d8c80b34edfd8212159c63d23c977739a0d960c626" dependencies = [ "hash-db", "hashbrown", @@ -2889,9 +2918,9 @@ dependencies = [ "blake2s_simd", "blake3", "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "multihash-derive", - "sha2 0.9.8", + "sha2 0.9.9", "sha3", "unsigned-varint 0.5.1", ] @@ -2903,9 +2932,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" dependencies = [ "digest 0.9.0", - "generic-array 0.14.4", + "generic-array 0.14.5", "multihash-derive", - "sha2 0.9.8", + "sha2 0.9.9", "unsigned-varint 0.7.1", ] @@ -2938,7 +2967,7 @@ dependencies = [ "bytes 1.1.0", "futures 0.3.19", "log", - "pin-project 1.0.8", + "pin-project 1.0.10", "smallvec", "unsigned-varint 0.7.1", ] @@ -2958,7 +2987,7 @@ dependencies = [ "rand 0.8.4", "rand_distr", "simba", - "typenum 1.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum 1.15.0", ] [[package]] @@ -3148,7 +3177,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-benchmarking", "frame-support", @@ -3390,7 +3419,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-benchmarking", "frame-support", @@ -3407,7 +3436,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "frame-support", "frame-system", @@ -3608,27 +3637,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909" dependencies = [ - "pin-project-internal 0.4.28", + "pin-project-internal 0.4.29", ] [[package]] name = "pin-project" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ - "pin-project-internal 1.0.8", + "pin-project-internal 1.0.10", ] [[package]] name = "pin-project-internal" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a" dependencies = [ "proc-macro2", "quote", @@ -3637,9 +3666,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -3654,9 +3683,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -3673,7 +3702,7 @@ checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] name = "polkadot-core-primitives" version = "0.9.13" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -3686,7 +3715,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.13" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ "derive_more", "frame-support", @@ -3738,9 +3767,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "pretty_assertions" @@ -3813,9 +3842,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.34" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] @@ -3887,17 +3916,6 @@ dependencies = [ "prost", ] -[[package]] -name = "pwasm-utils" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" -dependencies = [ - "byteorder", - "log", - "parity-wasm", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -3917,9 +3935,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -3991,14 +4009,14 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", ] [[package]] name = "rand_distr" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964d548f8e7d12e102ef183a0de7e98180c9f8729f555897a857b96e48122d2f" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", "rand 0.8.4", @@ -4220,7 +4238,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ "futures 0.3.19", - "pin-project 0.4.28", + "pin-project 0.4.29", "static_assertions", ] @@ -4242,7 +4260,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "log", "sp-core", @@ -4253,7 +4271,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -4269,7 +4287,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "impl-trait-for-tuples", "memmap2", @@ -4286,7 +4304,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -4297,7 +4315,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "fnv", "futures 0.3.19", @@ -4325,7 +4343,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-trait", "futures 0.3.19", @@ -4349,7 +4367,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "lazy_static", "libsecp256k1", @@ -4376,25 +4394,24 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ - "derive_more", "environmental", "parity-scale-codec", - "pwasm-utils", "sc-allocator", "sp-core", "sp-maybe-compressed-blob", "sp-serializer", "sp-wasm-interface", "thiserror", + "wasm-instrument", "wasmi", ] [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "log", "parity-scale-codec", @@ -4410,7 +4427,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-std", "async-trait", @@ -4418,7 +4435,6 @@ dependencies = [ "bitflags", "bytes 1.1.0", "cid", - "derive_more", "either", "fnv", "fork-tree", @@ -4430,10 +4446,10 @@ dependencies = [ "linked-hash-map", "linked_hash_set", "log", - "lru 0.7.1", + "lru 0.7.2", "parity-scale-codec", "parking_lot", - "pin-project 1.0.8", + "pin-project 1.0.10", "prost", "prost-build", "rand 0.7.3", @@ -4461,7 +4477,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "libp2p", @@ -4474,7 +4490,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "hash-db", @@ -4505,7 +4521,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "jsonrpc-core", @@ -4530,7 +4546,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "jsonrpc-core", @@ -4547,14 +4563,14 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "chrono", "futures 0.3.19", "libp2p", "log", "parking_lot", - "pin-project 1.0.8", + "pin-project 1.0.10", "rand 0.7.3", "serde", "serde_json", @@ -4565,7 +4581,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "ansi_term", "atty", @@ -4596,7 +4612,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -4607,9 +4623,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ - "derive_more", "futures 0.3.19", "log", "serde", @@ -4621,11 +4636,12 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "futures-timer", "lazy_static", + "parking_lot", "prometheus", ] @@ -4745,18 +4761,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.132" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.132" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -4765,9 +4781,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.73" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" +checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085" dependencies = [ "itoa 1.0.1", "ryu", @@ -4813,9 +4829,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", @@ -4824,6 +4840,17 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sha2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.1", + "digest 0.10.1", +] + [[package]] name = "sha3" version = "0.9.1" @@ -4866,9 +4893,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +checksum = "f054c6c1a6e95179d6f23ed974060dcefb2d9388bb7256900badad682c499de4" [[package]] name = "simba" @@ -4890,9 +4917,9 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "snow" @@ -4907,7 +4934,7 @@ dependencies = [ "rand_core 0.6.3", "ring", "rustc_version 0.3.3", - "sha2 0.9.8", + "sha2 0.9.9", "subtle", "x25519-dalek", ] @@ -4925,9 +4952,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "0f82496b90c36d70af5fcd482edaa2e0bd16fade569de1330405fecbbdac736b" dependencies = [ "libc", "winapi 0.3.9", @@ -4952,7 +4979,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "hash-db", "log", @@ -4969,7 +4996,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "blake2-rfc", "proc-macro-crate 1.1.0", @@ -4980,8 +5007,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "scale-info", @@ -4993,8 +5020,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "integer-sqrt", "num-traits", @@ -5009,7 +5036,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "sp-api", @@ -5021,11 +5048,11 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "log", - "lru 0.7.1", + "lru 0.7.2", "parity-scale-codec", "parking_lot", "sp-api", @@ -5039,7 +5066,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-trait", "futures 0.3.19", @@ -5058,7 +5085,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "base58", "bitflags", @@ -5086,7 +5113,7 @@ dependencies = [ "schnorrkel", "secrecy", "serde", - "sha2 0.9.8", + "sha2 0.10.1", "sp-core-hashing", "sp-debug-derive", "sp-externalities", @@ -5106,11 +5133,11 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "blake2-rfc", "byteorder", - "sha2 0.9.8", + "sha2 0.10.1", "sp-std", "tiny-keccak", "twox-hash", @@ -5119,7 +5146,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "proc-macro2", "quote", @@ -5130,7 +5157,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "kvdb", "parking_lot", @@ -5139,7 +5166,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "proc-macro2", "quote", @@ -5149,7 +5176,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "environmental", "parity-scale-codec", @@ -5160,7 +5187,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "finality-grandpa", "log", @@ -5178,7 +5205,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -5191,8 +5218,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "futures 0.3.19", "hash-db", @@ -5215,8 +5242,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "lazy_static", "sp-core", @@ -5226,11 +5253,10 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "0.10.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-trait", - "derive_more", "futures 0.3.19", "merlin", "parity-scale-codec", @@ -5239,12 +5265,13 @@ dependencies = [ "serde", "sp-core", "sp-externalities", + "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "zstd", ] @@ -5252,7 +5279,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "sp-api", "sp-core", @@ -5261,8 +5288,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "backtrace", "lazy_static", @@ -5272,7 +5299,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "rustc-hash", "serde", @@ -5281,8 +5308,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "either", "hash256-std-hasher", @@ -5303,8 +5330,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -5321,7 +5348,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "Inflector", "proc-macro-crate 1.1.0", @@ -5333,7 +5360,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "serde", "serde_json", @@ -5342,7 +5369,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "scale-info", @@ -5356,7 +5383,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "scale-info", @@ -5366,8 +5393,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "0.10.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "hash-db", "log", @@ -5390,12 +5417,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" [[package]] name = "sp-storage" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "impl-serde", "parity-scale-codec", @@ -5408,7 +5435,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "log", "sp-core", @@ -5421,7 +5448,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-trait", "futures-timer", @@ -5437,7 +5464,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "sp-std", @@ -5448,8 +5475,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "hash-db", "memory-db", @@ -5464,13 +5491,14 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", + "sp-core-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -5480,7 +5508,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -5490,10 +5518,11 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +version = "4.1.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "impl-trait-for-tuples", + "log", "parity-scale-codec", "sp-std", "wasmi", @@ -5507,9 +5536,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "ss58-registry" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83f0afe7e571565ef9aae7b0e4fb30fcaec4ebb9aea2f00489b772782aa03a4" +checksum = "8319f44e20b42e5c11b88b1ad4130c35fe2974665a007b08b02322070177136a" dependencies = [ "Inflector", "proc-macro2", @@ -5574,7 +5603,7 @@ dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", "schnorrkel", - "sha2 0.9.8", + "sha2 0.9.9", "zeroize", ] @@ -5586,20 +5615,20 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.14.0 (git+https://github.com/encointer/typenum)", + "typenum 1.14.0", ] [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate.git?branch=master#e4f9551a4d63f2f1761082439590d9865adf4dec" dependencies = [ "async-std", - "derive_more", "futures-util", "hyper", "log", "prometheus", + "thiserror", "tokio", ] @@ -5611,9 +5640,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -5640,13 +5669,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -5711,9 +5740,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] @@ -5741,7 +5770,7 @@ dependencies = [ "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.8", + "sha2 0.9.9", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -5783,7 +5812,7 @@ dependencies = [ "memchr", "mio 0.7.14", "num_cpus", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "winapi 0.3.9", ] @@ -5794,7 +5823,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" dependencies = [ "futures-core", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "tokio", ] @@ -5808,7 +5837,7 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "tokio", ] @@ -5834,7 +5863,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.8", "tracing-attributes", "tracing-core", ] @@ -5905,9 +5934,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.6" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eac131e334e81b6b3be07399482042838adcd7957aa0010231d0813e39e02fa" +checksum = "e3ddae50680c12ef75bfbf58416ca6622fa43d879553f6cb2ed1a817346e1ffe" dependencies = [ "hash-db", "hashbrown", @@ -5918,9 +5947,9 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cd" +checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" dependencies = [ "hash-db", ] @@ -5976,12 +6005,12 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "trybuild" -version = "1.0.53" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d664de8ea7e531ad4c0f5a834f20b8cb2b8e6dfe88d05796ee7887518ed67b9" +checksum = "f04343ff86b62ca40bd5dca986aadf4f10c152a9ebe9a869e456b60fa85afd3f" dependencies = [ "glob", - "lazy_static", + "once_cell", "serde", "serde_json", "termcolor", @@ -5996,21 +6025,15 @@ checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" [[package]] name = "twox-hash" -version = "1.6.1" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" +checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ "cfg-if 1.0.0", "rand 0.8.4", "static_assertions", ] -[[package]] -name = "typenum" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" - [[package]] name = "typenum" version = "1.14.0" @@ -6019,6 +6042,12 @@ dependencies = [ "scale-info", ] +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + [[package]] name = "ucd-trie" version = "0.1.3" @@ -6079,7 +6108,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.5", "subtle", ] @@ -6160,9 +6189,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "void" @@ -6200,9 +6229,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -6210,9 +6239,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" dependencies = [ "bumpalo", "lazy_static", @@ -6225,9 +6254,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -6237,9 +6266,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6247,9 +6276,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", @@ -6260,9 +6289,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" + +[[package]] +name = "wasm-instrument" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962e5b0401bbb6c887f54e69b8c496ea36f704df65db73e81fd5ff8dc3e63a9f" +dependencies = [ + "parity-wasm", +] [[package]] name = "wasm-timer" @@ -6305,9 +6343,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" dependencies = [ "js-sys", "wasm-bindgen", @@ -6343,9 +6381,9 @@ dependencies = [ [[package]] name = "which" -version = "4.2.2" +version = "4.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9" +checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2" dependencies = [ "either", "lazy_static", @@ -6440,7 +6478,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.13" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ "derivative", "impl-trait-for-tuples", @@ -6453,7 +6491,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.13" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ "frame-support", "frame-system", @@ -6473,7 +6511,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.13" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -6490,8 +6528,9 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#95a924f03a48fd4041197deddc3173d4a7d1806b" +source = "git+https://github.com/paritytech/polkadot?branch=master#f4d95232d6436eb49189b3af2f8a860fdf0654a2" dependencies = [ + "Inflector", "proc-macro2", "quote", "syn", @@ -6513,18 +6552,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +checksum = "cc222aec311c323c717f56060324f32b82da1ce1dd81d9a09aa6a9030bfe08db" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.2.2" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" +checksum = "81e8f13fef10b63c06356d65d416b070798ddabcadc10d3ece0c5be9b3c7eddb" dependencies = [ "proc-macro2", "quote", @@ -6534,18 +6573,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.9.0+zstd.1.5.0" +version = "0.9.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd" +checksum = "2390ea1bf6c038c39674f22d95f0564725fc06034a47129179810b2fc58caa54" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.1+zstd.1.5.0" +version = "4.1.3+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079" +checksum = "e99d81b99fb3c2c2c794e3fe56c305c63d5173a16a46b5850b07c935ffc7db79" dependencies = [ "libc", "zstd-sys", @@ -6553,9 +6592,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.1+zstd.1.5.0" +version = "1.6.2+zstd.1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33" +checksum = "2daf2f248d9ea44454bfcb2516534e8b8ad2fc91bf818a1885495fc42bc8ac9f" dependencies = [ "cc", "libc", From 56e4e9d498c343c9623d604f5e0b5b4033fef6f7 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 26 Jan 2022 14:56:25 +0100 Subject: [PATCH 04/20] [sybil-gate-template] change from `ValueQuery` to `OptionQuery` where needed --- primitives/src/sybil.rs | 4 ++-- sybil-gate-template/src/lib.rs | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/primitives/src/sybil.rs b/primitives/src/sybil.rs index ac0456fa..a5b6c51f 100644 --- a/primitives/src/sybil.rs +++ b/primitives/src/sybil.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use ep_core::fixed::traits::Fixed; use scale_info::TypeInfo; use sp_core::{RuntimeDebug, H256}; @@ -92,7 +92,7 @@ impl CallMetadata { /// This allows to generically call the sybil-personhood-oracle, whose response calls the method with the /// index defined in the `SybilResponse` -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum SybilResponse { Faucet = 1, diff --git a/sybil-gate-template/src/lib.rs b/sybil-gate-template/src/lib.rs index d53e8b14..bb469593 100644 --- a/sybil-gate-template/src/lib.rs +++ b/sybil-gate-template/src/lib.rs @@ -32,7 +32,6 @@ use encointer_primitives::{ }, }; use frame_support::{ - ensure, traits::{Currency, Get, PalletInfo}, weights::GetDispatchInfo, Parameter, @@ -170,11 +169,10 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; Sibling::try_from_account(&sender).ok_or(>::OnlyParachainsAllowed)?; - ensure!( - >::contains_key(&request_hash), - >::UnexpectedResponse - ); - let account = >::take(&request_hash); + + let account = >::take(&request_hash) + .ok_or_else(|| >::UnexpectedResponse)?; + debug!(target: LOG, "Received PersonhoodUniquenessRating for account: {:?}", account); for proof in rating.proofs() { @@ -235,7 +233,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn pending_requests)] pub(super) type PendingRequests = - StorageMap<_, Identity, H256, T::AccountId, ValueQuery>; + StorageMap<_, Identity, H256, T::AccountId, OptionQuery>; /// The proof of attendances that have already been used in a previous request /// Membership checks are faster with maps than with vecs, see: https://substrate.dev/recipes/map-set.html. From 1adadc00105acc076d32fc7e9beb2e304b697d55 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Wed, 26 Jan 2022 15:16:49 +0100 Subject: [PATCH 05/20] [scheduler] change from `ValueQuery` to `OptionQuery` where needed --- primitives/src/scheduler.rs | 4 ++-- scheduler/src/lib.rs | 25 +++++++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/primitives/src/scheduler.rs b/primitives/src/scheduler.rs index bad0d101..79acab49 100644 --- a/primitives/src/scheduler.rs +++ b/primitives/src/scheduler.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; #[cfg(feature = "serde_derive")] @@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize}; pub type CeremonyIndexType = u32; -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Debug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum CeremonyPhaseType { REGISTERING, diff --git a/scheduler/src/lib.rs b/scheduler/src/lib.rs index 19fc47f3..df7b1572 100644 --- a/scheduler/src/lib.rs +++ b/scheduler/src/lib.rs @@ -92,7 +92,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn ceremony_master)] - pub(super) type CeremonyMaster = StorageValue<_, T::AccountId, ValueQuery>; + pub(super) type CeremonyMaster = StorageValue<_, T::AccountId, OptionQuery>; #[pallet::type_value] pub(super) fn DefaultForNextPhaseTimestamp() -> T::Moment { @@ -116,7 +116,7 @@ pub mod pallet { { pub current_ceremony_index: CeremonyIndexType, pub current_phase: CeremonyPhaseType, - pub ceremony_master: T::AccountId, + pub ceremony_master: Option, pub phase_durations: Vec<(CeremonyPhaseType, T::Moment)>, } @@ -129,7 +129,7 @@ pub mod pallet { Self { current_ceremony_index: Default::default(), current_phase: CeremonyPhaseType::REGISTERING, - ceremony_master: Default::default(), + ceremony_master: None, phase_durations: Default::default(), } } @@ -143,7 +143,14 @@ pub mod pallet { fn build(&self) { >::put(&self.current_ceremony_index); >::put(&self.current_phase); - >::put(&self.ceremony_master); + + if let Some(ref ceremony_master) = self.ceremony_master { + // First I thought, it might be sensible to put an expect here. However, one can always + // edit the genesis config afterwards, so we can't really prevent here anything. + // + // substrate does the same in the sudo pallet. + >::put(&ceremony_master); + } self.phase_durations.iter().for_each(|(k, v)| { >::insert(k, v); @@ -157,7 +164,10 @@ pub mod pallet { #[pallet::weight((1000, DispatchClass::Operational, Pays::No))] pub fn next_phase(origin: OriginFor) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; - ensure!(sender == >::get(), Error::::AuthorizationRequired); + + let master = >::get().ok_or(Error::::AuthorizationRequired)?; + ensure!(sender == master, Error::::AuthorizationRequired); + Self::progress_phase()?; Ok(().into()) } @@ -166,7 +176,10 @@ pub mod pallet { #[pallet::weight((1000, DispatchClass::Operational, Pays::No))] pub fn push_by_one_day(origin: OriginFor) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; - ensure!(sender == >::get(), Error::::AuthorizationRequired); + + let master = >::get().ok_or(Error::::AuthorizationRequired)?; + ensure!(sender == master, Error::::AuthorizationRequired); + let tnext = Self::next_phase_timestamp().saturating_add(T::MomentsPerDay::get()); >::put(tnext); Ok(().into()) From 2d8e493afdf3748368bc85a65291e3e3edeeebfa Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 01:02:39 +0100 Subject: [PATCH 06/20] [communities] change from `ValueQuery` to `OptionQuery` where needed --- communities/src/lib.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/communities/src/lib.rs b/communities/src/lib.rs index f07a7066..9dff70e6 100644 --- a/communities/src/lib.rs +++ b/communities/src/lib.rs @@ -333,26 +333,30 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn community_master)] - pub(super) type CommunityMaster = StorageValue<_, T::AccountId, ValueQuery>; + pub(super) type CommunityMaster = StorageValue<_, T::AccountId, OptionQuery>; #[pallet::genesis_config] - pub struct GenesisConfig -// TODO_MAYBE_WHERE_CLAUSE - { - pub community_master: T::AccountId, + pub struct GenesisConfig { + pub community_master: Option, } #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { - Self { community_master: Default::default() } + Self { community_master: None } } } #[pallet::genesis_build] impl GenesisBuild for GenesisConfig { fn build(&self) { - >::put(&self.community_master); + if let Some(ref community_master) = self.community_master { + // First I thought, it might be sensible to put an expect here. However, one can always + // edit the genesis config afterwards, so we can't really prevent here anything. + // + // substrate does the same in the sudo pallet. + >::put(community_master); + } } } } From edd26efb678283a7a600aa08a9b9a95a82bb01a4 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 01:03:51 +0100 Subject: [PATCH 07/20] update `GeoHash` to const generic version --- communities/src/lib.rs | 11 +++++------ primitives/src/communities.rs | 9 ++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/communities/src/lib.rs b/communities/src/lib.rs index 9dff70e6..f7f5b9ea 100644 --- a/communities/src/lib.rs +++ b/communities/src/lib.rs @@ -29,7 +29,7 @@ use encointer_primitives::{ common::PalletString, communities::{ consts::*, validate_demurrage, validate_nominal_income, CommunityIdentifier, - CommunityMetadata as CommunityMetadataType, Degree, Location, LossyFrom, + CommunityMetadata as CommunityMetadataType, Degree, GeoHash, Location, LossyFrom, NominalIncome as NominalIncomeType, }, fixed::transcendental::{asin, cos, powi, sin, sqrt}, @@ -37,7 +37,6 @@ use encointer_primitives::{ }; use frame_support::{ensure, traits::Get}; use frame_system::{ensure_root, ensure_signed}; -use geohash::GeoHash; use log::{info, warn}; use sp_runtime::{DispatchResult, SaturatedConversion}; use sp_std::{prelude::*, result::Result}; @@ -96,7 +95,7 @@ pub mod pallet { Self::validate_location(&location)?; // All checks done, now mutate state - let geo_hash = GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION) + let geo_hash = GeoHash::try_from_params(location.lat, location.lon) .map_err(|_| >::InvalidLocationForGeohash)?; let mut locations: Vec = Vec::new(); @@ -144,7 +143,7 @@ pub mod pallet { Self::ensure_cid_exists(&cid)?; Self::ensure_bootstrapper(sender, cid)?; Self::validate_location(&location)?; - let geo_hash = GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION) + let geo_hash = GeoHash::try_from_params(location.lat, location.lon) .map_err(|_| >::InvalidLocationForGeohash)?; // insert location into locations let mut locations = Self::locations(&cid, &geo_hash); @@ -181,7 +180,7 @@ pub mod pallet { ); Self::ensure_cid_exists(&cid)?; Self::ensure_bootstrapper(sender, cid)?; - let geo_hash = GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION) + let geo_hash = GeoHash::try_from_params(location.lat, location.lon) .map_err(|_| >::InvalidLocationForGeohash)?; Self::remove_location_intern(cid, location, geo_hash); Ok(().into()) @@ -556,7 +555,7 @@ impl Pallet { } fn get_nearby_locations(location: &Location) -> Result, Error> { let mut result: Vec = Vec::new(); - let geo_hash = GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION) + let geo_hash = GeoHash::try_from_params(location.lat, location.lon) .map_err(|_| >::InvalidLocationForGeohash)?; let mut relevant_buckets = Self::get_relevant_neighbor_buckets(&geo_hash, location)?; relevant_buckets.push(geo_hash); diff --git a/primitives/src/communities.rs b/primitives/src/communities.rs index 73fc3457..59c2063b 100644 --- a/primitives/src/communities.rs +++ b/primitives/src/communities.rs @@ -19,7 +19,7 @@ use codec::{Decode, Encode}; use concat_arrays::concat_arrays; use crc::{Crc, CRC_32_CKSUM}; use ep_core::fixed::types::I64F64; -use geohash::GeoHash; +use geohash::GeoHash as GeohashGeneric; use scale_info::TypeInfo; use sp_core::RuntimeDebug; use sp_std::{fmt, fmt::Formatter, prelude::Vec, str::FromStr}; @@ -40,6 +40,9 @@ use crate::{ use crate::error::CommunityIdentifierError; pub use ep_core::fixed::traits::{LossyFrom, LossyInto}; +use consts::GEO_HASH_BUCKET_RESOLUTION; + +pub type GeoHash = GeohashGeneric; pub type CommunityIndexType = u32; pub type LocationIndexType = u32; pub type Degree = I64F64; @@ -99,7 +102,7 @@ impl CommunityIdentifier { location: Location, bootstrappers: Vec, ) -> Result { - let geohash = GeoHash::try_from_params(location.lat, location.lon, 5); + let geohash = GeoHash::try_from_params(location.lat, location.lon); match geohash { Ok(v) => { let mut geohash_cropped = [0u8; 5]; @@ -307,7 +310,7 @@ pub mod consts { pub const METERS_PER_DEGREE_AT_EQUATOR: I32F0 = I32F0::from_bits(0x0001B2D7); /// the number of base32 digits to use (as opposed to number of bits or bytes of information) - pub const BUCKET_RESOLUTION: usize = 5usize; + pub const GEO_HASH_BUCKET_RESOLUTION: usize = 5; /// Dirty bit key for offfchain storage pub const CACHE_DIRTY_KEY: &[u8] = b"dirty"; From 7b765e75b4144474efe338df7c7d45db6eb3ebd0 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 01:43:06 +0100 Subject: [PATCH 08/20] [primitives] derive `MaxEncodedLen` for most types. --- primitives/Cargo.toml | 2 +- primitives/core/src/bs58_verify.rs | 4 ++-- primitives/src/balances.rs | 4 ++-- primitives/src/bazaar.rs | 4 ++-- primitives/src/common.rs | 4 ++-- primitives/src/communities.rs | 21 +++++++++++++++++---- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 3d46c67d..0ed5e981 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] bs58 = { version = "0.4.0", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive", "max-encoded-len"] } concat-arrays = { version = "0.1.2", default-features = false } crc = "2.0.0" geohash = { git = "https://github.com/encointer/geohash", branch = "master" } diff --git a/primitives/core/src/bs58_verify.rs b/primitives/core/src/bs58_verify.rs index 66994358..9c61cc10 100644 --- a/primitives/core/src/bs58_verify.rs +++ b/primitives/core/src/bs58_verify.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; @@ -67,7 +67,7 @@ impl Bs58verify { } } -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum Bs58Error { /// Non ascii character at index diff --git a/primitives/src/balances.rs b/primitives/src/balances.rs index b56a1f72..1c8e2403 100644 --- a/primitives/src/balances.rs +++ b/primitives/src/balances.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use ep_core::fixed::types::I64F64; use scale_info::TypeInfo; use sp_core::RuntimeDebug; @@ -26,7 +26,7 @@ use serde::{Deserialize, Serialize}; pub type BalanceType = I64F64; pub type Demurrage = I64F64; -#[derive(Encode, Decode, Default, RuntimeDebug, Clone, Copy, TypeInfo)] +#[derive(Encode, Decode, Default, RuntimeDebug, Clone, Copy, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub struct BalanceEntry { /// The balance of the account after last manual adjustment diff --git a/primitives/src/bazaar.rs b/primitives/src/bazaar.rs index fd49fe5c..dd0d7886 100644 --- a/primitives/src/bazaar.rs +++ b/primitives/src/bazaar.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; @@ -23,7 +23,7 @@ use crate::{common::PalletString, communities::CommunityIdentifier}; #[cfg(feature = "serde_derive")] use serde::{Deserialize, Serialize}; -#[derive(Encode, Decode, Default, RuntimeDebug, Clone, Eq, PartialEq, TypeInfo)] +#[derive(Encode, Decode, Default, RuntimeDebug, Clone, Eq, PartialEq, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub struct BusinessIdentifier { pub community_identifier: CommunityIdentifier, diff --git a/primitives/src/common.rs b/primitives/src/common.rs index 71a733f8..c03c56fb 100644 --- a/primitives/src/common.rs +++ b/primitives/src/common.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; @@ -73,7 +73,7 @@ pub fn validate_ipfs_cid(cid: &IpfsCid) -> Result<(), IpfsValidationError> { Bs58verify::verify(&cid.as_bytes_or_noop()).map_err(|e| IpfsValidationError::InvalidBase58(e)) } -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum IpfsValidationError { /// Invalid length supplied. Should be 46. Is: \[length\] diff --git a/primitives/src/communities.rs b/primitives/src/communities.rs index 59c2063b..fd149854 100644 --- a/primitives/src/communities.rs +++ b/primitives/src/communities.rs @@ -15,7 +15,7 @@ // along with Encointer. If not, see . use bs58; -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use concat_arrays::concat_arrays; use crc::{Crc, CRC_32_CKSUM}; use ep_core::fixed::types::I64F64; @@ -66,7 +66,9 @@ pub fn validate_nominal_income(nominal_income: &NominalIncome) -> Result<(), ()> Ok(()) } -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Default, PartialOrd, Ord, TypeInfo)] +#[derive( + Encode, Decode, Copy, Clone, PartialEq, Eq, Default, PartialOrd, Ord, TypeInfo, MaxEncodedLen, +)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub struct CommunityIdentifier { #[cfg_attr(feature = "serde_derive", serde(with = "serialize_array"))] @@ -156,7 +158,18 @@ fn decorate_bs58_err(err: bs58::decode::Error) -> bs58::decode::Error { // Location in lat/lon. Fixpoint value in degree with 8 decimal bits and 24 fractional bits #[derive( - Encode, Decode, Copy, Clone, PartialEq, Eq, Default, RuntimeDebug, PartialOrd, Ord, TypeInfo, + Encode, + Decode, + Copy, + Clone, + PartialEq, + Eq, + Default, + RuntimeDebug, + PartialOrd, + Ord, + TypeInfo, + MaxEncodedLen, )] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub struct Location { @@ -262,7 +275,7 @@ impl Default for CommunityMetadata { } } -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum CommunityMetadataError { /// Invalid ascii character at \[index\] From 69cfb218659377364fce8339a975ed1f69776b9c Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 01:43:42 +0100 Subject: [PATCH 09/20] [bazaar] add `pallet::without_storage_info` because we can't satisfy `MaxEncodedLen` everywhere yet. --- bazaar/src/lib.rs | 1 + communities/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/bazaar/src/lib.rs b/bazaar/src/lib.rs index cff5bf44..16531ed4 100644 --- a/bazaar/src/lib.rs +++ b/bazaar/src/lib.rs @@ -48,6 +48,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub (super) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::call] diff --git a/communities/src/lib.rs b/communities/src/lib.rs index f7f5b9ea..4d6027a6 100644 --- a/communities/src/lib.rs +++ b/communities/src/lib.rs @@ -54,6 +54,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub (super) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::config] From 40151315561d3729ac110c5cac46dedba9569017 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 02:44:37 +0100 Subject: [PATCH 10/20] [ceremonies] derive `MaxEncodedLen` for some stuff --- primitives/src/ceremonies.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/primitives/src/ceremonies.rs b/primitives/src/ceremonies.rs index e3a269b3..448d2231 100644 --- a/primitives/src/ceremonies.rs +++ b/primitives/src/ceremonies.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Encointer. If not, see . -use codec::{Decode, Encode}; +use codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::{RuntimeDebug, H256}; use sp_runtime::traits::{BlakeTwo256, Hash, IdentifyAccount, Verify}; @@ -38,7 +38,7 @@ use sp_std::vec::Vec; #[cfg(feature = "std")] use sp_core::Pair; -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub enum Reputation { // no attestations for attendance claim @@ -57,7 +57,9 @@ impl Default for Reputation { } } -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, Default, RuntimeDebug, TypeInfo)] +#[derive( + Encode, Decode, Copy, Clone, PartialEq, Eq, Default, RuntimeDebug, TypeInfo, MaxEncodedLen, +)] #[cfg_attr(feature = "serde_derive", derive(Serialize, Deserialize))] pub struct ClaimOfAttendance { pub claimant_public: AccountId, @@ -171,7 +173,9 @@ impl ClaimOfAttendance { pub prover_public: AccountId, @@ -218,7 +222,9 @@ mod tests { } } -#[derive(Encode, Decode, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, Default)] +#[derive( + Encode, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, +)] pub struct AssignmentCount { pub bootstrappers: ParticipantIndexType, pub reputables: ParticipantIndexType, @@ -232,7 +238,9 @@ impl AssignmentCount { } } -#[derive(Encode, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive( + Encode, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, +)] pub struct Assignment { pub bootstrappers_reputables: AssignmentParams, pub endorsees: AssignmentParams, @@ -241,7 +249,9 @@ pub struct Assignment { } // Todo: abstract AssignmentParams trait and use two different structs: AssignmentParams, LocationAssignmentParams -#[derive(Encode, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] +#[derive( + Encode, Decode, Default, Copy, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen, +)] pub struct AssignmentParams { /// Random prime below number of meetup participants. For locations this is the amount of locations. pub m: u64, From b1e27340ade8a0f25eca67469e2fd8b4207b2f30 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 02:44:59 +0100 Subject: [PATCH 11/20] [ceremonies] use OptionQuery where necessary --- ceremonies/src/lib.rs | 81 +++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 29 deletions(-) diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs index f404a96b..8b05b6cc 100644 --- a/ceremonies/src/lib.rs +++ b/ceremonies/src/lib.rs @@ -95,10 +95,11 @@ pub mod pallet { reputable: T::AccountId, ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; - ensure!( - sender == >::ceremony_master(), - Error::::AuthorizationRequired - ); + + let master = >::ceremony_master() + .ok_or(Error::::AuthorizationRequired)?; + ensure!(sender == master, Error::::AuthorizationRequired); + let cindex = >::current_ceremony_index(); >::insert( &(cid, cindex - 1), @@ -459,7 +460,7 @@ pub mod pallet { Blake2_128Concat, ParticipantIndexType, T::AccountId, - ValueQuery, + OptionQuery, >; #[pallet::storage] @@ -488,7 +489,7 @@ pub mod pallet { Blake2_128Concat, ParticipantIndexType, T::AccountId, - ValueQuery, + OptionQuery, >; #[pallet::storage] @@ -517,7 +518,7 @@ pub mod pallet { Blake2_128Concat, ParticipantIndexType, T::AccountId, - ValueQuery, + OptionQuery, >; #[pallet::storage] @@ -546,7 +547,7 @@ pub mod pallet { Blake2_128Concat, ParticipantIndexType, T::AccountId, - ValueQuery, + OptionQuery, >; #[pallet::storage] @@ -619,7 +620,7 @@ pub mod pallet { Blake2_128Concat, AttestationIndexType, Vec, - ValueQuery, + OptionQuery, >; #[pallet::storage] @@ -1037,12 +1038,21 @@ impl Pallet { ); for p in bootstrappers_reputables { if p < assigned.bootstrappers { - result.push(Self::bootstrapper_registry(community_ceremony, &(p + 1))); //safe; small number per meetup + if let Some(bs) = Self::bootstrapper_registry(community_ceremony, &(p + 1)) { + //safe; small number per meetup + result.push(bs); + } else { + error!(target: LOG, "Bootstrapper not found!!") + } } else if p < assigned.bootstrappers + assigned.reputables { - result.push(Self::reputable_registry( - community_ceremony, - &(p - assigned.bootstrappers + 1), //safe; small number per meetup - )); + if let Some(r) = + Self::reputable_registry(community_ceremony, &(p - assigned.bootstrappers + 1)) + { + //safe; small number per meetup + result.push(r); + } else { + error!(target: LOG, "Reputable not found!!") + } } } @@ -1050,7 +1060,12 @@ impl Pallet { assignment_fn_inverse(meetup_index, params.endorsees, meetup_count, assigned.endorsees); for p in endorsees { if p < assigned.endorsees { - result.push(Self::endorsee_registry(community_ceremony, &(p + 1))); //safe; <= number of meetup participants + if let Some(e) = Self::endorsee_registry(community_ceremony, &(p + 1)) { + //safe; small number per meetup + result.push(e); + } else { + error!(target: LOG, "Endorsee not found!!") + } } } @@ -1058,7 +1073,12 @@ impl Pallet { assignment_fn_inverse(meetup_index, params.newbies, meetup_count, assigned.newbies); for p in newbies { if p < assigned.newbies { - result.push(Self::newbie_registry(community_ceremony, &(p + 1))); //safe; <= number of meetup participants + if let Some(n) = Self::newbie_registry(community_ceremony, &(p + 1)) { + //safe; small number per meetup + result.push(n); + } else { + error!(target: LOG, "Newbie not found!!") + } } } @@ -1110,17 +1130,19 @@ impl Pallet { ); continue } - let attestees = Self::attestation_registry( + + if let Some(attestees) = Self::attestation_registry( (cid, cindex), &Self::attestation_index((*cid, cindex), &participant), - ); - if attestees.len() < (n_honest_participants - 1) as usize { - debug!( - target: LOG, - "skipped participant because didn't testify for honest peers: {:?}", - participant - ); - continue + ) { + if attestees.len() < (n_honest_participants - 1) as usize { + debug!( + target: LOG, + "skipped participant because didn't testify for honest peers: {:?}", + participant + ); + continue + } } let mut was_attested_count = 0u32; @@ -1128,12 +1150,13 @@ impl Pallet { if other_participant == participant { continue } - let attestees_from_other = Self::attestation_registry( + if let Some(attestees_from_other) = Self::attestation_registry( (cid, cindex), &Self::attestation_index((cid, cindex), &other_participant), - ); - if attestees_from_other.contains(&participant) { - was_attested_count += 1; // <= number of meetup participants + ) { + if attestees_from_other.contains(&participant) { + was_attested_count += 1; // <= number of meetup participants + } } } From 70703444ee86337f19fd23b135d3271367ec5a11 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 02:45:49 +0100 Subject: [PATCH 12/20] [ceremonies] add `pallet::without_storage_info` because we can't satisfy `MaxEncodedLen` everywhere yet. --- ceremonies/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs index 8b05b6cc..7647d587 100644 --- a/ceremonies/src/lib.rs +++ b/ceremonies/src/lib.rs @@ -64,6 +64,7 @@ pub mod pallet { #[pallet::pallet] #[pallet::generate_store(pub (super) trait Store)] + #[pallet::without_storage_info] pub struct Pallet(PhantomData); #[pallet::config] From 77aa93309b7ac57b26bcf725f085cacbf3b5d301 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 04:35:47 +0100 Subject: [PATCH 13/20] [communities] incorporate GeoHash changes --- Cargo.lock | 6 ++---- Cargo.toml | 11 +++++++---- communities/src/tests.rs | 26 +++++++++----------------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12a4a770..12845ca0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1508,7 +1508,6 @@ dependencies = [ [[package]] name = "geohash" version = "0.11.1-alpha.0" -source = "git+https://github.com/encointer/geohash?branch=master#7cf5425b8bffcc8c39e77f4e53a5663e295ca581" dependencies = [ "parity-scale-codec", "scale-info", @@ -5610,7 +5609,6 @@ dependencies = [ [[package]] name = "substrate-fixed" version = "0.5.7" -source = "git+https://github.com/encointer/substrate-fixed?tag=v0.5.7#2f353acee3c7cf7a386863a89fc6cb805048561f" dependencies = [ "parity-scale-codec", "scale-info", @@ -6029,7 +6027,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "rand 0.8.4", "static_assertions", ] @@ -6037,8 +6035,8 @@ dependencies = [ [[package]] name = "typenum" version = "1.14.0" -source = "git+https://github.com/encointer/typenum#ec35bb80fcfb495de2e1f6966381c3f85e8a6509" dependencies = [ + "parity-scale-codec", "scale-info", ] diff --git a/Cargo.toml b/Cargo.toml index 1daedc42..e050f700 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,8 +19,11 @@ members = [ 'test-utils' ] -#[patch."https://github.com/encointer/substrate-fixed"] -#substrate-fixed = { path = "../substrate-fixed"} +[patch."https://github.com/encointer/substrate-fixed"] +substrate-fixed = { path = "../substrate-fixed"} -#[patch."https://github.com/encointer/geohash"] -#geohash = { path = "../geohash"} +[patch."https://github.com/encointer/typenum"] +typenum = { path = "../typenum"} + +[patch."https://github.com/encointer/geohash"] +geohash = { path = "../geohash"} diff --git a/communities/src/tests.rs b/communities/src/tests.rs index badea69e..635327a1 100644 --- a/communities/src/tests.rs +++ b/communities/src/tests.rs @@ -28,7 +28,7 @@ use test_utils::{ type T = Degree; fn string_to_geohash(s: &str) -> GeoHash { - GeoHash(std::string::String::from(s).as_bytes().to_vec()) + GeoHash::try_from(s).unwrap() } /// register a simple test community with a specified location and defined bootstrappers @@ -145,8 +145,7 @@ fn new_community_works() { )); let cid = CommunityIdentifier::new(location.clone(), bs.clone()).unwrap(); let cids = EncointerCommunities::community_identifiers(); - let geo_hash = - GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash = GeoHash::try_from_params(location.lat, location.lon).unwrap(); assert!(cids.contains(&cid)); assert_eq!(EncointerCommunities::locations(&cid, &geo_hash), vec![location]); assert_eq!(EncointerCommunities::cids_by_geohash(&geo_hash), vec![cid]); @@ -171,11 +170,9 @@ fn two_communities_in_same_bucket_works() { }; let location = Location { lat: T::from_num(0i32), lon: T::from_num(0i32) }; - let geo_hash = - GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash = GeoHash::try_from_params(location.lat, location.lon).unwrap(); let location2 = Location { lat: T::from_num(0), lon: T::from_num(-0.015) }; - let geo_hash2 = - GeoHash::try_from_params(location2.lat, location2.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash2 = GeoHash::try_from_params(location2.lat, location2.lon).unwrap(); assert_eq!(geo_hash, geo_hash2); assert_ok!(EncointerCommunities::new_community( @@ -257,15 +254,13 @@ fn add_location_works() { let some_bootstrapper = AccountId::from(AccountKeyring::Alice); let location = Location { lat: T::from_num(0i32), lon: T::from_num(0i32) }; - let geo_hash = - GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash = GeoHash::try_from_params(location.lat, location.lon).unwrap(); assert_eq!(EncointerCommunities::locations(&cid, &geo_hash), vec![location]); assert_eq!(EncointerCommunities::cids_by_geohash(&geo_hash), vec![cid]); // add location in same bucket let location2 = Location { lat: T::from_num(0), lon: T::from_num(-0.015) }; - let geo_hash2 = - GeoHash::try_from_params(location2.lat, location2.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash2 = GeoHash::try_from_params(location2.lat, location2.lon).unwrap(); assert_eq!(geo_hash, geo_hash2); EncointerCommunities::add_location( @@ -283,8 +278,7 @@ fn add_location_works() { // add location in different bucket let location3 = Location { lat: T::from_num(0), lon: T::from_num(0.015) }; - let geo_hash3 = - GeoHash::try_from_params(location3.lat, location3.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash3 = GeoHash::try_from_params(location3.lat, location3.lon).unwrap(); EncointerCommunities::add_location( Origin::signed(some_bootstrapper.clone()), @@ -357,15 +351,13 @@ fn remove_location_works() { let some_bootstrapper = AccountId::from(AccountKeyring::Alice); let location = Location { lat: T::from_num(0i32), lon: T::from_num(0i32) }; - let geo_hash = - GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash = GeoHash::try_from_params(location.lat, location.lon).unwrap(); assert_eq!(EncointerCommunities::locations(&cid, &geo_hash), vec![location]); assert_eq!(EncointerCommunities::cids_by_geohash(&geo_hash), vec![cid]); // add location in same bucket let location2 = Location { lat: T::from_num(0), lon: T::from_num(-0.015) }; - let geo_hash2 = - GeoHash::try_from_params(location2.lat, location2.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash2 = GeoHash::try_from_params(location2.lat, location2.lon).unwrap(); assert_eq!(geo_hash, geo_hash2); EncointerCommunities::add_location( From a04901374998429b15f244a00f16f5a6abccd7fe Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 04:44:56 +0100 Subject: [PATCH 14/20] fix tests compilation; issue_rewards test fails. --- ceremonies/src/mock.rs | 4 ++-- ceremonies/src/tests.rs | 40 +++++++++++++++++------------------ communities/src/mock.rs | 11 ++++++---- personhood-oracle/src/mock.rs | 4 ++-- scheduler/src/mock.rs | 2 +- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/ceremonies/src/mock.rs b/ceremonies/src/mock.rs index 7cc5492c..df353b19 100644 --- a/ceremonies/src/mock.rs +++ b/ceremonies/src/mock.rs @@ -78,14 +78,14 @@ impl_encointer_balances!(TestRuntime); pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); encointer_communities::GenesisConfig:: { - community_master: AccountId::from(AccountKeyring::Alice), + community_master: Some(AccountKeyring::Alice.to_account_id()), } .assimilate_storage(&mut t) .unwrap(); encointer_scheduler::GenesisConfig:: { current_phase: CeremonyPhaseType::REGISTERING, current_ceremony_index: 1, - ceremony_master: AccountId::from(AccountKeyring::Alice), + ceremony_master: Some(AccountKeyring::Alice.to_account_id()), phase_durations: vec![ (CeremonyPhaseType::REGISTERING, ONE_DAY), (CeremonyPhaseType::ASSIGNING, ONE_DAY), diff --git a/ceremonies/src/tests.rs b/ceremonies/src/tests.rs index 6968ab0a..1f1523a4 100644 --- a/ceremonies/src/tests.rs +++ b/ceremonies/src/tests.rs @@ -317,8 +317,8 @@ fn registering_participant_works() { assert_eq!(EncointerCeremonies::bootstrapper_count((cid, cindex)), 2); assert_eq!(EncointerCeremonies::bootstrapper_index((cid, cindex), &bob), 2); - assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1), alice); - assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &2), bob); + assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1).unwrap(), alice); + assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &2).unwrap(), bob); let newbies = add_population(2, 2); let newbie_1 = account_id(&newbies[0]); @@ -329,10 +329,10 @@ fn registering_participant_works() { assert_ok!(register(newbie_2.clone(), cid, None)); assert_eq!(EncointerCeremonies::newbie_count((cid, cindex)), 2); assert_eq!(EncointerCeremonies::newbie_index((cid, cindex), &newbie_1), 1); - assert_eq!(EncointerCeremonies::newbie_registry((cid, cindex), &1), newbie_1); + assert_eq!(EncointerCeremonies::newbie_registry((cid, cindex), &1).unwrap(), newbie_1); assert_eq!(EncointerCeremonies::newbie_index((cid, cindex), &newbie_2), 2); - assert_eq!(EncointerCeremonies::newbie_registry((cid, cindex), &2), newbie_2); + assert_eq!(EncointerCeremonies::newbie_registry((cid, cindex), &2).unwrap(), newbie_2); let newbies = add_population(2, 4); let endorsee_1 = account_id(&newbies[0]); @@ -359,10 +359,10 @@ fn registering_participant_works() { assert_eq!(EncointerCeremonies::bootstrapper_count((cid, cindex)), 2); assert_eq!(EncointerCeremonies::endorsee_index((cid, cindex), &endorsee_1), 1); - assert_eq!(EncointerCeremonies::endorsee_registry((cid, cindex), &1), endorsee_1); + assert_eq!(EncointerCeremonies::endorsee_registry((cid, cindex), &1).unwrap(), endorsee_1); assert_eq!(EncointerCeremonies::endorsee_index((cid, cindex), &endorsee_2), 2); - assert_eq!(EncointerCeremonies::endorsee_registry((cid, cindex), &2), endorsee_2); + assert_eq!(EncointerCeremonies::endorsee_registry((cid, cindex), &2).unwrap(), endorsee_2); // Registering Reputables is tested in grow_population_works. }); @@ -412,7 +412,7 @@ fn attest_claims_works() { assert_eq!(EncointerCeremonies::attestation_count((cid, cindex)), 2); assert_eq!(EncointerCeremonies::attestation_index((cid, cindex), &account_id(&bob)), 2); - let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &2); + let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &2).unwrap(); assert!(wit_vec.len() == 2); assert!(wit_vec.contains(&account_id(&alice))); assert!(wit_vec.contains(&account_id(&ferdie))); @@ -446,7 +446,7 @@ fn attest_claims_for_non_participant_fails_silently() { 3, ); assert_eq!(EncointerCeremonies::attestation_count((cid, cindex)), 1); - let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1); + let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1).unwrap(); assert!(wit_vec.contains(&account_id(&alice)) == false); assert!(wit_vec.len() == 1); }); @@ -500,7 +500,7 @@ fn attest_claims_with_non_participant_fails_silently() { 3, ); assert_eq!(EncointerCeremonies::attestation_count((cid, cindex)), 1); - let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1); + let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1).unwrap(); assert!(wit_vec.contains(&account_id(&eve)) == false); assert!(wit_vec.len() == 1); }); @@ -537,7 +537,7 @@ fn attest_claims_with_wrong_meetup_index_fails() { Origin::signed(account_id(&alice)), alice_claims )); - let attestees = EncointerCeremonies::attestation_registry((cid, cindex), &1); + let attestees = EncointerCeremonies::attestation_registry((cid, cindex), &1).unwrap(); assert!(attestees.contains(&account_id(&ferdie)) == false); assert!(attestees.len() == 1); }); @@ -574,7 +574,7 @@ fn attest_claims_with_wrong_ceremony_index_fails() { Origin::signed(account_id(&alice)), alice_attestations )); - let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1); + let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1).unwrap(); assert!(wit_vec.contains(&account_id(&ferdie)) == false); assert!(wit_vec.len() == 1); }); @@ -604,7 +604,7 @@ fn attest_claims_with_wrong_timestamp_fails() { ) .is_err()); let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1); - assert!(wit_vec.len() == 0); + assert!(wit_vec.is_none()); }); } @@ -634,7 +634,7 @@ fn attest_claims_with_wrong_location_fails() { ) .is_err()); let wit_vec = EncointerCeremonies::attestation_registry((cid, cindex), &1); - assert!(wit_vec.len() == 0); + assert!(wit_vec.is_none()); }); } @@ -1097,7 +1097,7 @@ fn ceremony_index_and_purging_registry_works() { let reputation_lifetime = ::ReputationLifetime::get(); assert_ok!(register(alice.clone(), cid, None)); - assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1), alice); + assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1).unwrap(), alice); for _ in 0..reputation_lifetime { run_to_next_phase(); @@ -1105,7 +1105,10 @@ fn ceremony_index_and_purging_registry_works() { run_to_next_phase(); // still not purged - assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1), alice); + assert_eq!( + EncointerCeremonies::bootstrapper_registry((cid, cindex), &1).unwrap(), + alice + ); } // only after n=ReputationLifetimes cycles everything should be purged @@ -1117,11 +1120,8 @@ fn ceremony_index_and_purging_registry_works() { let new_cindex = EncointerScheduler::current_ceremony_index(); assert_eq!(new_cindex, cindex + reputation_lifetime + 1); assert_eq!(EncointerCeremonies::bootstrapper_count((cid, cindex)), 0); - assert_eq!( - EncointerCeremonies::bootstrapper_registry((cid, cindex), &1), - AccountId::default() - ); - assert_eq!(EncointerCeremonies::bootstrapper_index((cid, cindex), &alice), NONE); + assert_eq!(EncointerCeremonies::bootstrapper_registry((cid, cindex), &1), None); + assert_eq!(EncointerCeremonies::bootstrapper_index((cid, cindex), &alice), 0); }); } diff --git a/communities/src/mock.rs b/communities/src/mock.rs index aa44723e..6bd9eb52 100644 --- a/communities/src/mock.rs +++ b/communities/src/mock.rs @@ -58,13 +58,16 @@ impl_encointer_scheduler!(TestRuntime); // genesis values pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - dut::GenesisConfig:: { community_master: AccountId::from(AccountKeyring::Alice) } - .assimilate_storage(&mut t) - .unwrap(); + dut::GenesisConfig:: { + community_master: Some(AccountKeyring::Alice.to_account_id()), + } + .assimilate_storage(&mut t) + .unwrap(); + encointer_scheduler::GenesisConfig:: { current_phase: CeremonyPhaseType::REGISTERING, current_ceremony_index: 1, - ceremony_master: AccountId::from(AccountKeyring::Alice), + ceremony_master: Some(AccountKeyring::Alice.to_account_id()), phase_durations: vec![ (CeremonyPhaseType::REGISTERING, ONE_DAY), (CeremonyPhaseType::ASSIGNING, ONE_DAY), diff --git a/personhood-oracle/src/mock.rs b/personhood-oracle/src/mock.rs index c3556a74..c64f34a6 100644 --- a/personhood-oracle/src/mock.rs +++ b/personhood-oracle/src/mock.rs @@ -66,14 +66,14 @@ impl_encointer_ceremonies!(TestRuntime); pub fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); encointer_communities::GenesisConfig:: { - community_master: AccountId::from(AccountKeyring::Alice), + community_master: Some(AccountKeyring::Alice.to_account_id()), } .assimilate_storage(&mut t) .unwrap(); encointer_scheduler::GenesisConfig:: { current_phase: CeremonyPhaseType::REGISTERING, current_ceremony_index: 1, - ceremony_master: AccountId::from(AccountKeyring::Alice), + ceremony_master: Some(AccountKeyring::Alice.to_account_id()), phase_durations: vec![ (CeremonyPhaseType::REGISTERING, ONE_DAY), (CeremonyPhaseType::ASSIGNING, ONE_DAY), diff --git a/scheduler/src/mock.rs b/scheduler/src/mock.rs index cfb44ca4..495ea495 100644 --- a/scheduler/src/mock.rs +++ b/scheduler/src/mock.rs @@ -56,7 +56,7 @@ pub fn new_test_ext(phase_duration: u64) -> sp_io::TestExternalities { dut::GenesisConfig:: { current_phase: CeremonyPhaseType::REGISTERING, current_ceremony_index: 1, - ceremony_master: master(), + ceremony_master: Some(master()), phase_durations: vec![ (CeremonyPhaseType::REGISTERING, phase_duration), (CeremonyPhaseType::ASSIGNING, phase_duration), From 3d4f14ae40c17507c60b561359f43d4351eb1e11 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 19:07:43 +0100 Subject: [PATCH 15/20] [ceremonies] fix issue_rewards test. --- ceremonies/src/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs index 7647d587..06cf85ac 100644 --- a/ceremonies/src/lib.rs +++ b/ceremonies/src/lib.rs @@ -1132,19 +1132,21 @@ impl Pallet { continue } - if let Some(attestees) = Self::attestation_registry( + match Self::attestation_registry( (cid, cindex), &Self::attestation_index((*cid, cindex), &participant), ) { - if attestees.len() < (n_honest_participants - 1) as usize { - debug!( - target: LOG, - "skipped participant because didn't testify for honest peers: {:?}", - participant - ); - continue - } - } + Some(attestees) => + if attestees.len() < (n_honest_participants - 1) as usize { + debug!( + target: LOG, + "skipped participant because didn't testify for honest peers: {:?}", + participant + ); + continue + }, + None => continue, + }; let mut was_attested_count = 0u32; for other_participant in &meetup_participants { From 1830113d49550d674f51a0e7d764b2fff4b34047 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 19:13:43 +0100 Subject: [PATCH 16/20] [ceremonies] improve code readability --- ceremonies/src/lib.rs | 47 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs index 06cf85ac..4b465612 100644 --- a/ceremonies/src/lib.rs +++ b/ceremonies/src/lib.rs @@ -1039,21 +1039,20 @@ impl Pallet { ); for p in bootstrappers_reputables { if p < assigned.bootstrappers { - if let Some(bs) = Self::bootstrapper_registry(community_ceremony, &(p + 1)) { - //safe; small number per meetup - result.push(bs); - } else { - error!(target: LOG, "Bootstrapper not found!!") + //safe; small number per meetup + match Self::bootstrapper_registry(community_ceremony, &(p + 1)) { + Some(bs) => result.push(bs), + None => error!(target: LOG, "Bootstrapper not found!!"), } } else if p < assigned.bootstrappers + assigned.reputables { - if let Some(r) = - Self::reputable_registry(community_ceremony, &(p - assigned.bootstrappers + 1)) - { - //safe; small number per meetup - result.push(r); - } else { - error!(target: LOG, "Reputable not found!!") - } + //safe; small number per meetup + match Self::reputable_registry( + community_ceremony, + &(p - assigned.bootstrappers + 1), + ) { + Some(r) => result.push(r), + None => error!(target: LOG, "Reputable not found!!"), + }; } } @@ -1061,12 +1060,11 @@ impl Pallet { assignment_fn_inverse(meetup_index, params.endorsees, meetup_count, assigned.endorsees); for p in endorsees { if p < assigned.endorsees { - if let Some(e) = Self::endorsee_registry(community_ceremony, &(p + 1)) { - //safe; small number per meetup - result.push(e); - } else { - error!(target: LOG, "Endorsee not found!!") - } + //safe; small number per meetup + match Self::endorsee_registry(community_ceremony, &(p + 1)) { + Some(e) => result.push(e), + None => error!(target: LOG, "Endorsee not found!!"), + }; } } @@ -1074,12 +1072,11 @@ impl Pallet { assignment_fn_inverse(meetup_index, params.newbies, meetup_count, assigned.newbies); for p in newbies { if p < assigned.newbies { - if let Some(n) = Self::newbie_registry(community_ceremony, &(p + 1)) { - //safe; small number per meetup - result.push(n); - } else { - error!(target: LOG, "Newbie not found!!") - } + //safe; small number per meetup + match Self::newbie_registry(community_ceremony, &(p + 1)) { + Some(n) => result.push(n), + None => error!(target: LOG, "Newbie not found!!"), + }; } } From 8dc744808d3203edc577a66c16552ef2e12298f3 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 19:25:20 +0100 Subject: [PATCH 17/20] bump substrate-fixed@v0.5.8 and remove patches for it. --- Cargo.lock | 28 +++++++++++++++------------- Cargo.toml | 10 +++++----- primitives/core/Cargo.toml | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12845ca0..d8c67b5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1492,7 +1492,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.15.0", + "typenum 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1501,7 +1501,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" dependencies = [ - "typenum 1.15.0", + "typenum 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check", ] @@ -2615,7 +2615,7 @@ dependencies = [ "rand 0.8.4", "serde", "sha2 0.9.9", - "typenum 1.15.0", + "typenum 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2986,7 +2986,7 @@ dependencies = [ "rand 0.8.4", "rand_distr", "simba", - "typenum 1.15.0", + "typenum 1.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5608,12 +5608,13 @@ dependencies = [ [[package]] name = "substrate-fixed" -version = "0.5.7" +version = "0.5.8" +source = "git+https://github.com/encointer/substrate-fixed?tag=v0.5.8#5984ba9b9433d5007597c7f03f65ea5bf6d08601" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.14.0", + "typenum 1.15.0 (git+https://github.com/encointer/typenum?tag=v1.15.0)", ] [[package]] @@ -6034,17 +6035,18 @@ dependencies = [ [[package]] name = "typenum" -version = "1.14.0" -dependencies = [ - "parity-scale-codec", - "scale-info", -] +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "typenum" version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +source = "git+https://github.com/encointer/typenum?tag=v1.15.0#14e21b6532ad2adf893fbe329b78deb7ae7dfad0" +dependencies = [ + "parity-scale-codec", + "scale-info", +] [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index e050f700..afa0546f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,11 +19,11 @@ members = [ 'test-utils' ] -[patch."https://github.com/encointer/substrate-fixed"] -substrate-fixed = { path = "../substrate-fixed"} - -[patch."https://github.com/encointer/typenum"] -typenum = { path = "../typenum"} +#[patch."https://github.com/encointer/substrate-fixed"] +#substrate-fixed = { path = "../substrate-fixed"} +# +#[patch."https://github.com/encointer/typenum"] +#typenum = { path = "../typenum"} [patch."https://github.com/encointer/geohash"] geohash = { path = "../geohash"} diff --git a/primitives/core/Cargo.toml b/primitives/core/Cargo.toml index f529b4b2..b5dcdd4e 100644 --- a/primitives/core/Cargo.toml +++ b/primitives/core/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } impl-serde = { version = "0.3.0", optional = true, default-features = false } -fixed = { package = "substrate-fixed", tag = "v0.5.7", default-features = false, git = "https://github.com/encointer/substrate-fixed" } +fixed = { package = "substrate-fixed", tag = "v0.5.8", default-features = false, git = "https://github.com/encointer/substrate-fixed" } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, default-features = false, features = ["derive","alloc"] } From cefbeb6b6996b8bc7939fc45654f41e1d2ca6787 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Thu, 27 Jan 2022 22:29:49 +0100 Subject: [PATCH 18/20] bump geohash@v0.12.0 and remove patches for it. --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- communities/Cargo.toml | 1 - primitives/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8c67b5f..e68e5330 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1507,7 +1507,8 @@ dependencies = [ [[package]] name = "geohash" -version = "0.11.1-alpha.0" +version = "0.12.0" +source = "git+https://github.com/encointer/geohash?tag=v0.12.0#eed7dcb86ff73ee2689f5f4e091feb86078c11dd" dependencies = [ "parity-scale-codec", "scale-info", @@ -3312,7 +3313,6 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "geohash", "log", "pallet-encointer-scheduler", "parity-scale-codec", diff --git a/Cargo.toml b/Cargo.toml index afa0546f..824cecc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,5 +25,5 @@ members = [ #[patch."https://github.com/encointer/typenum"] #typenum = { path = "../typenum"} -[patch."https://github.com/encointer/geohash"] -geohash = { path = "../geohash"} +#[patch."https://github.com/encointer/geohash"] +#geohash = { path = "../geohash"} diff --git a/communities/Cargo.toml b/communities/Cargo.toml index a0a46bff..b00fff42 100644 --- a/communities/Cargo.toml +++ b/communities/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies] codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive"] } log = { version = "0.4.14", default-features = false } -geohash = { default-features = false, git = "https://github.com/encointer/geohash", branch = "master" } scale-info = { version = "1.0", default-features = false } # local deps diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 0ed5e981..c5f179c9 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -9,7 +9,7 @@ bs58 = { version = "0.4.0", default-features = false, features = ["alloc"] } codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false, features = ["derive", "max-encoded-len"] } concat-arrays = { version = "0.1.2", default-features = false } crc = "2.0.0" -geohash = { git = "https://github.com/encointer/geohash", branch = "master" } +geohash = { git = "https://github.com/encointer/geohash", tag = "v0.12.0" } log = { version = "0.4.14", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = "1.0.101", optional = true, default-features = false, features = ["derive","alloc"] } From 5067faff831612331c78dc3083b61912c6a05282 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 28 Jan 2022 00:16:03 +0100 Subject: [PATCH 19/20] [ceremonies] better logs --- ceremonies/src/lib.rs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs index 4b465612..43de24ed 100644 --- a/ceremonies/src/lib.rs +++ b/ceremonies/src/lib.rs @@ -1042,7 +1042,10 @@ impl Pallet { //safe; small number per meetup match Self::bootstrapper_registry(community_ceremony, &(p + 1)) { Some(bs) => result.push(bs), - None => error!(target: LOG, "Bootstrapper not found!!"), + None => error!( + target: LOG, + "[Ceremonies::get_meetup_participants] Bootstrapper not found!!" + ), } } else if p < assigned.bootstrappers + assigned.reputables { //safe; small number per meetup @@ -1051,7 +1054,10 @@ impl Pallet { &(p - assigned.bootstrappers + 1), ) { Some(r) => result.push(r), - None => error!(target: LOG, "Reputable not found!!"), + None => error!( + target: LOG, + "[Ceremonies::get_meetup_participants] Reputable not found!!" + ), }; } } @@ -1063,7 +1069,10 @@ impl Pallet { //safe; small number per meetup match Self::endorsee_registry(community_ceremony, &(p + 1)) { Some(e) => result.push(e), - None => error!(target: LOG, "Endorsee not found!!"), + None => error!( + target: LOG, + "[Ceremonies::get_meetup_participants] Endorsee not found!!" + ), }; } } @@ -1075,7 +1084,10 @@ impl Pallet { //safe; small number per meetup match Self::newbie_registry(community_ceremony, &(p + 1)) { Some(n) => result.push(n), - None => error!(target: LOG, "Newbie not found!!"), + None => error!( + target: LOG, + "[Ceremonies::get_meetup_participants] Newbie not found!!" + ), }; } } From 066770d2d123339ac1569d5a3d975eb4a566dc02 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Fri, 28 Jan 2022 00:44:51 +0100 Subject: [PATCH 20/20] fix rebase errors --- communities/src/tests.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/communities/src/tests.rs b/communities/src/tests.rs index 635327a1..bae2902d 100644 --- a/communities/src/tests.rs +++ b/communities/src/tests.rs @@ -299,20 +299,17 @@ fn remove_community_works() { let some_bootstrapper = AccountId::from(AccountKeyring::Alice); let location = Location { lat: T::from_num(0i32), lon: T::from_num(0i32) }; - let geo_hash = - GeoHash::try_from_params(location.lat, location.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash = GeoHash::try_from_params(location.lat, location.lon).unwrap(); assert_eq!(EncointerCommunities::locations(&cid, &geo_hash), vec![location]); assert_eq!(EncointerCommunities::cids_by_geohash(&geo_hash), vec![cid]); // add location in same bucket let location2 = Location { lat: T::from_num(0), lon: T::from_num(-0.015) }; - let geo_hash2 = - GeoHash::try_from_params(location2.lat, location2.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash2 = GeoHash::try_from_params(location2.lat, location2.lon).unwrap(); assert_eq!(geo_hash, geo_hash2); let location3 = Location { lat: T::from_num(10), lon: T::from_num(-0.015) }; - let geo_hash3 = - GeoHash::try_from_params(location3.lat, location3.lon, BUCKET_RESOLUTION).unwrap(); + let geo_hash3 = GeoHash::try_from_params(location3.lat, location3.lon).unwrap(); EncointerCommunities::add_location( Origin::signed(some_bootstrapper.clone()),