From 3fa0fc67fd653676673836d056e9e47ff4bf1399 Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Fri, 17 May 2024 11:47:01 +0800 Subject: [PATCH 1/6] randomness by vrf --- Cargo.lock | 890 ++++++++++++------------ Cargo.toml | 7 +- node/src/service.rs | 7 +- pallets/container/Cargo.toml | 1 + pallets/container/src/mock.rs | 28 +- pallets/randomness/Cargo.toml | 56 ++ pallets/randomness/README.md | 115 +++ pallets/randomness/src/benchmarks.rs | 58 ++ pallets/randomness/src/inherent.rs | 64 ++ pallets/randomness/src/lib.rs | 188 +++++ pallets/randomness/src/mock.rs | 134 ++++ pallets/randomness/src/tests.rs | 9 + pallets/randomness/src/types.rs | 37 + pallets/randomness/src/weights.rs | 59 ++ pallets/sequencer-grouping/Cargo.toml | 5 + pallets/sequencer-grouping/src/lib.rs | 25 +- pallets/sequencer-grouping/src/mock.rs | 26 +- pallets/sequencer-grouping/src/tests.rs | 19 +- pallets/sequencer-staking/Cargo.toml | 2 +- pallets/sequencer-staking/src/mock.rs | 24 +- runtime/Cargo.toml | 4 + runtime/src/lib.rs | 62 +- 22 files changed, 1336 insertions(+), 484 deletions(-) create mode 100644 pallets/randomness/Cargo.toml create mode 100644 pallets/randomness/README.md create mode 100644 pallets/randomness/src/benchmarks.rs create mode 100644 pallets/randomness/src/inherent.rs create mode 100644 pallets/randomness/src/lib.rs create mode 100644 pallets/randomness/src/mock.rs create mode 100644 pallets/randomness/src/tests.rs create mode 100644 pallets/randomness/src/types.rs create mode 100644 pallets/randomness/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index 5090e7a..90fb9f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -89,7 +89,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -142,47 +142,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -190,9 +191,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "approx" @@ -228,7 +229,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -368,9 +369,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" @@ -451,27 +452,25 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.1", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite 0.2.14", ] [[package]] name = "async-executor" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98c37cf288e302c16ef6c8472aad1e034c6c84ce5ea7b8101c98eb4a802fee" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-lite 2.3.0", "slab", ] @@ -520,8 +519,8 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.6.0", - "rustix 0.38.32", + "polling 3.7.0", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -571,33 +570,33 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" dependencies = [ "async-io 2.3.2", - "async-lock 2.8.0", + "async-lock 3.3.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.32", + "rustix 0.38.34", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" @@ -607,7 +606,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -637,9 +636,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -682,9 +681,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -732,13 +731,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.17", + "prettyplease 0.2.20", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -883,18 +882,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" dependencies = [ - "async-channel 2.2.0", + "async-channel 2.3.1", "async-lock 3.3.0", "async-task", - "fastrand 2.0.2", "futures-io", "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] @@ -985,9 +982,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -1024,9 +1021,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] @@ -1048,7 +1045,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1056,12 +1053,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.92" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1130,9 +1128,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1227,7 +1225,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -1259,30 +1257,30 @@ dependencies = [ [[package]] name = "color-print" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" +checksum = "1ee543c60ff3888934877a5671f45494dd27ed4ba25c6670b9a7576b7ed7a8c0" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" +checksum = "77ff1a80c5f3cb1ca7c06ffdd71b6a6dd6d8f896c42141fbd43f50ed28dcdb93" dependencies = [ "nom", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.63", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "comfy-table" @@ -1303,9 +1301,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1344,7 +1342,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -1654,7 +1652,7 @@ dependencies = [ "cumulus-primitives-core", "futures", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1767,7 +1765,7 @@ dependencies = [ "futures", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-parachain-primitives", "polkadot-primitives", @@ -1931,7 +1929,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2141,13 +2139,13 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1a416b2e6a5c99d78049b91425dbdb844f4351fd9fb61da47b70c2f90cf2ed4" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", @@ -2271,7 +2269,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2289,9 +2287,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21db378d04296a84d8b7d047c36bb3954f0b46529db725d7e62fb02f9ba53ccc" +checksum = "bb497fad022245b29c2a0351df572e2d67c1046bcef2260ebc022aec81efea82" dependencies = [ "cc", "cxxbridge-flags", @@ -2301,9 +2299,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5262a7fa3f0bae2a55b767c223ba98032d7c328f5c13fa5cdc980b77fc0658" +checksum = "9327c7f9fbd6329a200a5d4aa6f674c60ab256525ff0084b52a889d4e4c60cee" dependencies = [ "cc", "codespan-reporting", @@ -2311,24 +2309,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "cxxbridge-flags" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8dcadd2e2fb4a501e1d9e93d6e88e6ea494306d8272069c92d5a9edf8855c0" +checksum = "688c799a4a846f1c0acb9f36bb9c6272d9b3d9457f3633c7753c6057270df13c" [[package]] name = "cxxbridge-macro" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad08a837629ad949b73d032c637653d069e909cffe4ee7870b02301939ce39cc" +checksum = "928bc249a7e3cd554fd2e8e08a426e9670c50bbfc9a621653cfa9accc9641783" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2338,23 +2336,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2362,9 +2360,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2433,7 +2431,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2535,7 +2533,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2559,9 +2557,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.58", + "syn 2.0.63", "termcolor", - "toml 0.8.12", + "toml 0.8.13", "walkdir", ] @@ -2672,7 +2670,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek 4.1.2", "ed25519", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -2749,7 +2747,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2760,7 +2758,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2790,9 +2788,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2859,9 +2857,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener 5.3.0", "pin-project-lite 0.2.14", @@ -2899,7 +2897,7 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -2925,9 +2923,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fatality" @@ -2976,9 +2974,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "file-per-thread-logger" @@ -3014,7 +3012,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "scale-info", ] @@ -3038,9 +3036,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-sys", @@ -3134,7 +3132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38f1660c2e59d206386658ca7fa867c2ccdb44429cc8a5a16a2975a338aa7047" dependencies = [ "Inflector", - "array-bytes 6.2.2", + "array-bytes 6.2.3", "chrono", "clap", "comfy-table", @@ -3185,7 +3183,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -3268,7 +3266,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81aecbbc1c62055e8ce472283bc655bf6c0f968a4d22d504bf6aad4ea44ccbc4" dependencies = [ "aquamarine 0.5.0", - "array-bytes 6.2.2", + "array-bytes 6.2.3", "bitflags 1.3.2", "docify", "environmental", @@ -3320,7 +3318,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -3333,7 +3331,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -3344,7 +3342,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -3432,7 +3430,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -3512,7 +3510,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -3527,7 +3525,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -3629,9 +3627,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -3697,7 +3695,7 @@ dependencies = [ "futures-timer", "no-std-compat", "nonzero_ext", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "portable-atomic", "quanta", "rand", @@ -3784,9 +3782,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -3799,7 +3797,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -3828,9 +3826,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex-literal" @@ -3960,7 +3958,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -3977,7 +3975,7 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -4135,7 +4133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -4213,7 +4211,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -4245,6 +4243,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -4280,9 +4284,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -4298,9 +4302,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4b0e68d9af1f066c06d6e2397583795b912d78537d7d907c561e82c13d69fa1" +checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -4314,9 +4318,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92f254f56af1ae84815b9b1325094743dcf05b92abb5e94da2e81a35cff0cada" +checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" dependencies = [ "futures-util", "http", @@ -4335,9 +4339,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "274d68152c24aa78977243bb56f28d7946e6aa309945b37d33174a3f92d89a3a" +checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" dependencies = [ "anyhow", "async-trait", @@ -4346,7 +4350,7 @@ dependencies = [ "futures-util", "hyper", "jsonrpsee-types", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand", "rustc-hash", @@ -4360,9 +4364,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac13bc1e44cd00448a5ff485824a128629c945f02077804cb659c07a0ba41395" +checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" dependencies = [ "async-trait", "hyper", @@ -4380,22 +4384,22 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c326f9e95aeff7d707b2ffde72c22a52acc975ba1c48587776c02b90c4747a6" +checksum = "7d0bb047e79a143b32ea03974a6bf59b62c2a4c5f5d42a381c907a8bbb3f75c0" dependencies = [ "heck 0.4.1", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "jsonrpsee-server" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b5bfbda5f8fb63f997102fd18f73e35e34c84c6dcdbdbbe72c6e48f6d2c959b" +checksum = "12d8b6a9674422a8572e0b0abb12feeb3f2aeda86528c80d0350c2bd0923ab41" dependencies = [ "futures-util", "http", @@ -4417,9 +4421,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc828e537868d6b12bbb07ec20324909a22ced6efca0057c825c3e1126b2c6d" +checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" dependencies = [ "anyhow", "beef", @@ -4430,9 +4434,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f00abe918bf34b785f87459b9205790e5361a3f7437adb50e928dc243f27eb" +checksum = "58b9db2dfd5bb1194b0ce921504df9ceae210a345bc2f6c5a61432089bbab070" dependencies = [ "http", "jsonrpsee-client-transport", @@ -4486,7 +4490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] @@ -4497,7 +4501,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rocksdb", "smallvec", @@ -4528,9 +4532,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libloading" @@ -4557,7 +4561,7 @@ dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.14", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -4622,7 +4626,7 @@ dependencies = [ "multihash 0.17.0", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "quick-protobuf", "rand", @@ -4642,7 +4646,7 @@ dependencies = [ "futures", "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "smallvec", "trust-dns-resolver", ] @@ -4804,7 +4808,7 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quinn-proto", "rand", "rustls 0.20.9", @@ -4920,7 +4924,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quicksink", "rw-stream-sink", "soketto", @@ -5090,9 +5094,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -5166,7 +5170,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -5180,7 +5184,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -5191,7 +5195,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -5202,7 +5206,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -5254,7 +5258,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", ] [[package]] @@ -5364,7 +5368,7 @@ dependencies = [ "hashlink", "lioness", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "rand_chacha 0.3.1", "rand_distr", @@ -5781,20 +5785,19 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -5826,11 +5829,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -5838,9 +5840,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -5933,7 +5935,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -5962,9 +5964,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchestra" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2356622ffdfe72362a45a1e5e87bb113b8327e596e39b91f11f0ef4395c8da79" +checksum = "92829eef0328a3d1cd22a02c0e51deb92a5362df3e7d21a4e9bdc38934694e66" dependencies = [ "async-trait", "dyn-clonable", @@ -5979,15 +5981,15 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedb646674596266dc9bb2b5c7eea7c36b32ecc7777eba0d510196972d72c4fd" +checksum = "1344346d5af32c95bbddea91b18a88cc83eac394192d20ef2fc4c40a74332355" dependencies = [ "expander 2.1.0", "indexmap 2.2.6", "itertools 0.11.0", "petgraph", - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -6215,7 +6217,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32a1e978b043f4bf7cfcdb130a51dda4dbade1de5b85d2d634082edbc08f9cb" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "binary-merkle-tree", "frame-support", "frame-system", @@ -6294,15 +6296,16 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "12.0.0" +version = "12.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e777e84455b11e0a8798466566ebb23939f196145183665f5e67e94706ffa112" +checksum = "26edc27ed73c658e6f3d37b4cc8822be3f293e1f0dc58830b42c272781ac8a44" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-authorship", + "pallet-balances", "pallet-session", "parity-scale-codec", "rand", @@ -6343,6 +6346,7 @@ dependencies = [ "pallet-sequencer-grouping", "parity-scale-codec", "primitives-container", + "rand", "scale-info", "serde", "sp-consensus-aura", @@ -6771,6 +6775,28 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-randomness" +version = "0.1.0" +dependencies = [ + "async-trait", + "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-ranked-collective" version = "31.0.0" @@ -6871,7 +6897,9 @@ dependencies = [ "frame-system", "log", "pallet-balances", + "pallet-randomness", "parity-scale-codec", + "rand", "scale-info", "serde", "sp-core", @@ -6893,6 +6921,7 @@ dependencies = [ "pallet-sequencer-grouping", "parity-scale-codec", "popsicle-runtime", + "rand", "scale-info", "serde", "similar-asserts", @@ -6995,7 +7024,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -7314,7 +7343,7 @@ dependencies = [ "log", "lz4", "memmap2 0.5.10", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "siphasher", "snap", @@ -7323,9 +7352,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -7338,11 +7367,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -7379,12 +7408,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -7403,15 +7432,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -7433,9 +7462,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -7470,9 +7499,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -7481,9 +7510,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -7491,22 +7520,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "pest_meta" -version = "2.7.9" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -7515,9 +7544,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -7540,7 +7569,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -7563,12 +7592,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-io", ] @@ -7822,7 +7851,7 @@ dependencies = [ "fatality", "futures", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -8084,7 +8113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99c07e2dad8712e1e5978c6404aca20d2c7f1b5d6151d60277f49ce949b3ed5d" dependencies = [ "always-assert", - "array-bytes 6.2.2", + "array-bytes 6.2.3", "blake3", "cfg-if", "futures", @@ -8182,7 +8211,7 @@ dependencies = [ "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-primitives", "sc-network", @@ -8315,7 +8344,7 @@ dependencies = [ "kvdb", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "polkadot-node-jaeger", "polkadot-node-metrics", @@ -8346,7 +8375,7 @@ dependencies = [ "futures", "futures-timer", "orchestra", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8582,7 +8611,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", @@ -8775,7 +8804,7 @@ dependencies = [ "polkavm-common 0.8.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -8787,7 +8816,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -8797,7 +8826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl 0.8.0", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -8807,7 +8836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -8817,7 +8846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" dependencies = [ "gimli 0.28.1", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "log", "object 0.32.2", "polkavm-common 0.9.0", @@ -8849,15 +8878,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite 0.2.14", - "rustix 0.38.32", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] @@ -8979,6 +9008,7 @@ dependencies = [ "pallet-collator-selection", "pallet-container", "pallet-message-queue", + "pallet-randomness", "pallet-sequencer-grouping", "pallet-sequencer-staking", "pallet-session", @@ -9069,7 +9099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -9084,12 +9114,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -9143,15 +9173,6 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -9193,29 +9214,29 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "thiserror", ] @@ -9227,7 +9248,7 @@ checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "prometheus-client-derive-encode", ] @@ -9239,7 +9260,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -9254,12 +9275,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "32445183788a6159990b6e44d9955d0d6c06b7b9384b4c3e9a0d152a1bf30d56" dependencies = [ "bytes", - "prost-derive 0.12.4", + "prost-derive 0.12.5", ] [[package]] @@ -9299,15 +9320,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" dependencies = [ "anyhow", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -9461,7 +9482,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", ] [[package]] @@ -9485,9 +9506,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ "bitflags 2.5.0", ] @@ -9548,13 +9569,22 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -9573,22 +9603,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -9743,7 +9773,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -9927,9 +9957,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -9949,7 +9979,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -9991,9 +10021,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -10016,9 +10046,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -10028,14 +10058,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "subtle 2.5.0", "zeroize", ] @@ -10080,15 +10110,15 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -10102,9 +10132,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -10113,9 +10143,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ruzstd" @@ -10141,9 +10171,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" @@ -10190,7 +10220,7 @@ dependencies = [ "multihash 0.18.1", "multihash-codetable", "parity-scale-codec", - "prost 0.12.4", + "prost 0.12.5", "prost-build", "rand", "sc-client-api", @@ -10250,7 +10280,7 @@ version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfb28048e5b2d168870e2205d3e41db1f387a781831a8b8b82c9f10536c2742" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "docify", "log", "memmap2 0.9.4", @@ -10280,7 +10310,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -10289,7 +10319,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20c2eae4d9396b19403f89f058a6a684066b58e051b1310f246eb9b41a7b54fe" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "chrono", "clap", "fdlimit", @@ -10335,7 +10365,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -10367,7 +10397,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-state-db", "schnellru", @@ -10392,7 +10422,7 @@ dependencies = [ "libp2p-identity", "log", "mockall", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-utils", "serde", @@ -10450,7 +10480,7 @@ dependencies = [ "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -10502,14 +10532,14 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a49993da0847cf1ef84184e24e8d95f71efac2e940556678bf9e45a8fd0a47f" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-channel 1.9.0", "async-trait", "fnv", "futures", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-network", @@ -10543,7 +10573,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-consensus-beefy", "sc-rpc", "serde", @@ -10574,7 +10604,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19945689693bbea950220bf7af1c79a2f70f5f37b97f7e6d136dcaf2b34f4a5" dependencies = [ "ahash 0.8.11", - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-trait", "dyn-clone", "finality-grandpa", @@ -10583,7 +10613,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "sc-block-builder", "sc-chain-spec", @@ -10663,7 +10693,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b8f8ddc63df8219768b729f9098ecd4362d2756b40784071cd44c3041f1d51d" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", @@ -10716,7 +10746,7 @@ dependencies = [ "cfg-if", "libc", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rustix 0.36.17", "sc-allocator", "sc-executor-common", @@ -10749,8 +10779,8 @@ version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ef7283da5d643ef89ed094e1b23451ec70386a9474d337cdaa0ef81870bb2d4" dependencies = [ - "array-bytes 6.2.2", - "parking_lot 0.12.1", + "array-bytes 6.2.3", + "parking_lot 0.12.2", "serde_json", "sp-application-crypto", "sp-core", @@ -10775,7 +10805,7 @@ dependencies = [ "mixnet", "multiaddr", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-network", "sc-transaction-pool-api", @@ -10794,7 +10824,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4067423488686ff78561ed0d32ac7e2617edd31219088b1322e85e945e62de29" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-channel 1.9.0", "async-trait", "asynchronous-codec", @@ -10809,7 +10839,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "partial_sort", "pin-project", "rand", @@ -10843,7 +10873,7 @@ dependencies = [ "futures", "libp2p-identity", "log", - "prost 0.12.4", + "prost 0.12.5", "prost-build", "sc-client-api", "sc-network", @@ -10897,13 +10927,13 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c4a77832e7d86e2b8f579339a47ebc16eec560bb4d62c42f0daad10700a512" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-channel 1.9.0", "futures", "libp2p-identity", "log", "parity-scale-codec", - "prost 0.12.4", + "prost 0.12.5", "prost-build", "sc-client-api", "sc-network", @@ -10919,7 +10949,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7dfdaf49edeaa23ae0da1a9bf6ea3e308c11822cb3a853996f1203b06249411" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "async-channel 1.9.0", "async-trait", "fork-tree", @@ -10929,7 +10959,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "prost 0.12.4", + "prost 0.12.5", "prost-build", "sc-client-api", "sc-consensus", @@ -10956,7 +10986,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b3824e7a1aa29ed3d2294810c8e018a6df3798eec236f3043a62945daf7d9b1" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "futures", "libp2p", "log", @@ -10976,7 +11006,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9d03fd90a535f30badaee9763a2124b9c68dae406e29497f406bfd45cbc7eac" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "bytes", "fnv", "futures", @@ -10988,7 +11018,7 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "sc-client-api", "sc-network", @@ -11025,7 +11055,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -11094,14 +11124,14 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66dcea3fe5f0bcbaf08d6a42e877ae8f50b9cdbc87f65f7c79fbe5003e3969dc" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "futures", "futures-util", "hex", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "sc-chain-spec", "sc-client-api", @@ -11134,7 +11164,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand", "sc-chain-spec", @@ -11193,7 +11223,7 @@ checksum = "9863fb81595a25b908d7143c1a3e162d237e67890088363df4a121fe37c49d08" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sp-core", ] @@ -11263,7 +11293,7 @@ dependencies = [ "futures", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand", "sc-utils", @@ -11286,7 +11316,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rustc-hash", "sc-client-api", @@ -11313,7 +11343,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -11328,7 +11358,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -11372,16 +11402,16 @@ dependencies = [ "futures-timer", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "prometheus", "sp-arithmetic", ] [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", @@ -11393,11 +11423,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -11414,9 +11444,9 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ "ahash 0.8.11", "cfg-if", @@ -11533,11 +11563,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -11546,9 +11576,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -11565,9 +11595,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -11580,9 +11610,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -11598,20 +11628,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -11620,9 +11650,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -11724,9 +11754,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -11868,7 +11898,7 @@ dependencies = [ "fnv", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -11917,13 +11947,13 @@ dependencies = [ "futures-channel", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", "lru 0.11.1", "no-std-net", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand", "rand_chacha 0.3.1", @@ -11971,9 +12001,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -12031,7 +12061,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -12098,7 +12128,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "schnellru", "sp-api", "sp-consensus", @@ -12222,7 +12252,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d7a0fd8f16dcc3761198fc83be12872f823b37b749bc72a3a6a1f702509366" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", @@ -12240,7 +12270,7 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "paste", "primitive-types", "rand", @@ -12285,7 +12315,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -12295,7 +12325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] @@ -12306,7 +12336,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -12393,7 +12423,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbab8b61bd61d5f8625a0c75753b5d5a23be55d3445419acd42caf59cf6236b" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sp-core", "sp-externalities", ] @@ -12556,7 +12586,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -12599,7 +12629,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "smallvec", "sp-core", @@ -12723,7 +12753,7 @@ dependencies = [ "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "scale-info", "schnellru", @@ -12763,7 +12793,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -12880,7 +12910,7 @@ version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ee775f7fc9dfae15d9d5a806efa7d3215f7b7b1cfd225809285a0281addeab" dependencies = [ - "array-bytes 6.2.2", + "array-bytes 6.2.3", "bounded-collections", "derivative", "environmental", @@ -13029,7 +13059,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -13131,7 +13161,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.12", + "toml 0.8.13", "walkdir", "wasm-opt", ] @@ -13167,9 +13197,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -13234,8 +13264,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -13254,7 +13284,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -13266,9 +13296,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] @@ -13290,18 +13320,18 @@ checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -13429,10 +13459,10 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -13445,7 +13475,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -13475,7 +13505,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -13485,7 +13515,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -13504,9 +13534,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -13514,7 +13544,6 @@ dependencies = [ "futures-sink", "pin-project-lite 0.2.14", "tokio", - "tracing", ] [[package]] @@ -13528,21 +13557,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -13558,17 +13587,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -13582,15 +13600,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.6", + "winnow 0.6.8", ] [[package]] @@ -13658,7 +13676,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -13703,7 +13721,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -13809,7 +13827,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "resolv-conf", "smallvec", "thiserror", @@ -13932,9 +13950,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -14043,9 +14061,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -14108,7 +14126,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", "wasm-bindgen-shared", ] @@ -14142,7 +14160,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14260,9 +14278,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -14624,14 +14642,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.32", + "rustix 0.38.34", ] [[package]] name = "wide" -version = "0.7.15" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" +checksum = "aab6594190de06d718a5dbc5fa781ab62f8903797056480e549ca74add6b7065" dependencies = [ "bytemuck", "safe_arch", @@ -14661,11 +14679,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -14918,9 +14936,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -14994,7 +15012,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -15006,7 +15024,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand", "static_assertions", ] @@ -15022,22 +15040,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] @@ -15057,7 +15075,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.63", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 69ebbf3..99b5d7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,9 @@ default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic polkavm = "0.9.3" polkavm-linker = "0.9.2" polkavm-derive = "0.9.1" +derive_more = "0.99" +async-trait = "0.1.71" +hex = { version = "0.4.3", default-features = false } log = { version = "0.4.20", default-features = false } quote = { version = "1.0.33" } serde = { version = "1.0.197", default-features = false } @@ -59,12 +62,13 @@ similar-asserts = "1.1.0" smallvec = "1.11.0" hex-literal = { version = "0.4.1"} color-print = "0.3.4" -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ +codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [ "derive", ] } scale-info = { version = "2.10.0", default-features = false, features = [ "derive", ] } +rand = { version = "0.8.5", default-features = false } # Substrate / FRAME frame-benchmarking = { version = "31.0.0", default-features = false} @@ -170,6 +174,7 @@ cumulus-relay-chain-interface = { version = "0.10.0" } # Local popsicle-runtime = { path = "./runtime", default-features = false } +pallet-randomness = { path = "./pallets/randomness", default-features = false } pallet-sequencer-grouping ={ path = "./pallets/sequencer-grouping", default-features = false } pallet-sequencer-staking ={ path = "./pallets/sequencer-staking", default-features = false } pallet-container = { path = "pallets/container", default-features = false } diff --git a/node/src/service.rs b/node/src/service.rs index f1b662b..2908840 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -24,7 +24,6 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; // Substrate Imports use crate::container_task::spawn_container_task; use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; -use primitives_container::ContainerRuntimeApi; use sc_client_api::Backend; use sc_consensus::ImportQueue; use sc_executor::{ @@ -35,12 +34,12 @@ use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; -use sp_core::Pair; +// use sp_core::Pair; use sp_keystore::KeystorePtr; -use sp_runtime::{app_crypto::AppCrypto, traits::BlakeTwo256}; +// use sp_runtime::{app_crypto::AppCrypto, traits::BlakeTwo256}; use substrate_prometheus_endpoint::Registry; -use sp_runtime::AccountId32; +// use sp_runtime::AccountId32; /// Native executor type. pub struct ParachainNativeExecutor; diff --git a/pallets/container/Cargo.toml b/pallets/container/Cargo.toml index 8c5ee03..c1dc7cd 100644 --- a/pallets/container/Cargo.toml +++ b/pallets/container/Cargo.toml @@ -32,6 +32,7 @@ sp-core = { workspace = true } [dev-dependencies] serde = { workspace = true } +rand = { workspace = true } # Substrate sp-core = { workspace = true } diff --git a/pallets/container/src/mock.rs b/pallets/container/src/mock.rs index ac7424c..e125bc0 100644 --- a/pallets/container/src/mock.rs +++ b/pallets/container/src/mock.rs @@ -1,9 +1,12 @@ +use core::marker::PhantomData; +use frame_system::pallet_prelude::BlockNumberFor; +use crate::Config; + use frame_support::{derive_impl, parameter_types, traits::Everything}; use frame_system as system; -use pallet_sequencer_grouping::SimpleRandomness; use sp_core::{ConstU32, H256}; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, IdentityLookup, Hash}, BuildStorage, }; type Block = frame_system::mocking::MockBlock; @@ -49,12 +52,31 @@ impl frame_system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } +// Randomness trait +pub struct TestRandomness { + _marker: PhantomData, +} +impl frame_support::traits::Randomness> +for TestRandomness +{ + fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { + use rand::{rngs::OsRng, RngCore}; + let mut digest: Vec<_> = [0u8; 32].into(); + OsRng.fill_bytes(&mut digest); + digest.extend_from_slice(subject); + let randomness = T::Hashing::hash(&digest); + // NOTE: Test randomness is always "fresh" assuming block_number is > DrawingFreezeout + let block_number = 0u32.into(); + (randomness, block_number) + } +} + impl pallet_sequencer_grouping::Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type MaxGroupSize = ConstU32<100>; type MaxGroupNumber = ConstU32<100>; - type Randomness = SimpleRandomness; + type RandomnessSource = TestRandomness; } parameter_types! { diff --git a/pallets/randomness/Cargo.toml b/pallets/randomness/Cargo.toml new file mode 100644 index 0000000..5438ed8 --- /dev/null +++ b/pallets/randomness/Cargo.toml @@ -0,0 +1,56 @@ +[package] +authors.workspace = true +description = "Provides on-chain randomness" +edition.workspace = true +homepage.workspace = true +license.workspace = true +name = 'pallet-randomness' +repository.workspace = true +version = "0.1.0" + + +[dependencies] +async-trait = { workspace = true } +codec = { workspace = true } +frame-benchmarking = { workspace = true, optional = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +hex = { workspace = true } +log = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true, optional = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-std = { workspace = true } +sp-inherents = { workspace = true } + +[dev-dependencies] +derive_more = { workspace = true } +pallet-balances = { workspace = true, features = ["std"] } + +[features] +default = ["std"] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", +] +std = [ + "frame-support/std", + "frame-system/std", + "hex/std", + "codec/std", + "scale-info/std", + "serde", + "sp-core/std", + "sp-io/std", + "sp-runtime/std", + "sp-std/std", + "sp-inherents/std", + "log/std", +] +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", +] diff --git a/pallets/randomness/README.md b/pallets/randomness/README.md new file mode 100644 index 0000000..e0d161d --- /dev/null +++ b/pallets/randomness/README.md @@ -0,0 +1,115 @@ +# Randomness Solutions Tradeoff Analysis + +This pallet provides access to 1 source of randomness: + +1. The **BABE epoch randomness** is produced by the relay chain per relay chain epoch. It is based on **all the VRF produced** by the relay chain validators **during** a complete **epoch**.(~600 blocks on Kusama, ~2400 blocks on Polkadot). At the beginning of a new Epoch, those VRFs are **mixed together** and **hashed** in order to produce a **pseudo-random word**. + +## CAP Theorem + +The CAP Theorem says we can have at most 2 of the following properties: Consistency, Availability, and Partition Tolerance. + +### Consistency + +At any block, the random word is consistent between the nodes. + +In practice it means that there **is only 1 possible random word generated** and so the node cannot choose between multiple ones. + +### Example + +Having multiple actors **sending a VRF proof** of the randomly generated word, and **revealing** their random words after all the proofs have been published. (the random word would be the hash of all the secrets) + +By doing so, once the VRF proofs have all been published, there can only be 1 generated word. +_(This example however doesn't have the "Availability" property as actors can "fail" to reveal their secret preventing the random word to be available)_ + +### Availability + +Every request to generate a random word receives a response. + +In practice, it means a node **cannot withhold** any information **preventing** the random word to receive **a response**. + +#### Example + +Using the mandatory VRF of the current collator as a pseudo-random word makes it "available" as it is always present when the block is produced. + +If the collator skips the block production, the next collator producing the block will be able to include its VRF to the block, allowing to provide the pseudo-random word. +_(This example however breaks the "consistency" because for the given block, there were the possibility of 2 different pseudo-random)_ + +### Partition Tolerance + +The network continues to operate, even if an arbitrary number of nodes are failing. + +In practice, it means that the randomness process cannot rely on a designated node but must, like the blockchain consensus, continue to work with a subset of the collators. + +#### Example + +Ex: Using the current block collator to produce the randomness output is partition tolerant. +If the current block collator fails to produce the block, the consensus will pick another collator allowing to produce the pseudo-random word. + +## Breaking down in 2 categories + +Because we can't get rid of the partition tolerance, we can only provide solutions that are compromising the Consistency or the Availability. + +### Category 1: Availability Over Consistency + +The solutions in category 1 provide a pseudo-random process that is guaranteed to provide a pseudo-random word but cannot ensure it hasn't been tampered before being revealed. + +This is the case for the [Babe Epoch Randomness] which ensure each epoch provides a pseudo-random word but also allows the last validator of an epoch to known and pick 2 different pseudo-random words by skipping the block production (At the cost of a relay chain block reward) + +### Category 2: Consistency over Availability + +The solutions in this category provide a pseudo-random that cannot be tampered and that is unique but cannot provide the guarantee it will be always be possible to retrieve it. + +This is the case of the [Mixed Delayed Secret] (not yet described), which will require collators to provide a VRF proof of locally generated secret, and to reveal it later once all the VRF proofs have been published. Such a solution will guarantee that, once the VRF proofs are published, it is impossible to provide a different pseudo-random word. It also guarantees that if at least 1 collator is a good actor, it will be impossible to know the pseudo-random word until all the secrets are revealed. However such solution cannot guarantee that a node will always be able to provide its secret (it can be lost, it can be attacked, or the node can be malicious and refuses to publish it). + +## Babe Epoch Randomness + +The Babe epoch randomness is based on **all the VRF produced** by the validators **during** a complete **epoch**.(~600 blocks on Kusama, ~2400 blocks on Polkadot) +At the beginning of a new Epoch, those VRFs are **mixed together** and **hashed** in order to produce a **pseudo-random word**. +To ensure each pseudo-random word generated during an epoch is different, the Smart Contract must provide a unique salt each time. + +### Properties + +- This randomness is totally **independent of the parachain**, preventing a malicious actor on the parachain to influence the randomness value. +- This randomness is **constant during a full epoch range** (~250 blocks on Kusama, ~2300 blocks on Polkadot) making it **resilient enough against censorship**. If a collator prevents fulfillment at a given block, another collator can fulfill it at the next block with the same random value. +- This randomness **requires** at last 1 epoch after the current epoch (**~1h30** on Kusama, **~6h** on Polkadot) to ensure the pseudo-random word cannot be predicted at the time of the request. + +### Risks + +The **danger** in this process comes from the knowledge that the **last validator** (Validator Y in the schema) has when producing the last block of an Epoch. The process being deterministic and all the material to generate the pseudo random word being known, the validator can decide to **skip producing the block** in order to not include its VRF, which would result in a different pseudo-random word. + +Because epoch are time-based, if the block is skipped, there won't be any additional block produced for that epoch. So the last validator of the block knows both possible output: + +1. When **producing the block** including its VRF => pseudo-random word **AAAA** +2. When **skipping the block** and using already known previous VRFs => pseudo-random word **BBBB** + +The only **incentive** to prevent the validator from skipping the block is the **block rewards**. So the randomness value is only **economically safe if the value at stake is lower than a block reward**. + +```sequence +note over Validator: Validator A +note over Relay: Epoch 1: Block #2399 +Relay->Para: (Relay Block #2399) +note over Para: Block #111\nRequest Randomness (@Epoch 3) +note left of Relay: No knowledge of epoch 2 randomness\nexists yet +Validator->Relay: (Relay Block #2400) +note over Relay: Epoch 2: Block #2400\n(random epoch 1: 0xAAAAAA...) +note over Relay: .\n.\n. +note over Para: .\n.\n. +note over Validator: Validator X +Validator->Relay: Produces #4798\n(influences Epoch 2 Randomness\nbut doesn't know the result) +note over Validator: Validator Y +Validator->Relay: Produces #4799\n(knows/influences Epoch 2 Randomness)\ncan choose 0xBBBBBB... or 0xCCCCCC... +note over Relay: Epoch 3: Block #4800\n(random epoch 2: 0xBBBBBB...or 0xCCCCCC...) +Relay->Para: (Relay Block #4800) +note over Para: Block #222\nFulFill Randomness using\n0xBBBBBB...or 0xCCCCCC... +``` + +_In this schema, we can see that validator Y can decide the epoch 2 randomness by producing or skipping its block._ + +### Multiple slot leaders + +Additionally, the Babe consensus can sometime allow multiple validator to produce a block at the same slot. If that is the last slot of an Epoch,the selected validators coordinate in order to decide which one is producing the block, offering the choice of even more pseudo-random words. + +### Asynchronous Backing + +This solution is **safe** even after the asynchronous backing is supported as the pseudo-random is not dependent on which relay block the parachain block is referencing. +A collator being able to choose the relay block on top of which it builds the parachain block will not influence the pseudo-random word. diff --git a/pallets/randomness/src/benchmarks.rs b/pallets/randomness/src/benchmarks.rs new file mode 100644 index 0000000..ba5162f --- /dev/null +++ b/pallets/randomness/src/benchmarks.rs @@ -0,0 +1,58 @@ +#![cfg(feature = "runtime-benchmarks")] + +//! Benchmarking +use crate::{ + Call, Config, InherentIncluded, Pallet, RandomnessResult, RandomnessResults, RelayEpoch, + RequestType, +}; +use frame_benchmarking::{benchmarks, impl_benchmark_test_suite}; +use frame_system::RawOrigin; + +benchmarks! { + // Benchmark for inherent included in every block + set_babe_randomness_results { + // set the current relay epoch as 9, `get_epoch_index` configured to return 10 + const BENCHMARKING_OLD_EPOCH: u64 = 9u64; + RelayEpoch::::put(BENCHMARKING_OLD_EPOCH); + let benchmarking_babe_output = T::Hash::default(); + let benchmarking_new_epoch = BENCHMARKING_OLD_EPOCH.saturating_add(1u64); + RandomnessResults::::insert( + RequestType::BabeEpoch(benchmarking_new_epoch), + RandomnessResult::new() + ); + }: _(RawOrigin::None) + verify { + // verify randomness result + assert_eq!( + RandomnessResults::::get( + RequestType::BabeEpoch(benchmarking_new_epoch) + ).unwrap().randomness, + Some(benchmarking_babe_output) + ); + assert!(InherentIncluded::::get().is_some()); + assert_eq!( + RelayEpoch::::get(), + benchmarking_new_epoch + ); + } +} + +#[cfg(test)] +mod tests { + use crate::mock::Test; + use sp_io::TestExternalities; + use sp_runtime::BuildStorage; + + pub fn new_test_ext() -> TestExternalities { + let t = frame_system::GenesisConfig::::default() + .build_storage() + .unwrap(); + TestExternalities::new(t) + } +} + +impl_benchmark_test_suite!( + Pallet, + crate::benchmarks::tests::new_test_ext(), + crate::mock::Test +); diff --git a/pallets/randomness/src/inherent.rs b/pallets/randomness/src/inherent.rs new file mode 100644 index 0000000..a6db988 --- /dev/null +++ b/pallets/randomness/src/inherent.rs @@ -0,0 +1,64 @@ +//! Inherents used for randomness +use codec::{Decode, Encode}; +use sp_inherents::{Error, InherentData, InherentIdentifier, IsFatalError}; +use sp_runtime::RuntimeString; + +#[derive(Encode)] +#[cfg_attr(feature = "std", derive(Debug, Decode))] +/// Error type for missing mandatory inherent of pallet_randomness +pub enum InherentError { + /// Takes an error explanation as string + Other(RuntimeString), +} + +impl IsFatalError for InherentError { + fn is_fatal_error(&self) -> bool { + match *self { + InherentError::Other(_) => true, + } + } +} + +impl InherentError { + /// Try to create an instance ouf of the given identifier and data. + #[cfg(feature = "std")] + pub fn try_from(id: &InherentIdentifier, data: &[u8]) -> Option { + if id == &INHERENT_IDENTIFIER { + ::decode(&mut &*data).ok() + } else { + None + } + } +} + +/// The InherentIdentifier to set the babe randomness results +pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"baberand"; + +/// A bare minimum inherent data provider that provides no real data. +/// The inherent is simply used as a way to kick off some computation +/// until https://github.com/paritytech/substrate/pull/10128 lands. +pub struct InherentDataProvider; + +#[cfg(feature = "std")] +#[async_trait::async_trait] +impl sp_inherents::InherentDataProvider for InherentDataProvider { + async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + inherent_data.put_data(INHERENT_IDENTIFIER, &()) + } + + async fn try_handle_error( + &self, + identifier: &InherentIdentifier, + _error: &[u8], + ) -> Option> { + // Don't process modules from other inherents + if *identifier != INHERENT_IDENTIFIER { + return None; + } + + // All errors with the randomness inherent are fatal + Some(Err(Error::Application(Box::from(String::from( + "Error processing dummy randomness inherent", + ))))) + } +} diff --git a/pallets/randomness/src/lib.rs b/pallets/randomness/src/lib.rs new file mode 100644 index 0000000..18efe4b --- /dev/null +++ b/pallets/randomness/src/lib.rs @@ -0,0 +1,188 @@ +//! # Randomness Pallet +//! +//! This pallet provides access to 1 sources of randomness: +//! 1. relay chain BABE one epoch ago randomness, produced by the relay chain per relay chain epoch +//! These options are represented as `type::RequestType`. +//! +//! There are no extrinsics for this pallet. Instead, public functions on `Pallet` expose +//! user actions for the precompile i.e. `request_randomness`. +//! +//! ## Babe Epoch Randomness +//! Babe epoch randomness is retrieved once every relay chain epoch. +//! +//! The `set_babe_randomness_results` mandatory inherent reads the Babe epoch randomness from the +//! relay chain state proof and fills any pending `RandomnessResults` for this epoch randomness. +//! +//! `Config::BabeDataGetter` is responsible for reading the epoch index and epoch randomness +//! from the relay chain state proof. The moonbeam `GetBabeData` implementation is in the runtime. + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::pallet; +pub use pallet::*; +use sp_std::vec::Vec; +pub use weights::WeightInfo; + +#[cfg(any(test, feature = "runtime-benchmarks"))] +mod benchmarks; +pub mod types; +pub use types::*; +pub mod weights; + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; +mod inherent; + +/// Read babe randomness info from the relay chain state proof +pub trait GetBabeData { + fn get_epoch_index() -> EpochIndex; + fn get_epoch_randomness() -> Randomness; +} + +#[pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use inherent::{InherentError, INHERENT_IDENTIFIER}; + use sp_runtime::traits::Hash; + use sp_std::convert::TryInto; + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(PhantomData); + + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Get the BABE data from the runtime + type BabeDataGetter: GetBabeData>; + type WeightInfo: WeightInfo; + } + + #[pallet::error] + pub enum Error { + CannotRequestRandomnessAfterMaxDelay, + } + + /// Relay epoch + #[pallet::storage] + #[pallet::getter(fn relay_epoch)] + pub(crate) type RelayEpoch = StorageValue<_, u64, ValueQuery>; + + /// Ensures the mandatory inherent was included in the block + #[pallet::storage] + #[pallet::getter(fn inherent_included)] + pub(crate) type InherentIncluded = StorageValue<_, ()>; + + /// Snapshot of randomness to fulfill all requests that are for the same raw randomness + /// Removed once $value.request_count == 0 + #[pallet::storage] + #[pallet::getter(fn randomness_results)] + pub type RandomnessResults = + StorageMap<_, Twox64Concat, RequestType, RandomnessResult>; + + #[pallet::call] + impl Pallet { + /// Populates `RandomnessResults` due this epoch with BABE epoch randomness + #[pallet::call_index(0)] + #[pallet::weight(( + ::WeightInfo::set_babe_randomness_results(), + DispatchClass::Mandatory + ))] + pub fn set_babe_randomness_results(origin: OriginFor) -> DispatchResultWithPostInfo { + ensure_none(origin)?; + let last_relay_epoch_index = >::get(); + let relay_epoch_index = T::BabeDataGetter::get_epoch_index(); + if relay_epoch_index > last_relay_epoch_index { + // NOTE: Whether n = 1 or 2 depends on the trait implementation of BabeDataGetter + let babe_n_epochs_ago_this_block = RequestType::BabeEpoch(relay_epoch_index); + if let Some(randomness) = T::BabeDataGetter::get_epoch_randomness() { + let result = RandomnessResult { + request_count: 1, + randomness: Some(randomness), + }; + >::insert(babe_n_epochs_ago_this_block, result); + } else { + log::warn!( + "Failed to fill BABE epoch randomness results \ + REQUIRE HOTFIX TO FILL EPOCH RANDOMNESS RESULTS FOR EPOCH {:?}", + relay_epoch_index + ); + } + } + >::put(relay_epoch_index); + >::put(()); + Ok(Pays::No.into()) + } + } + + #[pallet::inherent] + impl ProvideInherent for Pallet { + type Call = Call; + type Error = InherentError; + const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER; + + fn is_inherent_required(_: &InherentData) -> Result, Self::Error> { + // Return Ok(Some(_)) unconditionally because this inherent is required in every block + // If it is not found, throw a VrfInherentRequired error. + Ok(Some(InherentError::Other( + sp_runtime::RuntimeString::Borrowed( + "Inherent required to set babe randomness results", + ), + ))) + } + + // The empty-payload inherent extrinsic. + fn create_inherent(_data: &InherentData) -> Option { + Some(Call::set_babe_randomness_results {}) + } + + fn is_inherent(call: &Self::Call) -> bool { + matches!(call, Call::set_babe_randomness_results { .. }) + } + } + + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_finalize(_now: BlockNumberFor) { + // Ensure the mandatory inherent was included in the block or the block is invalid + assert!( + >::take().is_some(), + "Mandatory randomness inherent not included; InherentIncluded storage item is empty" + ); + } + } + + // Randomness trait + impl frame_support::traits::Randomness> for Pallet { + /// Uses the BABE randomness to generate a random seed. + fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { + let relay_epoch_index = >::get(); + let randomness_output = + RandomnessResults::::get(RequestType::BabeEpoch(relay_epoch_index)) + .unwrap_or_else(|| { + log::error!( + "FATAL Could not find the included Babe randomness for {:?}. Using None", + relay_epoch_index + ); + RandomnessResult::::new() + }) + .randomness + .unwrap_or_else(|| { + log::error!("FATAL included BABE randomness is `None`. Using default hash"); + T::Hash::default() + }); + let mut digest = Vec::new(); + digest.extend_from_slice(randomness_output.as_ref()); + digest.extend_from_slice(subject); + let randomness = T::Hashing::hash(digest.as_slice()); + // TODO: Randomness Established at start of Epoch! This is nontrivial to implement + // because we need to map the start-of-epoch relayblock to its matching parablock + // in its current form block_number is meaningless and should not be relied upon + let randomness_established_at = 0u32.into(); + (randomness, randomness_established_at) + } + } +} diff --git a/pallets/randomness/src/mock.rs b/pallets/randomness/src/mock.rs new file mode 100644 index 0000000..15a1c76 --- /dev/null +++ b/pallets/randomness/src/mock.rs @@ -0,0 +1,134 @@ +//! A minimal runtime including the pallet-randomness pallet +use super::*; +use crate as pallet_randomness; +use frame_support::{ + construct_runtime, derive_impl, parameter_types, traits::Everything, weights::Weight, +}; +use sp_core::{H160, H256}; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, Perbill, +}; +use sp_std::convert::{TryFrom, TryInto}; + +pub type AccountId = H160; +pub type Balance = u128; + +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +construct_runtime!( + pub enum Test + { + System: frame_system, + Balances: pallet_balances, + Randomness: pallet_randomness, + } +); + +parameter_types! { + pub const BlockHashCount: u32 = 250; + pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0); + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const SS58Prefix: u8 = 42; +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Test { + type BaseCallFilter = Everything; + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type Nonce = u64; + type Block = Block; + type RuntimeCall = RuntimeCall; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = pallet_balances::AccountData; + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type BlockWeights = (); + type BlockLength = (); + type SS58Prefix = SS58Prefix; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const ExistentialDeposit: u128 = 1; +} +impl pallet_balances::Config for Test { + type MaxReserves = (); + type ReserveIdentifier = [u8; 4]; + type MaxLocks = (); + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = (); + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; + type FreezeIdentifier = (); + type MaxFreezes = frame_support::traits::ConstU32<1>; +} + +pub struct BabeDataGetter; +impl crate::GetBabeData> for BabeDataGetter { + fn get_epoch_index() -> u64 { + 10u64 + } + fn get_epoch_randomness() -> Option { + Some(H256::default()) + } +} + +parameter_types! { + pub const Deposit: u128 = 10; + pub const MaxRandomWords: u8 = 1; + pub const MinBlockDelay: u32 = 2; + pub const MaxBlockDelay: u32 = 20; +} +impl Config for Test { + type BabeDataGetter = BabeDataGetter; + type WeightInfo = (); +} + +/// Externality builder for pallet randomness mock runtime +#[derive(Default)] +pub(crate) struct ExtBuilder { + /// Balance amounts per AccountId + balances: Vec<(AccountId, Balance)>, +} + +impl ExtBuilder { + #[allow(dead_code)] + pub(crate) fn with_balances(mut self, balances: Vec<(AccountId, Balance)>) -> Self { + self.balances = balances; + self + } + + #[allow(dead_code)] + pub(crate) fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .expect("Frame system builds valid default genesis config"); + + pallet_balances::GenesisConfig:: { + balances: self.balances, + } + .assimilate_storage(&mut t) + .expect("Pallet balances storage can be assimilated"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} diff --git a/pallets/randomness/src/tests.rs b/pallets/randomness/src/tests.rs new file mode 100644 index 0000000..8a3fbb4 --- /dev/null +++ b/pallets/randomness/src/tests.rs @@ -0,0 +1,9 @@ +use crate::mock::*; + +#[test] +fn set_babe_randomness_results_is_mandatory() { + use frame_support::dispatch::{DispatchClass, GetDispatchInfo}; + + let info = crate::Call::::set_babe_randomness_results {}.get_dispatch_info(); + assert_eq!(info.class, DispatchClass::Mandatory); +} diff --git a/pallets/randomness/src/types.rs b/pallets/randomness/src/types.rs new file mode 100644 index 0000000..e38ef07 --- /dev/null +++ b/pallets/randomness/src/types.rs @@ -0,0 +1,37 @@ +use frame_support::pallet_prelude::*; + +#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[scale_info(skip_type_params(T))] +/// Shared request info, a subset of `RequestInfo` +pub enum RequestType { + /// Babe one epoch ago + BabeEpoch(u64), +} + +#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[scale_info(skip_type_params(T))] +/// Type of request +/// Represents a request for the most recent randomness at or after the inner first field +/// Expiration is second inner field +pub enum RequestInfo { + /// Babe one epoch ago + BabeEpoch(u64, u64), +} + +#[derive(PartialEq, Eq, Clone, Default, Encode, Decode, RuntimeDebug, TypeInfo)] +/// Raw randomness snapshot, the unique value for a `RequestType` in `RandomnessResults` map +pub struct RandomnessResult { + /// Randomness once available + pub randomness: Option, + /// Number of randomness requests for the type + pub request_count: u64, +} + +impl RandomnessResult { + pub fn new() -> RandomnessResult { + RandomnessResult { + randomness: None, + request_count: 1u64, + } + } +} diff --git a/pallets/randomness/src/weights.rs b/pallets/randomness/src/weights.rs new file mode 100644 index 0000000..46f6302 --- /dev/null +++ b/pallets/randomness/src/weights.rs @@ -0,0 +1,59 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for pallet_randomness. +pub trait WeightInfo { + fn set_babe_randomness_results() -> Weight; +} + +/// Weights for pallet_randomness using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: Randomness RelayEpoch (r:1 w:1) + /// Proof Skipped: Randomness RelayEpoch (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelayStateProof (r:1 w:0) + /// Proof Skipped: ParachainSystem RelayStateProof (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Randomness RandomnessResults (r:0 w:1) + /// Proof Skipped: Randomness RandomnessResults (max_values: None, max_size: None, mode: Measured) + /// Storage: Randomness InherentIncluded (r:0 w:1) + /// Proof Skipped: Randomness InherentIncluded (max_values: Some(1), max_size: None, mode: Measured) + fn set_babe_randomness_results() -> Weight { + // Proof Size summary in bytes: + // Measured: `216` + // Estimated: `1701` + // Minimum execution time: 6_713_000 picoseconds. + Weight::from_parts(6_963_000, 1701) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: Randomness RelayEpoch (r:1 w:1) + /// Proof Skipped: Randomness RelayEpoch (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem ValidationData (r:1 w:0) + /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainSystem RelayStateProof (r:1 w:0) + /// Proof Skipped: ParachainSystem RelayStateProof (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Randomness RandomnessResults (r:0 w:1) + /// Proof Skipped: Randomness RandomnessResults (max_values: None, max_size: None, mode: Measured) + /// Storage: Randomness InherentIncluded (r:0 w:1) + /// Proof Skipped: Randomness InherentIncluded (max_values: Some(1), max_size: None, mode: Measured) + fn set_babe_randomness_results() -> Weight { + // Proof Size summary in bytes: + // Measured: `216` + // Estimated: `1701` + // Minimum execution time: 6_713_000 picoseconds. + Weight::from_parts(6_963_000, 1701) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } +} diff --git a/pallets/sequencer-grouping/Cargo.toml b/pallets/sequencer-grouping/Cargo.toml index 5684bb1..64a2219 100644 --- a/pallets/sequencer-grouping/Cargo.toml +++ b/pallets/sequencer-grouping/Cargo.toml @@ -19,11 +19,15 @@ sp-runtime = { workspace = true, default-features = false } sp-std = { workspace = true, default-features = false } sp-core = { workspace = true, default-features = false } +# Local +pallet-randomness = { workspace = true, default-features = false } + [dev-dependencies] pallet-balances = { workspace = true, default-features = false, features = [ "insecure_zero_ed", "std" ] } sp-core = { workspace = true, default-features = false, features = [ "std" ] } sp-io = { workspace = true, default-features = false, features = [ "std" ] } sp-runtime = { workspace = true, default-features = false } +rand = { workspace = true } [features] default = [ "std" ] @@ -35,6 +39,7 @@ std = [ "scale-info/std", "sp-runtime/std", "sp-std/std", + "pallet-randomness/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks" ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/sequencer-grouping/src/lib.rs b/pallets/sequencer-grouping/src/lib.rs index f3b2b34..c3117fa 100644 --- a/pallets/sequencer-grouping/src/lib.rs +++ b/pallets/sequencer-grouping/src/lib.rs @@ -21,7 +21,6 @@ pub mod pallet { traits::{BuildGenesisConfig, Randomness}, }; use frame_system::pallet_prelude::*; - use sp_runtime::traits::Hash; use sp_std::vec::Vec; pub type RoundIndex = u32; @@ -35,7 +34,7 @@ pub mod pallet { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Type representing the weight of this pallet type WeightInfo: WeightInfo; - type Randomness: Randomness>; + type RandomnessSource: Randomness>; /// Maximum size of each sequencer group #[pallet::constant] @@ -164,27 +163,11 @@ pub mod pallet { } } - pub struct SimpleRandomness(PhantomData); - - impl Randomness> for SimpleRandomness { - fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { - let hash = T::Hashing::hash(subject); - let current_block = frame_system::Pallet::::block_number(); - (hash, current_block) - } - - fn random_seed() -> (T::Hash, BlockNumberFor) { - Self::random(b"seed") - } - } - impl Pallet { pub fn shuffle_accounts(mut accounts: Vec) -> Vec { - // let random_seed = Self::get_and_increment_nonce(); - let random_seed = frame_system::Pallet::::parent_hash().encode(); - // let random_value = T::Randomness::random(&random_seed); - // let random_value = ::decode(&mut random_value.0.as_ref()).unwrap_or(0); - let random_value = random_seed[0]; + let random_seed = b"shuffle_sequencers"; + let random_value = T::RandomnessSource::random(random_seed); + let random_value = ::decode(&mut random_value.0.as_ref()).unwrap_or(0); for i in (1..accounts.len()).rev() { let j: usize = (random_value as usize) % (i + 1); accounts.swap(i, j); diff --git a/pallets/sequencer-grouping/src/mock.rs b/pallets/sequencer-grouping/src/mock.rs index 345bce2..8c6afd0 100644 --- a/pallets/sequencer-grouping/src/mock.rs +++ b/pallets/sequencer-grouping/src/mock.rs @@ -1,8 +1,11 @@ +use std::marker::PhantomData; use crate as pallet_sequencer_grouping; +use crate::Config; use frame_support::{derive_impl, parameter_types, traits::Everything}; +use frame_system::pallet_prelude::BlockNumberFor; use sp_core::{ConstU32, H256}; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, IdentityLookup, Hash}, BuildStorage, }; @@ -49,12 +52,29 @@ impl frame_system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } -// impl pallet_insecure_randomness_collective_flip::Config for Test {} +// Randomness trait +pub struct TestRandomness { + _marker: PhantomData, +} +impl frame_support::traits::Randomness> +for TestRandomness +{ + fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { + use rand::{rngs::OsRng, RngCore}; + let mut digest: Vec<_> = [0u8; 32].into(); + OsRng.fill_bytes(&mut digest); + digest.extend_from_slice(subject); + let randomness = T::Hashing::hash(&digest); + // NOTE: Test randomness is always "fresh" assuming block_number is > DrawingFreezeout + let block_number = 0u32.into(); + (randomness, block_number) + } +} impl pallet_sequencer_grouping::Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - type Randomness = pallet_sequencer_grouping::SimpleRandomness; + type RandomnessSource = TestRandomness; type MaxGroupSize = ConstU32<5u32>; type MaxGroupNumber = ConstU32<10u32>; } diff --git a/pallets/sequencer-grouping/src/tests.rs b/pallets/sequencer-grouping/src/tests.rs index 9880386..6dbd422 100644 --- a/pallets/sequencer-grouping/src/tests.rs +++ b/pallets/sequencer-grouping/src/tests.rs @@ -97,20 +97,19 @@ fn trigger_group_works() { #[test] fn account_in_group_works() { new_test_ext().execute_with(|| { - System::set_block_number(10); - let parent_hash = H256::from_low_u64_be(12345); - frame_system::Pallet::::set_parent_hash(parent_hash); - assert_ok!(SequencerGrouping::set_group_metric(RuntimeOrigin::root(), 2, 3)); assert_ok!(SequencerGrouping::trigger_group(vec![1, 2, 3, 4, 5, 6], 1, 1)); println!("Group Members: {:?}", GroupMembers::::get()); - assert_eq!(SequencerGrouping::account_in_group(1), Ok(0)); - assert_eq!(SequencerGrouping::account_in_group(2), Ok(2)); - assert_eq!(SequencerGrouping::account_in_group(3), Ok(2)); - assert_eq!(SequencerGrouping::account_in_group(4), Ok(1)); - assert_eq!(SequencerGrouping::account_in_group(5), Ok(1)); - assert_eq!(SequencerGrouping::account_in_group(6), Ok(0)); + let mut all_members = Vec::new(); + for group in GroupMembers::::get().iter() { + assert_eq!(group.len(), 2); + for member in group { + assert!(!all_members.contains(member)); // Ensure no duplicate members in all groups + all_members.push(*member); + } + } + assert_eq!(all_members.len(), 6); }); } diff --git a/pallets/sequencer-staking/Cargo.toml b/pallets/sequencer-staking/Cargo.toml index f584801..2447590 100644 --- a/pallets/sequencer-staking/Cargo.toml +++ b/pallets/sequencer-staking/Cargo.toml @@ -40,7 +40,7 @@ sp-io = { workspace = true, default-features = false } sp-runtime = { workspace = true, default-features = false } popsicle-runtime = { workspace = true } similar-asserts = { workspace = true } - +rand = { workspace = true } [features] default = ["std"] diff --git a/pallets/sequencer-staking/src/mock.rs b/pallets/sequencer-staking/src/mock.rs index f5dcbd3..9891cef 100644 --- a/pallets/sequencer-staking/src/mock.rs +++ b/pallets/sequencer-staking/src/mock.rs @@ -1,4 +1,5 @@ use crate as pallet_sequencer_staking; +use crate::Config; use crate::SEQUENCER_LOCK_ID; use frame_support::{ derive_impl, @@ -17,7 +18,7 @@ use frame_system::pallet_prelude::BlockNumberFor; use popsicle_runtime::POPS; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, + traits::{BlakeTwo256, IdentityLookup, Hash}, BuildStorage, Perbill, }; use std::marker::PhantomData; @@ -126,10 +127,29 @@ impl pallet_assets::Config for Test { type BenchmarkHelper = (); } +// Randomness trait +pub struct TestRandomness { + _marker: PhantomData, +} +impl frame_support::traits::Randomness> +for TestRandomness +{ + fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { + use rand::{rngs::OsRng, RngCore}; + let mut digest: Vec<_> = [0u8; 32].into(); + OsRng.fill_bytes(&mut digest); + digest.extend_from_slice(subject); + let randomness = T::Hashing::hash(&digest); + // NOTE: Test randomness is always "fresh" assuming block_number is > DrawingFreezeout + let block_number = 0u32.into(); + (randomness, block_number) + } +} + impl pallet_sequencer_grouping::Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - type Randomness = pallet_sequencer_grouping::SimpleRandomness; + type RandomnessSource = TestRandomness; type MaxGroupSize = ConstU32<5u32>; type MaxGroupNumber = ConstU32<10u32>; } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index cb308e7..2026e05 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -87,6 +87,7 @@ parachains-common = { workspace = true, default-features = false } parachain-info = { workspace = true, default-features = false } # Local +pallet-randomness = { workspace = true, default-features = false } pallet-sequencer-grouping ={ workspace = true, default-features = false } pallet-sequencer-staking ={ workspace = true, default-features = false } pallet-container = { workspace = true , default-features = false } @@ -146,6 +147,7 @@ std = [ "xcm-builder/std", "xcm-executor/std", "xcm/std", + "pallet-randomness/std", "pallet-sequencer-grouping/std", "pallet-sequencer-staking/std", "pallet-container/std", @@ -177,6 +179,7 @@ runtime-benchmarks = [ "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", + "pallet-randomness/runtime-benchmarks", "pallet-sequencer-grouping/runtime-benchmarks", "pallet-sequencer-staking/runtime-benchmarks", "pallet-container/runtime-benchmarks" @@ -206,6 +209,7 @@ try-runtime = [ "parachain-info/try-runtime", "polkadot-runtime-common/try-runtime", "sp-runtime/try-runtime", + "pallet-randomness/try-runtime", "pallet-sequencer-grouping/try-runtime", "pallet-sequencer-staking/try-runtime", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index b709381..44f9a62 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,7 +17,7 @@ use frame_system::EnsureSigned; use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; use smallvec::smallvec; use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata, Get}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, @@ -49,7 +49,8 @@ use frame_system::{ EnsureRoot, }; pub use pallet_container; -use pallet_sequencer_grouping::SimpleRandomness; +use pallet_randomness; +use pallet_sequencer_grouping; use pallet_sequencer_staking::WeightInfo; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; @@ -571,12 +572,65 @@ impl pallet_sequencer_staking::Config for Runtime { type WeightInfo = (); } +/// Only callable after `set_validation_data` is called which forms this proof the same way +fn relay_chain_state_proof() -> cumulus_pallet_parachain_system::RelayChainStateProof { + let relay_storage_root = ParachainSystem::validation_data() + .expect("set in `set_validation_data`") + .relay_parent_storage_root; + let relay_chain_state = + ParachainSystem::relay_state_proof().expect("set in `set_validation_data`"); + cumulus_pallet_parachain_system::RelayChainStateProof::new( + ParachainInfo::get(), + relay_storage_root, + relay_chain_state, + ) + .expect("Invalid relay chain state proof, already constructed in `set_validation_data`") +} + +pub struct BabeDataGetter; +impl pallet_randomness::GetBabeData> for BabeDataGetter { + // Tolerate panic here because only ever called in inherent (so can be omitted) + fn get_epoch_index() -> u64 { + if cfg!(feature = "runtime-benchmarks") { + // storage reads as per actual reads + let _relay_storage_root = ParachainSystem::validation_data(); + let _relay_chain_state = ParachainSystem::relay_state_proof(); + const BENCHMARKING_NEW_EPOCH: u64 = 10u64; + return BENCHMARKING_NEW_EPOCH; + } + relay_chain_state_proof() + .read_optional_entry(cumulus_primitives_core::relay_chain::well_known_keys::EPOCH_INDEX) + .ok() + .flatten() + .expect("expected to be able to read epoch index from relay chain state proof") + } + fn get_epoch_randomness() -> Option { + if cfg!(feature = "runtime-benchmarks") { + // storage reads as per actual reads + let _relay_storage_root = ParachainSystem::validation_data(); + let _relay_chain_state = ParachainSystem::relay_state_proof(); + let benchmarking_babe_output = Hash::default(); + return Some(benchmarking_babe_output); + } + relay_chain_state_proof() + .read_optional_entry( + cumulus_primitives_core::relay_chain::well_known_keys::ONE_EPOCH_AGO_RANDOMNESS, + ) + .ok() + .flatten() + } +} +impl pallet_randomness::Config for Runtime { + type BabeDataGetter = BabeDataGetter; + type WeightInfo = pallet_randomness::weights::SubstrateWeight; +} + impl pallet_sequencer_grouping::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = pallet_sequencer_grouping::weights::SubstrateWeight; type MaxGroupSize = ConstU32<100>; type MaxGroupNumber = ConstU32<100>; - type Randomness = SimpleRandomness; + type RandomnessSource = pallet_randomness::Pallet; } parameter_types! { @@ -633,6 +687,8 @@ construct_runtime!( // Popsicle pallets. SequencerStaking: pallet_sequencer_staking = 40, SequencerGroupingPallet: pallet_sequencer_grouping = 41, + RandomnessSource: pallet_randomness::{Pallet, Call, Storage, Inherent} = 42, + ContainerPallet:pallet_container = 51, } ); From f32c6c7a44ca7d2f0cd631df992f56830c4c1024 Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Mon, 20 May 2024 15:15:53 +0800 Subject: [PATCH 2/6] fix sequencer-staking-pallet cargo.toml --- pallets/sequencer-staking/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/sequencer-staking/Cargo.toml b/pallets/sequencer-staking/Cargo.toml index 2447590..92f4f56 100644 --- a/pallets/sequencer-staking/Cargo.toml +++ b/pallets/sequencer-staking/Cargo.toml @@ -65,6 +65,7 @@ std = [ "pallet-balances/std", "pallet-assets/std", "pallet-sequencer-grouping/std", + "popsicle-runtime/std", ] try-runtime = [ "frame-support/try-runtime", From a167b30f3898e4d092b7201536a266c3cb1064d8 Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Fri, 24 May 2024 18:04:29 +0800 Subject: [PATCH 3/6] add log --- pallets/randomness/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pallets/randomness/src/lib.rs b/pallets/randomness/src/lib.rs index 18efe4b..876bc0d 100644 --- a/pallets/randomness/src/lib.rs +++ b/pallets/randomness/src/lib.rs @@ -95,6 +95,7 @@ pub mod pallet { ensure_none(origin)?; let last_relay_epoch_index = >::get(); let relay_epoch_index = T::BabeDataGetter::get_epoch_index(); + log::info!("last relay epoch index: {:?}, current relay epoch index: {:?}", last_relay_epoch_index, relay_epoch_index); if relay_epoch_index > last_relay_epoch_index { // NOTE: Whether n = 1 or 2 depends on the trait implementation of BabeDataGetter let babe_n_epochs_ago_this_block = RequestType::BabeEpoch(relay_epoch_index); @@ -104,6 +105,8 @@ pub mod pallet { randomness: Some(randomness), }; >::insert(babe_n_epochs_ago_this_block, result); + log::info!("Successfully filled Babe randomness results for epoch {:?}", relay_epoch_index); + log::info!("Randomness: {:?}", randomness); } else { log::warn!( "Failed to fill BABE epoch randomness results \ From 822e1023256186b25e42e2b7268207595b5e6d76 Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Mon, 3 Jun 2024 17:19:22 +0800 Subject: [PATCH 4/6] add create_inherent_data_providers --- Cargo.lock | 1 + node/Cargo.toml | 1 + node/src/service.rs | 9 +++++++-- pallets/randomness/src/lib.rs | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90fb9f9..1e6cf26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8935,6 +8935,7 @@ dependencies = [ "futures", "jsonrpsee", "log", + "pallet-randomness", "pallet-transaction-payment-rpc", "parity-scale-codec", "polkadot-cli", diff --git a/node/Cargo.toml b/node/Cargo.toml index 8b6b13e..31bf20a 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -84,6 +84,7 @@ color-print = { workspace = true } # Local popsicle-runtime = { workspace = true } +pallet-randomness = { workspace = true } [build-dependencies] substrate-build-script-utils = { workspace = true } diff --git a/node/src/service.rs b/node/src/service.rs index 2908840..70d3d41 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -363,7 +363,8 @@ fn build_import_queue( block_import, move |_, _| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - Ok(timestamp) + let randomness = pallet_randomness::inherent::InherentDataProvider;; + Ok((timestamp, randomness)) }, slot_duration, &task_manager.spawn_essential_handle(), @@ -415,7 +416,11 @@ fn start_consensus( ); let params = BasicAuraParams { - create_inherent_data_providers: move |_, ()| async move { Ok(()) }, + create_inherent_data_providers: move |_, ()| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let randomness = pallet_randomness::inherent::InherentDataProvider;; + Ok((timestamp, randomness)) + }, block_import, para_client: client, relay_client: relay_chain_interface, diff --git a/pallets/randomness/src/lib.rs b/pallets/randomness/src/lib.rs index 876bc0d..5c874b6 100644 --- a/pallets/randomness/src/lib.rs +++ b/pallets/randomness/src/lib.rs @@ -33,7 +33,7 @@ pub mod weights; mod mock; #[cfg(test)] mod tests; -mod inherent; +pub mod inherent; /// Read babe randomness info from the relay chain state proof pub trait GetBabeData { From 2748ea9def340bbe934815af442364ae9c84eab7 Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Wed, 5 Jun 2024 18:20:38 +0800 Subject: [PATCH 5/6] change random seed to relay epoch index --- Cargo.lock | 484 +++++++++++++------------- node/src/chain_spec.rs | 2 +- pallets/randomness/src/lib.rs | 14 +- pallets/randomness/src/types.rs | 4 +- pallets/sequencer-grouping/src/lib.rs | 11 +- 5 files changed, 257 insertions(+), 258 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e6cf26..167ff1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.28.1", + "gimli 0.29.0", ] [[package]] @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -191,9 +191,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "approx" @@ -229,7 +229,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -457,16 +457,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite 0.2.14", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", @@ -509,17 +509,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.1", "rustix 0.38.34", "slab", "tracing", @@ -537,12 +537,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite 0.2.14", ] @@ -576,12 +576,12 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "329972aa325176e89114919f2a80fdae4f4c040f66a370b1a1159c6c0f94e7aa" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", @@ -606,7 +606,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -642,16 +642,16 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ - "addr2line 0.21.0", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.35.0", "rustc-demangle", ] @@ -737,7 +737,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -882,12 +882,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel 2.3.1", - "async-lock 3.3.0", "async-task", "futures-io", "futures-lite 2.3.0", @@ -1053,9 +1052,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -1184,9 +1183,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -1225,7 +1224,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -1273,7 +1272,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -1289,7 +1288,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ "strum 0.26.2", - "strum_macros 0.26.2", + "strum_macros 0.26.4", "unicode-width", ] @@ -1524,9 +1523,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -1561,9 +1560,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -1652,7 +1651,7 @@ dependencies = [ "cumulus-primitives-core", "futures", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1765,7 +1764,7 @@ dependencies = [ "futures", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-parachain-primitives", "polkadot-primitives", @@ -1929,7 +1928,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2145,7 +2144,7 @@ dependencies = [ "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", @@ -2269,7 +2268,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2309,7 +2308,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2326,7 +2325,7 @@ checksum = "928bc249a7e3cd554fd2e8e08a426e9670c50bbfc9a621653cfa9accc9641783" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2431,7 +2430,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2533,7 +2532,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2557,9 +2556,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.63", + "syn 2.0.66", "termcolor", - "toml 0.8.13", + "toml 0.8.14", "walkdir", ] @@ -2679,9 +2678,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -2747,7 +2746,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2758,7 +2757,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -2825,43 +2824,22 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.14", -] - -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite 0.2.14", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite 0.2.14", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.3.1", "pin-project-lite 0.2.14", ] @@ -2897,7 +2875,7 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3012,7 +2990,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "scale-info", ] @@ -3183,7 +3161,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3318,7 +3296,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3331,7 +3309,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3342,7 +3320,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3525,7 +3503,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -3677,6 +3655,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + [[package]] name = "glob" version = "0.3.1" @@ -3695,7 +3679,7 @@ dependencies = [ "futures-timer", "no-std-compat", "nonzero_ext", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "portable-atomic", "quanta", "rand", @@ -3943,9 +3927,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -4054,7 +4038,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "core-foundation", "fnv", "futures", @@ -4166,9 +4150,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -4350,7 +4334,7 @@ dependencies = [ "futures-util", "hyper", "jsonrpsee-types", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "rustc-hash", @@ -4392,7 +4376,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -4490,7 +4474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -4501,7 +4485,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rocksdb", "smallvec", @@ -4532,9 +4516,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -4626,7 +4610,7 @@ dependencies = [ "multihash 0.17.0", "multistream-select", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand", @@ -4646,7 +4630,7 @@ dependencies = [ "futures", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", "trust-dns-resolver", ] @@ -4808,7 +4792,7 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quinn-proto", "rand", "rustls 0.20.9", @@ -4924,7 +4908,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quicksink", "rw-stream-sink", "soketto", @@ -5020,9 +5004,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "pkg-config", @@ -5076,9 +5060,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lioness" @@ -5170,7 +5154,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -5184,7 +5168,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -5195,7 +5179,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -5206,7 +5190,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -5334,9 +5318,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -5368,7 +5352,7 @@ dependencies = [ "hashlink", "lioness", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "rand_chacha 0.3.1", "rand_distr", @@ -5633,11 +5617,10 @@ checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -5885,6 +5868,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -5935,7 +5927,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -7024,7 +7016,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -7343,7 +7335,7 @@ dependencies = [ "log", "lz4", "memmap2 0.5.10", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "siphasher", "snap", @@ -7408,9 +7400,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.10", @@ -7528,7 +7520,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -7569,7 +7561,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -7592,9 +7584,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -7851,7 +7843,7 @@ dependencies = [ "fatality", "futures", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -8211,7 +8203,7 @@ dependencies = [ "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-primitives", "sc-network", @@ -8344,7 +8336,7 @@ dependencies = [ "kvdb", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "polkadot-node-jaeger", "polkadot-node-metrics", @@ -8375,7 +8367,7 @@ dependencies = [ "futures", "futures-timer", "orchestra", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8611,7 +8603,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", @@ -8804,7 +8796,7 @@ dependencies = [ "polkavm-common 0.8.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -8816,7 +8808,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -8826,7 +8818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl 0.8.0", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -8836,7 +8828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -8878,9 +8870,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "5e6a007746f34ed64099e88783b0ae369eaa3da6392868ba262e2af9b8fbaea1" dependencies = [ "cfg-if", "concurrent-queue", @@ -9100,7 +9092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -9120,7 +9112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -9215,14 +9207,14 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -9237,7 +9229,7 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "thiserror", ] @@ -9249,7 +9241,7 @@ checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -9261,7 +9253,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -9276,12 +9268,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32445183788a6159990b6e44d9955d0d6c06b7b9384b4c3e9a0d152a1bf30d56" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.5", + "prost-derive 0.12.6", ] [[package]] @@ -9321,15 +9313,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -9619,7 +9611,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -10029,7 +10021,7 @@ dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -10066,7 +10058,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", "subtle 2.5.0", "zeroize", ] @@ -10133,9 +10125,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -10221,7 +10213,7 @@ dependencies = [ "multihash 0.18.1", "multihash-codetable", "parity-scale-codec", - "prost 0.12.5", + "prost 0.12.6", "prost-build", "rand", "sc-client-api", @@ -10311,7 +10303,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -10366,7 +10358,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -10398,7 +10390,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-state-db", "schnellru", @@ -10423,7 +10415,7 @@ dependencies = [ "libp2p-identity", "log", "mockall", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-utils", "serde", @@ -10481,7 +10473,7 @@ dependencies = [ "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -10540,7 +10532,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-network", @@ -10574,7 +10566,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-consensus-beefy", "sc-rpc", "serde", @@ -10614,7 +10606,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "sc-block-builder", "sc-chain-spec", @@ -10694,7 +10686,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b8f8ddc63df8219768b729f9098ecd4362d2756b40784071cd44c3041f1d51d" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", @@ -10747,7 +10739,7 @@ dependencies = [ "cfg-if", "libc", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rustix 0.36.17", "sc-allocator", "sc-executor-common", @@ -10781,7 +10773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ef7283da5d643ef89ed094e1b23451ec70386a9474d337cdaa0ef81870bb2d4" dependencies = [ "array-bytes 6.2.3", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "serde_json", "sp-application-crypto", "sp-core", @@ -10806,7 +10798,7 @@ dependencies = [ "mixnet", "multiaddr", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-network", "sc-transaction-pool-api", @@ -10840,7 +10832,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "partial_sort", "pin-project", "rand", @@ -10874,7 +10866,7 @@ dependencies = [ "futures", "libp2p-identity", "log", - "prost 0.12.5", + "prost 0.12.6", "prost-build", "sc-client-api", "sc-network", @@ -10934,7 +10926,7 @@ dependencies = [ "libp2p-identity", "log", "parity-scale-codec", - "prost 0.12.5", + "prost 0.12.6", "prost-build", "sc-client-api", "sc-network", @@ -10960,7 +10952,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "prost 0.12.5", + "prost 0.12.6", "prost-build", "sc-client-api", "sc-consensus", @@ -11019,7 +11011,7 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "sc-client-api", "sc-network", @@ -11056,7 +11048,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -11132,7 +11124,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "sc-chain-spec", "sc-client-api", @@ -11165,7 +11157,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "sc-chain-spec", @@ -11224,7 +11216,7 @@ checksum = "9863fb81595a25b908d7143c1a3e162d237e67890088363df4a121fe37c49d08" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", ] @@ -11294,7 +11286,7 @@ dependencies = [ "futures", "libp2p", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "sc-utils", @@ -11317,7 +11309,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rustc-hash", "sc-client-api", @@ -11344,7 +11336,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -11359,7 +11351,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -11403,7 +11395,7 @@ dependencies = [ "futures-timer", "lazy_static", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "sp-arithmetic", ] @@ -11611,9 +11603,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -11629,13 +11621,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -11954,7 +11946,7 @@ dependencies = [ "log", "lru 0.11.1", "no-std-net", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "rand_chacha 0.3.1", @@ -12062,7 +12054,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -12129,7 +12121,7 @@ dependencies = [ "futures", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "schnellru", "sp-api", "sp-consensus", @@ -12271,7 +12263,7 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "paste", "primitive-types", "rand", @@ -12316,7 +12308,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -12326,7 +12318,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -12337,7 +12329,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -12424,7 +12416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbab8b61bd61d5f8625a0c75753b5d5a23be55d3445419acd42caf59cf6236b" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", "sp-externalities", ] @@ -12587,7 +12579,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -12630,7 +12622,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "smallvec", "sp-core", @@ -12754,7 +12746,7 @@ dependencies = [ "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "scale-info", "schnellru", @@ -12794,7 +12786,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13052,15 +13044,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13162,7 +13154,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.13", + "toml 0.8.14", "walkdir", "wasm-opt", ] @@ -13198,9 +13190,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.63" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -13297,9 +13289,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] @@ -13321,18 +13313,18 @@ checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13451,16 +13443,16 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite 0.2.14", "signal-hook-registry", "socket2 0.5.7", @@ -13470,13 +13462,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13558,14 +13550,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -13601,15 +13593,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.11", ] [[package]] @@ -13677,7 +13669,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13722,7 +13714,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -13828,7 +13820,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "resolv-conf", "smallvec", "thiserror", @@ -13951,9 +13943,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -14038,9 +14030,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -14127,7 +14119,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -14161,7 +14153,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14648,9 +14640,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.19" +version = "0.7.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab6594190de06d718a5dbc5fa781ab62f8903797056480e549ca74add6b7065" +checksum = "2c5cb32c74fe55350a3272ba792f050613e692253ae0d89ad5d83eb0dcea15e1" dependencies = [ "bytemuck", "safe_arch", @@ -14937,9 +14929,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d" dependencies = [ "memchr", ] @@ -15013,7 +15005,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] @@ -15025,7 +15017,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "static_assertions", ] @@ -15056,14 +15048,14 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -15076,7 +15068,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.63", + "syn 2.0.66", ] [[package]] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 7a99942..25cac99 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -226,7 +226,7 @@ fn testnet_genesis( "sequencerStaking": { "candidates": vec![alice, bob], "sequencerCommission": Perbill::from_percent(5), - "blocksPerRound": 1440, + "blocksPerRound": 10, // "numSelectedCandidates": 2, "delegations": Vec::<(AccountId, AccountId, u128)>::new(), } diff --git a/pallets/randomness/src/lib.rs b/pallets/randomness/src/lib.rs index 5c874b6..419f05a 100644 --- a/pallets/randomness/src/lib.rs +++ b/pallets/randomness/src/lib.rs @@ -50,7 +50,7 @@ pub mod pallet { use sp_runtime::traits::Hash; use sp_std::convert::TryInto; #[pallet::pallet] - #[pallet::without_storage_info] + // #[pallet::without_storage_info] pub struct Pallet(PhantomData); /// Configuration trait of this pallet. @@ -69,7 +69,11 @@ pub mod pallet { /// Relay epoch #[pallet::storage] #[pallet::getter(fn relay_epoch)] - pub(crate) type RelayEpoch = StorageValue<_, u64, ValueQuery>; + pub type RelayEpoch = StorageValue<_, u64, ValueQuery>; + + // #[pallet::storage] + // #[pallet::getter(fn latest_relay_epoch_requested)] + // pub type LatestRelayEpochRequested = StorageValue<_, u64, ValueQuery>; /// Ensures the mandatory inherent was included in the block #[pallet::storage] @@ -80,7 +84,7 @@ pub mod pallet { /// Removed once $value.request_count == 0 #[pallet::storage] #[pallet::getter(fn randomness_results)] - pub type RandomnessResults = + pub(crate) type RandomnessResults = StorageMap<_, Twox64Concat, RequestType, RandomnessResult>; #[pallet::call] @@ -162,7 +166,9 @@ pub mod pallet { impl frame_support::traits::Randomness> for Pallet { /// Uses the BABE randomness to generate a random seed. fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { - let relay_epoch_index = >::get(); + let mut relay_epoch_index_bytes = subject.clone(); + let relay_epoch_index = u64::decode(&mut relay_epoch_index_bytes).expect("Decoding failed"); + log::info!("input relay epoch index: {:?}", relay_epoch_index); let randomness_output = RandomnessResults::::get(RequestType::BabeEpoch(relay_epoch_index)) .unwrap_or_else(|| { diff --git a/pallets/randomness/src/types.rs b/pallets/randomness/src/types.rs index e38ef07..4513d66 100644 --- a/pallets/randomness/src/types.rs +++ b/pallets/randomness/src/types.rs @@ -1,6 +1,6 @@ use frame_support::pallet_prelude::*; -#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Copy, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] /// Shared request info, a subset of `RequestInfo` pub enum RequestType { @@ -18,7 +18,7 @@ pub enum RequestInfo { BabeEpoch(u64, u64), } -#[derive(PartialEq, Eq, Clone, Default, Encode, Decode, RuntimeDebug, TypeInfo)] +#[derive(PartialEq, Eq, Clone, Default, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)] /// Raw randomness snapshot, the unique value for a `RequestType` in `RandomnessResults` map pub struct RandomnessResult { /// Randomness once available diff --git a/pallets/sequencer-grouping/src/lib.rs b/pallets/sequencer-grouping/src/lib.rs index c3117fa..c8777b6 100644 --- a/pallets/sequencer-grouping/src/lib.rs +++ b/pallets/sequencer-grouping/src/lib.rs @@ -30,7 +30,7 @@ pub mod pallet { pub struct Pallet(PhantomData); #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config + pallet_randomness::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// Type representing the weight of this pallet type WeightInfo: WeightInfo; @@ -125,7 +125,7 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::set_group_metric())] + #[pallet::weight(::WeightInfo::set_group_metric())] pub fn set_group_metric( origin: OriginFor, group_size: u32, @@ -143,7 +143,7 @@ pub mod pallet { //#[cfg(feature = "runtime-benchmarks")] #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::benchmark_trigger_group( + #[pallet::weight(::WeightInfo::benchmark_trigger_group( T::MaxGroupSize::get(), T::MaxGroupNumber::get() ))] @@ -165,8 +165,9 @@ pub mod pallet { impl Pallet { pub fn shuffle_accounts(mut accounts: Vec) -> Vec { - let random_seed = b"shuffle_sequencers"; - let random_value = T::RandomnessSource::random(random_seed); + // todo: the relay_epoch may change when the block is verified by the validator, which will cause the chain stalls + let relay_epoch = pallet_randomness::Pallet::::relay_epoch(); + let random_value = T::RandomnessSource::random(&relay_epoch.encode()); let random_value = ::decode(&mut random_value.0.as_ref()).unwrap_or(0); for i in (1..accounts.len()).rev() { let j: usize = (random_value as usize) % (i + 1); From da7fe3b57026e2524ebe327b6e4aac861e14809d Mon Sep 17 00:00:00 2001 From: usherasnick <461826470@qq.com> Date: Thu, 6 Jun 2024 21:46:23 +0800 Subject: [PATCH 6/6] WIP: local-vrf --- Cargo.lock | 3 +++ node/src/service.rs | 7 +++++-- pallets/randomness/Cargo.toml | 3 +++ pallets/randomness/src/inherent.rs | 27 ++++++++++++++++++++++----- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 167ff1e..cf667fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6780,11 +6780,14 @@ dependencies = [ "log", "pallet-balances", "parity-scale-codec", + "sc-executor", + "sc-service", "scale-info", "serde", "sp-core", "sp-inherents", "sp-io", + "sp-keystore", "sp-runtime", "sp-std", ] diff --git a/node/src/service.rs b/node/src/service.rs index 70d3d41..30eb2a3 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -416,9 +416,12 @@ fn start_consensus( ); let params = BasicAuraParams { - create_inherent_data_providers: move |_, ()| async move { + create_inherent_data_providers: move |parent_header, inherent_data| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let randomness = pallet_randomness::inherent::InherentDataProvider;; + let randomness = pallet_randomness::inherent::InherentDataProvider { + client: client.clone(), + keystore: keystore.clone(), + };; Ok((timestamp, randomness)) }, block_import, diff --git a/pallets/randomness/Cargo.toml b/pallets/randomness/Cargo.toml index 5438ed8..d677b02 100644 --- a/pallets/randomness/Cargo.toml +++ b/pallets/randomness/Cargo.toml @@ -19,8 +19,11 @@ hex = { workspace = true } log = { workspace = true } scale-info = { workspace = true } serde = { workspace = true, optional = true } +sc-executor = { workspace = true } +sc-service = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } +sp-keystore = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } sp-inherents = { workspace = true } diff --git a/pallets/randomness/src/inherent.rs b/pallets/randomness/src/inherent.rs index a6db988..a0c43c9 100644 --- a/pallets/randomness/src/inherent.rs +++ b/pallets/randomness/src/inherent.rs @@ -2,6 +2,18 @@ use codec::{Decode, Encode}; use sp_inherents::{Error, InherentData, InherentIdentifier, IsFatalError}; use sp_runtime::RuntimeString; +use sc_service::TFullClient; +use sc_executor::NativeElseWasmExecutor; +use sp_runtime::{generic, OpaqueExtrinsic}; +use sp_runtime::traits::BlakeTwo256; +use std::sync::Arc; +use sp_keystore::{Keystore, KeystorePtr}; + +pub type BlockNumber = u32; +pub type Header = generic::Header; +pub type Block = generic::Block; +type FullClient = +TFullClient>; #[derive(Encode)] #[cfg_attr(feature = "std", derive(Debug, Decode))] @@ -32,17 +44,22 @@ impl InherentError { } /// The InherentIdentifier to set the babe randomness results -pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"baberand"; +pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"vrf-rand"; -/// A bare minimum inherent data provider that provides no real data. -/// The inherent is simply used as a way to kick off some computation -/// until https://github.com/paritytech/substrate/pull/10128 lands. -pub struct InherentDataProvider; +pub struct InherentDataProvider +where + RuntimeApi: Send + Sync, + Executor: sc_executor::NativeExecutionDispatch + 'static, +{ + pub client: Arc>, + pub keystore: Arc, +} #[cfg(feature = "std")] #[async_trait::async_trait] impl sp_inherents::InherentDataProvider for InherentDataProvider { async fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + inherent_data.put_data(INHERENT_IDENTIFIER, &()) }