From 9981d06f838025fd4df468ecb372ccabf3efdfab Mon Sep 17 00:00:00 2001 From: driemworks Date: Wed, 26 Feb 2025 14:04:19 -0600 Subject: [PATCH 01/21] migrate test modules --- Cargo.lock | 6505 +++++++++++++++-- Cargo.toml | 67 +- client/consensus/randomness-beacon/Cargo.toml | 17 +- .../randomness-beacon/src/gossipsub.rs | 2 +- .../randomness-beacon/src/instant_seal.rs | 252 + client/consensus/randomness-beacon/src/lib.rs | 1 + test-utils/client/Cargo.toml | 42 + test-utils/client/src/client_ext.rs | 206 + test-utils/client/src/lib.rs | 450 ++ test-utils/runtime/Cargo.toml | 120 + test-utils/runtime/build.rs | 43 + test-utils/runtime/client/Cargo.toml | 28 + .../runtime/client/src/block_builder_ext.rs | 74 + test-utils/runtime/client/src/lib.rs | 214 + test-utils/runtime/client/src/trait_tests.rs | 546 ++ test-utils/runtime/res/README.md | 24 + .../runtime/res/default_genesis_config.json | 113 + .../default_genesis_config_incomplete.json | 99 + .../res/default_genesis_config_invalid.json | 113 + .../res/default_genesis_config_invalid_2.json | 113 + test-utils/runtime/src/extrinsic.rs | 228 + test-utils/runtime/src/genesismap.rs | 179 + test-utils/runtime/src/lib.rs | 1534 ++++ .../runtime/src/substrate_test_pallet.rs | 252 + .../runtime/transaction-pool/Cargo.toml | 27 + .../runtime/transaction-pool/src/lib.rs | 541 ++ 26 files changed, 11121 insertions(+), 669 deletions(-) create mode 100644 client/consensus/randomness-beacon/src/instant_seal.rs create mode 100644 test-utils/client/Cargo.toml create mode 100644 test-utils/client/src/client_ext.rs create mode 100644 test-utils/client/src/lib.rs create mode 100644 test-utils/runtime/Cargo.toml create mode 100644 test-utils/runtime/build.rs create mode 100644 test-utils/runtime/client/Cargo.toml create mode 100644 test-utils/runtime/client/src/block_builder_ext.rs create mode 100644 test-utils/runtime/client/src/lib.rs create mode 100644 test-utils/runtime/client/src/trait_tests.rs create mode 100644 test-utils/runtime/res/README.md create mode 100644 test-utils/runtime/res/default_genesis_config.json create mode 100644 test-utils/runtime/res/default_genesis_config_incomplete.json create mode 100644 test-utils/runtime/res/default_genesis_config_invalid.json create mode 100644 test-utils/runtime/res/default_genesis_config_invalid_2.json create mode 100644 test-utils/runtime/src/extrinsic.rs create mode 100644 test-utils/runtime/src/genesismap.rs create mode 100644 test-utils/runtime/src/lib.rs create mode 100644 test-utils/runtime/src/substrate_test_pallet.rs create mode 100644 test-utils/runtime/transaction-pool/Cargo.toml create mode 100644 test-utils/runtime/transaction-pool/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 718bd81..9fcbb0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,13 +12,22 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.3", +] + [[package]] name = "addr2line" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", ] [[package]] @@ -34,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -44,7 +53,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher", + "cipher 0.4.4", "cpufeatures", ] @@ -56,10 +65,21 @@ checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", "aes", - "cipher", + "cipher 0.4.4", "ctr", "ghash", - "subtle", + "subtle 2.6.1", +] + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "version_check", ] [[package]] @@ -90,6 +110,36 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + [[package]] name = "anyhow" version = "1.0.96" @@ -396,14 +446,30 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive 0.4.0", + "asn1-rs-impl 0.1.0", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror 1.0.69", + "time", +] + [[package]] name = "asn1-rs" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", + "asn1-rs-derive 0.5.1", + "asn1-rs-impl 0.2.0", "displaydoc", "nom", "num-traits", @@ -412,6 +478,34 @@ dependencies = [ "time", ] +[[package]] +name = "asn1-rs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607495ec7113b178fbba7a6166a27f99e774359ef4823adbefd756b5b81d7970" +dependencies = [ + "asn1-rs-derive 0.6.0", + "asn1-rs-impl 0.2.0", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror 2.0.11", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + [[package]] name = "asn1-rs-derive" version = "0.5.1" @@ -421,7 +515,30 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure", + "synstructure 0.13.1", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", + "synstructure 0.13.1", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -435,6 +552,12 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + [[package]] name = "async-channel" version = "1.9.0" @@ -510,7 +633,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix", + "rustix 0.38.44", "slab", "tracing", "windows-sys 0.59.0", @@ -553,7 +676,7 @@ dependencies = [ "cfg-if", "event-listener 5.4.0", "futures-lite", - "rustix", + "rustix 0.38.44", "tracing", ] @@ -580,7 +703,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix", + "rustix 0.38.44", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -623,9 +746,9 @@ dependencies = [ "async-trait", "futures-io", "futures-util", - "hickory-resolver", + "hickory-resolver 0.25.0-alpha.5", "pin-utils", - "socket2", + "socket2 0.5.8", ] [[package]] @@ -645,6 +768,19 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "asynchronous-codec" version = "0.7.0" @@ -687,11 +823,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -714,6 +850,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "base64" version = "0.22.1" @@ -737,6 +879,28 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bip39" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "bitcoin-internals" version = "0.2.0" @@ -777,6 +941,18 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + [[package]] name = "blake2" version = "0.10.6" @@ -797,13 +973,37 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e90f7deecfac93095eb874a40febd69427776e24e1bd7f87f33ac62d6f0174df" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -812,7 +1012,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -828,6 +1028,18 @@ dependencies = [ "piper", ] +[[package]] +name = "bounded-collections" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "bounded-collections" version = "0.2.3" @@ -849,6 +1061,15 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -861,6 +1082,12 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + [[package]] name = "bytemuck" version = "1.21.0" @@ -879,12 +1106,56 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher 0.2.5", + "ppv-lite86", +] + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.25", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "cc" version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -903,12 +1174,28 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" +dependencies = [ + "byteorder", + "keystream", +] + [[package]] name = "chacha20" version = "0.9.1" @@ -916,7 +1203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher", + "cipher 0.4.4", "cpufeatures", ] @@ -928,45 +1215,156 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20", - "cipher", + "cipher 0.4.4", "poly1305", "zeroize", ] [[package]] -name = "cipher" -version = "0.4.4" +name = "chrono" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ - "crypto-common", - "inout", - "zeroize", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.6", ] [[package]] -name = "common-path" -version = "1.0.0" +name = "cid" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" +dependencies = [ + "core2", + "multibase", + "multihash 0.17.0", + "serde", + "unsigned-varint 0.7.2", +] [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "cid" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" dependencies = [ - "crossbeam-utils", + "core2", + "multibase", + "multihash 0.18.1", + "serde", + "unsigned-varint 0.7.2", ] [[package]] -name = "const-oid" -version = "0.9.6" +name = "cipher" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] [[package]] -name = "const-random" +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "clap" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +dependencies = [ + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width 0.1.14", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-hex" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" @@ -1033,6 +1431,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1048,6 +1456,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1057,6 +1474,113 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-bforest" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-entity", + "cranelift-isle", + "gimli 0.27.3", + "hashbrown 0.13.2", + "log", + "regalloc2 0.6.1", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" + +[[package]] +name = "cranelift-entity" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +dependencies = [ + "serde", +] + +[[package]] +name = "cranelift-frontend" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" + +[[package]] +name = "cranelift-native" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.5", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.14" @@ -1103,9 +1627,9 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", + "subtle 2.6.1", "zeroize", ] @@ -1115,19 +1639,39 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "generic-array 0.12.4", + "subtle 1.0.0", +] + [[package]] name = "crypto-mac" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array", - "subtle", + "generic-array 0.14.7", + "subtle 2.6.1", +] + +[[package]] +name = "crypto-mac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" +dependencies = [ + "generic-array 0.14.7", + "subtle 2.6.1", ] [[package]] @@ -1136,7 +1680,20 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher", + "cipher 0.4.4", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle 2.6.1", + "zeroize", ] [[package]] @@ -1151,7 +1708,7 @@ dependencies = [ "digest 0.10.7", "fiat-crypto", "rustc_version", - "subtle", + "subtle 2.6.1", "zeroize", ] @@ -1166,6 +1723,78 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "cxx" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bc580dceb395cae0efdde0a88f034cfd8a276897e40c693a7b87bed17971d33" +dependencies = [ + "cc", + "cxxbridge-cmd", + "cxxbridge-flags", + "cxxbridge-macro", + "foldhash", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49d8c1baedad72a7efda12ad8d7ad687b3e7221dfb304a12443fd69e9de8bb30" +dependencies = [ + "cc", + "codespan-reporting", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.98", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43afb0e3b2ef293492a31ecd796af902112460d53e5f923f7804f348a769f9c" +dependencies = [ + "clap", + "codespan-reporting", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0257ad2096a2474fe877e9e055ab69603851c3d6b394efcc7e0443899c2492ce" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46cbd7358a46b760609f1cb5093683328e58ca50e594a308716f5403fdc03e5" +dependencies = [ + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.98", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", +] + [[package]] name = "data-encoding" version = "2.8.0" @@ -1202,13 +1831,41 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs 0.5.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "der-parser" version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "der-parser" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" +dependencies = [ + "asn1-rs 0.7.0", "displaydoc", "nom", "num-bigint", @@ -1280,13 +1937,28 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1298,23 +1970,65 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle", + "subtle 2.6.1", ] [[package]] -name = "displaydoc" -version = "0.2.5" +name = "directories" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", + "dirs-sys", ] [[package]] -name = "docify" -version = "0.2.9" +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "docify" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" dependencies = [ @@ -1335,10 +2049,16 @@ dependencies = [ "regex", "syn 2.0.98", "termcolor", - "toml", + "toml 0.8.20", "walkdir", ] +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "dtoa" version = "1.0.9" @@ -1403,12 +2123,26 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.3", "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle", + "subtle 2.6.1", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", "zeroize", ] @@ -1418,7 +2152,7 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.3", "ed25519", "hashbrown 0.14.5", "hex", @@ -1443,28 +2177,59 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array", + "generic-array 0.14.7", "group", "pkcs8", "rand_core 0.6.4", "sec1", "serdect", - "subtle", + "subtle 2.6.1", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "enum-as-inner" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "enum-as-inner" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.98", ] +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "environmental" version = "1.1.4" @@ -1514,13 +2279,22 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "exit-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" +dependencies = [ + "futures", +] + [[package]] name = "expander" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ - "blake2", + "blake2 0.10.6", "file-guard", "fs-err", "prettyplease", @@ -1529,6 +2303,18 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "2.3.0" @@ -1542,7 +2328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle", + "subtle 2.6.1", ] [[package]] @@ -1561,6 +2347,44 @@ dependencies = [ "winapi", ] +[[package]] +name = "file-per-thread-logger" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[package]] +name = "finality-grandpa" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc" +dependencies = [ + "either", + "futures", + "futures-timer", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.3", + "scale-info", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1579,6 +2403,15 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1591,6 +2424,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +[[package]] +name = "fork-tree" +version = "13.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6736bef9fd175fafbb97495565456651c43ccac2ae550faee709e11534e3621" +dependencies = [ + "parity-scale-codec", +] + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1601,46 +2443,37 @@ dependencies = [ ] [[package]] -name = "frame-benchmarking" -version = "38.0.0" +name = "forwarded-header-value" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01bdd47c2d541b38bd892da647d1e972c9d85b4ecd7094ad64f7600175da54d" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ - "frame-support 38.2.0", - "frame-support-procedural 30.0.6", - "frame-system 38.0.0", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api 34.0.0", - "sp-application-crypto 38.0.0", - "sp-core 34.0.0", - "sp-io 38.0.0", - "sp-runtime 39.0.5", - "sp-runtime-interface 28.0.0", - "sp-storage 21.0.0", - "static_assertions", + "nonempty", + "thiserror 1.0.69", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "frame-benchmarking" version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c221b23f5cc5990830c4010bc01eac1cf401327e2bec362b0d28cb261809958" dependencies = [ - "frame-support 39.0.0", - "frame-support-procedural 31.0.1", - "frame-system 39.1.0", + "frame-support", + "frame-support-procedural", + "frame-system", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api 35.0.0", + "sp-api", "sp-application-crypto 39.0.0", "sp-core 35.0.0", "sp-io 39.0.0", @@ -1651,15 +2484,22 @@ dependencies = [ ] [[package]] -name = "frame-metadata" -version = "16.0.0" +name = "frame-executive" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" +checksum = "7c883a3f584c13832c6fa79f49ea19ae48694029408b0aa457da16424a2518e2" dependencies = [ - "cfg-if", + "aquamarine", + "frame-support", + "frame-system", + "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", - "serde", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-tracing 17.0.1", ] [[package]] @@ -1675,45 +2515,20 @@ dependencies = [ ] [[package]] -name = "frame-support" -version = "38.2.0" +name = "frame-metadata-hash-extension" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7dd8b9f161a8289e3b9fe6c1068519358dbff2270d38097a923d3d1b4459dca" +checksum = "014915e6982d15be6eedd8034daf020e62a057577f99d71e33ad2002367a35dc" dependencies = [ - "aquamarine", "array-bytes", - "bitflags 1.3.2", + "const-hex", "docify", - "environmental", - "frame-metadata 16.0.0", - "frame-support-procedural 30.0.6", - "impl-trait-for-tuples", - "k256", + "frame-support", + "frame-system", "log", - "macro_magic", "parity-scale-codec", - "paste", "scale-info", - "serde", - "serde_json", - "smallvec", - "sp-api 34.0.0", - "sp-arithmetic", - "sp-core 34.0.0", - "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-genesis-builder 0.15.1", - "sp-inherents 34.0.0", - "sp-io 38.0.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 39.0.5", - "sp-staking 36.0.0", - "sp-state-machine 0.43.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1", - "sp-weights", - "static_assertions", - "tt-call", + "sp-runtime 40.1.0", ] [[package]] @@ -1728,8 +2543,8 @@ dependencies = [ "bitflags 1.3.2", "docify", "environmental", - "frame-metadata 18.0.0", - "frame-support-procedural 31.0.1", + "frame-metadata", + "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", @@ -1740,17 +2555,17 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic", "sp-core 35.0.0", "sp-crypto-hashing-proc-macro", "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-genesis-builder 0.16.0", + "sp-genesis-builder", "sp-inherents 35.0.0", "sp-io 39.0.0", - "sp-metadata-ir 0.8.0", + "sp-metadata-ir", "sp-runtime 40.1.0", - "sp-staking 37.0.0", + "sp-staking", "sp-state-machine 0.44.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-tracing 17.0.1", @@ -1760,27 +2575,6 @@ dependencies = [ "tt-call", ] -[[package]] -name = "frame-support-procedural" -version = "30.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da784d943f2a945be923ab081a7c0837355b38045c50945d7ec1a138e2f3c52" -dependencies = [ - "Inflector", - "cfg-expr", - "derive-syn-parse", - "docify", - "expander", - "frame-support-procedural-tools", - "itertools 0.11.0", - "macro_magic", - "proc-macro-warning", - "proc-macro2", - "quote", - "sp-crypto-hashing", - "syn 2.0.98", -] - [[package]] name = "frame-support-procedural" version = "31.0.1" @@ -1795,7 +2589,7 @@ dependencies = [ "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", - "proc-macro-warning", + "proc-macro-warning 1.84.1", "proc-macro2", "quote", "sp-crypto-hashing", @@ -1809,7 +2603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", @@ -1828,44 +2622,46 @@ dependencies = [ [[package]] name = "frame-system" -version = "38.0.0" +version = "39.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7fa02f8c305496d2ae52edaecdb9d165f11afa965e05686d7d7dd1ce93611" +checksum = "b97b74455a72cc924b8b8e8a1dee05de90d3714d1723b0ff54b9e6976aa009ac" dependencies = [ "cfg-if", "docify", - "frame-support 38.2.0", + "frame-support", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 38.0.0", - "sp-runtime 39.0.5", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 37.0.0", + "sp-version", "sp-weights", ] [[package]] -name = "frame-system" -version = "39.1.0" +name = "frame-system-rpc-runtime-api" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97b74455a72cc924b8b8e8a1dee05de90d3714d1723b0ff54b9e6976aa009ac" +checksum = "9756d979251b162f1c9821a944b95e5fdd4d6c7aab8854a33b5820ce02a77af5" dependencies = [ - "cfg-if", "docify", - "frame-support 39.0.0", - "log", "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2224250e66348e71a952060f50b75bf02b7114241818602ccc46e0f905331193" +dependencies = [ + "frame-support", + "parity-scale-codec", + "sp-api", "sp-runtime 40.1.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 38.0.0", - "sp-weights", ] [[package]] @@ -1877,6 +2673,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "funty" version = "2.0.0" @@ -1898,6 +2704,16 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-bounded" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" +dependencies = [ + "futures-timer", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -1956,6 +2772,16 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "futures-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +dependencies = [ + "futures-io", + "rustls 0.21.12", +] + [[package]] name = "futures-rustls" version = "0.26.0" @@ -1963,7 +2789,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls", + "rustls 0.23.23", "rustls-pki-types", ] @@ -2004,7 +2830,16 @@ dependencies = [ ] [[package]] -name = "generator" +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generator" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" @@ -2016,6 +2851,15 @@ dependencies = [ "windows 0.58.0", ] +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -2068,10 +2912,31 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug", + "opaque-debug 0.3.1", "polyval", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +dependencies = [ + "fallible-iterator 0.2.0", + "indexmap 1.9.3", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] + [[package]] name = "gimli" version = "0.31.1" @@ -2090,6 +2955,26 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.3", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -2098,7 +2983,26 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle", + "subtle 2.6.1", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.7.1", + "slab", + "tokio", + "tokio-util", + "tracing", ] [[package]] @@ -2113,7 +3017,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.2.0", - "indexmap", + "indexmap 2.7.1", "slab", "tokio", "tokio-util", @@ -2141,13 +3045,22 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.11", ] [[package]] @@ -2156,7 +3069,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash", + "ahash 0.8.11", "allocator-api2", ] @@ -2171,6 +3084,15 @@ dependencies = [ "foldhash", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "hashlink" version = "0.9.1" @@ -2180,6 +3102,12 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -2225,6 +3153,30 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" +[[package]] +name = "hickory-proto" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 1.0.3", + "ipnet", + "once_cell", + "rand 0.8.5", + "thiserror 1.0.69", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-proto" version = "0.25.0-alpha.5" @@ -2235,15 +3187,15 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.6.1", "futures-channel", "futures-io", "futures-util", - "idna", + "idna 1.0.3", "ipnet", "once_cell", "rand 0.9.0", - "socket2", + "socket2 0.5.8", "thiserror 2.0.11", "tinyvec", "tokio", @@ -2251,6 +3203,27 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-resolver" +version = "0.24.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.24.4", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror 1.0.69", + "tokio", + "tracing", +] + [[package]] name = "hickory-resolver" version = "0.25.0-alpha.5" @@ -2259,11 +3232,11 @@ checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.25.0-alpha.5", "ipconfig", "moka", "once_cell", - "parking_lot", + "parking_lot 0.12.3", "rand 0.9.0", "resolv-conf", "smallvec", @@ -2287,7 +3260,17 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -2307,7 +3290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array", + "generic-array 0.14.7", "hmac 0.8.1", ] @@ -2344,6 +3327,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.1" @@ -2363,7 +3357,7 @@ dependencies = [ "bytes", "futures-util", "http 1.2.0", - "http-body", + "http-body 1.0.1", "pin-project-lite", ] @@ -2373,6 +3367,42 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.8", + "tokio", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.6.0" @@ -2382,10 +3412,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", + "h2 0.4.8", "http 1.2.0", - "http-body", + "http-body 1.0.1", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -2393,6 +3424,25 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", + "log", + "rustls 0.23.23", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.10" @@ -2403,15 +3453,38 @@ dependencies = [ "futures-channel", "futures-util", "http 1.2.0", - "http-body", - "hyper", + "http-body 1.0.1", + "hyper 1.6.0", "pin-project-lite", - "socket2", + "socket2 0.5.8", "tokio", "tower-service", "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -2534,6 +3607,27 @@ dependencies = [ name = "idn-traits" version = "0.0.1" +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "1.0.3" @@ -2572,7 +3666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ "async-io", - "core-foundation", + "core-foundation 0.9.4", "fnv", "futures", "if-addrs", @@ -2589,6 +3683,25 @@ dependencies = [ "windows 0.53.0", ] +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.12", + "hyper 0.14.32", + "log", + "rand 0.8.5", + "tokio", + "url", + "xmltree", +] + [[package]] name = "igd-next" version = "0.15.1" @@ -2601,7 +3714,7 @@ dependencies = [ "futures", "http 1.2.0", "http-body-util", - "hyper", + "hyper 1.6.0", "hyper-util", "log", "rand 0.8.5", @@ -2687,6 +3800,17 @@ dependencies = [ "quote", ] +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + [[package]] name = "indexmap" version = "2.7.1" @@ -2703,7 +3827,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array", + "generic-array 0.14.7", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", ] [[package]] @@ -2715,13 +3848,30 @@ dependencies = [ "num-traits", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ip_network" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" + [[package]] name = "ipconfig" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.8", "widestring", "windows-sys 0.48.0", "winreg", @@ -2733,6 +3883,17 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "is-terminal" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -2767,13 +3928,111 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] -name = "js-sys" -version = "0.3.77" +name = "jobserver" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ - "once_cell", - "wasm-bindgen", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.24.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "834af00800e962dee8f7bfc0f60601de215e73e78e5497d733a2919da837d3c8" +dependencies = [ + "jsonrpsee-core", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.24.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76637f6294b04e747d68e69336ef839a3493ca62b35bf488ead525f7da75c5bb" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "jsonrpsee-types", + "parking_lot 0.12.3", + "rand 0.8.5", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-proc-macros" +version = "0.24.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fcae0c6c159e11541080f1f829873d8f374f81eda0abc67695a13fc8dc1a580" +dependencies = [ + "heck 0.5.0", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.24.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66b7a3df90a1a60c3ed68e7ca63916b53e9afa928e33531e87f61a9c8e9ae87b" +dependencies = [ + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "route-recognizer", + "serde", + "serde_json", + "soketto", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.24.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddb81adb1a5ae9182df379e374a79e24e992334e7346af4d065ae5b2acb8d4c6" +dependencies = [ + "http 1.2.0", + "serde", + "serde_json", + "thiserror 1.0.69", ] [[package]] @@ -2799,6 +4058,12 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keystream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -2808,6 +4073,25 @@ dependencies = [ "log", ] +[[package]] +name = "kvdb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" +dependencies = [ + "smallvec", +] + +[[package]] +name = "kvdb-memorydb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" +dependencies = [ + "kvdb", + "parking_lot 0.12.3", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -2820,6 +4104,49 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libp2p" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" +dependencies = [ + "bytes", + "either", + "futures", + "futures-timer", + "getrandom 0.2.15", + "instant", + "libp2p-allow-block-list 0.2.0", + "libp2p-connection-limits 0.2.1", + "libp2p-core 0.40.1", + "libp2p-dns 0.40.1", + "libp2p-identify", + "libp2p-identity", + "libp2p-kad", + "libp2p-mdns 0.44.0", + "libp2p-metrics 0.13.1", + "libp2p-noise 0.43.2", + "libp2p-ping 0.43.1", + "libp2p-quic 0.9.3", + "libp2p-request-response", + "libp2p-swarm 0.43.7", + "libp2p-tcp 0.40.1", + "libp2p-upnp 0.1.1", + "libp2p-wasm-ext", + "libp2p-websocket 0.42.2", + "libp2p-yamux 0.44.1", + "multiaddr 0.18.2", + "pin-project", + "rw-stream-sink", + "thiserror 1.0.69", +] + [[package]] name = "libp2p" version = "0.55.0" @@ -2831,37 +4158,61 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.15", - "libp2p-allow-block-list", - "libp2p-connection-limits", - "libp2p-core", - "libp2p-dns", + "libp2p-allow-block-list 0.5.0", + "libp2p-connection-limits 0.5.0", + "libp2p-core 0.43.0", + "libp2p-dns 0.43.0", "libp2p-gossipsub", "libp2p-identity", - "libp2p-mdns", - "libp2p-metrics", - "libp2p-noise", - "libp2p-ping", - "libp2p-quic", - "libp2p-swarm", - "libp2p-tcp", - "libp2p-upnp", - "libp2p-websocket", - "libp2p-yamux", - "multiaddr", + "libp2p-mdns 0.47.0", + "libp2p-metrics 0.16.0", + "libp2p-noise 0.46.0", + "libp2p-ping 0.46.0", + "libp2p-quic 0.12.0", + "libp2p-swarm 0.46.0", + "libp2p-tcp 0.43.0", + "libp2p-upnp 0.4.0", + "libp2p-websocket 0.45.0", + "libp2p-yamux 0.47.0", + "multiaddr 0.18.2", "pin-project", "rw-stream-sink", "thiserror 2.0.11", ] +[[package]] +name = "libp2p-allow-block-list" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" +dependencies = [ + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "void", +] + [[package]] name = "libp2p-allow-block-list" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38944b7cb981cc93f2f0fb411ff82d0e983bd226fbcc8d559639a3a73236568b" dependencies = [ - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.46.0", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" +dependencies = [ + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "void", ] [[package]] @@ -2870,9 +4221,37 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efe9323175a17caa8a2ed4feaf8a548eeef5e0b72d03840a0eab4bcb0210ce1c" dependencies = [ - "libp2p-core", + "libp2p-core 0.43.0", + "libp2p-identity", + "libp2p-swarm 0.46.0", +] + +[[package]] +name = "libp2p-core" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", "libp2p-identity", - "libp2p-swarm", + "log", + "multiaddr 0.18.2", + "multihash 0.19.3", + "multistream-select", + "once_cell", + "parking_lot 0.12.3", + "pin-project", + "quick-protobuf", + "rand 0.8.5", + "rw-stream-sink", + "smallvec", + "thiserror 1.0.69", + "unsigned-varint 0.7.2", + "void", ] [[package]] @@ -2886,11 +4265,11 @@ dependencies = [ "futures", "futures-timer", "libp2p-identity", - "multiaddr", - "multihash", + "multiaddr 0.18.2", + "multihash 0.19.3", "multistream-select", "once_cell", - "parking_lot", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -2901,6 +4280,22 @@ dependencies = [ "web-time", ] +[[package]] +name = "libp2p-dns" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" +dependencies = [ + "async-trait", + "futures", + "libp2p-core 0.40.1", + "libp2p-identity", + "log", + "parking_lot 0.12.3", + "smallvec", + "trust-dns-resolver", +] + [[package]] name = "libp2p-dns" version = "0.43.0" @@ -2910,10 +4305,10 @@ dependencies = [ "async-std-resolver", "async-trait", "futures", - "hickory-resolver", - "libp2p-core", + "hickory-resolver 0.25.0-alpha.5", + "libp2p-core 0.43.0", "libp2p-identity", - "parking_lot", + "parking_lot 0.12.3", "smallvec", "tracing", ] @@ -2925,7 +4320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d558548fa3b5a8e9b66392f785921e363c57c05dcadfda4db0d41ae82d313e4a" dependencies = [ "async-channel 2.3.1", - "asynchronous-codec", + "asynchronous-codec 0.7.0", "base64 0.22.1", "byteorder", "bytes", @@ -2934,14 +4329,14 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.15", - "hashlink", + "hashlink 0.9.1", "hex_fmt", - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-identity", - "libp2p-swarm", - "prometheus-client", + "libp2p-swarm 0.46.0", + "prometheus-client 0.22.3", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1", "rand 0.8.5", "regex", "sha2 0.10.8", @@ -2949,6 +4344,29 @@ dependencies = [ "web-time", ] +[[package]] +name = "libp2p-identify" +version = "0.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" +dependencies = [ + "asynchronous-codec 0.6.2", + "either", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "log", + "lru", + "quick-protobuf", + "quick-protobuf-codec 0.2.0", + "smallvec", + "thiserror 1.0.69", + "void", +] + [[package]] name = "libp2p-identity" version = "0.2.10" @@ -2958,7 +4376,7 @@ dependencies = [ "bs58", "ed25519-dalek", "hkdf", - "multihash", + "multihash 0.19.3", "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", @@ -2967,6 +4385,56 @@ dependencies = [ "zeroize", ] +[[package]] +name = "libp2p-kad" +version = "0.44.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" +dependencies = [ + "arrayvec", + "asynchronous-codec 0.6.2", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "log", + "quick-protobuf", + "quick-protobuf-codec 0.2.0", + "rand 0.8.5", + "sha2 0.10.8", + "smallvec", + "thiserror 1.0.69", + "uint 0.9.5", + "unsigned-varint 0.7.2", + "void", +] + +[[package]] +name = "libp2p-mdns" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" +dependencies = [ + "data-encoding", + "futures", + "if-watch", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "log", + "rand 0.8.5", + "smallvec", + "socket2 0.5.8", + "tokio", + "trust-dns-proto 0.22.0", + "void", +] + [[package]] name = "libp2p-mdns" version = "0.47.0" @@ -2976,18 +4444,35 @@ dependencies = [ "async-io", "async-std", "futures", - "hickory-proto", + "hickory-proto 0.25.0-alpha.5", "if-watch", - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.46.0", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.5.8", "tokio", "tracing", ] +[[package]] +name = "libp2p-metrics" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" +dependencies = [ + "instant", + "libp2p-core 0.40.1", + "libp2p-identify", + "libp2p-identity", + "libp2p-kad", + "libp2p-ping 0.43.1", + "libp2p-swarm 0.43.7", + "once_cell", + "prometheus-client 0.21.2", +] + [[package]] name = "libp2p-metrics" version = "0.16.0" @@ -2995,104 +4480,242 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ce58c64292e87af624fcb86465e7dd8342e46a388d71e8fec0ab37ee789630a" dependencies = [ "futures", - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-gossipsub", "libp2p-identity", - "libp2p-ping", - "libp2p-swarm", + "libp2p-ping 0.46.0", + "libp2p-swarm 0.46.0", "pin-project", - "prometheus-client", + "prometheus-client 0.22.3", "web-time", ] [[package]] name = "libp2p-noise" -version = "0.46.0" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcc133e0f3cea07acde6eb8a9665cb11b600bd61110b010593a0210b8153b16" +checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" dependencies = [ - "asynchronous-codec", "bytes", + "curve25519-dalek 4.1.3", "futures", - "libp2p-core", + "libp2p-core 0.40.1", "libp2p-identity", - "multiaddr", - "multihash", + "log", + "multiaddr 0.18.2", + "multihash 0.19.3", "once_cell", "quick-protobuf", "rand 0.8.5", + "sha2 0.10.8", "snow", "static_assertions", - "thiserror 2.0.11", - "tracing", + "thiserror 1.0.69", "x25519-dalek", "zeroize", ] [[package]] -name = "libp2p-ping" +name = "libp2p-noise" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2529993ff22deb2504c0130a58b60fb77f036be555053922db1a0490b5798b" +checksum = "afcc133e0f3cea07acde6eb8a9665cb11b600bd61110b010593a0210b8153b16" dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", "futures", - "futures-timer", - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-identity", - "libp2p-swarm", + "multiaddr 0.18.2", + "multihash 0.19.3", + "once_cell", + "quick-protobuf", "rand 0.8.5", + "snow", + "static_assertions", + "thiserror 2.0.11", "tracing", - "web-time", + "x25519-dalek", + "zeroize", ] [[package]] -name = "libp2p-quic" -version = "0.12.0" +name = "libp2p-ping" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41432a159b00424a0abaa2c80d786cddff81055ac24aa127e0cf375f7858d880" +checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" dependencies = [ - "async-std", + "either", "futures", "futures-timer", - "if-watch", - "libp2p-core", + "instant", + "libp2p-core 0.40.1", "libp2p-identity", - "libp2p-tls", - "quinn", + "libp2p-swarm 0.43.7", + "log", "rand 0.8.5", - "ring 0.17.9", - "rustls", - "socket2", - "thiserror 2.0.11", - "tokio", - "tracing", + "void", ] [[package]] -name = "libp2p-swarm" +name = "libp2p-ping" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "803399b4b6f68adb85e63ab573ac568154b193e9a640f03e0f2890eabbcb37f8" +checksum = "7b2529993ff22deb2504c0130a58b60fb77f036be555053922db1a0490b5798b" dependencies = [ - "async-std", - "either", - "fnv", "futures", "futures-timer", - "libp2p-core", + "libp2p-core 0.43.0", "libp2p-identity", - "lru", - "multistream-select", - "once_cell", + "libp2p-swarm 0.46.0", "rand 0.8.5", - "smallvec", - "tokio", "tracing", "web-time", ] [[package]] -name = "libp2p-tcp" +name = "libp2p-quic" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +dependencies = [ + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-tls 0.2.1", + "log", + "parking_lot 0.12.3", + "quinn 0.10.2", + "rand 0.8.5", + "ring 0.16.20", + "rustls 0.21.12", + "socket2 0.5.8", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "libp2p-quic" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41432a159b00424a0abaa2c80d786cddff81055ac24aa127e0cf375f7858d880" +dependencies = [ + "async-std", + "futures", + "futures-timer", + "if-watch", + "libp2p-core 0.43.0", + "libp2p-identity", + "libp2p-tls 0.6.0", + "quinn 0.11.6", + "rand 0.8.5", + "ring 0.17.9", + "rustls 0.23.23", + "socket2 0.5.8", + "thiserror 2.0.11", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-request-response" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" +dependencies = [ + "async-trait", + "futures", + "instant", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm 0.43.7", + "log", + "rand 0.8.5", + "smallvec", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.43.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.40.1", + "libp2p-identity", + "libp2p-swarm-derive", + "log", + "multistream-select", + "once_cell", + "rand 0.8.5", + "smallvec", + "tokio", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803399b4b6f68adb85e63ab573ac568154b193e9a640f03e0f2890eabbcb37f8" +dependencies = [ + "async-std", + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-core 0.43.0", + "libp2p-identity", + "lru", + "multistream-select", + "once_cell", + "rand 0.8.5", + "smallvec", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" +dependencies = [ + "heck 0.4.1", + "proc-macro-warning 0.4.2", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "libp2p-tcp" +version = "0.40.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" +dependencies = [ + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core 0.40.1", + "libp2p-identity", + "log", + "socket2 0.5.8", + "tokio", +] + +[[package]] +name = "libp2p-tcp" version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65346fb4d36035b23fec4e7be4c320436ba53537ce9b6be1d1db1f70c905cad0" @@ -3102,12 +4725,31 @@ dependencies = [ "futures-timer", "if-watch", "libc", - "libp2p-core", - "socket2", + "libp2p-core 0.43.0", + "socket2 0.5.8", "tokio", "tracing", ] +[[package]] +name = "libp2p-tls" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" +dependencies = [ + "futures", + "futures-rustls 0.24.0", + "libp2p-core 0.40.1", + "libp2p-identity", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "thiserror 1.0.69", + "x509-parser 0.15.1", + "yasna", +] + [[package]] name = "libp2p-tls" version = "0.6.0" @@ -3115,18 +4757,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcaebc1069dea12c5b86a597eaaddae0317c2c2cb9ec99dc94f82fd340f5c78b" dependencies = [ "futures", - "futures-rustls", - "libp2p-core", + "futures-rustls 0.26.0", + "libp2p-core 0.43.0", "libp2p-identity", - "rcgen", + "rcgen 0.11.3", "ring 0.17.9", - "rustls", + "rustls 0.23.23", "rustls-webpki 0.101.7", "thiserror 2.0.11", - "x509-parser", + "x509-parser 0.16.0", "yasna", ] +[[package]] +name = "libp2p-upnp" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" +dependencies = [ + "futures", + "futures-timer", + "igd-next 0.14.3", + "libp2p-core 0.40.1", + "libp2p-swarm 0.43.7", + "log", + "tokio", + "void", +] + [[package]] name = "libp2p-upnp" version = "0.4.0" @@ -3135,13 +4793,48 @@ checksum = "d457b9ecceb66e7199f049926fad447f1f17f040e8d29d690c086b4cab8ed14a" dependencies = [ "futures", "futures-timer", - "igd-next", - "libp2p-core", - "libp2p-swarm", + "igd-next 0.15.1", + "libp2p-core 0.43.0", + "libp2p-swarm 0.46.0", "tokio", "tracing", ] +[[package]] +name = "libp2p-wasm-ext" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e5d8e3a9e07da0ef5b55a9f26c009c8fb3c725d492d8bb4b431715786eea79c" +dependencies = [ + "futures", + "js-sys", + "libp2p-core 0.40.1", + "send_wrapper", + "wasm-bindgen", + "wasm-bindgen-futures", +] + +[[package]] +name = "libp2p-websocket" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538" +dependencies = [ + "either", + "futures", + "futures-rustls 0.24.0", + "libp2p-core 0.40.1", + "libp2p-identity", + "log", + "parking_lot 0.12.3", + "pin-project-lite", + "rw-stream-sink", + "soketto", + "thiserror 1.0.69", + "url", + "webpki-roots", +] + [[package]] name = "libp2p-websocket" version = "0.45.0" @@ -3150,10 +4843,10 @@ checksum = "2bf5d48a4d8fad8a49fbf23816a878cac25623549f415d74da8ef4327e6196a9" dependencies = [ "either", "futures", - "futures-rustls", - "libp2p-core", + "futures-rustls 0.26.0", + "libp2p-core 0.43.0", "libp2p-identity", - "parking_lot", + "parking_lot 0.12.3", "pin-project-lite", "rw-stream-sink", "soketto", @@ -3163,6 +4856,19 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "libp2p-yamux" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" +dependencies = [ + "futures", + "libp2p-core 0.40.1", + "log", + "thiserror 1.0.69", + "yamux 0.12.1", +] + [[package]] name = "libp2p-yamux" version = "0.47.0" @@ -3171,13 +4877,24 @@ checksum = "f15df094914eb4af272acf9adaa9e287baa269943f32ea348ba29cfb9bfc60d8" dependencies = [ "either", "futures", - "libp2p-core", + "libp2p-core 0.43.0", "thiserror 2.0.11", "tracing", "yamux 0.12.1", "yamux 0.13.4", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.8.0", + "libc", + "redox_syscall 0.5.8", +] + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -3205,7 +4922,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle", + "subtle 2.6.1", ] [[package]] @@ -3226,6 +4943,30 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "link-cplusplus" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linked_hash_set" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "linregress" version = "0.5.4" @@ -3235,18 +4976,87 @@ dependencies = [ "nalgebra", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "linux-raw-sys" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "lioness" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" +dependencies = [ + "arrayref", + "blake2 0.8.1", + "chacha", + "keystream", +] + [[package]] name = "litemap" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +[[package]] +name = "litep2p" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a3d13ee6af6f01bb2093aa6d5f29b79ede7de6277e5d0394e8f5d8eaa5a86" +dependencies = [ + "async-trait", + "bs58", + "bytes", + "cid 0.10.1", + "ed25519-dalek", + "futures", + "futures-timer", + "hex-literal", + "hickory-resolver 0.24.4", + "indexmap 2.7.1", + "libc", + "mockall 0.13.1", + "multiaddr 0.17.1", + "multihash 0.17.0", + "network-interface", + "parking_lot 0.12.3", + "pin-project", + "prost 0.12.6", + "prost-build", + "rand 0.8.5", + "rcgen 0.10.0", + "ring 0.16.20", + "rustls 0.20.9", + "serde", + "sha2 0.10.8", + "simple-dns", + "smallvec", + "snow", + "socket2 0.5.8", + "thiserror 2.0.11", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tokio-util", + "tracing", + "uint 0.10.0", + "unsigned-varint 0.8.0", + "url", + "x25519-dalek", + "x509-parser 0.17.0", + "yamux 0.13.4", + "yasna", + "zeroize", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -3276,7 +5086,7 @@ dependencies = [ "generator", "scoped-tls", "tracing", - "tracing-subscriber", + "tracing-subscriber 0.3.19", ] [[package]] @@ -3289,36 +5099,73 @@ dependencies = [ ] [[package]] -name = "macro_magic" -version = "0.5.1" +name = "lru-cache" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" dependencies = [ - "macro_magic_core", - "macro_magic_macros", - "quote", - "syn 2.0.98", + "linked-hash-map", ] [[package]] -name = "macro_magic_core" -version = "0.5.1" +name = "lz4" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ - "const-random", - "derive-syn-parse", - "macro_magic_core_macros", - "proc-macro2", - "quote", - "syn 2.0.98", + "lz4-sys", ] [[package]] -name = "macro_magic_core_macros" -version = "0.5.1" +name = "lz4-sys" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "macro_magic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "macro_magic_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", @@ -3342,6 +5189,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchers" version = "0.1.0" @@ -3351,6 +5207,12 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "matrixmultiply" version = "0.3.9" @@ -3367,6 +5229,42 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.44", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.32.0" @@ -3376,6 +5274,20 @@ dependencies = [ "hash-db", ] +[[package]] +name = "merkleized-metadata" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c592efaf1b3250df14c8f3c2d952233f0302bb81d3586db2f303666c1cd607" +dependencies = [ + "array-bytes", + "blake3", + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-info", +] + [[package]] name = "merlin" version = "3.0.0" @@ -3414,6 +5326,84 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "mixnet" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" +dependencies = [ + "arrayref", + "arrayvec", + "bitflags 1.3.2", + "blake2 0.10.6", + "c2-chacha", + "curve25519-dalek 4.1.3", + "either", + "hashlink 0.8.4", + "lioness", + "log", + "parking_lot 0.12.3", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_distr", + "subtle 2.6.1", + "thiserror 1.0.69", + "zeroize", +] + +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive 0.11.4", + "predicates 2.1.5", + "predicates-tree", +] + +[[package]] +name = "mockall" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "mockall_derive 0.13.1", + "predicates 3.1.3", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mockall_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "moka" version = "0.12.10" @@ -3424,7 +5414,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "loom", - "parking_lot", + "parking_lot 0.12.3", "portable-atomic", "rustc_version", "smallvec", @@ -3433,6 +5423,25 @@ dependencies = [ "uuid", ] +[[package]] +name = "multiaddr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "log", + "multibase", + "multihash 0.17.0", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.7.2", + "url", +] + [[package]] name = "multiaddr" version = "0.18.2" @@ -3444,7 +5453,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash", + "multihash 0.19.3", "percent-encoding", "serde", "static_assertions", @@ -3463,6 +5472,40 @@ dependencies = [ "data-encoding-macro", ] +[[package]] +name = "multihash" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.8", + "sha3", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "multihash" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" +dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive", + "sha2 0.10.8", + "sha3", + "unsigned-varint 0.7.2", +] + [[package]] name = "multihash" version = "0.19.3" @@ -3473,6 +5516,20 @@ dependencies = [ "unsigned-varint 0.8.0", ] +[[package]] +name = "multihash-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +dependencies = [ + "proc-macro-crate 1.1.3", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure 0.12.6", +] + [[package]] name = "multimap" version = "0.10.0" @@ -3573,6 +5630,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "network-interface" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" +dependencies = [ + "cc", + "libc", + "thiserror 1.0.69", + "winapi", +] + [[package]] name = "nix" version = "0.26.4" @@ -3584,6 +5653,12 @@ dependencies = [ "libc", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -3600,6 +5675,24 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3672,6 +5765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3684,6 +5778,27 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", + "memchr", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "object" version = "0.36.7" @@ -3693,13 +5808,31 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs 0.5.2", +] + [[package]] name = "oid-registry" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", +] + +[[package]] +name = "oid-registry" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" +dependencies = [ + "asn1-rs 0.7.0", ] [[package]] @@ -3708,6 +5841,12 @@ version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + [[package]] name = "opaque-debug" version = "0.3.1" @@ -3715,8 +5854,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] -name = "overload" -version = "0.1.1" +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" @@ -3726,29 +5877,67 @@ version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f8b3dc7ead2fafe65a65d1589017f25fd1c3e020dea3371c210ebdcfd0c11f5" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic", "sp-core 35.0.0", "sp-io 39.0.0", "sp-runtime 40.1.0", ] +[[package]] +name = "pallet-authorship" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "452584dcccd8412609dea0d9e63e4b36564b66793e637420624b9f61aa1cf2e9" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 40.1.0", +] + +[[package]] +name = "pallet-babe" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef195d55a068a8bd069d87d840d9153e1788fcb46b3c1b07c37f550918119374" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto 39.0.0", + "sp-consensus-babe", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-session", + "sp-staking", +] + [[package]] name = "pallet-balances" -version = "40.0.0" +version = "40.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5800e106650e41577d852e003a212b82998bb2fd1e348ed08436ef620fd094f" +checksum = "8b3d18caaae72674d6536d339c1ae5b5063b55de5813a43ee045847d28c0a128" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", @@ -3759,14 +5948,14 @@ dependencies = [ name = "pallet-idn-manager" version = "0.0.1-dev" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "idn-traits", "pallet-balances", "pallet-xcm", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-io 39.0.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3782,9 +5971,9 @@ dependencies = [ "ark-ec", "ark-serialize", "ark-std", - "frame-benchmarking 38.0.0", - "frame-support 38.2.0", - "frame-system 38.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "hex", "log", "parity-scale-codec", @@ -3794,23 +5983,65 @@ dependencies = [ "sha2 0.10.8", "sp-ark-bls12-381", "sp-consensus-randomness-beacon", - "sp-core 34.0.0", + "sp-core 35.0.0", "sp-inherents 34.0.0", - "sp-io 38.0.0", + "sp-io 39.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.5", + "sp-runtime 40.1.0", "timelock", ] +[[package]] +name = "pallet-session" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e69f96c09d4ae772ee095f1392ef33a8d46f5dfa5be8a217935e9effd2979c39" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-session", + "sp-staking", + "sp-state-machine 0.44.0", + "sp-trie 38.0.0", +] + +[[package]] +name = "pallet-timestamp" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dcb0a659187a3b9364a1754fb30cc962109be0753e9689d92fe01e47c747a71" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-inherents 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-storage 22.0.0", + "sp-timestamp", +] + [[package]] name = "pallet-transaction-payment" version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ee68d52c4f65063624f02ac83691ca6e46b471c8eb3bfb6f60b441f24a23ab" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "serde", @@ -3825,10 +6056,10 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "165300c258d4f6fd325d3195e3d68b976891d5710a6f0ac636b935906c22891c" dependencies = [ - "bounded-collections", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "bounded-collections 0.2.3", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-balances", "parity-scale-codec", "scale-info", @@ -3856,6 +6087,27 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "parity-db" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +dependencies = [ + "blake2 0.10.6", + "crc32fast", + "fs2", + "hex", + "libc", + "log", + "lz4", + "memmap2 0.5.10", + "parking_lot 0.12.3", + "rand 0.8.5", + "siphasher", + "snap", + "winapi", +] + [[package]] name = "parity-scale-codec" version = "3.7.4" @@ -3879,7 +6131,7 @@ version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", @@ -3897,6 +6149,17 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -3904,7 +6167,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.10", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -3915,11 +6192,17 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.8", "smallvec", "windows-targets 0.52.6", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "password-hash" version = "0.5.0" @@ -3928,7 +6211,7 @@ checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle", + "subtle 2.6.1", ] [[package]] @@ -3937,6 +6220,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.0", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -3947,6 +6239,15 @@ dependencies = [ "password-hash", ] +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "pem" version = "3.0.4" @@ -3970,7 +6271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.7.1", ] [[package]] @@ -4026,6 +6327,12 @@ dependencies = [ "spki", ] +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + [[package]] name = "polkadot-core-primitives" version = "16.0.0" @@ -4044,7 +6351,7 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d10a3da595ecd419e526a9cfcc013cd00bcd9a2c962991d6efb312df8307eaf" dependencies = [ - "bounded-collections", + "bounded-collections 0.2.3", "derive_more 0.99.19", "parity-scale-codec", "polkadot-core-primitives", @@ -4055,11 +6362,36 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "polkavm" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common 0.9.0", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +dependencies = [ + "log", +] + [[package]] name = "polkavm-common" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +dependencies = [ + "log", +] [[package]] name = "polkavm-common" @@ -4129,6 +6461,27 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common 0.9.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linux-raw" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" + [[package]] name = "polling" version = "3.7.4" @@ -4139,7 +6492,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] @@ -4151,7 +6504,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.1", "universal-hash", ] @@ -4163,7 +6516,7 @@ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug", + "opaque-debug 0.3.1", "universal-hash", ] @@ -4188,6 +6541,46 @@ dependencies = [ "zerocopy 0.7.35", ] +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools 0.10.5", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +dependencies = [ + "anstyle", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" + +[[package]] +name = "predicates-tree" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "prettyplease" version = "0.2.29" @@ -4225,6 +6618,16 @@ dependencies = [ "uint 0.10.0", ] +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror 1.0.69", + "toml 0.5.11", +] + [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -4258,6 +6661,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "proc-macro-warning" version = "1.84.1" @@ -4278,6 +6692,32 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.3", + "thiserror 1.0.69", +] + +[[package]] +name = "prometheus-client" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.3", + "prometheus-client-derive-encode", +] + [[package]] name = "prometheus-client" version = "0.22.3" @@ -4286,7 +6726,7 @@ checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", - "parking_lot", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -4301,6 +6741,32 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "proptest" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" +dependencies = [ + "bitflags 2.8.0", + "lazy_static", + "num-traits", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax 0.8.5", + "unarray", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive 0.12.6", +] + [[package]] name = "prost" version = "0.13.5" @@ -4308,7 +6774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.13.5", ] [[package]] @@ -4317,20 +6783,33 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "heck", + "heck 0.5.0", "itertools 0.14.0", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost", + "prost 0.13.5", "prost-types", "regex", "syn 2.0.98", "tempfile", ] +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "prost-derive" version = "0.13.5" @@ -4350,37 +6829,92 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "prost", + "prost 0.13.5", ] [[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-protobuf" -version = "0.8.1" +name = "psm" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" dependencies = [ - "byteorder", + "cc", ] [[package]] -name = "quick-protobuf-codec" -version = "0.3.1" +name = "quanta" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ - "asynchronous-codec", + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" +dependencies = [ + "asynchronous-codec 0.6.2", + "bytes", + "quick-protobuf", + "thiserror 1.0.69", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +dependencies = [ + "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", "thiserror 1.0.69", "unsigned-varint 0.8.0", ] +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", + "rustc-hash 1.1.0", + "rustls 0.21.12", + "thiserror 1.0.69", + "tokio", + "tracing", +] + [[package]] name = "quinn" version = "0.11.6" @@ -4392,16 +6926,33 @@ dependencies = [ "bytes", "futures-io", "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", + "quinn-proto 0.11.9", + "quinn-udp 0.5.10", + "rustc-hash 2.1.1", + "rustls 0.23.23", + "socket2 0.5.8", "thiserror 2.0.11", "tokio", "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.16.20", + "rustc-hash 1.1.0", + "rustls 0.21.12", + "slab", + "thiserror 1.0.69", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-proto" version = "0.11.9" @@ -4412,8 +6963,8 @@ dependencies = [ "getrandom 0.2.15", "rand 0.8.5", "ring 0.17.9", - "rustc-hash", - "rustls", + "rustc-hash 2.1.1", + "rustls 0.23.23", "rustls-pki-types", "slab", "thiserror 2.0.11", @@ -4422,16 +6973,29 @@ dependencies = [ "web-time", ] +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2 0.5.8", + "tracing", + "windows-sys 0.48.0", +] + [[package]] name = "quinn-udp" version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "libc", "once_cell", - "socket2", + "socket2 0.5.8", "tracing", "windows-sys 0.59.0", ] @@ -4493,6 +7057,12 @@ dependencies = [ "rand_core 0.9.1", ] +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + [[package]] name = "rand_core" version = "0.6.4" @@ -4512,6 +7082,43 @@ dependencies = [ "zerocopy 0.8.20", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "raw-cpuid" +version = "11.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "529468c1335c1c03919960dfefdb1b3648858c20d7ec2d0663e728e4a717efbc" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -4538,18 +7145,39 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" +dependencies = [ + "pem 1.1.1", + "ring 0.16.20", + "time", + "yasna", +] + [[package]] name = "rcgen" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ - "pem", + "pem 3.0.4", "ring 0.16.20", "time", "yasna", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.5.8" @@ -4559,6 +7187,17 @@ dependencies = [ "bitflags 2.8.0", ] +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.15", + "libredox", + "thiserror 1.0.69", +] + [[package]] name = "ref-cast" version = "1.0.23" @@ -4579,6 +7218,31 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "regalloc2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" +dependencies = [ + "fxhash", + "log", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash 1.1.0", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.11.1" @@ -4640,7 +7304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle", + "subtle 2.6.1", ] [[package]] @@ -4672,6 +7336,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rtnetlink" version = "0.13.1" @@ -4697,6 +7367,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.1.1" @@ -4715,7 +7391,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.25", ] [[package]] @@ -4727,6 +7403,20 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.36.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + [[package]] name = "rustix" version = "0.38.44" @@ -4736,24 +7426,60 @@ dependencies = [ "bitflags 2.8.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", "windows-sys 0.59.0", ] +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "ring 0.16.20", + "sct", + "webpki", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring 0.17.9", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ + "log", "once_cell", "ring 0.17.9", "rustls-pki-types", "rustls-webpki 0.102.8", - "subtle", + "subtle 2.6.1", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pki-types" version = "1.11.0" @@ -4791,60 +7517,1091 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] -name = "rw-stream-sink" -version = "0.4.0" +name = "rw-stream-sink" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + +[[package]] +name = "ryu" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc-allocator" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a63e577eb150187ddd444a0a6f01e1ece0a5cfc592aacb4204d9f79bdc5265d" +dependencies = [ + "log", + "sp-core 35.0.0", + "sp-wasm-interface 21.0.1", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-basic-authorship" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e135c7efa86a538c5edb6456e00ffa13816d3a1d53fdba8fa81d6e1d06c9c995" +dependencies = [ + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-proposer-metrics", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-block-builder" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa58cf10d78568fa19d3cd723984bc864c19113fa83f2f252020c91f925b8480" +dependencies = [ + "parity-scale-codec", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-trie 38.0.0", +] + +[[package]] +name = "sc-chain-spec" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f193a962c3bea44d03d6ec61ef3b54cc3d629a8058a25bcb181d06f1ac7b3a79" +dependencies = [ + "array-bytes", + "docify", + "log", + "memmap2 0.9.5", + "parity-scale-codec", + "sc-chain-spec-derive", + "sc-client-api", + "sc-executor", + "sc-network", + "sc-telemetry", + "serde", + "serde_json", + "sp-blockchain", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-genesis-builder", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "sp-tracing 17.0.1", +] + +[[package]] +name = "sc-chain-spec-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b18cef11d2c69703e0d7c3528202ef4ed1cd2b47a6f063e9e17cad8255b1fa94" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "sc-client-api" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89717374ec68c01c2493d65f7e1854814c371ed9e8f9826a160ee9d0d473824" +dependencies = [ + "fnv", + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-executor", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-database", + "sp-externalities 0.30.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "sp-statement-store", + "sp-storage 22.0.0", + "sp-trie 38.0.0", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-client-db" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cfd3ac7c6d086ae3c5c4dc6e16c91d4a713618466d1ea3f5bec07eb19e0c6eb" +dependencies = [ + "hash-db", + "kvdb", + "kvdb-memorydb", + "linked-hash-map", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-state-db", + "schnellru", + "sp-arithmetic", + "sp-blockchain", + "sp-core 35.0.0", + "sp-database", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "sp-trie 38.0.0", +] + +[[package]] +name = "sc-consensus" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82287d29c4f569b7d6b0589ddb60a0cd5e41c82242b582f347d89a8f28bc305f" +dependencies = [ + "async-trait", + "futures", + "log", + "mockall 0.11.4", + "parking_lot 0.12.3", + "sc-client-api", + "sc-network-types", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-aura" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cae6c8dfa585db7cdb5057d72c27c67654a9b077c1cf38eeba6fc56ed0d885f" +dependencies = [ + "async-trait", + "futures", + "log", + "parity-scale-codec", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sc-consensus-slots", + "sc-telemetry", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-slots", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-babe" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6342aba8e37a25f20e0d57af9fdc05ac93369ee23a16ba486eb0c40a09a4047" +dependencies = [ + "async-trait", + "fork-tree", + "futures", + "log", + "num-bigint", + "num-rational", + "num-traits", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-consensus", + "sc-consensus-epochs", + "sc-consensus-slots", + "sc-telemetry", + "sc-transaction-pool-api", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-inherents 35.0.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-epochs" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db49ba7a929e282406a03ed47b00011ef26525cab9bb0e2ce51026d93c411f8b" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime 40.1.0", +] + +[[package]] +name = "sc-consensus-manual-seal" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "437a1da5fd1252ec2cb2c86fb7a51a44a0b6a3239b733440a2dce30f48d14ed2" +dependencies = [ + "assert_matches", + "async-trait", + "futures", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", + "sp-timestamp", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-consensus-randomness-beacon" +version = "1.0.0" +dependencies = [ + "ark-bls12-381", + "ark-serialize", + "async-std", + "futures", + "futures-timer", + "libp2p 0.55.0", + "log", + "parity-scale-codec", + "prost 0.13.5", + "prost-build", + "prost-types", + "rand 0.8.5", + "sc-basic-authorship", + "sc-consensus", + "sc-consensus-manual-seal", + "sc-transaction-pool", + "sc-transaction-pool-api", + "scale-info", + "serde", + "sp-api", + "sp-ark-bls12-381", + "sp-blockchain", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "substrate-test-runtime-client", + "substrate-test-runtime-transaction-pool", + "tokio", +] + +[[package]] +name = "sc-consensus-slots" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3973057fb689d2fc626867858e6589d251c162c7f2d513189e39b104d2bb5c7" +dependencies = [ + "async-trait", + "futures", + "futures-timer", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-telemetry", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-slots", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", +] + +[[package]] +name = "sc-executor" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b450573fc0ca024bdcb6d508d61c104f862519ca7f78c416bd8042c9db32975" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-executor-common", + "sc-executor-polkavm", + "sc-executor-wasmtime", + "schnellru", + "sp-api", + "sp-core 35.0.0", + "sp-externalities 0.30.0", + "sp-io 39.0.0", + "sp-panic-handler", + "sp-runtime-interface 29.0.0", + "sp-trie 38.0.0", + "sp-version", + "sp-wasm-interface 21.0.1", + "tracing", +] + +[[package]] +name = "sc-executor-common" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f5d872331b68ed4601488100f22e8aa16331de006b51d4c69353930c568a16" +dependencies = [ + "polkavm", + "sc-allocator", + "sp-maybe-compressed-blob", + "sp-wasm-interface 21.0.1", + "thiserror 1.0.69", + "wasm-instrument", +] + +[[package]] +name = "sc-executor-polkavm" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16c4b3532c0f6dae1fcbe85f4582618042aefb9c8e2a03f855d298f56362daaa" +dependencies = [ + "log", + "polkavm", + "sc-executor-common", + "sp-wasm-interface 21.0.1", +] + +[[package]] +name = "sc-executor-wasmtime" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d04b8d98a96a83b56eeb1061cd4a7a1949b7c2c147d572d309c4e4d5c0d870f" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "log", + "parking_lot 0.12.3", + "rustix 0.36.17", + "sc-allocator", + "sc-executor-common", + "sp-runtime-interface 29.0.0", + "sp-wasm-interface 21.0.1", + "wasmtime", +] + +[[package]] +name = "sc-informant" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed07e72b3d6db0bee2c18b7737a07a6fbd21cc103e4067165cf71da40ae0f0e1" +dependencies = [ + "console", + "futures", + "futures-timer", + "log", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sp-blockchain", + "sp-runtime 40.1.0", +] + +[[package]] +name = "sc-keystore" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23bdd4b927614411c69cb62500790a7d93fced0e5a9824b71c36f957e0dae0f5" +dependencies = [ + "array-bytes", + "parking_lot 0.12.3", + "serde_json", + "sp-application-crypto 39.0.0", + "sp-core 35.0.0", + "sp-keystore 0.41.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-mixnet" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465af602a26f73d129f70a6b979c44f4c6bd28c2fdfc018315df2125d179d60" +dependencies = [ + "array-bytes", + "arrayvec", + "blake2 0.10.6", + "bytes", + "futures", + "futures-timer", + "log", + "mixnet", + "multiaddr 0.18.2", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-network", + "sc-network-types", + "sc-transaction-pool-api", + "sp-api", + "sp-consensus", + "sp-core 35.0.0", + "sp-keystore 0.41.0", + "sp-mixnet", + "sp-runtime 40.1.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-network" +version = "0.48.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3751a666e9e16c73bda5d2531b80e086392a66b6006214e2951e29747f2c5b06" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "async-trait", + "asynchronous-codec 0.6.2", + "bytes", + "cid 0.9.0", + "either", + "fnv", + "futures", + "futures-timer", + "ip_network", + "libp2p 0.52.4", + "linked_hash_set", + "litep2p", + "log", + "mockall 0.11.4", + "once_cell", + "parity-scale-codec", + "parking_lot 0.12.3", + "partial_sort", + "pin-project", + "prost 0.12.6", + "prost-build", + "rand 0.8.5", + "sc-client-api", + "sc-network-common", + "sc-network-types", + "sc-utils", + "schnellru", + "serde", + "serde_json", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "unsigned-varint 0.7.2", + "void", + "wasm-timer", + "zeroize", +] + +[[package]] +name = "sc-network-common" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "425b88da9cc89a85ddb6d693d93aee2a708ad9c230b73f8aa638dbad0c63b535" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "futures", + "libp2p-identity", + "parity-scale-codec", + "prost-build", + "sc-consensus", + "sc-network-types", + "sp-consensus", + "sp-consensus-grandpa", + "sp-runtime 40.1.0", +] + +[[package]] +name = "sc-network-light" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da04be64a20ced7775f97014031dae5b5408f460e5abe4f3e733d559cb8a846a" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "futures", + "log", + "parity-scale-codec", + "prost 0.12.6", + "prost-build", + "sc-client-api", + "sc-network", + "sc-network-types", + "sp-blockchain", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-network-sync" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ce6a2562c9d4710bc56e0c2841653fd7596ef9708530b7e45e1444222b979b" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "async-trait", + "fork-tree", + "futures", + "futures-timer", + "log", + "mockall 0.11.4", + "parity-scale-codec", + "prost 0.12.6", + "prost-build", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-types", + "sc-utils", + "schnellru", + "smallvec", + "sp-arithmetic", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", + "tokio-stream", +] + +[[package]] +name = "sc-network-transactions" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a069de44381e1329d7033877d212a8287d779a2f3ebd3748c4fec6ee465e55" +dependencies = [ + "array-bytes", + "futures", + "log", + "parity-scale-codec", + "sc-network", + "sc-network-common", + "sc-network-sync", + "sc-network-types", + "sc-utils", + "sp-consensus", + "sp-runtime 40.1.0", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-network-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3001bb4db4dbad087e72c851d983c7b9618e37dce382d86355130f7ec7b79f20" +dependencies = [ + "bs58", + "ed25519-dalek", + "libp2p-identity", + "litep2p", + "log", + "multiaddr 0.18.2", + "multihash 0.19.3", + "rand 0.8.5", + "thiserror 1.0.69", + "zeroize", +] + +[[package]] +name = "sc-offchain" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc5e0b1ad78caf4b34d4acbb3dbe4d13fbbdaafcf8cbed26766e028ac7393275" +dependencies = [ + "array-bytes", + "bytes", + "fnv", + "futures", + "futures-timer", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls", + "hyper-util", + "log", + "num_cpus", + "once_cell", + "parity-scale-codec", + "parking_lot 0.12.3", + "rand 0.8.5", + "rustls 0.23.23", + "sc-client-api", + "sc-network", + "sc-network-common", + "sc-network-types", + "sc-transaction-pool-api", + "sc-utils", + "sp-api", + "sp-core 35.0.0", + "sp-externalities 0.30.0", + "sp-keystore 0.41.0", + "sp-offchain", + "sp-runtime 40.1.0", + "threadpool", + "tracing", +] + +[[package]] +name = "sc-proposer-metrics" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f680a0bed67dab19898624246376ba85d5f70a89859ba030830aacd079c28d3c" +dependencies = [ + "log", + "substrate-prometheus-endpoint", +] + +[[package]] +name = "sc-rpc" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ac6a01eb88a5ea7e2ed7e6348f332548262fd00247c263f5b081dff3d1432b" +dependencies = [ + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-mixnet", + "sc-rpc-api", + "sc-tracing", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core 35.0.0", + "sp-keystore 0.41.0", + "sp-offchain", + "sp-rpc", + "sp-runtime 40.1.0", + "sp-session", + "sp-statement-store", + "sp-version", + "tokio", +] + +[[package]] +name = "sc-rpc-api" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a45ebf7365e369bea319018dd2706929d4d8d8807829a1989dfaf3f1c7125d" +dependencies = [ + "jsonrpsee", + "parity-scale-codec", + "sc-chain-spec", + "sc-mixnet", + "sc-transaction-pool-api", + "scale-info", + "serde", + "serde_json", + "sp-core 35.0.0", + "sp-rpc", + "sp-runtime 40.1.0", + "sp-version", + "thiserror 1.0.69", +] + +[[package]] +name = "sc-rpc-server" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460bd636ce21bf431d7fffcf7a988c0f35369ecbd1aff00c8edbce42b13dc9e1" +dependencies = [ + "dyn-clone", + "forwarded-header-value", + "futures", + "governor", + "http 1.2.0", + "http-body-util", + "hyper 1.6.0", + "ip_network", + "jsonrpsee", + "log", + "sc-rpc-api", + "serde", + "serde_json", + "substrate-prometheus-endpoint", + "tokio", + "tower", + "tower-http", +] + +[[package]] +name = "sc-rpc-spec-v2" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c4734b9d0f16e9d7dc45a75b7f413d58ab612b70b7c63a598eedff58255f88a" +dependencies = [ + "array-bytes", + "futures", + "futures-util", + "hex", + "itertools 0.11.0", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "rand 0.8.5", + "sc-chain-spec", + "sc-client-api", + "sc-rpc", + "sc-transaction-pool-api", + "schnellru", + "serde", + "sp-api", + "sp-blockchain", + "sp-core 35.0.0", + "sp-rpc", + "sp-runtime 40.1.0", + "sp-version", + "thiserror 1.0.69", + "tokio", + "tokio-stream", +] + +[[package]] +name = "sc-service" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "894407165874a8c81aa51ab5ff5823ca2a2eb7806f5f1b2ab1c2df9bb92cce62" +dependencies = [ + "async-trait", + "directories", + "exit-future", + "futures", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "sc-chain-spec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-informant", + "sc-keystore", + "sc-network", + "sc-network-common", + "sc-network-light", + "sc-network-sync", + "sc-network-transactions", + "sc-network-types", + "sc-rpc", + "sc-rpc-server", + "sc-rpc-spec-v2", + "sc-sysinfo", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "schnellru", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-externalities 0.30.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", + "sp-session", + "sp-state-machine 0.44.0", + "sp-storage 22.0.0", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie 38.0.0", + "sp-version", + "static_init", + "substrate-prometheus-endpoint", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "sc-state-db" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b1bda0a8847a094dbd8aa379c3b6ce3c86f70ba29ad2f506b561a06b3d78fe" +dependencies = [ + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sp-core 35.0.0", +] + +[[package]] +name = "sc-sysinfo" +version = "41.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e636383d99aa72ab948ea0939df12273a5b0cfe977e71c09ab6cc0379c051c2" +dependencies = [ + "derive_more 0.99.19", + "futures", + "libc", + "log", + "rand 0.8.5", + "rand_pcg", + "regex", + "sc-telemetry", + "serde", + "serde_json", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-io 39.0.0", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sc-telemetry" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c48f501f4b696b6497f0dd181892938bfc6ccf580636ae57b4ab2c05ea15d80f" +dependencies = [ + "chrono", + "futures", + "libp2p 0.52.4", + "log", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "sc-network", + "sc-utils", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-timer", +] + +[[package]] +name = "sc-tracing" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7363a0fd9e950660db34440db8c29ac7ec14b3af43c649ad2f64e4d4a7b09413" +dependencies = [ + "chrono", + "console", + "is-terminal", + "libc", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "rustc-hash 1.1.0", + "sc-client-api", + "sc-tracing-proc-macro", + "serde", + "sp-api", + "sp-blockchain", + "sp-core 35.0.0", + "sp-rpc", + "sp-runtime 40.1.0", + "sp-tracing 17.0.1", + "thiserror 1.0.69", + "tracing", + "tracing-log 0.2.0", + "tracing-subscriber 0.3.19", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "sc-transaction-pool" +version = "38.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +checksum = "850d5f7e46e7b6943c2bcc627a82cf11d7604b95a24e2c0e0f28a24fbff4095c" dependencies = [ + "async-trait", "futures", - "pin-project", - "static_assertions", + "futures-timer", + "indexmap 2.7.1", + "itertools 0.11.0", + "linked-hash-map", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-transaction-pool-api", + "sc-utils", + "serde", + "sp-api", + "sp-blockchain", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-runtime 40.1.0", + "sp-tracing 17.0.1", + "sp-transaction-pool", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tokio", + "tokio-stream", ] [[package]] -name = "ryu" -version = "1.0.19" +name = "sc-transaction-pool-api" +version = "38.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "894984d3ba3c6f51573dc395bcdeed02aaeb96d88c403a13c726852ed70a8584" +dependencies = [ + "async-trait", + "futures", + "log", + "parity-scale-codec", + "serde", + "sp-blockchain", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "thiserror 1.0.69", +] [[package]] -name = "safe_arch" -version = "0.7.4" +name = "sc-utils" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" +checksum = "f63860daa5455a5f3689bec3e94aad823746bac0f4166761786435043ab01a27" dependencies = [ - "bytemuck", + "async-channel 1.9.0", + "futures", + "futures-timer", + "log", + "parking_lot 0.12.3", + "prometheus", + "sp-arithmetic", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "scale-bits" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" dependencies = [ - "winapi-util", + "parity-scale-codec", + "scale-type-resolver", ] [[package]] -name = "sc-consensus-randomness-beacon" -version = "1.0.0" +name = "scale-decode" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ - "ark-bls12-381", - "ark-serialize", - "async-std", - "futures", - "futures-timer", - "libp2p", - "log", + "derive_more 0.99.19", "parity-scale-codec", - "prost", - "prost-build", - "prost-types", - "rand 0.8.5", - "scale-info", - "serde", - "sp-ark-bls12-381", - "tokio", + "scale-bits", + "scale-type-resolver", + "smallvec", ] [[package]] @@ -4867,19 +8624,34 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "schnellru" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ - "ahash", + "ahash 0.8.11", "cfg-if", "hashbrown 0.13.2", ] @@ -4893,13 +8665,13 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle", + "subtle 2.6.1", "zeroize", ] @@ -4915,6 +8687,22 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.9", + "untrusted 0.9.0", +] + [[package]] name = "sec1" version = "0.7.3" @@ -4923,10 +8711,10 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array", + "generic-array 0.14.7", "pkcs8", "serdect", - "subtle", + "subtle 2.6.1", "zeroize", ] @@ -4957,11 +8745,58 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.8.0", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" @@ -5054,7 +8889,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug", + "opaque-debug 0.3.1", ] [[package]] @@ -5125,12 +8960,27 @@ dependencies = [ "wide", ] +[[package]] +name = "simple-dns" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee851d0e5e7af3721faea1843e8015e820a234f81fda3dea9247e15bac9a86a" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "simple-mermaid" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -5140,6 +8990,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "smallvec" version = "1.14.0" @@ -5163,6 +9019,12 @@ dependencies = [ "futures-lite", ] +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + [[package]] name = "snow" version = "0.9.6" @@ -5170,14 +9032,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ "aes-gcm", - "blake2", + "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "ring 0.17.9", "rustc_version", "sha2 0.10.8", - "subtle", + "subtle 2.6.1", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", ] [[package]] @@ -5199,35 +9071,13 @@ dependencies = [ "base64 0.22.1", "bytes", "futures", + "http 1.2.0", "httparse", "log", "rand 0.8.5", "sha1", ] -[[package]] -name = "sp-api" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbce492e0482134128b7729ea36f5ef1a9f9b4de2d48ff8dde7b5e464e28ce75" -dependencies = [ - "docify", - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro 20.0.0", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 39.0.5", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.43.0", - "sp-trie 37.0.0", - "sp-version 37.0.0", - "thiserror 1.0.69", -] - [[package]] name = "sp-api" version = "35.0.0" @@ -5239,110 +9089,254 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro 21.0.0", + "sp-api-proc-macro", "sp-core 35.0.0", "sp-externalities 0.30.0", - "sp-metadata-ir 0.8.0", + "sp-metadata-ir", "sp-runtime 40.1.0", "sp-runtime-interface 29.0.0", "sp-state-machine 0.44.0", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "thiserror 1.0.69", ] [[package]] name = "sp-api-proc-macro" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +checksum = "37f8b9621cfa68a45d6f9c124e672b8f6780839a6c95279a7877d244fef8d1dc" dependencies = [ "Inflector", - "blake2", + "blake2 0.10.6", "expander", - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", ] [[package]] -name = "sp-api-proc-macro" -version = "21.0.0" +name = "sp-application-crypto" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8133012faa5f75b2f0b1619d9f720c1424ac477152c143e5f7dbde2fe1a958" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-io 38.0.0", +] + +[[package]] +name = "sp-application-crypto" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f6850bd745fe9c0a200a8e729a82c8036250e1ad1ef24ed7498b2289935c974" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 35.0.0", + "sp-io 39.0.0", +] + +[[package]] +name = "sp-arithmetic" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-ark-bls12-381" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-bls12-381-ext", + "sp-crypto-ec-utils", +] + +[[package]] +name = "sp-block-builder" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d66b12f19243bac666aa84c1df18f12989b924b467377973b349ff4913c3e6" +dependencies = [ + "sp-api", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", +] + +[[package]] +name = "sp-blockchain" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10c9a1cd459bac54920bac5e467609dadfdac3e3503be0a864539aeb11071b70" +dependencies = [ + "futures", + "parity-scale-codec", + "parking_lot 0.12.3", + "schnellru", + "sp-api", + "sp-consensus", + "sp-core 35.0.0", + "sp-database", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "thiserror 1.0.69", + "tracing", +] + +[[package]] +name = "sp-consensus" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068254c448b84efac1c4a5b15f650851ef24ba77bda21802da34f73410096c09" +dependencies = [ + "async-trait", + "futures", + "log", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-consensus-aura" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f8b9621cfa68a45d6f9c124e672b8f6780839a6c95279a7877d244fef8d1dc" +checksum = "b2174e77fed7a92c90f3d3e3603a0b4580ea311b2df8343aa62112c9597e2a97" dependencies = [ - "Inflector", - "blake2", - "expander", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.98", + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-consensus-slots", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-timestamp", ] [[package]] -name = "sp-application-crypto" -version = "38.0.0" +name = "sp-consensus-babe" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8133012faa5f75b2f0b1619d9f720c1424ac477152c143e5f7dbde2fe1a958" +checksum = "e1633fab9075508861b82999305a3d3d35f35a780feaf4e81f9d59aa6d62e5f7" dependencies = [ + "async-trait", "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 38.0.0", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-consensus-slots", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-timestamp", ] [[package]] -name = "sp-application-crypto" -version = "39.0.0" +name = "sp-consensus-grandpa" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6850bd745fe9c0a200a8e729a82c8036250e1ad1ef24ed7498b2289935c974" +checksum = "fee1b89de331df0c7b1502d626540d455a058eb86fa49f58cef0364d1a02abda" dependencies = [ + "finality-grandpa", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-api", + "sp-application-crypto 39.0.0", "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", ] [[package]] -name = "sp-arithmetic" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +name = "sp-consensus-randomness-beacon" +version = "0.0.1-dev" dependencies = [ - "docify", - "integer-sqrt", - "num-traits", + "array-bytes", + "async-trait", "parity-scale-codec", "scale-info", "serde", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", + "sp-inherents 35.0.0", + "tokio", ] [[package]] -name = "sp-ark-bls12-381" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +name = "sp-consensus-slots" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d79170cc0a66b22d29adee140017a16c01257d61b5d713bbe47224eb7c3dd45" dependencies = [ - "ark-bls12-381-ext", - "sp-crypto-ec-utils", + "parity-scale-codec", + "scale-info", + "serde", + "sp-timestamp", ] [[package]] -name = "sp-consensus-randomness-beacon" -version = "0.0.1-dev" +name = "sp-core" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f230cb12575455070da0fc174815958423a0b9a641d5e304a9457113c7cb4007" dependencies = [ "array-bytes", - "async-trait", + "bip39", + "bitflags 1.3.2", + "blake2 0.10.6", + "bounded-collections 0.1.9", + "bs58", + "dyn-clonable", + "ed25519-zebra 3.1.0", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde 0.4.0", + "itertools 0.10.5", + "libsecp256k1", + "log", + "merlin", "parity-scale-codec", + "parking_lot 0.12.3", + "paste", + "primitive-types 0.12.2", + "rand 0.8.5", "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", "serde", - "sp-inherents 34.0.0", - "tokio", + "sp-core-hashing", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface 24.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ss58-registry", + "substrate-bip39 0.4.6", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", ] [[package]] @@ -5353,11 +9347,11 @@ checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" dependencies = [ "array-bytes", "bitflags 1.3.2", - "blake2", - "bounded-collections", + "blake2 0.10.6", + "bounded-collections 0.2.3", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 4.0.3", "futures", "hash-db", "hash256-std-hasher", @@ -5369,7 +9363,7 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "paste", "primitive-types 0.12.2", "rand 0.8.5", @@ -5385,7 +9379,7 @@ dependencies = [ "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -5400,11 +9394,11 @@ checksum = "4532774405a712a366a98080cbb4daa28c38ddff0ec595902ad6ee6a78a809f8" dependencies = [ "array-bytes", "bitflags 1.3.2", - "blake2", - "bounded-collections", + "blake2 0.10.6", + "bounded-collections 0.2.3", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 4.0.3", "futures", "hash-db", "hash256-std-hasher", @@ -5416,7 +9410,7 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "paste", "primitive-types 0.13.1", "rand 0.8.5", @@ -5432,17 +9426,31 @@ dependencies = [ "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage 22.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror 1.0.69", "tracing", "w3f-bls", "zeroize", ] +[[package]] +name = "sp-core-hashing" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "twox-hash", +] + [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "ark-bls12-377", "ark-bls12-377-ext", @@ -5456,7 +9464,7 @@ dependencies = [ "ark-ed-on-bls12-381-bandersnatch", "ark-ed-on-bls12-381-bandersnatch-ext", "ark-scale", - "sp-runtime-interface 24.0.0", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] @@ -5484,6 +9492,16 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "sp-database" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" +dependencies = [ + "kvdb", + "parking_lot 0.12.3", +] + [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -5498,7 +9516,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "proc-macro2", "quote", @@ -5508,11 +9526,23 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.25.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63867ec85950ced90d4ab1bba902a47db1b1efdf2829f653945669b2bb470a9c" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-externalities" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 19.0.0", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] @@ -5537,19 +9567,6 @@ dependencies = [ "sp-storage 22.0.0", ] -[[package]] -name = "sp-genesis-builder" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a646ed222fd86d5680faa4a8967980eb32f644cae6c8523e1c689a6deda3e8" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde_json", - "sp-api 34.0.0", - "sp-runtime 39.0.5", -] - [[package]] name = "sp-genesis-builder" version = "0.16.0" @@ -5559,7 +9576,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde_json", - "sp-api 35.0.0", + "sp-api", "sp-runtime 40.1.0", ] @@ -5645,6 +9662,30 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "sp-keyring" +version = "40.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ca46ebad50bd836bb2ea8951c9436149b5610299ff538087dd7989174d8f831" +dependencies = [ + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "strum 0.26.3", +] + +[[package]] +name = "sp-keystore" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96806a28a62ed9ddecd0b28857b1344d029390f7c5c42a2ff9199cbf5638635c" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.3", + "sp-core 28.0.0", + "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.69", +] + [[package]] name = "sp-keystore" version = "0.40.0" @@ -5652,7 +9693,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "sp-core 34.0.0", "sp-externalities 0.29.0", ] @@ -5664,20 +9705,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1d41475fcdf253f9f0da839564c1b7f8a95c6a293ddfffd6e48e3671e76f33b" dependencies = [ "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "sp-core 35.0.0", "sp-externalities 0.30.0", ] [[package]] -name = "sp-metadata-ir" -version = "0.7.0" +name = "sp-maybe-compressed-blob" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" dependencies = [ - "frame-metadata 16.0.0", - "parity-scale-codec", - "scale-info", + "thiserror 1.0.69", + "zstd 0.12.4", ] [[package]] @@ -5686,9 +9726,32 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427be4e8e6a33cb8ffc8c91f8834b9c6f563daf246e8f0da16e9e0db3db55f5a" dependencies = [ - "frame-metadata 18.0.0", + "frame-metadata", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "sp-mixnet" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "506bf9fd887c786d0e954543827b126ee78426e9c58e53cc868c65edd1201ff5" +dependencies = [ "parity-scale-codec", "scale-info", + "sp-api", + "sp-application-crypto 39.0.0", +] + +[[package]] +name = "sp-offchain" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c18f168775c2e88cab262fd2c8c002a19eeac2ed804b03bd5b7c7c7b190b7061" +dependencies = [ + "sp-api", + "sp-core 35.0.0", + "sp-runtime 40.1.0", ] [[package]] @@ -5701,6 +9764,17 @@ dependencies = [ "regex", ] +[[package]] +name = "sp-rpc" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeb69b45312efd9aeb87a6763aba24b1cb4d177b7a205a18905d1edd792c974f" +dependencies = [ + "rustc-hash 1.1.0", + "serde", + "sp-core 35.0.0", +] + [[package]] name = "sp-runtime" version = "39.0.5" @@ -5761,19 +9835,38 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f66b66d8cec3d785fa6289336c1d9cbd4305d5d84f7134378c4d79ed7983e6fb" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types 0.12.2", + "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface-proc-macro 17.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 16.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 20.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.18.0", "primitive-types 0.13.1", - "sp-externalities 0.25.0", - "sp-runtime-interface-proc-macro 17.0.0", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-storage 19.0.0", - "sp-tracing 16.0.0", - "sp-wasm-interface 20.0.0", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "static_assertions", ] @@ -5820,11 +9913,25 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "Inflector", "expander", - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", @@ -5838,24 +9945,25 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", ] [[package]] -name = "sp-staking" -version = "36.0.0" +name = "sp-session" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a73eedb4b85f4cd420d31764827546aa22f82ce1646d0fd258993d051de7a90" +checksum = "8c9d8923ce9b19389c4a8d00059a3cf9f5c4014095edf0dec0fe32f6a60e02b5" dependencies = [ - "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 39.0.5", + "sp-api", + "sp-core 35.0.0", + "sp-keystore 0.41.0", + "sp-runtime 40.1.0", + "sp-staking", ] [[package]] @@ -5881,7 +9989,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "rand 0.8.5", "smallvec", "sp-core 34.0.0", @@ -5902,7 +10010,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "rand 0.8.5", "smallvec", "sp-core 35.0.0", @@ -5914,21 +10022,60 @@ dependencies = [ "trie-db", ] -[[package]] -name = "sp-std" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" - -[[package]] -name = "sp-std" -version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" - +[[package]] +name = "sp-statement-store" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c8959bbd46dca069b4b9cf9880e1534406b2bb9c09ac45b8367652db50f3eda" +dependencies = [ + "aes-gcm", + "curve25519-dalek 4.1.3", + "ed25519-dalek", + "hkdf", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sha2 0.10.8", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-externalities 0.30.0", + "sp-runtime 40.1.0", + "sp-runtime-interface 29.0.0", + "thiserror 1.0.69", + "x25519-dalek", +] + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" + +[[package]] +name = "sp-storage" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb92d7b24033a8a856d6e20dd980b653cbd7af7ec471cc988b1b7c1d2e3a32b" +dependencies = [ + "impl-serde 0.4.0", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sp-storage" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -5963,15 +10110,41 @@ dependencies = [ "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sp-timestamp" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595d392536ab1d212749f1d937692df157a0debf9a8b96a5ff78d38485dd6ac5" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +dependencies = [ + "parity-scale-codec", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "tracing-core", + "tracing-subscriber 0.2.25", +] + [[package]] name = "sp-tracing" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.3.19", ] [[package]] @@ -5983,7 +10156,32 @@ dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.3.19", +] + +[[package]] +name = "sp-transaction-pool" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a18b6735f4a24245afd32850bac08ba113bb1a228146d5093b4db9baeb2f6a" +dependencies = [ + "sp-api", + "sp-runtime 40.1.0", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f7c631a7407335e4c8747efa4023c1b927f6cccfb845f3d9b467779f6c38de5" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-core 35.0.0", + "sp-inherents 35.0.0", + "sp-runtime 40.1.0", + "sp-trie 38.0.0", ] [[package]] @@ -5992,13 +10190,13 @@ version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" dependencies = [ - "ahash", + "ahash 0.8.11", "hash-db", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", @@ -6016,12 +10214,12 @@ version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1851c4929ae88932c6bcdb9e60f4063e478ca612012af3b6d365c7dc9c591f7f" dependencies = [ - "ahash", + "ahash 0.8.11", "hash-db", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot", + "parking_lot 0.12.3", "rand 0.8.5", "scale-info", "schnellru", @@ -6033,24 +10231,6 @@ dependencies = [ "trie-root", ] -[[package]] -name = "sp-version" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d521a405707b5be561367cd3d442ff67588993de24062ce3adefcf8437ee9fe1" -dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "parity-wasm", - "scale-info", - "serde", - "sp-crypto-hashing-proc-macro", - "sp-runtime 39.0.5", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version-proc-macro 14.0.0", - "thiserror 1.0.69", -] - [[package]] name = "sp-version" version = "38.0.0" @@ -6065,39 +10245,41 @@ dependencies = [ "sp-crypto-hashing-proc-macro", "sp-runtime 40.1.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version-proc-macro 15.0.0", + "sp-version-proc-macro", "thiserror 1.0.69", ] [[package]] name = "sp-version-proc-macro" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" dependencies = [ "parity-scale-codec", + "proc-macro-warning 1.84.1", "proc-macro2", "quote", "syn 2.0.98", ] [[package]] -name = "sp-version-proc-macro" -version = "15.0.0" +name = "sp-wasm-interface" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", "parity-scale-codec", - "proc-macro-warning", - "proc-macro2", - "quote", - "syn 2.0.98", + "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmtime", ] [[package]] name = "sp-wasm-interface" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk#b9b73eb2758edc8af140fea60fdc51f890eefc48" +source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -6115,6 +10297,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", + "wasmtime", ] [[package]] @@ -6123,7 +10306,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" dependencies = [ - "bounded-collections", + "bounded-collections 0.2.3", "parity-scale-codec", "scale-info", "serde", @@ -6138,6 +10321,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" version = "0.7.3" @@ -6176,10 +10368,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3061478a487d11bc79a57c752a7021fa591906fd58108cf35925f8ed85c2bd4" dependencies = [ "array-bytes", - "bounded-collections", + "bounded-collections 0.2.3", "derivative", "environmental", - "frame-support 39.0.0", + "frame-support", "hex-literal", "impl-trait-for-tuples", "log", @@ -6197,8 +10389,8 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cce13bf3abbda42464069f92c21c8cd64eeb089b43cde3c3aca5f90cf485d7b" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "pallet-asset-conversion", @@ -6215,44 +10407,295 @@ dependencies = [ ] [[package]] -name = "staging-xcm-executor" -version = "18.0.0" +name = "staging-xcm-executor" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e07e7020a321d74513c3d6e4015008de56e2a362758fd9615f6837b29b01a9ee" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime 40.1.0", + "sp-weights", + "staging-xcm", + "tracing", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases 0.1.1", + "libc", + "parking_lot 0.11.2", + "parking_lot_core 0.8.6", + "static_init_macro", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1389c88ddd739ec6d3f8f83343764a0e944cd23cfbf126a9796a714b0b6edd6f" +dependencies = [ + "cfg_aliases 0.1.1", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.98", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b6772e9c3621b8d067a706dfda6a20db6faa7cde39822c58ffc8588d16409c5" +dependencies = [ + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "log", + "prometheus", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "substrate-test-client" +version = "2.0.1" +dependencies = [ + "array-bytes", + "async-trait", + "futures", + "parity-scale-codec", + "sc-client-api", + "sc-client-db", + "sc-consensus", + "sc-executor", + "sc-offchain", + "sc-service", + "serde", + "serde_json", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-keyring", + "sp-keystore 0.34.0", + "sp-runtime 40.1.0", + "sp-state-machine 0.44.0", + "tokio", +] + +[[package]] +name = "substrate-test-runtime" +version = "2.0.0" +dependencies = [ + "array-bytes", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-rpc-runtime-api", + "futures", + "log", + "pallet-babe", + "pallet-balances", + "pallet-timestamp", + "parity-scale-codec", + "sc-block-builder", + "sc-chain-spec", + "sc-executor", + "sc-executor-common", + "sc-service", + "scale-info", + "serde", + "serde_json", + "sp-api", + "sp-application-crypto 39.0.0", + "sp-block-builder", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-grandpa", + "sp-core 35.0.0", + "sp-crypto-hashing", + "sp-externalities 0.30.0", + "sp-genesis-builder", + "sp-inherents 35.0.0", + "sp-io 39.0.0", + "sp-keyring", + "sp-offchain", + "sp-runtime 40.1.0", + "sp-session", + "sp-state-machine 0.44.0", + "sp-tracing 17.0.1", + "sp-transaction-pool", + "sp-trie 38.0.0", + "sp-version", + "substrate-test-runtime-client", + "substrate-wasm-builder", + "tracing", + "trie-db", +] + +[[package]] +name = "substrate-test-runtime-client" +version = "2.0.0" +dependencies = [ + "futures", + "sc-block-builder", + "sc-client-api", + "sc-consensus", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core 35.0.0", + "sp-runtime 40.1.0", + "substrate-test-client", + "substrate-test-runtime", +] + +[[package]] +name = "substrate-test-runtime-transaction-pool" +version = "2.0.0" +dependencies = [ + "futures", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sp-blockchain", + "sp-runtime 40.1.0", + "substrate-test-runtime-client", + "thiserror 1.0.69", +] + +[[package]] +name = "substrate-wasm-builder" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07e7020a321d74513c3d6e4015008de56e2a362758fd9615f6837b29b01a9ee" +checksum = "cfebe406eca8d18abd10bb29d7c6af2d656fa60b5d4a8033afd80b97795b9efb" dependencies = [ - "environmental", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "impl-trait-for-tuples", + "array-bytes", + "build-helper", + "cargo_metadata", + "console", + "filetime", + "frame-metadata", + "jobserver", + "merkleized-metadata", "parity-scale-codec", - "scale-info", - "sp-arithmetic", + "parity-wasm", + "polkavm-linker", + "sc-executor", + "shlex", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-weights", - "staging-xcm", - "tracing", + "sp-maybe-compressed-blob", + "sp-tracing 17.0.1", + "sp-version", + "strum 0.26.3", + "tempfile", + "toml 0.8.20", + "walkdir", + "wasm-opt", ] [[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "substrate-bip39" -version = "0.6.0" +name = "subtle" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" -dependencies = [ - "hmac 0.12.1", - "pbkdf2", - "schnorrkel", - "sha2 0.10.8", - "zeroize", -] +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" @@ -6282,6 +10725,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -6300,7 +10755,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.8.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -6326,6 +10781,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.17.1" @@ -6336,7 +10797,7 @@ dependencies = [ "fastrand", "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 0.38.44", "windows-sys 0.59.0", ] @@ -6349,6 +10810,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + [[package]] name = "thiserror" version = "1.0.69" @@ -6399,6 +10866,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.37" @@ -6446,7 +10922,7 @@ dependencies = [ "ark-std", "array-bytes", "chacha20poly1305", - "generic-array", + "generic-array 0.14.7", "parity-scale-codec", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -6503,10 +10979,10 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -6522,6 +10998,44 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls 0.23.23", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" +dependencies = [ + "futures-util", + "log", + "rustls 0.23.23", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tungstenite", +] + [[package]] name = "tokio-util" version = "0.7.13" @@ -6530,11 +11044,21 @@ checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.20" @@ -6562,13 +11086,50 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap", + "indexmap 2.7.1", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "bitflags 2.8.0", + "bytes", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "pin-project-lite", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" version = "0.3.3" @@ -6608,6 +11169,27 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -6619,15 +11201,48 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers 0.0.1", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-serde", +] + [[package]] name = "tracing-subscriber" version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ - "matchers", + "matchers 0.1.0", "nu-ansi-term", "once_cell", + "parking_lot 0.12.3", "regex", "sharded-slab", "smallvec", @@ -6635,7 +11250,7 @@ dependencies = [ "time", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", ] [[package]] @@ -6659,6 +11274,78 @@ dependencies = [ "hash-db", ] +[[package]] +name = "trust-dns-proto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.5.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand 0.8.5", + "smallvec", + "socket2 0.4.10", + "thiserror 1.0.69", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-proto" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand 0.8.5", + "smallvec", + "thiserror 1.0.69", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror 1.0.69", + "tokio", + "tracing", + "trust-dns-proto 0.23.2", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -6671,6 +11358,26 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" +[[package]] +name = "tungstenite" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" +dependencies = [ + "bytes", + "data-encoding", + "http 1.2.0", + "httparse", + "log", + "rand 0.9.0", + "rustls 0.23.23", + "rustls-pki-types", + "sha1", + "thiserror 2.0.11", + "url", + "utf-8", +] + [[package]] name = "tuplex" version = "0.1.2" @@ -6719,6 +11426,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + [[package]] name = "unicode-ident" version = "1.0.17" @@ -6734,6 +11453,18 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -6747,7 +11478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle", + "subtle 2.6.1", ] [[package]] @@ -6755,12 +11486,22 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +dependencies = [ + "asynchronous-codec 0.6.2", + "bytes", + "futures-io", + "futures-util", +] [[package]] name = "unsigned-varint" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +dependencies = [ + "bytes", + "tokio-util", +] [[package]] name = "untrusted" @@ -6781,10 +11522,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna", + "idna 1.0.3", "percent-encoding", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf16_iter" version = "1.0.5" @@ -6824,6 +11571,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "w3f-bls" version = "0.1.4" @@ -6953,6 +11706,275 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-instrument" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "wasm-opt" +version = "0.116.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" +dependencies = [ + "anyhow", + "libc", + "strum 0.24.1", + "strum_macros 0.24.3", + "tempfile", + "thiserror 1.0.69", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", +] + +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmparser" +version = "0.102.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +dependencies = [ + "indexmap 1.9.3", + "url", +] + +[[package]] +name = "wasmtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "object 0.30.4", + "once_cell", + "paste", + "psm", + "rayon", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-cache", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" +dependencies = [ + "anyhow", + "base64 0.21.7", + "bincode", + "directories-next", + "file-per-thread-logger", + "log", + "rustix 0.36.17", + "serde", + "sha2 0.10.8", + "toml 0.5.11", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "wasmtime-cranelift" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.27.3", + "log", + "object 0.30.4", + "target-lexicon", + "thiserror 1.0.69", + "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-environ" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.27.3", + "indexmap 1.9.3", + "log", + "object 0.30.4", + "serde", + "target-lexicon", + "thiserror 1.0.69", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" +dependencies = [ + "addr2line 0.19.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.27.3", + "log", + "object 0.30.4", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" +dependencies = [ + "object 0.30.4", + "once_cell", + "rustix 0.36.17", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-runtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "paste", + "rand 0.8.5", + "rustix 0.36.17", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-types" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror 1.0.69", + "wasmparser", +] + [[package]] name = "web-sys" version = "0.3.77" @@ -6973,6 +11995,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.9", + "untrusted 0.9.0", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -7046,6 +12078,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.53.0" @@ -7119,6 +12160,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7146,6 +12196,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -7177,6 +12242,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7189,6 +12260,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7201,6 +12278,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7219,6 +12302,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7231,6 +12320,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7243,6 +12338,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7255,6 +12356,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7322,29 +12429,63 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "serde", "zeroize", ] +[[package]] +name = "x509-parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs 0.5.2", + "data-encoding", + "der-parser 8.2.0", + "lazy_static", + "nom", + "oid-registry 0.6.1", + "rusticata-macros", + "thiserror 1.0.69", + "time", +] + [[package]] name = "x509-parser" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs", + "asn1-rs 0.6.2", "data-encoding", - "der-parser", + "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry", + "oid-registry 0.7.1", "rusticata-macros", "thiserror 1.0.69", "time", ] +[[package]] +name = "x509-parser" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460" +dependencies = [ + "asn1-rs 0.7.0", + "data-encoding", + "der-parser 10.0.0", + "lazy_static", + "nom", + "oid-registry 0.8.1", + "rusticata-macros", + "thiserror 2.0.11", + "time", +] + [[package]] name = "xcm-procedural" version = "11.0.0" @@ -7363,10 +12504,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27196c596b9175eb068f7e34da0be09e26806ae69cb8cbc837f26dff494ef1e" dependencies = [ - "frame-support 39.0.0", + "frame-support", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-weights", "staging-xcm", "staging-xcm-executor", @@ -7396,7 +12537,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "static_assertions", @@ -7411,7 +12552,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot", + "parking_lot 0.12.3", "pin-project", "rand 0.8.5", "static_assertions", @@ -7448,7 +12589,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure", + "synstructure 0.13.1", ] [[package]] @@ -7510,7 +12651,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure", + "synstructure 0.13.1", ] [[package]] @@ -7554,3 +12695,51 @@ dependencies = [ "quote", "syn 2.0.98", ] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.14+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 1632721..ad4bdbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ members = [ "pallets/randomness-beacon", "pallets/idn-manager", "support/traits", + "test-utils/client", + "test-utils/runtime", ] resolver = "2" @@ -47,20 +49,67 @@ default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic [workspace.dependencies] # Async & Concurrency async-trait = "0.1.85" +futures = "0.3" +thiserror = { version = "1.0.64" } tokio = { version = "^1", features = ["full"] } # Serialization +array-bytes = { version = "6.2.2", default-features = false } serde = { version = "1.0.197", default-features = false } +serde_json = { version = "1.0.132", default-features = false } # Polkadot & Substrate -frame-benchmarking = { version = "38.0.0", default-features = false } -frame-support = { version = "38.0.0", default-features = false } -frame-system = { version = "38.0.0", default-features = false } -sp-core = { version = "34.0.0", default-features = false } -sp-inherents = { version = "34.0.0", default-features = false } -sp-io = { version = "38.0.0", default-features = false } +frame-benchmarking = { version = "39.0.0", default-features = false } +frame-executive = { version = "39.0.0", default-features = false } +frame-metadata-hash-extension = { version = "0.7.0", default-features = false } +frame-support = { version = "39.0.0", default-features = false } +frame-system = { version = "39.1.0", default-features = false } +frame-system-rpc-runtime-api = { version = "35.0.0", default-features = false } +pallet-babe = { version = "39.0.0", default-features = false } +pallet-balances = { version = "40.0.1", default-features = false } +pallet-timestamp = { version = "38.0.0", default-features = false } +sc-basic-authorship = { version = "0.48.0", default-features = false } +sc-block-builder = { version = "0.43.0", default-features = false } +sc-client-api = { version = "38.0.0", default-features = false } +sc-consensus = { version = "0.47.0", default-features = false } +sc-consensus-manual-seal = { version = "0.49.0", default-features = false } +sc-chain-spec = { version = "41.0.0", default-features = false } +sc-client-db = { version = "0.45.0", default-features = false } +sc-executor = { version = "0.41.0", default-features = false } +sc-executor-common = { version = "0.36.0", default-features = false } +sc-offchain = { version = "43.0.0", default-features = false } +sc-service = { version = "0.49.0", default-features = false } +sc-transaction-pool = { version = "38.1.0", default-features = false } +sc-transaction-pool-api = { version = "38.1.0", default-features = false } +sp-api = { version = "35.0.0", default-features = false } +sp-application-crypto = { version = "39.0.0", default-features = false } +sp-blockchain = { version = "38.0.0", default-features = false } +sp-block-builder = { version = "35.0.0", default-features = false } +sp-consensus = { version = "0.41.0", default-features = false } +sp-consensus-aura = { version = "0.41.0", default-features = false } +sp-consensus-babe = { version = "0.41.0", default-features = false } +sp-consensus-grandpa = { version = "22.0.0", default-features = false } +sp-core = { version = "35.0.0", default-features = false } +sp-crypto-hashing = { version = "0.1.0", default-features = false } +sp-externalities = { version = "0.30.0", default-features = false } +sp-genesis-builder = { version = "0.16.0", default-features = false } +sp-inherents = { version = "35.0.0", default-features = false } +sp-io = { version = "39.0.0", default-features = false } +sp-keyring = { version = "40.0.0", default-features = false } sp-keystore = { version = "0.34.0", default-features = false } -sp-runtime = { version = "39.0.3", default-features = false } +sp-offchain = { version = "35.0.0", default-features = false } +sp-runtime = { version = "40.1.0", default-features = false } +sp-session = { version = "37.0.0", default-features = false } +sp-state-machine = { version = "0.44.0", default-features = false } +sp-tracing = { version = "17.0.1", default-features = false } +sp-trie = { version = "38.0.0", default-features = false } +sp-transaction-pool = { version = "35.0.0", default-features = false } +sp-version = { version = "38.0.0", default-features = false } +substrate-test-client = { path = "./test-utils/client" } # yanked from crates.io +substrate-test-runtime = { path = "./test-utils/runtime" } +substrate-test-runtime-transaction-pool = { path = "./test-utils/runtime/transaction-pool" } # yanked from crates.io +substrate-test-runtime-client = { path = "./test-utils/runtime/client" } # yanked from crates.io +substrate-wasm-builder = { version = "25.0.0", default-features = false } # Arkworks (crypto) sp-ark-bls12-381 = { git = "https://github.com/paritytech/arkworks-substrate", version = "0.4.2", default-features = false } @@ -71,7 +120,9 @@ ark-std = { version = "0.4.0", default-features = false } # Logging & Utilities log = { version = "0.4.21", default-features = false } - +parking_lot = { version = "0.12.1", default-features = false } +tracing = { version = "0.1.41", default-features = false } +trie-db = { version = "0.29.1", default-features = false } # Parity SCALE Codec codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index ae2a08c..6e4319c 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -28,8 +28,13 @@ libp2p = { version = "0.55.0", features = [ prost = "0.13.4" prost-types = "0.13.4" log = { workspace = true } -futures = "0.3" +futures.workspace = true scale-info.workspace = true +sc-consensus-manual-seal.workspace = true +sp-api.workspace = true +sp-blockchain.workspace = true +sp-inherents = {workspace = true, default-features = true } +sp-runtime.workspace = true # arkworks dependencies sp-ark-bls12-381 = { workspace = true, optional = true } @@ -43,8 +48,16 @@ prost-build = "0.13.4" async-std = "1.13.0" futures-timer = "3.0.3" rand = "0.8.5" -tokio = { version = "1.43.0", features = ["full"] } +tokio.workspace = true +substrate-test-runtime-transaction-pool.workspace = true +substrate-test-runtime-client.workspace = true +sc-basic-authorship.workspace = true +sc-consensus.workspace = true +sc-transaction-pool.workspace = true +sc-transaction-pool-api.workspace = true +sp-core = { workspace = true, default-features = true } + [features] e2e = [] host-arkworks = ["sp-ark-bls12-381/std"] \ No newline at end of file diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 0f9a977..f39d6c3 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -27,7 +27,7 @@ //! //! ## Examples //! -//! ``` +//! ``` no_run //! use sc_consensus_randomness_beacon::gossipsub::{GossipsubNetwork, GossipsubState}; //! use sc_consensus_randomness_beacon::types::*; //! use futures::StreamExt; diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs new file mode 100644 index 0000000..9c524c7 --- /dev/null +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -0,0 +1,252 @@ +/* + * Copyright 2025 by Ideal Labs, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//! # Inherent-Data Sync based consensus mechanism +//! +//! This consensus mechanism produces blocks whenever it has the necessary data as required by inherent data providers. +//! Specifically, the goal is to author a block whenever there are N new messages in a queue +//! + +// use futures::prelude::*; +// use futures_timer::Delay; +// use prometheus_endpoint::Registry; +// use sc_client_api::{ +// backend::{Backend as ClientBackend, Finalizer}, +// client::BlockchainEvents, +// }; +// use sc_consensus::{ +// block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, +// import_queue::{BasicQueue, BoxBlockImport, Verifier}, +// }; +use sc_consensus_manual_seal::{ + consensus::ConsensusDataProvider, + EngineCommand, + ManualSealParams, + run_manual_seal +}; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::HeaderBackend; +// use sp_consensus::{Environment, Proposer, SelectChain}; +// use sp_core::traits::SpawnNamed; +use sp_inherents::CreateInherentDataProviders; +use sp_runtime::{traits::Block as BlockT, ConsensusEngineId}; +use std::{marker::PhantomData, sync::Arc, time::Duration}; + +const LOG_TARGET: &str = "drand-lock-step"; + +// / The `ConsensusEngineId` of Manual Seal. +// pub const MANUAL_SEAL_ENGINE_ID: ConsensusEngineId = [b'm', b'a', b'n', b'l']; + +/// Params required to start the data-sync sealing authorship task. +pub struct ConsensusParams, TP, SC, CIDP, P> { + /// Block import instance for well. importing blocks. + pub block_import: BI, + + /// The environment we are producing blocks for. + pub env: E, + + /// Client instance + pub client: Arc, + + /// Shared reference to the transaction pool. + pub pool: Arc, + + /// SelectChain strategy. + pub select_chain: SC, + + /// Digest provider for inclusion in blocks. + pub consensus_data_provider: Option>>, + + /// Something that can create the inherent data providers. + pub create_inherent_data_providers: CIDP, +} + + +// /// runs the background authorship task for the randomness-beacon pulse-based seal engine. +// /// It creates a new block for every N pulses from a randomness beacon ingested into a queue +// pub async fn run( +// ConsensusParams { +// block_import, +// env, +// client, +// pool, +// select_chain, +// consensus_data_provider, +// create_inherent_data_providers, +// }: ConsensusParams, +// ) where +// B: BlockT + 'static, +// BI: BlockImport + Send + Sync + 'static, +// C: HeaderBackend + Finalizer + ProvideRuntimeApi + 'static, +// CB: ClientBackend + 'static, +// E: Environment + 'static, +// E::Proposer: Proposer, +// SC: SelectChain + 'static, +// TP: TransactionPool, +// CIDP: CreateInherentDataProviders, +// P: codec::Encode + Send + Sync + 'static, +// { +// // instant-seal creates blocks as soon as transactions are imported +// // into the transaction pool. +// let commands_stream = pool.import_notification_stream().map(|_| EngineCommand::SealNewBlock { +// create_empty: true, +// finalize: false, +// parent_hash: None, +// sender: None, +// }); + +// run_manual_seal(ManualSealParams { +// block_import, +// env, +// client, +// pool, +// commands_stream, +// select_chain, +// consensus_data_provider, +// create_inherent_data_providers, +// }) +// .await +// } + +#[cfg(test)] +mod tests { + use super::*; + use sc_basic_authorship::ProposerFactory; + use sc_consensus::{BlockImportParams, ImportedAux}; + use sc_consensus_manual_seal::{CreatedBlock, Error}; + use sc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; + use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; + use sp_inherents::InherentData; + use sp_runtime::generic::{Digest, DigestItem}; + use substrate_test_runtime_client::{ + DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, + }; + use substrate_test_runtime_client::AccountKeyring::Alice; + use substrate_test_runtime_transaction_pool::{uxt, TestApi}; + use futures::StreamExt; + + fn api() -> Arc { + Arc::new(TestApi::empty()) + } + + const SOURCE: TransactionSource = TransactionSource::External; + + struct TestDigestProvider { + _client: Arc, + } + impl ConsensusDataProvider for TestDigestProvider + where + B: BlockT, + C: ProvideRuntimeApi + Send + Sync, + { + type Proof = (); + + fn create_digest( + &self, + _parent: &B::Header, + _inherents: &InherentData, + ) -> Result { + Ok(Digest { logs: vec![] }) + } + + fn append_block_import( + &self, + _parent: &B::Header, + params: &mut BlockImportParams, + _inherents: &InherentData, + _proof: Self::Proof, + ) -> Result<(), Error> { + params.post_digests.push(DigestItem::Other(vec![1])); + Ok(()) + } + } + + + #[tokio::test] + async fn instant_seal() { + let builder = TestClientBuilder::new(); + let (client, select_chain) = builder.build_with_longest_chain(); + let client = Arc::new(client); + let spawner = sp_core::testing::TaskExecutor::new(); + let genesis_hash = client.info().genesis_hash; + let pool_api = Arc::new(FullChainApi::new(client.clone(), None, &spawner.clone())); + let pool = Arc::new(BasicPool::with_revalidation_type( + Options::default(), + true.into(), + pool_api, + None, + RevalidationType::Full, + spawner.clone(), + 0, + genesis_hash, + genesis_hash, + )); + let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None); + // this test checks that blocks are created as soon as transactions are imported into the + // pool. + let (sender, receiver) = futures::channel::oneshot::channel(); + let mut sender = Arc::new(Some(sender)); + let commands_stream = + pool.pool().validated_pool().import_notification_stream().map(move |_| { + // we're only going to submit one tx so this fn will only be called once. + let mut_sender = Arc::get_mut(&mut sender).unwrap(); + let sender = std::mem::take(mut_sender); + EngineCommand::SealNewBlock { + create_empty: false, + finalize: true, + parent_hash: None, + sender, + } + }); + + // spawn the background authorship task + tokio::spawn(run_manual_seal(ManualSealParams { + block_import: client.clone(), + env, + client: client.clone(), + pool: pool.clone(), + commands_stream, + select_chain, + create_inherent_data_providers: |_, _| async { Ok(()) }, + consensus_data_provider: None, + })); + + // submit a transaction to pool. + let result = pool.submit_one(genesis_hash, SOURCE, uxt(Alice, 0)).await; + // assert that it was successfully imported + assert!(result.is_ok()); + // assert that the background task returns ok + let created_block = receiver.await.unwrap().unwrap(); + assert_eq!( + created_block, + CreatedBlock { + hash: created_block.hash, + aux: ImportedAux { + header_only: false, + clear_justification_requests: false, + needs_justification: false, + bad_justification: false, + is_new_best: true, + }, + proof_size: 0 + } + ); + // assert that there's a new block in the db. + assert!(client.header(created_block.hash).unwrap().is_some()); + assert_eq!(client.header(created_block.hash).unwrap().unwrap().number, 1) + } + +} \ No newline at end of file diff --git a/client/consensus/randomness-beacon/src/lib.rs b/client/consensus/randomness-beacon/src/lib.rs index b76c8cf..cbf5541 100644 --- a/client/consensus/randomness-beacon/src/lib.rs +++ b/client/consensus/randomness-beacon/src/lib.rs @@ -17,4 +17,5 @@ extern crate alloc; pub mod gossipsub; +pub mod instant_seal; pub mod types; diff --git a/test-utils/client/Cargo.toml b/test-utils/client/Cargo.toml new file mode 100644 index 0000000..ebd1eab --- /dev/null +++ b/test-utils/client/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "substrate-test-client" +description = "Client testing utilities" +version = "2.0.1" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +homepage.workspace = true +repository.workspace = true +publish = false + +[lints] +workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +array-bytes = { workspace = true, default-features = true } +async-trait = { workspace = true } +codec = { workspace = true, default-features = true } +futures = { workspace = true } +serde = { workspace = true, default-features = true } +serde_json = { workspace = true, default-features = true } +sc-client-api = { workspace = true, default-features = true } +sc-client-db = { features = [ + "test-helpers", +], workspace = true } +sc-consensus = { workspace = true, default-features = true } +sc-executor = { workspace = true, default-features = true } +sc-offchain = { workspace = true, default-features = true } +sc-service = { features = [ + "test-helpers", +], workspace = true } +sp-blockchain = { workspace = true, default-features = true } +sp-consensus = { workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } +sp-keyring = { workspace = true, default-features = true } +sp-keystore = { workspace = true, default-features = true } +sp-runtime = { workspace = true, default-features = true } +sp-state-machine = { workspace = true, default-features = true } +tokio = { features = ["sync"], workspace = true, default-features = true } diff --git a/test-utils/client/src/client_ext.rs b/test-utils/client/src/client_ext.rs new file mode 100644 index 0000000..a4f91f2 --- /dev/null +++ b/test-utils/client/src/client_ext.rs @@ -0,0 +1,206 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client extension for tests. + +use sc_client_api::{backend::Finalizer, client::BlockBackend}; +use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; +use sc_service::client::Client; +use sp_consensus::Error as ConsensusError; +use sp_runtime::{traits::Block as BlockT, Justification, Justifications}; + +pub use sp_consensus::BlockOrigin; + +/// Extension trait for a test client. +pub trait ClientExt: Sized { + /// Finalize a block. + fn finalize_block( + &self, + hash: Block::Hash, + justification: Option, + ) -> sp_blockchain::Result<()>; + + /// Returns hash of the genesis block. + fn genesis_hash(&self) -> ::Hash; +} + +/// Extension trait for a test client around block importing. +#[async_trait::async_trait] +pub trait ClientBlockImportExt: Sized { + /// Import block to the chain. No finality. + async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError>; + + /// Import a block and make it our best block if possible. + async fn import_as_best(&self, origin: BlockOrigin, block: Block) + -> Result<(), ConsensusError>; + + /// Import a block and finalize it. + async fn import_as_final( + &self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError>; + + /// Import block with justification(s), finalizes block. + async fn import_justified( + &self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError>; +} + +impl ClientExt for Client +where + B: sc_client_api::backend::Backend, + E: sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + 'static, + Self: BlockImport, + Block: BlockT, +{ + fn finalize_block( + &self, + hash: Block::Hash, + justification: Option, + ) -> sp_blockchain::Result<()> { + Finalizer::finalize_block(self, hash, justification, true) + } + + fn genesis_hash(&self) -> ::Hash { + self.block_hash(0u32.into()).unwrap().unwrap() + } +} + +/// This implementation is required, because of the weird api requirements around `BlockImport`. +#[async_trait::async_trait] +impl ClientBlockImportExt for std::sync::Arc +where + for<'r> &'r T: BlockImport, + T: Send + Sync, +{ + async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_best( + &self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_final( + &self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_justified( + &self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.justifications = Some(justifications); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } +} + +#[async_trait::async_trait] +impl ClientBlockImportExt for Client +where + Self: BlockImport, + RA: Send + Sync, + B: Send + Sync, + E: Send + Sync, +{ + async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_best( + &self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_as_final( + &self, + origin: BlockOrigin, + block: Block, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); + + BlockImport::import_block(self, import).await.map(|_| ()) + } + + async fn import_justified( + &self, + origin: BlockOrigin, + block: Block, + justifications: Justifications, + ) -> Result<(), ConsensusError> { + let (header, extrinsics) = block.deconstruct(); + let mut import = BlockImportParams::new(origin, header); + import.justifications = Some(justifications); + import.body = Some(extrinsics); + import.finalized = true; + import.fork_choice = Some(ForkChoiceStrategy::LongestChain); + + BlockImport::import_block(self, import).await.map(|_| ()) + } +} diff --git a/test-utils/client/src/lib.rs b/test-utils/client/src/lib.rs new file mode 100644 index 0000000..c076406 --- /dev/null +++ b/test-utils/client/src/lib.rs @@ -0,0 +1,450 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client testing utilities. + +#![warn(missing_docs)] + +pub mod client_ext; + +pub use self::client_ext::{BlockOrigin, ClientBlockImportExt, ClientExt}; +pub use sc_client_api::{execution_extensions::ExecutionExtensions, BadBlocks, ForkBlocks}; +pub use sc_client_db::{self, Backend, BlocksPruning}; +pub use sc_executor::{self, WasmExecutionMethod, WasmExecutor}; +pub use sc_service::{client, RpcHandlers}; +pub use sp_consensus; +pub use sp_keyring::{ + ed25519::Keyring as Ed25519Keyring, sr25519::Keyring as Sr25519Keyring, AccountKeyring, +}; +pub use sp_keystore::{Keystore, KeystorePtr}; +pub use sp_runtime::{Storage, StorageChild}; + +use futures::{future::Future, stream::StreamExt}; +use sc_client_api::BlockchainEvents; +use sc_service::client::{ClientConfig, LocalCallExecutor}; +use serde::Deserialize; +use sp_core::{storage::ChildInfo, testing::TaskExecutor}; +use sp_runtime::{ + codec::Encode, + traits::{Block as BlockT, Header}, + OpaqueExtrinsic, +}; +use std::{ + collections::{HashMap, HashSet}, + pin::Pin, + sync::Arc, +}; + +/// A genesis storage initialization trait. +pub trait GenesisInit: Default { + /// Construct genesis storage. + fn genesis_storage(&self) -> Storage; +} + +impl GenesisInit for () { + fn genesis_storage(&self) -> Storage { + Default::default() + } +} + +/// A builder for creating a test client instance. +pub struct TestClientBuilder { + genesis_init: G, + /// The key is an unprefixed storage key, this only contains + /// default child trie content. + child_storage_extension: HashMap, StorageChild>, + backend: Arc, + _executor: std::marker::PhantomData, + fork_blocks: ForkBlocks, + bad_blocks: BadBlocks, + enable_offchain_indexing_api: bool, + enable_import_proof_recording: bool, + no_genesis: bool, +} + +impl Default + for TestClientBuilder, G> +{ + fn default() -> Self { + Self::with_default_backend() + } +} + +impl + TestClientBuilder, G> +{ + /// Create new `TestClientBuilder` with default backend. + pub fn with_default_backend() -> Self { + let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); + Self::with_backend(backend) + } + + /// Create new `TestClientBuilder` with default backend and pruning window size + pub fn with_pruning_window(blocks_pruning: u32) -> Self { + let backend = Arc::new(Backend::new_test(blocks_pruning, 0)); + Self::with_backend(backend) + } + + /// Create new `TestClientBuilder` with default backend and storage chain mode + pub fn with_tx_storage(blocks_pruning: u32) -> Self { + let backend = + Arc::new(Backend::new_test_with_tx_storage(BlocksPruning::Some(blocks_pruning), 0)); + Self::with_backend(backend) + } +} + +impl + TestClientBuilder +{ + /// Create a new instance of the test client builder. + pub fn with_backend(backend: Arc) -> Self { + TestClientBuilder { + backend, + child_storage_extension: Default::default(), + genesis_init: Default::default(), + _executor: Default::default(), + fork_blocks: None, + bad_blocks: None, + enable_offchain_indexing_api: false, + no_genesis: false, + enable_import_proof_recording: false, + } + } + + /// Alter the genesis storage parameters. + pub fn genesis_init_mut(&mut self) -> &mut G { + &mut self.genesis_init + } + + /// Give access to the underlying backend of these clients + pub fn backend(&self) -> Arc { + self.backend.clone() + } + + /// Extend child storage + pub fn add_child_storage( + mut self, + child_info: &ChildInfo, + key: impl AsRef<[u8]>, + value: impl AsRef<[u8]>, + ) -> Self { + let storage_key = child_info.storage_key(); + let entry = self.child_storage_extension.entry(storage_key.to_vec()).or_insert_with(|| { + StorageChild { data: Default::default(), child_info: child_info.clone() } + }); + entry.data.insert(key.as_ref().to_vec(), value.as_ref().to_vec()); + self + } + + /// Sets custom block rules. + pub fn set_block_rules( + mut self, + fork_blocks: ForkBlocks, + bad_blocks: BadBlocks, + ) -> Self { + self.fork_blocks = fork_blocks; + self.bad_blocks = bad_blocks; + self + } + + /// Enable the offchain indexing api. + pub fn enable_offchain_indexing_api(mut self) -> Self { + self.enable_offchain_indexing_api = true; + self + } + + /// Enable proof recording on import. + pub fn enable_import_proof_recording(mut self) -> Self { + self.enable_import_proof_recording = true; + self + } + + /// Disable writing genesis. + pub fn set_no_genesis(mut self) -> Self { + self.no_genesis = true; + self + } + + /// Build the test client with the given native executor. + pub fn build_with_executor( + self, + executor: ExecutorDispatch, + ) -> ( + client::Client, + sc_consensus::LongestChain, + ) + where + ExecutorDispatch: + sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + Clone + 'static, + Backend: sc_client_api::backend::Backend, + >::OffchainStorage: 'static, + { + let storage = { + let mut storage = self.genesis_init.genesis_storage(); + // Add some child storage keys. + for (key, child_content) in self.child_storage_extension { + storage.children_default.insert( + key, + StorageChild { + data: child_content.data.into_iter().collect(), + child_info: child_content.child_info, + }, + ); + } + + storage + }; + + let client_config = ClientConfig { + enable_import_proof_recording: self.enable_import_proof_recording, + offchain_indexing_api: self.enable_offchain_indexing_api, + no_genesis: self.no_genesis, + ..Default::default() + }; + + let genesis_block_builder = sc_service::GenesisBlockBuilder::new( + &storage, + !client_config.no_genesis, + self.backend.clone(), + executor.clone(), + ) + .expect("Creates genesis block builder"); + + let spawn_handle = Box::new(TaskExecutor::new()); + + let client = client::Client::new( + self.backend.clone(), + executor, + spawn_handle, + genesis_block_builder, + self.fork_blocks, + self.bad_blocks, + None, + None, + client_config, + ) + .expect("Creates new client"); + + let longest_chain = sc_consensus::LongestChain::new(self.backend); + + (client, longest_chain) + } +} + +impl + TestClientBuilder>, Backend, G> +{ + /// Build the test client with the given native executor. + pub fn build_with_native_executor( + self, + executor: I, + ) -> ( + client::Client< + Backend, + client::LocalCallExecutor>, + Block, + RuntimeApi, + >, + sc_consensus::LongestChain, + ) + where + I: Into>>, + Backend: sc_client_api::backend::Backend + 'static, + H: sc_executor::HostFunctions, + { + let executor = executor.into().unwrap_or_else(|| WasmExecutor::::builder().build()); + let executor = LocalCallExecutor::new( + self.backend.clone(), + executor.clone(), + Default::default(), + ExecutionExtensions::new(None, Arc::new(executor)), + ) + .expect("Creates LocalCallExecutor"); + + self.build_with_executor(executor) + } +} + +/// The output of an RPC transaction. +pub struct RpcTransactionOutput { + /// The output string of the transaction if any. + pub result: String, + /// An async receiver if data will be returned via a callback. + pub receiver: tokio::sync::mpsc::Receiver, +} + +impl std::fmt::Debug for RpcTransactionOutput { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "RpcTransactionOutput {{ result: {:?}, receiver }}", self.result) + } +} + +/// An error for when the RPC call fails. +#[derive(Deserialize, Debug)] +pub struct RpcTransactionError { + /// A Number that indicates the error type that occurred. + pub code: i64, + /// A String providing a short description of the error. + pub message: String, + /// A Primitive or Structured value that contains additional information about the error. + pub data: Option, +} + +impl std::fmt::Display for RpcTransactionError { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + std::fmt::Debug::fmt(self, f) + } +} + +/// An extension trait for `RpcHandlers`. +#[async_trait::async_trait] +pub trait RpcHandlersExt { + /// Send a transaction through the RpcHandlers. + async fn send_transaction( + &self, + extrinsic: OpaqueExtrinsic, + ) -> Result; +} + +#[async_trait::async_trait] +impl RpcHandlersExt for RpcHandlers { + async fn send_transaction( + &self, + extrinsic: OpaqueExtrinsic, + ) -> Result { + let (result, rx) = self + .rpc_query(&format!( + r#"{{ + "jsonrpc": "2.0", + "method": "author_submitExtrinsic", + "params": ["0x{}"], + "id": 0 + }}"#, + array_bytes::bytes2hex("", &extrinsic.encode()) + )) + .await + .expect("valid JSON-RPC request object; qed"); + parse_rpc_result(result, rx) + } +} + +pub(crate) fn parse_rpc_result( + result: String, + receiver: tokio::sync::mpsc::Receiver, +) -> Result { + let json: serde_json::Value = + serde_json::from_str(&result).expect("the result can only be a JSONRPC string; qed"); + let error = json.as_object().expect("JSON result is always an object; qed").get("error"); + + if let Some(error) = error { + return Err(serde_json::from_value(error.clone()) + .expect("the JSONRPC result's error is always valid; qed")) + } + + Ok(RpcTransactionOutput { result, receiver }) +} + +/// An extension trait for `BlockchainEvents`. +pub trait BlockchainEventsExt +where + C: BlockchainEvents, + B: BlockT, +{ + /// Wait for `count` blocks to be imported in the node and then exit. This function will not + /// return if no blocks are ever created, thus you should restrict the maximum amount of time of + /// the test execution. + fn wait_for_blocks(&self, count: usize) -> Pin + Send>>; +} + +impl BlockchainEventsExt for C +where + C: BlockchainEvents, + B: BlockT, +{ + fn wait_for_blocks(&self, count: usize) -> Pin + Send>> { + assert!(count > 0, "'count' argument must be greater than 0"); + + let mut import_notification_stream = self.import_notification_stream(); + let mut blocks = HashSet::new(); + + Box::pin(async move { + while let Some(notification) = import_notification_stream.next().await { + if notification.is_new_best { + blocks.insert(*notification.header.number()); + if blocks.len() == count { + break + } + } + } + }) + } +} + +#[cfg(test)] +mod tests { + #[test] + fn parses_error_properly() { + let (_, rx) = tokio::sync::mpsc::channel(1); + assert!(super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "result": 19, + "id": 1 + }"# + .to_string(), + rx + ) + .is_ok()); + + let (_, rx) = tokio::sync::mpsc::channel(1); + let error = super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "error": { + "code": -32601, + "message": "Method not found" + }, + "id": 1 + }"# + .to_string(), + rx, + ) + .unwrap_err(); + assert_eq!(error.code, -32601); + assert_eq!(error.message, "Method not found"); + assert!(error.data.is_none()); + + let (_, rx) = tokio::sync::mpsc::channel(1); + let error = super::parse_rpc_result( + r#"{ + "jsonrpc": "2.0", + "error": { + "code": -32601, + "message": "Method not found", + "data": 42 + }, + "id": 1 + }"# + .to_string(), + rx, + ) + .unwrap_err(); + assert_eq!(error.code, -32601); + assert_eq!(error.message, "Method not found"); + assert!(error.data.is_some()); + } +} diff --git a/test-utils/runtime/Cargo.toml b/test-utils/runtime/Cargo.toml new file mode 100644 index 0000000..1c82c73 --- /dev/null +++ b/test-utils/runtime/Cargo.toml @@ -0,0 +1,120 @@ +[package] +name = "substrate-test-runtime" +version = "2.0.0" +authors.workspace = true +edition.workspace = true +build = "build.rs" +license = "Apache-2.0" +homepage.workspace = true +repository.workspace = true +publish = false + +[lints] +workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +sp-application-crypto = { features = ["serde"], workspace = true } +sp-consensus-aura = { features = ["serde"], workspace = true } +sp-consensus-babe = { features = ["serde"], workspace = true } +sp-genesis-builder = { workspace = true } +sp-block-builder = { workspace = true } +codec = { features = ["derive"], workspace = true } +scale-info = { features = ["derive"], workspace = true } +sp-inherents = { workspace = true } +sp-keyring = { workspace = true } +sp-offchain = { workspace = true } +sp-core = { features = ["serde"], workspace = true } +sp-crypto-hashing = { workspace = true } +sp-io = { workspace = true } +frame-support = { workspace = true } +sp-version = { workspace = true } +sp-session = { workspace = true } +sp-api = { workspace = true } +sp-runtime = { features = ["serde"], workspace = true } +pallet-babe = { workspace = true } +pallet-balances = { workspace = true } +frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } +frame-system = { workspace = true } +frame-system-rpc-runtime-api = { workspace = true } +pallet-timestamp = { workspace = true } +sp-consensus-grandpa = { features = ["serde"], workspace = true } +sp-trie = { workspace = true } +sp-transaction-pool = { workspace = true } +trie-db = { workspace = true } +sc-service = { features = ["test-helpers"], optional = true, workspace = true } +sp-state-machine = { workspace = true } +sp-externalities = { workspace = true } + +# 3rd party +array-bytes = { optional = true, workspace = true, default-features = true } +serde_json = { workspace = true, features = ["alloc"] } +log = { workspace = true } +tracing = { workspace = true, default-features = false } + +[dev-dependencies] +futures = { workspace = true } +sc-block-builder = { workspace = true, default-features = true } +sc-chain-spec = { workspace = true, default-features = true } +sc-executor = { workspace = true, default-features = true } +sc-executor-common = { workspace = true, default-features = true } +sp-consensus = { workspace = true, default-features = true } +substrate-test-runtime-client = { workspace = true } +sp-tracing = { workspace = true, default-features = true } +serde = { features = ["alloc", "derive"], workspace = true } +serde_json = { features = ["alloc"], workspace = true } + +[build-dependencies] +substrate-wasm-builder = { optional = true, features = ["metadata-hash"], workspace = true, default-features = true } + +[features] +default = ["std"] + +std = [ + "array-bytes", + "codec/std", + "frame-executive/std", + "frame-metadata-hash-extension/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "log/std", + "pallet-babe/std", + "pallet-balances/std", + "pallet-timestamp/std", + "sc-executor/std", + "sc-service", + "scale-info/std", + "serde/std", + "serde_json/std", + "sp-api/std", + "sp-application-crypto/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-consensus-babe/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-crypto-hashing/std", + "sp-externalities/std", + "sp-genesis-builder/std", + "sp-inherents/std", + "sp-io/std", + "sp-keyring/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-state-machine/std", + "sp-tracing/std", + "sp-transaction-pool/std", + "sp-trie/std", + "sp-version/std", + "substrate-wasm-builder", + "tracing/std", + "trie-db/std", +] + +# Special feature to disable logging +disable-logging = ["sp-api/disable-logging"] diff --git a/test-utils/runtime/build.rs b/test-utils/runtime/build.rs new file mode 100644 index 0000000..d38173f --- /dev/null +++ b/test-utils/runtime/build.rs @@ -0,0 +1,43 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +fn main() { + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + // Note that we set the stack-size to 1MB explicitly even though it is set + // to this value by default. This is because some of our tests + // (`restoration_of_globals`) depend on the stack-size. + .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") + .enable_metadata_hash("TOKEN", 10) + .import_memory() + .build(); + } + + #[cfg(feature = "std")] + { + substrate_wasm_builder::WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .set_file_name("wasm_binary_logging_disabled.rs") + .enable_feature("disable-logging") + .build(); + } +} diff --git a/test-utils/runtime/client/Cargo.toml b/test-utils/runtime/client/Cargo.toml new file mode 100644 index 0000000..5dd3c30 --- /dev/null +++ b/test-utils/runtime/client/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "substrate-test-runtime-client" +version = "2.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +homepage.workspace = true +repository.workspace = true +publish = false + +[lints] +workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +futures = { workspace = true } +sc-block-builder = { workspace = true, default-features = true } +sc-client-api = { workspace = true, default-features = true } +sc-consensus = { workspace = true, default-features = true } +sp-api = { workspace = true, default-features = true } +sp-blockchain = { workspace = true, default-features = true } +sp-consensus = { workspace = true, default-features = true } +sp-core = { workspace = true, default-features = true } +sp-runtime = { workspace = true, default-features = true } +substrate-test-client = { workspace = true } +substrate-test-runtime = { workspace = true } diff --git a/test-utils/runtime/client/src/block_builder_ext.rs b/test-utils/runtime/client/src/block_builder_ext.rs new file mode 100644 index 0000000..f7bf76b --- /dev/null +++ b/test-utils/runtime/client/src/block_builder_ext.rs @@ -0,0 +1,74 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Block Builder extensions for tests. + +use sc_block_builder::BlockBuilderApi; +use sp_api::{ApiExt, ProvideRuntimeApi}; +use substrate_test_runtime::*; + +/// Extension trait for test block builder. +pub trait BlockBuilderExt { + /// Add transfer extrinsic to the block. + fn push_transfer( + &mut self, + transfer: substrate_test_runtime::Transfer, + ) -> Result<(), sp_blockchain::Error>; + + /// Add unsigned storage change extrinsic to the block. + fn push_storage_change( + &mut self, + key: Vec, + value: Option>, + ) -> Result<(), sp_blockchain::Error>; + + /// Adds an extrinsic which pushes DigestItem to header's log + fn push_deposit_log_digest_item( + &mut self, + log: sp_runtime::generic::DigestItem, + ) -> Result<(), sp_blockchain::Error>; +} + +impl<'a, A> BlockBuilderExt for sc_block_builder::BlockBuilder<'a, substrate_test_runtime::Block, A> +where + A: ProvideRuntimeApi + + sp_api::CallApiAt + + 'a, + A::Api: BlockBuilderApi + ApiExt, +{ + fn push_transfer( + &mut self, + transfer: substrate_test_runtime::Transfer, + ) -> Result<(), sp_blockchain::Error> { + self.push(transfer.into_unchecked_extrinsic()) + } + + fn push_storage_change( + &mut self, + key: Vec, + value: Option>, + ) -> Result<(), sp_blockchain::Error> { + self.push(ExtrinsicBuilder::new_storage_change(key, value).build()) + } + + fn push_deposit_log_digest_item( + &mut self, + log: sp_runtime::generic::DigestItem, + ) -> Result<(), sp_blockchain::Error> { + self.push(ExtrinsicBuilder::new_deposit_log_digest_item(log).build()) + } +} diff --git a/test-utils/runtime/client/src/lib.rs b/test-utils/runtime/client/src/lib.rs new file mode 100644 index 0000000..435f3f5 --- /dev/null +++ b/test-utils/runtime/client/src/lib.rs @@ -0,0 +1,214 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Client testing utilities. + +#![warn(missing_docs)] + +pub mod trait_tests; + +mod block_builder_ext; + +pub use sc_consensus::LongestChain; +use std::sync::Arc; +pub use substrate_test_client::*; +pub use substrate_test_runtime as runtime; + +pub use self::block_builder_ext::BlockBuilderExt; + +use sp_core::storage::ChildInfo; +use substrate_test_runtime::genesismap::GenesisStorageBuilder; + +/// A prelude to import in tests. +pub mod prelude { + // Trait extensions + pub use super::{ + BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, + TestClientBuilderExt, + }; + // Client structs + pub use super::{ + Backend, ExecutorDispatch, TestClient, TestClientBuilder, WasmExecutionMethod, + }; + // Keyring + pub use super::{AccountKeyring, Sr25519Keyring}; +} + +/// Test client database backend. +pub type Backend = substrate_test_client::Backend; + +/// Test client executor. +pub type ExecutorDispatch = + client::LocalCallExecutor; + +/// Parameters of test-client builder with test-runtime. +#[derive(Default)] +pub struct GenesisParameters { + heap_pages_override: Option, + extra_storage: Storage, + wasm_code: Option>, +} + +impl GenesisParameters { + /// Set the wasm code that should be used at genesis. + pub fn set_wasm_code(&mut self, code: Vec) { + self.wasm_code = Some(code); + } + + /// Access extra genesis storage. + pub fn extra_storage(&mut self) -> &mut Storage { + &mut self.extra_storage + } +} + +impl GenesisInit for GenesisParameters { + fn genesis_storage(&self) -> Storage { + GenesisStorageBuilder::default() + .with_heap_pages(self.heap_pages_override) + .with_wasm_code(&self.wasm_code) + .with_extra_storage(self.extra_storage.clone()) + .build() + } +} + +/// A `TestClient` with `test-runtime` builder. +pub type TestClientBuilder = substrate_test_client::TestClientBuilder< + substrate_test_runtime::Block, + E, + B, + GenesisParameters, +>; + +/// Test client type with `WasmExecutor` and generic Backend. +pub type Client = client::Client< + B, + client::LocalCallExecutor, + substrate_test_runtime::Block, + substrate_test_runtime::RuntimeApi, +>; + +/// A test client with default backend. +pub type TestClient = Client; + +/// A `TestClientBuilder` with default backend and executor. +pub trait DefaultTestClientBuilderExt: Sized { + /// Create new `TestClientBuilder` + fn new() -> Self; +} + +impl DefaultTestClientBuilderExt for TestClientBuilder { + fn new() -> Self { + Self::with_default_backend() + } +} + +/// A `test-runtime` extensions to `TestClientBuilder`. +pub trait TestClientBuilderExt: Sized { + /// Returns a mutable reference to the genesis parameters. + fn genesis_init_mut(&mut self) -> &mut GenesisParameters; + + /// Override the default value for Wasm heap pages. + fn set_heap_pages(mut self, heap_pages: u64) -> Self { + self.genesis_init_mut().heap_pages_override = Some(heap_pages); + self + } + + /// Add an extra value into the genesis storage. + /// + /// # Panics + /// + /// Panics if the key is empty. + fn add_extra_child_storage>, V: Into>>( + mut self, + child_info: &ChildInfo, + key: K, + value: V, + ) -> Self { + let storage_key = child_info.storage_key().to_vec(); + let key = key.into(); + assert!(!storage_key.is_empty()); + assert!(!key.is_empty()); + self.genesis_init_mut() + .extra_storage + .children_default + .entry(storage_key) + .or_insert_with(|| StorageChild { + data: Default::default(), + child_info: child_info.clone(), + }) + .data + .insert(key, value.into()); + self + } + + /// Add an extra child value into the genesis storage. + /// + /// # Panics + /// + /// Panics if the key is empty. + fn add_extra_storage>, V: Into>>(mut self, key: K, value: V) -> Self { + let key = key.into(); + assert!(!key.is_empty()); + self.genesis_init_mut().extra_storage.top.insert(key, value.into()); + self + } + + /// Build the test client. + fn build(self) -> Client { + self.build_with_longest_chain().0 + } + + /// Build the test client and longest chain selector. + fn build_with_longest_chain( + self, + ) -> (Client, sc_consensus::LongestChain); + + /// Build the test client and the backend. + fn build_with_backend(self) -> (Client, Arc); +} + +impl TestClientBuilderExt + for TestClientBuilder, B> +where + B: sc_client_api::backend::Backend + 'static, +{ + fn genesis_init_mut(&mut self) -> &mut GenesisParameters { + Self::genesis_init_mut(self) + } + + fn build_with_longest_chain( + self, + ) -> (Client, sc_consensus::LongestChain) { + self.build_with_native_executor(None) + } + + fn build_with_backend(self) -> (Client, Arc) { + let backend = self.backend(); + (self.build_with_native_executor(None).0, backend) + } +} + +/// Creates new client instance used for tests. +pub fn new() -> Client { + TestClientBuilder::new().build() +} + +/// Create a new native executor. +#[deprecated(note = "Switch to `WasmExecutor:default()`.")] +pub fn new_native_or_wasm_executor() -> WasmExecutor { + WasmExecutor::default() +} diff --git a/test-utils/runtime/client/src/trait_tests.rs b/test-utils/runtime/client/src/trait_tests.rs new file mode 100644 index 0000000..c3a5f17 --- /dev/null +++ b/test-utils/runtime/client/src/trait_tests.rs @@ -0,0 +1,546 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! tests that should hold for all implementations of certain traits. +//! to test implementations without duplication. + +#![allow(missing_docs)] + +use std::sync::Arc; + +use crate::{ + AccountKeyring, BlockBuilderExt, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt, +}; +use futures::executor::block_on; +use sc_block_builder::BlockBuilderBuilder; +use sc_client_api::{ + backend, + blockchain::{Backend as BlockChainBackendT, HeaderBackend}, +}; +use sp_consensus::BlockOrigin; +use sp_runtime::traits::Block as BlockT; +use substrate_test_runtime::Transfer; + +/// helper to test the `leaves` implementation for various backends +pub fn test_leaves_for_backend(backend: Arc) +where + B: backend::Backend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + + let client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + + let genesis_hash = client.chain_info().genesis_hash; + + assert_eq!(blockchain.leaves().unwrap(), vec![genesis_hash]); + + // G -> A1 + let a1 = BlockBuilderBuilder::new(&client) + .on_parent_block(genesis_hash) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a1.hash()]); + + // A1 -> A2 + let a2 = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + assert_eq!(blockchain.leaves().unwrap(), vec![a2.hash()]); + + // A2 -> A3 + let a3 = BlockBuilderBuilder::new(&client) + .on_parent_block(a2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + assert_eq!(blockchain.leaves().unwrap(), vec![a3.hash()]); + + // A3 -> A4 + let a4 = BlockBuilderBuilder::new(&client) + .on_parent_block(a3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a4.hash()]); + + // A4 -> A5 + let a5 = BlockBuilderBuilder::new(&client) + .on_parent_block(a4.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash()]); + + // A1 -> B2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b2.hash()]); + + // B2 -> B3 + let b3 = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b3.hash()]); + + // B3 -> B4 + let b4 = BlockBuilderBuilder::new(&client) + .on_parent_block(b3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash()]); + + // // B2 -> C3 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash()]); + + // A1 -> D2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); + assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash(), d2.hash()]); +} + +/// helper to test the `children` implementation for various backends +pub fn test_children_for_backend(backend: Arc) +where + B: backend::LocalBackend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + + let client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + let genesis_hash = client.chain_info().genesis_hash; + + // G -> A1 + let a1 = BlockBuilderBuilder::new(&client) + .on_parent_block(genesis_hash) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + + // A1 -> A2 + let a2 = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + // A2 -> A3 + let a3 = BlockBuilderBuilder::new(&client) + .on_parent_block(a2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + // A3 -> A4 + let a4 = BlockBuilderBuilder::new(&client) + .on_parent_block(a3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + + // A4 -> A5 + let a5 = BlockBuilderBuilder::new(&client) + .on_parent_block(a4.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + + // A1 -> B2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + + // B2 -> B3 + let b3 = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + + // B3 -> B4 + let b4 = BlockBuilderBuilder::new(&client) + .on_parent_block(b3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4)).unwrap(); + + // // B2 -> C3 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); + + // A1 -> D2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); + + let genesis_hash = client.chain_info().genesis_hash; + + let children1 = blockchain.children(a4.hash()).unwrap(); + assert_eq!(vec![a5.hash()], children1); + + let children2 = blockchain.children(a1.hash()).unwrap(); + assert_eq!(vec![a2.hash(), b2.hash(), d2.hash()], children2); + + let children3 = blockchain.children(genesis_hash).unwrap(); + assert_eq!(vec![a1.hash()], children3); + + let children4 = blockchain.children(b2.hash()).unwrap(); + assert_eq!(vec![b3.hash(), c3.hash()], children4); +} + +pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) +where + B: backend::LocalBackend, +{ + // block tree: + // G -> A1 -> A2 -> A3 -> A4 -> A5 + // A1 -> B2 -> B3 -> B4 + // B2 -> C3 + // A1 -> D2 + let client = TestClientBuilder::with_backend(backend.clone()).build(); + let blockchain = backend.blockchain(); + let genesis_hash = client.chain_info().genesis_hash; + + // G -> A1 + let a1 = BlockBuilderBuilder::new(&client) + .on_parent_block(genesis_hash) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); + + // A1 -> A2 + let a2 = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); + + // A2 -> A3 + let a3 = BlockBuilderBuilder::new(&client) + .on_parent_block(a2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); + + // A3 -> A4 + let a4 = BlockBuilderBuilder::new(&client) + .on_parent_block(a3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); + + // A4 -> A5 + let a5 = BlockBuilderBuilder::new(&client) + .on_parent_block(a4.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); + + // A1 -> B2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise B2 has the same hash as A2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 41, + nonce: 0, + }) + .unwrap(); + let b2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); + + // B2 -> B3 + let b3 = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); + + // B3 -> B4 + let b4 = BlockBuilderBuilder::new(&client) + .on_parent_block(b3.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap() + .build() + .unwrap() + .block; + block_on(client.import(BlockOrigin::Own, b4)).unwrap(); + + // // B2 -> C3 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(b2.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise C3 has the same hash as B3 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 1, + }) + .unwrap(); + let c3 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, c3)).unwrap(); + + // A1 -> D2 + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(a1.hash()) + .fetch_parent_block_number(&client) + .unwrap() + .build() + .unwrap(); + // this push is required as otherwise D2 has the same hash as B2 and won't get imported + builder + .push_transfer(Transfer { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Ferdie.into(), + amount: 1, + nonce: 0, + }) + .unwrap(); + let d2 = builder.build().unwrap().block; + block_on(client.import(BlockOrigin::Own, d2)).unwrap(); + + let genesis_hash = client.chain_info().genesis_hash; + + assert_eq!(blockchain.hash(0).unwrap().unwrap(), genesis_hash); + assert_eq!(blockchain.hash(1).unwrap().unwrap(), a1.hash()); + assert_eq!(blockchain.hash(2).unwrap().unwrap(), a2.hash()); + assert_eq!(blockchain.hash(3).unwrap().unwrap(), a3.hash()); + assert_eq!(blockchain.hash(4).unwrap().unwrap(), a4.hash()); + assert_eq!(blockchain.hash(5).unwrap().unwrap(), a5.hash()); +} diff --git a/test-utils/runtime/res/README.md b/test-utils/runtime/res/README.md new file mode 100644 index 0000000..fdf94fd --- /dev/null +++ b/test-utils/runtime/res/README.md @@ -0,0 +1,24 @@ +`default_genesis_config.json` file has been generated by the following code: +``` + use crate::genesismap::GenesisStorageBuilder; + #[test] + fn write_default_config_to_tmp_file() { + let j = json::to_string(&GenesisStorageBuilder::default().genesis_config()).unwrap().into_bytes(); + let mut file = fs::OpenOptions::new() + .create(true) + .write(true) + .open("/tmp/default_genesis_config.json").unwrap(); + file.write_all(&j); + } +``` + +`:code` field has been manually truncated to reduce file size. Test is only +comparing keys, not the values. + +`default_genesis_config_invalid.json` is just a broken copy of +`default_genesis_config.json` with `authorities` field renamed to +`renamed_authorities`. + + +`default_genesis_config_invalid.json` is just an incomplete copy of +`default_genesis_config.json` with `babe::authorities` field removed. diff --git a/test-utils/runtime/res/default_genesis_config.json b/test-utils/runtime/res/default_genesis_config.json new file mode 100644 index 0000000..95c7799 --- /dev/null +++ b/test-utils/runtime/res/default_genesis_config.json @@ -0,0 +1,113 @@ +{ + "system": {}, + "babe": { + "authorities": [ + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 1 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 1 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 1 + ] + ], + "epochConfig": { + "c": [ + 3, + 10 + ], + "allowed_slots": "PrimaryAndSecondaryPlainSlots" + } + }, + "substrateTest": { + "authorities": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" + ] + }, + "balances": { + "balances": [ + [ + "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", + 100000000000000000 + ], + [ + "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", + 100000000000000000 + ], + [ + "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", + 100000000000000000 + ], + [ + "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", + 100000000000000000 + ], + [ + "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", + 100000000000000000 + ], + [ + "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", + 100000000000000000 + ], + [ + "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", + 100000000000000000 + ], + [ + "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", + 100000000000000000 + ], + [ + "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", + 100000000000000000 + ], + [ + "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", + 100000000000000000 + ], + [ + "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", + 100000000000000000 + ], + [ + "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", + 100000000000000000 + ], + [ + "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", + 100000000000000000 + ], + [ + "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", + 100000000000000000 + ], + [ + "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", + 100000000000000000 + ], + [ + "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", + 100000000000000000 + ], + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 100000000000000000 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 100000000000000000 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 100000000000000000 + ] + ] + } +} diff --git a/test-utils/runtime/res/default_genesis_config_incomplete.json b/test-utils/runtime/res/default_genesis_config_incomplete.json new file mode 100644 index 0000000..510ed87 --- /dev/null +++ b/test-utils/runtime/res/default_genesis_config_incomplete.json @@ -0,0 +1,99 @@ +{ + "system": {}, + "babe": { + "epochConfig": { + "c": [ + 3, + 10 + ], + "allowed_slots": "PrimaryAndSecondaryPlainSlots" + } + }, + "substrateTest": { + "authorities": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" + ] + }, + "balances": { + "balances": [ + [ + "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", + 100000000000000000 + ], + [ + "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", + 100000000000000000 + ], + [ + "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", + 100000000000000000 + ], + [ + "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", + 100000000000000000 + ], + [ + "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", + 100000000000000000 + ], + [ + "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", + 100000000000000000 + ], + [ + "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", + 100000000000000000 + ], + [ + "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", + 100000000000000000 + ], + [ + "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", + 100000000000000000 + ], + [ + "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", + 100000000000000000 + ], + [ + "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", + 100000000000000000 + ], + [ + "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", + 100000000000000000 + ], + [ + "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", + 100000000000000000 + ], + [ + "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", + 100000000000000000 + ], + [ + "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", + 100000000000000000 + ], + [ + "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", + 100000000000000000 + ], + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 100000000000000000 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 100000000000000000 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 100000000000000000 + ] + ] + } +} diff --git a/test-utils/runtime/res/default_genesis_config_invalid.json b/test-utils/runtime/res/default_genesis_config_invalid.json new file mode 100644 index 0000000..f8e06f9 --- /dev/null +++ b/test-utils/runtime/res/default_genesis_config_invalid.json @@ -0,0 +1,113 @@ +{ + "system": {}, + "babe": { + "renamed_authorities": [ + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 1 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 1 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 1 + ] + ], + "epochConfig": { + "c": [ + 3, + 10 + ], + "allowed_slots": "PrimaryAndSecondaryPlainSlots" + } + }, + "substrateTest": { + "authorities": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" + ] + }, + "balances": { + "balances": [ + [ + "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", + 100000000000000000 + ], + [ + "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", + 100000000000000000 + ], + [ + "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", + 100000000000000000 + ], + [ + "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", + 100000000000000000 + ], + [ + "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", + 100000000000000000 + ], + [ + "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", + 100000000000000000 + ], + [ + "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", + 100000000000000000 + ], + [ + "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", + 100000000000000000 + ], + [ + "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", + 100000000000000000 + ], + [ + "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", + 100000000000000000 + ], + [ + "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", + 100000000000000000 + ], + [ + "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", + 100000000000000000 + ], + [ + "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", + 100000000000000000 + ], + [ + "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", + 100000000000000000 + ], + [ + "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", + 100000000000000000 + ], + [ + "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", + 100000000000000000 + ], + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 100000000000000000 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 100000000000000000 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 100000000000000000 + ] + ] + } +} diff --git a/test-utils/runtime/res/default_genesis_config_invalid_2.json b/test-utils/runtime/res/default_genesis_config_invalid_2.json new file mode 100644 index 0000000..a134554 --- /dev/null +++ b/test-utils/runtime/res/default_genesis_config_invalid_2.json @@ -0,0 +1,113 @@ +{ + "system": {}, + "babex": { + "authorities": [ + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 1 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 1 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 1 + ] + ], + "epochConfig": { + "c": [ + 3, + 10 + ], + "allowed_slots": "PrimaryAndSecondaryPlainSlots" + } + }, + "substrateTest": { + "authorities": [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" + ] + }, + "balances": { + "balances": [ + [ + "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", + 100000000000000000 + ], + [ + "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", + 100000000000000000 + ], + [ + "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", + 100000000000000000 + ], + [ + "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", + 100000000000000000 + ], + [ + "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", + 100000000000000000 + ], + [ + "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", + 100000000000000000 + ], + [ + "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", + 100000000000000000 + ], + [ + "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", + 100000000000000000 + ], + [ + "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", + 100000000000000000 + ], + [ + "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", + 100000000000000000 + ], + [ + "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", + 100000000000000000 + ], + [ + "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", + 100000000000000000 + ], + [ + "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", + 100000000000000000 + ], + [ + "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", + 100000000000000000 + ], + [ + "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", + 100000000000000000 + ], + [ + "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", + 100000000000000000 + ], + [ + "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", + 100000000000000000 + ], + [ + "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", + 100000000000000000 + ], + [ + "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", + 100000000000000000 + ] + ] + } +} diff --git a/test-utils/runtime/src/extrinsic.rs b/test-utils/runtime/src/extrinsic.rs new file mode 100644 index 0000000..4c884d4 --- /dev/null +++ b/test-utils/runtime/src/extrinsic.rs @@ -0,0 +1,228 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Provides utils for building the `Extrinsic` instances used with `substrate-test-runtime`. + +use crate::{ + substrate_test_pallet::pallet::Call as PalletCall, AccountId, Balance, BalancesCall, + CheckSubstrateCall, Extrinsic, Nonce, Pair, RuntimeCall, SignedPayload, TransferData, +}; +use codec::Encode; +use frame_metadata_hash_extension::CheckMetadataHash; +use frame_system::{CheckNonce, CheckWeight}; +use sp_core::crypto::Pair as TraitPair; +use sp_keyring::AccountKeyring; +use sp_runtime::{ + generic::Preamble, traits::TransactionExtension, transaction_validity::TransactionPriority, + Perbill, +}; + +/// Transfer used in test substrate pallet. Extrinsic is created and signed using this data. +#[derive(Clone)] +pub struct Transfer { + /// Transfer sender and signer of created extrinsic + pub from: Pair, + /// The recipient of the transfer + pub to: AccountId, + /// Amount of transfer + pub amount: Balance, + /// Sender's account nonce at which transfer is valid + pub nonce: u64, +} + +impl Transfer { + /// Convert into a signed unchecked extrinsic. + pub fn into_unchecked_extrinsic(self) -> Extrinsic { + ExtrinsicBuilder::new_transfer(self).build() + } +} + +impl Default for TransferData { + fn default() -> Self { + Self { + from: AccountKeyring::Alice.into(), + to: AccountKeyring::Bob.into(), + amount: 0, + nonce: 0, + } + } +} + +/// If feasible converts given `Extrinsic` to `TransferData` +impl TryFrom<&Extrinsic> for TransferData { + type Error = (); + fn try_from(uxt: &Extrinsic) -> Result { + match uxt { + Extrinsic { + function: RuntimeCall::Balances(BalancesCall::transfer_allow_death { dest, value }), + preamble: Preamble::Signed(from, _, ((CheckNonce(nonce), ..), ..)), + } => Ok(TransferData { from: *from, to: *dest, amount: *value, nonce: *nonce }), + Extrinsic { + function: RuntimeCall::SubstrateTest(PalletCall::bench_call { transfer }), + preamble: Preamble::Bare(_), + } => Ok(transfer.clone()), + _ => Err(()), + } + } +} + +/// Generates `Extrinsic` +pub struct ExtrinsicBuilder { + function: RuntimeCall, + signer: Option, + nonce: Option, + metadata_hash: Option<[u8; 32]>, +} + +impl ExtrinsicBuilder { + /// Create builder for given `RuntimeCall`. By default `Extrinsic` will be signed by `Alice`. + pub fn new(function: impl Into) -> Self { + Self { + function: function.into(), + signer: Some(AccountKeyring::Alice.pair()), + nonce: None, + metadata_hash: None, + } + } + + /// Create builder for given `RuntimeCall`. `Extrinsic` will be unsigned. + pub fn new_unsigned(function: impl Into) -> Self { + Self { function: function.into(), signer: None, nonce: None, metadata_hash: None } + } + + /// Create builder for `pallet_call::bench_transfer` from given `TransferData`. + pub fn new_bench_call(transfer: TransferData) -> Self { + Self::new_unsigned(PalletCall::bench_call { transfer }) + } + + /// Create builder for given `Transfer`. Transfer `nonce` will be used as `Extrinsic` nonce. + /// Transfer `from` will be used as Extrinsic signer. + pub fn new_transfer(transfer: Transfer) -> Self { + Self { + nonce: Some(transfer.nonce), + signer: Some(transfer.from.clone()), + metadata_hash: None, + ..Self::new(BalancesCall::transfer_allow_death { + dest: transfer.to, + value: transfer.amount, + }) + } + } + + /// Create builder for `PalletCall::include_data` call using given parameters + pub fn new_include_data(data: Vec) -> Self { + Self::new(PalletCall::include_data { data }) + } + + /// Create builder for `PalletCall::storage_change` call using given parameters. Will + /// create unsigned Extrinsic. + pub fn new_storage_change(key: Vec, value: Option>) -> Self { + Self::new_unsigned(PalletCall::storage_change { key, value }) + } + + /// Create builder for `PalletCall::offchain_index_set` call using given parameters + pub fn new_offchain_index_set(key: Vec, value: Vec) -> Self { + Self::new(PalletCall::offchain_index_set { key, value }) + } + + /// Create builder for `PalletCall::offchain_index_clear` call using given parameters + pub fn new_offchain_index_clear(key: Vec) -> Self { + Self::new(PalletCall::offchain_index_clear { key }) + } + + /// Create builder for `PalletCall::indexed_call` call using given parameters + pub fn new_indexed_call(data: Vec) -> Self { + Self::new(PalletCall::indexed_call { data }) + } + + /// Create builder for `PalletCall::new_deposit_log_digest_item` call using given `log` + pub fn new_deposit_log_digest_item(log: sp_runtime::generic::DigestItem) -> Self { + Self::new_unsigned(PalletCall::deposit_log_digest_item { log }) + } + + /// Create builder for `PalletCall::Call::new_deposit_log_digest_item` + pub fn new_fill_block(ratio: Perbill) -> Self { + Self::new(PalletCall::fill_block { ratio }) + } + + /// Create builder for `PalletCall::call_do_not_propagate` call using given parameters + pub fn new_call_do_not_propagate() -> Self { + Self::new(PalletCall::call_do_not_propagate {}) + } + + /// Create builder for `PalletCall::call_with_priority` call using given parameters + pub fn new_call_with_priority(priority: TransactionPriority) -> Self { + Self::new(PalletCall::call_with_priority { priority }) + } + + /// Create builder for `PalletCall::read` call using given parameters + pub fn new_read(count: u32) -> Self { + Self::new_unsigned(PalletCall::read { count }) + } + + /// Create builder for `PalletCall::read` call using given parameters + pub fn new_read_and_panic(count: u32) -> Self { + Self::new_unsigned(PalletCall::read_and_panic { count }) + } + + /// Unsigned `Extrinsic` will be created + pub fn unsigned(mut self) -> Self { + self.signer = None; + self + } + + /// Given `nonce` will be set in `Extrinsic` + pub fn nonce(mut self, nonce: Nonce) -> Self { + self.nonce = Some(nonce); + self + } + + /// Extrinsic will be signed by `signer` + pub fn signer(mut self, signer: Pair) -> Self { + self.signer = Some(signer); + self + } + + /// Metadata hash to put into the signed data of the extrinsic. + pub fn metadata_hash(mut self, metadata_hash: [u8; 32]) -> Self { + self.metadata_hash = Some(metadata_hash); + self + } + + /// Build `Extrinsic` using embedded parameters + pub fn build(self) -> Extrinsic { + if let Some(signer) = self.signer { + let tx_ext = ( + (CheckNonce::from(self.nonce.unwrap_or(0)), CheckWeight::new()), + CheckSubstrateCall {}, + self.metadata_hash + .map(CheckMetadataHash::new_with_custom_hash) + .unwrap_or_else(|| CheckMetadataHash::new(false)), + ); + let raw_payload = SignedPayload::from_raw( + self.function.clone(), + tx_ext.clone(), + tx_ext.implicit().unwrap(), + ); + let signature = raw_payload.using_encoded(|e| signer.sign(e)); + + Extrinsic::new_signed(self.function, signer.public(), signature, tx_ext) + } else { + Extrinsic::new_bare(self.function) + } + } +} diff --git a/test-utils/runtime/src/genesismap.rs b/test-utils/runtime/src/genesismap.rs new file mode 100644 index 0000000..9e97288 --- /dev/null +++ b/test-utils/runtime/src/genesismap.rs @@ -0,0 +1,179 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Tool for creating the genesis block. + +use super::{ + currency, substrate_test_pallet, wasm_binary_unwrap, AccountId, Balance, RuntimeGenesisConfig, +}; +use codec::Encode; +use sc_service::construct_genesis_block; +use sp_core::{ + sr25519, + storage::{well_known_keys, StateVersion, Storage}, + Pair, +}; +use sp_keyring::{AccountKeyring, Sr25519Keyring}; +use sp_runtime::{ + traits::{Block as BlockT, Hash as HashT, Header as HeaderT}, + BuildStorage, +}; + +/// Builder for generating storage from substrate-test-runtime genesis config. +/// +/// Default storage can be extended with additional key-value pairs. +pub struct GenesisStorageBuilder { + /// Authorities accounts used by any component requiring an authority set (e.g. babe). + authorities: Vec, + /// Accounts to be endowed with some funds. + balances: Vec<(AccountId, u64)>, + /// Override default number of heap pages. + heap_pages_override: Option, + /// Additional storage key pairs that will be added to the genesis map. + extra_storage: Storage, + /// Optional wasm code override. + wasm_code: Option>, +} + +impl Default for GenesisStorageBuilder { + /// Creates a builder with default settings for `substrate_test_runtime`. + fn default() -> Self { + Self::new( + vec![ + Sr25519Keyring::Alice.into(), + Sr25519Keyring::Bob.into(), + Sr25519Keyring::Charlie.into(), + ], + (0..16_usize) + .into_iter() + .map(|i| AccountKeyring::numeric(i).public()) + .chain(vec![ + AccountKeyring::Alice.into(), + AccountKeyring::Bob.into(), + AccountKeyring::Charlie.into(), + ]) + .collect(), + 1000 * currency::DOLLARS, + ) + } +} + +impl GenesisStorageBuilder { + /// Creates a storage builder for genesis config. `substrage test runtime` + /// [`RuntimeGenesisConfig`] is initialized with provided `authorities`, `endowed_accounts` with + /// given balance. Key-value pairs from `extra_storage` will be injected into built storage. + /// `HEAP_PAGES` key and value will also be placed into storage. + pub fn new( + authorities: Vec, + endowed_accounts: Vec, + balance: Balance, + ) -> Self { + GenesisStorageBuilder { + authorities, + balances: endowed_accounts.into_iter().map(|a| (a, balance)).collect(), + heap_pages_override: None, + extra_storage: Default::default(), + wasm_code: None, + } + } + + /// Override default wasm code to be placed into RuntimeGenesisConfig. + pub fn with_wasm_code(mut self, wasm_code: &Option>) -> Self { + self.wasm_code = wasm_code.clone(); + self + } + + pub fn with_heap_pages(mut self, heap_pages_override: Option) -> Self { + self.heap_pages_override = heap_pages_override; + self + } + + pub fn with_extra_storage(mut self, storage: Storage) -> Self { + self.extra_storage = storage; + self + } + + /// A `RuntimeGenesisConfig` from internal configuration + pub fn genesis_config(&self) -> RuntimeGenesisConfig { + let authorities_sr25519: Vec<_> = self + .authorities + .clone() + .into_iter() + .map(|id| sr25519::Public::from(id)) + .collect(); + + RuntimeGenesisConfig { + system: Default::default(), + babe: pallet_babe::GenesisConfig { + authorities: authorities_sr25519 + .clone() + .into_iter() + .map(|x| (x.into(), 1)) + .collect(), + ..Default::default() + }, + substrate_test: substrate_test_pallet::GenesisConfig { + authorities: authorities_sr25519.clone(), + ..Default::default() + }, + balances: pallet_balances::GenesisConfig { balances: self.balances.clone() }, + } + } + + /// Builds the `RuntimeGenesisConfig` and returns its storage. + pub fn build(self) -> Storage { + let mut storage = self + .genesis_config() + .build_storage() + .expect("Build storage from substrate-test-runtime RuntimeGenesisConfig"); + + if let Some(heap_pages) = self.heap_pages_override { + storage.top.insert(well_known_keys::HEAP_PAGES.into(), heap_pages.encode()); + } + + storage.top.insert( + well_known_keys::CODE.into(), + self.wasm_code.clone().unwrap_or(wasm_binary_unwrap().to_vec()), + ); + + storage.top.extend(self.extra_storage.top.clone()); + storage.children_default.extend(self.extra_storage.children_default.clone()); + + storage + } +} + +pub fn insert_genesis_block(storage: &mut Storage) -> sp_core::hash::H256 { + let child_roots = storage.children_default.iter().map(|(sk, child_content)| { + let state_root = + <<::Header as HeaderT>::Hashing as HashT>::trie_root( + child_content.data.clone().into_iter().collect(), + sp_runtime::StateVersion::V1, + ); + (sk.clone(), state_root.encode()) + }); + // add child roots to storage + storage.top.extend(child_roots); + let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( + storage.top.clone().into_iter().collect(), + sp_runtime::StateVersion::V1, + ); + let block: crate::Block = construct_genesis_block(state_root, StateVersion::V1); + let genesis_hash = block.header.hash(); + + genesis_hash +} diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs new file mode 100644 index 0000000..461d583 --- /dev/null +++ b/test-utils/runtime/src/lib.rs @@ -0,0 +1,1534 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. + +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate alloc; + +#[cfg(feature = "std")] +pub mod extrinsic; +#[cfg(feature = "std")] +pub mod genesismap; +pub mod substrate_test_pallet; + +#[cfg(not(feature = "std"))] +use alloc::{vec, vec::Vec}; +use codec::{Decode, Encode}; +use frame_support::{ + construct_runtime, derive_impl, + dispatch::DispatchClass, + genesis_builder_helper::{build_state, get_preset}, + parameter_types, + traits::{ConstU32, ConstU64}, + weights::{ + constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, + Weight, + }, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + CheckNonce, CheckWeight, +}; +use scale_info::TypeInfo; +use sp_application_crypto::Ss58Codec; +use sp_keyring::AccountKeyring; + +use sp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; +use sp_core::{OpaqueMetadata, RuntimeDebug}; +use sp_trie::{ + trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, + PrefixedMemoryDB, StorageProof, +}; +use trie_db::{Trie, TrieMut}; + +use serde_json::json; +use sp_api::{decl_runtime_apis, impl_runtime_apis}; +pub use sp_core::hash::H256; +use sp_genesis_builder::PresetId; +use sp_inherents::{CheckInherentsResult, InherentData}; +use sp_runtime::{ + impl_opaque_keys, impl_tx_ext_default, + traits::{BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, NumberFor, Verify}, + transaction_validity::{ + TransactionSource, TransactionValidity, TransactionValidityError, ValidTransaction, + }, + ApplyExtrinsicResult, ExtrinsicInclusionMode, Perbill, +}; +#[cfg(any(feature = "std", test))] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +pub use sp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Slot}; + +pub use pallet_balances::Call as BalancesCall; + +pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; +#[cfg(feature = "std")] +pub use extrinsic::{ExtrinsicBuilder, Transfer}; + +const LOG_TARGET: &str = "substrate-test-runtime"; + +// Include the WASM binary +#[cfg(feature = "std")] +include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); + +#[cfg(feature = "std")] +pub mod wasm_binary_logging_disabled { + include!(concat!(env!("OUT_DIR"), "/wasm_binary_logging_disabled.rs")); +} + +/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. +#[cfg(feature = "std")] +pub fn wasm_binary_unwrap() -> &'static [u8] { + WASM_BINARY.expect( + "Development wasm binary is not available. Testing is only supported with the flag + disabled.", + ) +} + +/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. +#[cfg(feature = "std")] +pub fn wasm_binary_logging_disabled_unwrap() -> &'static [u8] { + wasm_binary_logging_disabled::WASM_BINARY.expect( + "Development wasm binary is not available. Testing is only supported with the flag + disabled.", + ) +} + +/// Test runtime version. +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: alloc::borrow::Cow::Borrowed("test"), + impl_name: alloc::borrow::Cow::Borrowed("parity-test"), + authoring_version: 1, + spec_version: 2, + impl_version: 2, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + system_version: 1, +}; + +fn version() -> RuntimeVersion { + VERSION +} + +/// Native version. +#[cfg(any(feature = "std", test))] +pub fn native_version() -> NativeVersion { + NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } +} + +/// Transfer data extracted from Extrinsic containing `Balances::transfer_allow_death`. +#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct TransferData { + pub from: AccountId, + pub to: AccountId, + pub amount: Balance, + pub nonce: Nonce, +} + +/// The address format for describing accounts. +pub type Address = sp_core::sr25519::Public; +pub type Signature = sr25519::Signature; +#[cfg(feature = "std")] +pub type Pair = sp_core::sr25519::Pair; + +// TODO: Remove after the Checks are migrated to TxExtension. +/// The extension to the basic transaction logic. +pub type TxExtension = ( + (CheckNonce, CheckWeight), + CheckSubstrateCall, + frame_metadata_hash_extension::CheckMetadataHash, +); +/// The payload being signed in transactions. +pub type SignedPayload = sp_runtime::generic::SignedPayload; +/// Unchecked extrinsic type as expected by this runtime. +pub type Extrinsic = + sp_runtime::generic::UncheckedExtrinsic; + +/// An identifier for an account on this system. +pub type AccountId = ::Signer; +/// A simple hash type for all our hashing. +pub type Hash = H256; +/// The hashing algorithm used. +pub type Hashing = BlakeTwo256; +/// The block number type used in this runtime. +pub type BlockNumber = u64; +/// Index of a transaction. +pub type Nonce = u64; +/// The item of a block digest. +pub type DigestItem = sp_runtime::generic::DigestItem; +/// The digest of a block. +pub type Digest = sp_runtime::generic::Digest; +/// A test block. +pub type Block = sp_runtime::generic::Block; +/// A test block's header. +pub type Header = sp_runtime::generic::Header; +/// Balance of an account. +pub type Balance = u64; + +decl_runtime_apis! { + #[api_version(2)] + pub trait TestAPI { + /// Return the balance of the given account id. + fn balance_of(id: AccountId) -> u64; + /// A benchmark function that adds one to the given value and returns the result. + fn benchmark_add_one(val: &u64) -> u64; + /// A benchmark function that adds one to each value in the given vector and returns the + /// result. + fn benchmark_vector_add_one(vec: &Vec) -> Vec; + /// A function for that the signature changed in version `2`. + #[changed_in(2)] + fn function_signature_changed() -> Vec; + /// The new signature. + fn function_signature_changed() -> u64; + /// trie no_std testing + fn use_trie() -> u64; + /// Calls function in the loop using never-inlined function pointer + fn benchmark_indirect_call() -> u64; + /// Calls function in the loop + fn benchmark_direct_call() -> u64; + /// Allocates vector with given capacity. + fn vec_with_capacity(size: u32) -> Vec; + /// Returns the initialized block number. + fn get_block_number() -> u64; + + /// Test that `ed25519` crypto works in the runtime. + /// + /// Returns the signature generated for the message `ed25519` and the public key. + fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic); + /// Test that `sr25519` crypto works in the runtime. + /// + /// Returns the signature generated for the message `sr25519`. + fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic); + /// Test that `ecdsa` crypto works in the runtime. + /// + /// Returns the signature generated for the message `ecdsa`. + fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic); + /// Run various tests against storage. + fn test_storage(); + /// Check a witness. + fn test_witness(proof: StorageProof, root: crate::Hash); + /// Test that ensures that we can call a function that takes multiple + /// arguments. + fn test_multiple_arguments(data: Vec, other: Vec, num: u32); + /// Traces log "Hey I'm runtime." + fn do_trace_log(); + /// Verify the given signature, public & message bundle. + fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool; + /// Write the given `value` under the given `key` into the storage and then optional panic. + fn write_key_value(key: Vec, value: Vec, panic: bool); + } +} + +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] +pub struct CheckSubstrateCall; + +impl sp_runtime::traits::Printable for CheckSubstrateCall { + fn print(&self) { + "CheckSubstrateCall".print() + } +} + +impl sp_runtime::traits::RefundWeight for CheckSubstrateCall { + fn refund(&mut self, _weight: frame_support::weights::Weight) {} +} +impl sp_runtime::traits::ExtensionPostDispatchWeightHandler + for CheckSubstrateCall +{ + fn set_extension_weight(&mut self, _info: &CheckSubstrateCall) {} +} + +impl sp_runtime::traits::Dispatchable for CheckSubstrateCall { + type RuntimeOrigin = RuntimeOrigin; + type Config = CheckSubstrateCall; + type Info = CheckSubstrateCall; + type PostInfo = CheckSubstrateCall; + + fn dispatch( + self, + _origin: Self::RuntimeOrigin, + ) -> sp_runtime::DispatchResultWithInfo { + panic!("This implementation should not be used for actual dispatch."); + } +} + +impl sp_runtime::traits::TransactionExtension for CheckSubstrateCall { + const IDENTIFIER: &'static str = "CheckSubstrateCall"; + type Implicit = (); + type Pre = (); + type Val = (); + impl_tx_ext_default!(RuntimeCall; weight prepare); + + fn validate( + &self, + origin: ::RuntimeOrigin, + call: &RuntimeCall, + _info: &DispatchInfoOf, + _len: usize, + _self_implicit: Self::Implicit, + _inherited_implication: &impl Encode, + _source: TransactionSource, + ) -> Result< + (ValidTransaction, Self::Val, ::RuntimeOrigin), + TransactionValidityError, + > { + log::trace!(target: LOG_TARGET, "validate"); + let v = match call { + RuntimeCall::SubstrateTest(ref substrate_test_call) => + substrate_test_pallet::validate_runtime_call(substrate_test_call)?, + _ => Default::default(), + }; + Ok((v, (), origin)) + } +} + +construct_runtime!( + pub enum Runtime + { + System: frame_system, + Babe: pallet_babe, + SubstrateTest: substrate_test_pallet::pallet, + Balances: pallet_balances, + } +); + +/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. +/// This is used to limit the maximal weight of a single extrinsic. +const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used +/// by Operational extrinsics. +const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); +/// Max weight, actual value does not matter for test runtime. +const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); + +parameter_types! { + pub const BlockHashCount: BlockNumber = 2400; + pub const Version: RuntimeVersion = VERSION; + + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::pallet::Config for Runtime { + type BlockWeights = RuntimeBlockWeights; + type Nonce = Nonce; + type AccountId = AccountId; + type Lookup = sp_runtime::traits::IdentityLookup; + type Block = Block; + type AccountData = pallet_balances::AccountData; +} + +pub mod currency { + use crate::Balance; + const MILLICENTS: Balance = 1_000_000_000; + const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. + pub const DOLLARS: Balance = 100 * CENTS; +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 1 * currency::DOLLARS; + // For weight estimation, we assume that the most locks on an individual account will be 50. + // This number may need to be adjusted in the future if this assumption no longer holds true. + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; + type Balance = Balance; + type DustRemoval = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type FreezeIdentifier = (); + type MaxFreezes = (); + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; + type DoneSlashHandler = (); +} + +impl substrate_test_pallet::Config for Runtime {} + +// Required for `pallet_babe::Config`. +impl pallet_timestamp::Config for Runtime { + type Moment = u64; + type OnTimestampSet = Babe; + type MinimumPeriod = ConstU64<500>; + type WeightInfo = pallet_timestamp::weights::SubstrateWeight; +} + +parameter_types! { + pub const EpochDuration: u64 = 6; +} + +impl pallet_babe::Config for Runtime { + type EpochDuration = EpochDuration; + type ExpectedBlockTime = ConstU64<10_000>; + type EpochChangeTrigger = pallet_babe::SameAuthoritiesForever; + type DisabledValidators = (); + type KeyOwnerProof = sp_core::Void; + type EquivocationReportSystem = (); + type WeightInfo = (); + type MaxAuthorities = ConstU32<10>; + type MaxNominators = ConstU32<100>; +} + +/// Adds one to the given input and returns the final result. +#[inline(never)] +fn benchmark_add_one(i: u64) -> u64 { + i + 1 +} + +fn code_using_trie() -> u64 { + let pairs = [ + (b"0103000000000000000464".to_vec(), b"0400000000".to_vec()), + (b"0103000000000000000469".to_vec(), b"0401000000".to_vec()), + ] + .to_vec(); + + let mut mdb = PrefixedMemoryDB::default(); + let mut root = core::default::Default::default(); + { + let mut t = TrieDBMutBuilderV1::::new(&mut mdb, &mut root).build(); + for (key, value) in &pairs { + if t.insert(key, value).is_err() { + return 101 + } + } + } + + let trie = TrieDBBuilder::::new(&mdb, &root).build(); + let res = if let Ok(iter) = trie.iter() { iter.flatten().count() as u64 } else { 102 }; + + res +} + +impl_opaque_keys! { + pub struct SessionKeys { + pub ed25519: ed25519::AppPublic, + pub sr25519: sr25519::AppPublic, + pub ecdsa: ecdsa::AppPublic, + } +} + +pub const TEST_RUNTIME_BABE_EPOCH_CONFIGURATION: BabeEpochConfiguration = BabeEpochConfiguration { + c: (3, 10), + allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots, +}; + +impl_runtime_apis! { + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + version() + } + + fn execute_block(block: Block) { + log::trace!(target: LOG_TARGET, "execute_block: {block:#?}"); + Executive::execute_block(block); + } + + fn initialize_block(header: &::Header) -> ExtrinsicInclusionMode { + log::trace!(target: LOG_TARGET, "initialize_block: {header:#?}"); + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + fn metadata_versions() -> alloc::vec::Vec { + Runtime::metadata_versions() + } + } + + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + utx: ::Extrinsic, + block_hash: ::Hash, + ) -> TransactionValidity { + let validity = Executive::validate_transaction(source, utx.clone(), block_hash); + log::trace!(target: LOG_TARGET, "validate_transaction {:?} {:?}", utx, validity); + validity + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + log::trace!(target: LOG_TARGET, "finalize_block"); + Executive::finalize_block() + } + + fn inherent_extrinsics(_data: InherentData) -> Vec<::Extrinsic> { + vec![] + } + + fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult { + CheckInherentsResult::new() + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { + System::account_nonce(account) + } + } + + impl self::TestAPI for Runtime { + fn balance_of(id: AccountId) -> u64 { + Balances::free_balance(id) + } + + fn benchmark_add_one(val: &u64) -> u64 { + val + 1 + } + + fn benchmark_vector_add_one(vec: &Vec) -> Vec { + let mut vec = vec.clone(); + vec.iter_mut().for_each(|v| *v += 1); + vec + } + + fn function_signature_changed() -> u64 { + 1 + } + + fn use_trie() -> u64 { + code_using_trie() + } + + fn benchmark_indirect_call() -> u64 { + let function = benchmark_add_one; + (0..1000).fold(0, |p, i| p + function(i)) + } + fn benchmark_direct_call() -> u64 { + (0..1000).fold(0, |p, i| p + benchmark_add_one(i)) + } + + fn vec_with_capacity(size: u32) -> Vec { + Vec::with_capacity(size as usize) + } + + fn get_block_number() -> u64 { + System::block_number() + } + + fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { + test_ed25519_crypto() + } + + fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { + test_sr25519_crypto() + } + + fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { + test_ecdsa_crypto() + } + + fn test_storage() { + test_read_storage(); + test_read_child_storage(); + } + + fn test_witness(proof: StorageProof, root: crate::Hash) { + test_witness(proof, root); + } + + fn test_multiple_arguments(data: Vec, other: Vec, num: u32) { + assert_eq!(&data[..], &other[..]); + assert_eq!(data.len(), num as usize); + } + + fn do_trace_log() { + log::trace!(target: "test", "Hey I'm runtime"); + + let data = "THIS IS TRACING"; + + tracing::trace!(target: "test", %data, "Hey, I'm tracing"); + } + + fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool { + sp_io::crypto::ed25519_verify(&sig, &message, &public) + } + + fn write_key_value(key: Vec, value: Vec, panic: bool) { + sp_io::storage::set(&key, &value); + + if panic { + panic!("I'm just following my master"); + } + } + } + + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(1000) + } + + fn authorities() -> Vec { + SubstrateTest::authorities().into_iter().map(|auth| AuraId::from(auth)).collect() + } + } + + impl sp_consensus_babe::BabeApi for Runtime { + fn configuration() -> sp_consensus_babe::BabeConfiguration { + let epoch_config = Babe::epoch_config().unwrap_or(TEST_RUNTIME_BABE_EPOCH_CONFIGURATION); + sp_consensus_babe::BabeConfiguration { + slot_duration: Babe::slot_duration(), + epoch_length: EpochDuration::get(), + c: epoch_config.c, + authorities: Babe::authorities().to_vec(), + randomness: Babe::randomness(), + allowed_slots: epoch_config.allowed_slots, + } + } + + fn current_epoch_start() -> Slot { + Babe::current_epoch_start() + } + + fn current_epoch() -> sp_consensus_babe::Epoch { + Babe::current_epoch() + } + + fn next_epoch() -> sp_consensus_babe::Epoch { + Babe::next_epoch() + } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: sp_consensus_babe::EquivocationProof< + ::Header, + >, + _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, + ) -> Option<()> { + None + } + + fn generate_key_ownership_proof( + _slot: sp_consensus_babe::Slot, + _authority_id: sp_consensus_babe::AuthorityId, + ) -> Option { + None + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + let ext = Extrinsic::new_bare( + substrate_test_pallet::pallet::Call::storage_change{ + key:b"some_key".encode(), + value:Some(header.number.encode()) + }.into(), + ); + sp_io::offchain::submit_transaction(ext.encode()).unwrap(); + } + } + + impl sp_session::SessionKeys for Runtime { + fn generate_session_keys(_: Option>) -> Vec { + SessionKeys::generate(None) + } + + fn decode_session_keys( + encoded: Vec, + ) -> Option, sp_core::crypto::KeyTypeId)>> { + SessionKeys::decode_into_raw_public_keys(&encoded) + } + } + + impl sp_consensus_grandpa::GrandpaApi for Runtime { + fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { + Vec::new() + } + + fn current_set_id() -> sp_consensus_grandpa::SetId { + 0 + } + + fn submit_report_equivocation_unsigned_extrinsic( + _equivocation_proof: sp_consensus_grandpa::EquivocationProof< + ::Hash, + NumberFor, + >, + _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, + ) -> Option<()> { + None + } + + fn generate_key_ownership_proof( + _set_id: sp_consensus_grandpa::SetId, + _authority_id: sp_consensus_grandpa::AuthorityId, + ) -> Option { + None + } + } + + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(name: &Option) -> Option> { + get_preset::(name, |name| { + let patch = match name.as_ref() { + "staging" => { + let endowed_accounts: Vec = vec![ + AccountKeyring::Bob.public().into(), + AccountKeyring::Charlie.public().into(), + ]; + + json!({ + "balances": { + "balances": endowed_accounts.into_iter().map(|k| (k, 10 * currency::DOLLARS)).collect::>(), + }, + "substrateTest": { + "authorities": [ + AccountKeyring::Alice.public().to_ss58check(), + AccountKeyring::Ferdie.public().to_ss58check() + ], + } + }) + }, + "foobar" => json!({"foo":"bar"}), + _ => return None, + }; + Some(serde_json::to_string(&patch) + .expect("serialization to json is expected to work. qed.") + .into_bytes()) + }) + } + + fn preset_names() -> Vec { + vec![PresetId::from("foobar"), PresetId::from("staging")] + } + } +} + +fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { + let public0 = ed25519::AppPublic::generate_pair(None); + let public1 = ed25519::AppPublic::generate_pair(None); + let public2 = ed25519::AppPublic::generate_pair(None); + + let all = ed25519::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"ed25519").expect("Generates a valid `ed25519` signature."); + assert!(public0.verify(&"ed25519", &signature)); + (signature, public0) +} + +fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { + let public0 = sr25519::AppPublic::generate_pair(None); + let public1 = sr25519::AppPublic::generate_pair(None); + let public2 = sr25519::AppPublic::generate_pair(None); + + let all = sr25519::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"sr25519").expect("Generates a valid `sr25519` signature."); + assert!(public0.verify(&"sr25519", &signature)); + (signature, public0) +} + +fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { + let public0 = ecdsa::AppPublic::generate_pair(None); + let public1 = ecdsa::AppPublic::generate_pair(None); + let public2 = ecdsa::AppPublic::generate_pair(None); + + let all = ecdsa::AppPublic::all(); + assert!(all.contains(&public0)); + assert!(all.contains(&public1)); + assert!(all.contains(&public2)); + + let signature = public0.sign(&"ecdsa").expect("Generates a valid `ecdsa` signature."); + + assert!(public0.verify(&"ecdsa", &signature)); + (signature, public0) +} + +fn test_read_storage() { + const KEY: &[u8] = b":read_storage"; + sp_io::storage::set(KEY, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::storage::read(KEY, &mut v, 0); + assert_eq!(r, Some(4)); + assert_eq!(&v, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::storage::read(KEY, &mut v, 4); + assert_eq!(r, Some(0)); + assert_eq!(&v, &[0, 0, 0, 0]); +} + +fn test_read_child_storage() { + const STORAGE_KEY: &[u8] = b"unique_id_1"; + const KEY: &[u8] = b":read_child_storage"; + sp_io::default_child_storage::set(STORAGE_KEY, KEY, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 0); + assert_eq!(r, Some(4)); + assert_eq!(&v, b"test"); + + let mut v = [0u8; 4]; + let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 8); + assert_eq!(r, Some(0)); + assert_eq!(&v, &[0, 0, 0, 0]); +} + +fn test_witness(proof: StorageProof, root: crate::Hash) { + use sp_externalities::Externalities; + let db: sp_trie::MemoryDB = proof.into_memory_db(); + let backend = sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); + let mut overlay = sp_state_machine::OverlayedChanges::default(); + let mut ext = sp_state_machine::Ext::new( + &mut overlay, + &backend, + #[cfg(feature = "std")] + None, + ); + assert!(ext.storage(b"value3").is_some()); + assert!(ext.storage_root(Default::default()).as_slice() == &root[..]); + ext.place_storage(vec![0], Some(vec![1])); + assert!(ext.storage_root(Default::default()).as_slice() != &root[..]); +} + +/// Some tests require the hashed keys of the storage. As the values of hashed keys are not trivial +/// to guess, this small module provides the values of the keys, and the code which is required to +/// generate the keys. +#[cfg(feature = "std")] +pub mod storage_key_generator { + use super::*; + use sp_core::Pair; + + /// Generate hex string without prefix + pub(super) fn hex(x: T) -> String + where + T: array_bytes::Hex, + { + x.hex(Default::default()) + } + + fn concat_hashes(input: &Vec<&[u8]>) -> String { + input.iter().map(|s| sp_crypto_hashing::twox_128(s)).map(hex).collect() + } + + fn twox_64_concat(x: &[u8]) -> Vec { + sp_crypto_hashing::twox_64(x).iter().chain(x.iter()).cloned().collect() + } + + /// Generate the hashed storage keys from the raw literals. These keys are expected to be in + /// storage with given substrate-test runtime. + pub fn generate_expected_storage_hashed_keys(custom_heap_pages: bool) -> Vec { + let mut literals: Vec<&[u8]> = vec![b":code", b":extrinsic_index"]; + + if custom_heap_pages { + literals.push(b":heappages"); + } + + let keys: Vec> = vec![ + vec![b"Babe", b":__STORAGE_VERSION__:"], + vec![b"Babe", b"Authorities"], + vec![b"Babe", b"EpochConfig"], + vec![b"Babe", b"NextAuthorities"], + vec![b"Babe", b"SegmentIndex"], + vec![b"Balances", b":__STORAGE_VERSION__:"], + vec![b"Balances", b"TotalIssuance"], + vec![b"SubstrateTest", b":__STORAGE_VERSION__:"], + vec![b"SubstrateTest", b"Authorities"], + vec![b"System", b":__STORAGE_VERSION__:"], + vec![b"System", b"LastRuntimeUpgrade"], + vec![b"System", b"ParentHash"], + vec![b"System", b"UpgradedToTripleRefCount"], + vec![b"System", b"UpgradedToU32RefCount"], + ]; + + let mut expected_keys = keys.iter().map(concat_hashes).collect::>(); + expected_keys.extend(literals.into_iter().map(hex)); + + let balances_map_keys = (0..16_usize) + .into_iter() + .map(|i| AccountKeyring::numeric(i).public().to_vec()) + .chain(vec![ + AccountKeyring::Alice.public().to_vec(), + AccountKeyring::Bob.public().to_vec(), + AccountKeyring::Charlie.public().to_vec(), + ]) + .map(|pubkey| { + sp_crypto_hashing::blake2_128(&pubkey) + .iter() + .chain(pubkey.iter()) + .cloned() + .collect::>() + }) + .map(|hash_pubkey| { + [concat_hashes(&vec![b"System", b"Account"]), hex(hash_pubkey)].concat() + }); + + expected_keys.extend(balances_map_keys); + + expected_keys.push( + [ + concat_hashes(&vec![b"System", b"BlockHash"]), + hex(0u64.using_encoded(twox_64_concat)), + ] + .concat(), + ); + + expected_keys.sort(); + expected_keys + } + + /// Provides the commented list of hashed keys. This contains a hard-coded list of hashed keys + /// that would be generated by `generate_expected_storage_hashed_keys`. This list is provided + /// for the debugging convenience only. Value of each hex-string is documented with the literal + /// origin. + /// + /// `custom_heap_pages`: Should be set to `true` when the state contains the `:heap_pages` key + /// aka when overriding the heap pages to be used by the executor. + pub fn get_expected_storage_hashed_keys(custom_heap_pages: bool) -> Vec<&'static str> { + let mut res = vec![ + //SubstrateTest|:__STORAGE_VERSION__: + "00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429", + //SubstrateTest|Authorities + "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", + //Babe|:__STORAGE_VERSION__: + "1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429", + //Babe|Authorities + "1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d", + //Babe|SegmentIndex + "1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4", + //Babe|NextAuthorities + "1cb6f36e027abb2091cfb5110ab5087faacf00b9b41fda7a9268821c2a2b3e4c", + //Babe|EpochConfig + "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", + //System|:__STORAGE_VERSION__: + "26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", + //System|UpgradedToU32RefCount + "26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", + //System|ParentHash + "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", + //System::BlockHash|0 + "26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746bb1bdbcacd6ac9340000000000000000", + //System|UpgradedToTripleRefCount + "26aa394eea5630e07c48ae0c9558cef7a7fd6c28836b9a28522dc924110cf439", + + // System|Account|blake2_128Concat("//11") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da901cae4e3edfbb32c91ed3f01ab964f4eeeab50338d8e5176d3141802d7b010a55dadcd5f23cf8aaafa724627e967e90e", + // System|Account|blake2_128Concat("//4") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da91b614bd4a126f2d5d294e9a8af9da25248d7e931307afb4b68d8d565d4c66e00d856c6d65f5fed6bb82dcfb60e936c67", + // System|Account|blake2_128Concat("//7") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94b21aff9fe1e8b2fc4b0775b8cbeff28ba8e2c7594dd74730f3ca835e95455d199261897edc9735d602ea29615e2b10b", + // System|Account|blake2_128Concat("//Bob") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48", + // System|Account|blake2_128Concat("//3") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95786a2916fcb81e1bd5dcd81e0d2452884617f575372edb5a36d85c04cdf2e4699f96fe33eb5f94a28c041b88e398d0c", + // System|Account|blake2_128Concat("//14") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95b8542d9672c7b7e779cc7c1e6b605691c2115d06120ea2bee32dd601d02f36367564e7ddf84ae2717ca3f097459652e", + // System|Account|blake2_128Concat("//6") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da996c30bdbfab640838e6b6d3c33ab4adb4211b79e34ee8072eab506edd4b93a7b85a14c9a05e5cdd056d98e7dbca87730", + // System|Account|blake2_128Concat("//9") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99dc65b1339ec388fbf2ca0cdef51253512c6cfd663203ea16968594f24690338befd906856c4d2f4ef32dad578dba20c", + // System|Account|blake2_128Concat("//8") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99e6eb5abd62f5fd54793da91a47e6af6125d57171ff9241f07acaa1bb6a6103517965cf2cd00e643b27e7599ebccba70", + // System|Account|blake2_128Concat("//Charlie") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b0edae20838083f2cde1c4080db8cf8090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22", + // System|Account|blake2_128Concat("//10") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d0052993b6f3bd0544fd1f5e4125b9fbde3e789ecd53431fe5c06c12b72137153496dace35c695b5f4d7b41f7ed5763b", + // System|Account|blake2_128Concat("//1") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d6b7e9a5f12bc571053265dade10d3b4b606fc73f57f03cdb4c932d475ab426043e429cecc2ffff0d2672b0df8398c48", + // System|Account|blake2_128Concat("//Alice") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", + // System|Account|blake2_128Concat("//2") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e1a35f56ee295d39287cbffcfc60c4b346f136b564e1fad55031404dd84e5cd3fa76bfe7cc7599b39d38fd06663bbc0a", + // System|Account|blake2_128Concat("//5") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e2c1dc507e2035edbbd8776c440d870460c57f0008067cc01c5ff9eb2e2f9b3a94299a915a91198bd1021a6c55596f57", + // System|Account|blake2_128Concat("//0") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9eca0e653a94f4080f6311b4e7b6934eb2afba9278e30ccf6a6ceb3a8b6e336b70068f045c666f2e7f4f9cc5f47db8972", + // System|Account|blake2_128Concat("//13") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9ee8bf7ef90fc56a8aa3b90b344c599550c29b161e27ff8ba45bf6bad4711f326fc506a8803453a4d7e3158e993495f10", + // System|Account|blake2_128Concat("//12") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f5d6f1c082fe63eec7a71fcad00f4a892e3d43b7b0d04e776e69e7be35247cecdac65504c579195731eaf64b7940966e", + // System|Account|blake2_128Concat("//15") + "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9fbf0818841edf110e05228a6379763c4fc3c37459d9bdc61f58a5ebc01e9e2305a19d390c0543dc733861ec3cf1de01f", + // System|LastRuntimeUpgrade + "26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8", + // :code + "3a636f6465", + // :extrinsic_index + "3a65787472696e7369635f696e646578", + // Balances|:__STORAGE_VERSION__: + "c2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429", + // Balances|TotalIssuance + "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", + ]; + + if custom_heap_pages { + // :heappages + res.push("3a686561707061676573"); + } + + res + } + + #[test] + fn expected_keys_vec_are_matching() { + assert_eq!( + storage_key_generator::get_expected_storage_hashed_keys(false), + storage_key_generator::generate_expected_storage_hashed_keys(false), + ); + } +} + +#[cfg(test)] +mod tests { + use super::*; + use codec::Encode; + use frame_support::dispatch::DispatchInfo; + use sc_block_builder::BlockBuilderBuilder; + use sp_api::{ApiExt, ProvideRuntimeApi}; + use sp_consensus::BlockOrigin; + use sp_core::{storage::well_known_keys::HEAP_PAGES, traits::CallContext}; + use sp_runtime::{ + traits::{DispatchTransaction, Hash as _}, + transaction_validity::{InvalidTransaction, TransactionSource::External, ValidTransaction}, + }; + use substrate_test_runtime_client::{ + prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, + }; + + #[test] + fn heap_pages_is_respected() { + // This tests that the on-chain `HEAP_PAGES` parameter is respected. + + // Create a client devoting only 8 pages of wasm memory. This gives us ~512k of heap memory. + let client = TestClientBuilder::new().set_heap_pages(8).build(); + let best_hash = client.chain_info().best_hash; + + // Try to allocate 1024k of memory on heap. This is going to fail since it is twice larger + // than the heap. + let mut runtime_api = client.runtime_api(); + // This is currently required to allocate the 1024k of memory as configured above. + runtime_api.set_call_context(CallContext::Onchain); + let ret = runtime_api.vec_with_capacity(best_hash, 1048576); + assert!(ret.is_err()); + + // Create a block that sets the `:heap_pages` to 32 pages of memory which corresponds to + // ~2048k of heap memory. + let (new_at_hash, block) = { + let mut builder = BlockBuilderBuilder::new(&client) + .on_parent_block(best_hash) + .with_parent_block_number(0) + .build() + .unwrap(); + builder.push_storage_change(HEAP_PAGES.to_vec(), Some(32u64.encode())).unwrap(); + let block = builder.build().unwrap().block; + let hash = block.header.hash(); + (hash, block) + }; + + futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap(); + + // Allocation of 1024k while having ~2048k should succeed. + let ret = client.runtime_api().vec_with_capacity(new_at_hash, 1048576); + assert!(ret.is_ok()); + } + + #[test] + fn test_storage() { + let client = TestClientBuilder::new().build(); + let runtime_api = client.runtime_api(); + let best_hash = client.chain_info().best_hash; + + runtime_api.test_storage(best_hash).unwrap(); + } + + fn witness_backend() -> (sp_trie::MemoryDB, crate::Hash) { + let mut root = crate::Hash::default(); + let mut mdb = sp_trie::MemoryDB::::default(); + { + let mut trie = + sp_trie::trie_types::TrieDBMutBuilderV1::new(&mut mdb, &mut root).build(); + trie.insert(b"value3", &[142]).expect("insert failed"); + trie.insert(b"value4", &[124]).expect("insert failed"); + }; + (mdb, root) + } + + #[test] + fn witness_backend_works() { + let (db, root) = witness_backend(); + let backend = + sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); + let proof = sp_state_machine::prove_read(backend, vec![b"value3"]).unwrap(); + let client = TestClientBuilder::new().build(); + let runtime_api = client.runtime_api(); + let best_hash = client.chain_info().best_hash; + + runtime_api.test_witness(best_hash, proof, root).unwrap(); + } + + pub fn new_test_ext() -> sp_io::TestExternalities { + genesismap::GenesisStorageBuilder::new( + vec![AccountKeyring::One.public().into(), AccountKeyring::Two.public().into()], + vec![AccountKeyring::One.into(), AccountKeyring::Two.into()], + 1000 * currency::DOLLARS, + ) + .build() + .into() + } + + #[test] + fn validate_storage_keys() { + assert_eq!( + genesismap::GenesisStorageBuilder::default() + .build() + .top + .keys() + .cloned() + .map(storage_key_generator::hex) + .collect::>(), + storage_key_generator::get_expected_storage_hashed_keys(false) + ); + } + + #[test] + fn validate_unsigned_works() { + sp_tracing::try_init_simple(); + new_test_ext().execute_with(|| { + let failing_calls = vec![ + substrate_test_pallet::Call::bench_call { transfer: Default::default() }, + substrate_test_pallet::Call::include_data { data: vec![] }, + substrate_test_pallet::Call::fill_block { ratio: Perbill::from_percent(50) }, + ]; + let succeeding_calls = vec![ + substrate_test_pallet::Call::deposit_log_digest_item { + log: DigestItem::Other(vec![]), + }, + substrate_test_pallet::Call::storage_change { key: vec![], value: None }, + substrate_test_pallet::Call::read { count: 0 }, + substrate_test_pallet::Call::read_and_panic { count: 0 }, + ]; + + for call in failing_calls { + assert_eq!( + ::validate_unsigned( + TransactionSource::External, + &call, + ), + InvalidTransaction::Call.into(), + ); + } + + for call in succeeding_calls { + assert_eq!( + ::validate_unsigned( + TransactionSource::External, + &call, + ), + Ok(ValidTransaction { + provides: vec![BlakeTwo256::hash_of(&call).encode()], + ..Default::default() + }) + ); + } + }); + } + + #[test] + fn check_substrate_check_signed_extension_works() { + sp_tracing::try_init_simple(); + new_test_ext().execute_with(|| { + let x = AccountKeyring::Alice.into(); + let info = DispatchInfo::default(); + let len = 0_usize; + assert_eq!( + CheckSubstrateCall {} + .validate_only( + Some(x).into(), + &ExtrinsicBuilder::new_call_with_priority(16).build().function, + &info, + len, + External, + 0, + ) + .unwrap() + .0 + .priority, + 16 + ); + + assert_eq!( + CheckSubstrateCall {} + .validate_only( + Some(x).into(), + &ExtrinsicBuilder::new_call_do_not_propagate().build().function, + &info, + len, + External, + 0, + ) + .unwrap() + .0 + .propagate, + false + ); + }) + } + + mod genesis_builder_tests { + use super::*; + use crate::genesismap::GenesisStorageBuilder; + use sc_executor::{error::Result, WasmExecutor}; + use sc_executor_common::runtime_blob::RuntimeBlob; + use serde_json::json; + use sp_application_crypto::Ss58Codec; + use sp_core::traits::Externalities; + use sp_genesis_builder::Result as BuildResult; + use sp_state_machine::BasicExternalities; + use std::{fs, io::Write}; + use storage_key_generator::hex; + + pub fn executor_call( + ext: &mut dyn Externalities, + method: &str, + data: &[u8], + ) -> Result> { + let executor = WasmExecutor::::builder().build(); + executor.uncached_call( + RuntimeBlob::uncompress_if_needed(wasm_binary_unwrap()).unwrap(), + ext, + true, + method, + data, + ) + } + + #[test] + fn build_minimal_genesis_config_works() { + sp_tracing::try_init_simple(); + let default_minimal_json = r#"{"system":{},"babe":{"authorities":[],"epochConfig":{"c": [ 3, 10 ],"allowed_slots":"PrimaryAndSecondaryPlainSlots"}},"substrateTest":{"authorities":[]},"balances":{"balances":[]}}"#; + let mut t = BasicExternalities::new_empty(); + + executor_call(&mut t, "GenesisBuilder_build_state", &default_minimal_json.encode()) + .unwrap(); + + let mut keys = t.into_storages().top.keys().cloned().map(hex).collect::>(); + keys.sort(); + + let mut expected = [ + //SubstrateTest|Authorities + "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", + //Babe|SegmentIndex + "1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4", + //Babe|EpochConfig + "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", + //System|UpgradedToU32RefCount + "26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", + //System|ParentHash + "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", + //System::BlockHash|0 + "26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746bb1bdbcacd6ac9340000000000000000", + //System|UpgradedToTripleRefCount + "26aa394eea5630e07c48ae0c9558cef7a7fd6c28836b9a28522dc924110cf439", + + // System|LastRuntimeUpgrade + "26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8", + // :extrinsic_index + "3a65787472696e7369635f696e646578", + // Balances|TotalIssuance + "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", + + // added by on_genesis: + // Balances|:__STORAGE_VERSION__: + "c2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429", + //System|:__STORAGE_VERSION__: + "26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", + //Babe|:__STORAGE_VERSION__: + "1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429", + //SubstrateTest|:__STORAGE_VERSION__: + "00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429", + ].into_iter().map(String::from).collect::>(); + expected.sort(); + + assert_eq!(keys, expected); + } + + #[test] + fn default_config_as_json_works() { + sp_tracing::try_init_simple(); + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_get_preset", &None::<&PresetId>.encode()) + .unwrap(); + let r = Option::>::decode(&mut &r[..]) + .unwrap() + .expect("default config is there"); + let json = String::from_utf8(r.into()).expect("returned value is json. qed."); + + let expected = r#"{"system":{},"babe":{"authorities":[],"epochConfig":{"c":[1,4],"allowed_slots":"PrimaryAndSecondaryVRFSlots"}},"substrateTest":{"authorities":[]},"balances":{"balances":[]}}"#; + assert_eq!(expected.to_string(), json); + } + + #[test] + fn preset_names_listing_works() { + sp_tracing::try_init_simple(); + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_preset_names", &vec![]).unwrap(); + let r = Vec::::decode(&mut &r[..]).unwrap(); + assert_eq!(r, vec![PresetId::from("foobar"), PresetId::from("staging"),]); + log::info!("r: {:#?}", r); + } + + #[test] + fn named_config_works() { + sp_tracing::try_init_simple(); + let f = |cfg_name: &str, expected: &str| { + let mut t = BasicExternalities::new_empty(); + let name = cfg_name.to_string(); + let r = executor_call( + &mut t, + "GenesisBuilder_get_preset", + &Some(name.as_bytes()).encode(), + ) + .unwrap(); + let r = Option::>::decode(&mut &r[..]).unwrap(); + let json = + String::from_utf8(r.unwrap().into()).expect("returned value is json. qed."); + log::info!("json: {:#?}", json); + assert_eq!(expected.to_string(), json); + }; + + f("foobar", r#"{"foo":"bar"}"#); + f( + "staging", + r#"{"balances":{"balances":[["5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",1000000000000000],["5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",1000000000000000]]},"substrateTest":{"authorities":["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY","5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL"]}}"#, + ); + } + + #[test] + fn build_config_from_json_works() { + sp_tracing::try_init_simple(); + let j = include_str!("../res/default_genesis_config.json"); + + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); + let r = BuildResult::decode(&mut &r[..]); + assert!(r.is_ok()); + + let mut keys = t.into_storages().top.keys().cloned().map(hex).collect::>(); + + // following keys are not placed during `::build` + // process, add them `keys` to assert against known keys. + keys.push(hex(b":code")); + keys.sort(); + + assert_eq!(keys, storage_key_generator::get_expected_storage_hashed_keys(false)); + } + + #[test] + fn build_config_from_invalid_json_fails() { + sp_tracing::try_init_simple(); + let j = include_str!("../res/default_genesis_config_invalid.json"); + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); + let r = BuildResult::decode(&mut &r[..]).unwrap(); + log::info!("result: {:#?}", r); + assert_eq!(r, Err( + "Invalid JSON blob: unknown field `renamed_authorities`, expected `authorities` or `epochConfig` at line 4 column 25".to_string(), + )); + } + + #[test] + fn build_config_from_invalid_json_fails_2() { + sp_tracing::try_init_simple(); + let j = include_str!("../res/default_genesis_config_invalid_2.json"); + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); + let r = BuildResult::decode(&mut &r[..]).unwrap(); + assert_eq!(r, Err( + "Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `substrateTest`, `balances` at line 3 column 9".to_string(), + )); + } + + #[test] + fn build_config_from_incomplete_json_fails() { + sp_tracing::try_init_simple(); + let j = include_str!("../res/default_genesis_config_incomplete.json"); + + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); + let r = core::result::Result::<(), String>::decode(&mut &r[..]).unwrap(); + assert_eq!( + r, + Err("Invalid JSON blob: missing field `authorities` at line 11 column 3" + .to_string()) + ); + } + + #[test] + fn write_default_config_to_tmp_file() { + if std::env::var("WRITE_DEFAULT_JSON_FOR_STR_GC").is_ok() { + sp_tracing::try_init_simple(); + let mut file = fs::OpenOptions::new() + .create(true) + .write(true) + .open("/tmp/default_genesis_config.json") + .unwrap(); + + let j = serde_json::to_string(&GenesisStorageBuilder::default().genesis_config()) + .unwrap() + .into_bytes(); + file.write_all(&j).unwrap(); + } + } + + #[test] + fn build_genesis_config_with_patch_json_works() { + //this tests shows how to do patching on native side + sp_tracing::try_init_simple(); + + let mut t = BasicExternalities::new_empty(); + let r = executor_call(&mut t, "GenesisBuilder_get_preset", &None::<&PresetId>.encode()) + .unwrap(); + let r = Option::>::decode(&mut &r[..]) + .unwrap() + .expect("default config is there"); + let mut default_config: serde_json::Value = + serde_json::from_slice(&r[..]).expect("returned value is json. qed."); + + // Patch default json with some custom values: + let patch = json!({ + "babe": { + "epochConfig": { + "c": [ + 7, + 10 + ], + "allowed_slots": "PrimaryAndSecondaryPlainSlots" + } + }, + "substrateTest": { + "authorities": [ + AccountKeyring::Ferdie.public().to_ss58check(), + AccountKeyring::Alice.public().to_ss58check() + ], + } + }); + + sc_chain_spec::json_merge(&mut default_config, patch); + + // Build genesis config using custom json: + let mut t = BasicExternalities::new_empty(); + executor_call( + &mut t, + "GenesisBuilder_build_state", + &default_config.to_string().encode(), + ) + .unwrap(); + + // Ensure that custom values are in the genesis storage: + let storage = t.into_storages(); + let get_from_storage = |key: &str| -> Vec { + storage.top.get(&array_bytes::hex2bytes(key).unwrap()).unwrap().clone() + }; + + //SubstrateTest|Authorities + let value: Vec = get_from_storage( + "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", + ); + let authority_key_vec = + Vec::::decode(&mut &value[..]).unwrap(); + assert_eq!(authority_key_vec.len(), 2); + assert_eq!(authority_key_vec[0], AccountKeyring::Ferdie.public()); + assert_eq!(authority_key_vec[1], AccountKeyring::Alice.public()); + + //Babe|Authorities + let value: Vec = get_from_storage( + "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", + ); + assert_eq!( + BabeEpochConfiguration::decode(&mut &value[..]).unwrap(), + BabeEpochConfiguration { + c: (7, 10), + allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots + } + ); + + // Ensure that some values are default ones: + // Balances|TotalIssuance + let value: Vec = get_from_storage( + "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", + ); + assert_eq!(u64::decode(&mut &value[..]).unwrap(), 0); + + //System|ParentHash + let value: Vec = get_from_storage( + "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", + ); + assert_eq!(H256::decode(&mut &value[..]).unwrap(), [69u8; 32].into()); + } + } +} diff --git a/test-utils/runtime/src/substrate_test_pallet.rs b/test-utils/runtime/src/substrate_test_pallet.rs new file mode 100644 index 0000000..8375a68 --- /dev/null +++ b/test-utils/runtime/src/substrate_test_pallet.rs @@ -0,0 +1,252 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # substrate-test pallet +//! +//! Provides functionality used in unit-tests of numerous modules across substrate that require +//! functioning runtime. Some calls are allowed to be submitted as unsigned extrinsics, however most +//! of them requires signing. Refer to `pallet::Call` for further details. + +use alloc::{vec, vec::Vec}; +use frame_support::{pallet_prelude::*, storage}; +use sp_core::sr25519::Public; +use sp_runtime::{ + traits::Hash, + transaction_validity::{ + InvalidTransaction, TransactionSource, TransactionValidity, ValidTransaction, + }, +}; + +pub use self::pallet::*; + +const LOG_TARGET: &str = "substrate_test_pallet"; + +#[frame_support::pallet(dev_mode)] +pub mod pallet { + use super::*; + use crate::TransferData; + use frame_system::pallet_prelude::*; + use sp_core::storage::well_known_keys; + use sp_runtime::{traits::BlakeTwo256, transaction_validity::TransactionPriority, Perbill}; + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::storage] + #[pallet::getter(fn authorities)] + pub type Authorities = StorageValue<_, Vec, ValueQuery>; + + #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + pub authorities: Vec, + #[serde(skip)] + pub _config: core::marker::PhantomData, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + >::put(self.authorities.clone()); + } + } + + #[pallet::call] + impl Pallet { + /// Legacy call used in transaction pool benchmarks. + #[pallet::call_index(0)] + #[pallet::weight(100)] + pub fn bench_call(_origin: OriginFor, _transfer: TransferData) -> DispatchResult { + Ok(()) + } + + /// Implicitly fill a block body with some data. + #[pallet::call_index(1)] + #[pallet::weight(100)] + pub fn include_data(origin: OriginFor, _data: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + Ok(()) + } + + /// Put/delete some data from storage. Intended to use as an unsigned extrinsic. + #[pallet::call_index(2)] + #[pallet::weight(100)] + pub fn storage_change( + _origin: OriginFor, + key: Vec, + value: Option>, + ) -> DispatchResult { + match value { + Some(value) => storage::unhashed::put_raw(&key, &value), + None => storage::unhashed::kill(&key), + } + Ok(()) + } + + /// Write a key value pair to the offchain database. + #[pallet::call_index(3)] + #[pallet::weight(100)] + pub fn offchain_index_set( + origin: OriginFor, + key: Vec, + value: Vec, + ) -> DispatchResult { + frame_system::ensure_signed(origin)?; + sp_io::offchain_index::set(&key, &value); + Ok(()) + } + + /// Remove a key and an associated value from the offchain database. + #[pallet::call_index(4)] + #[pallet::weight(100)] + pub fn offchain_index_clear(origin: OriginFor, key: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + sp_io::offchain_index::clear(&key); + Ok(()) + } + + /// Create an index for this call. + #[pallet::call_index(5)] + #[pallet::weight(100)] + pub fn indexed_call(origin: OriginFor, data: Vec) -> DispatchResult { + frame_system::ensure_signed(origin)?; + let content_hash = sp_io::hashing::blake2_256(&data); + let extrinsic_index: u32 = + storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX).unwrap(); + sp_io::transaction_index::index(extrinsic_index, data.len() as u32, content_hash); + Ok(()) + } + + /// Deposit given digest items into the system storage. They will be included in a header + /// during finalization. + #[pallet::call_index(6)] + #[pallet::weight(100)] + pub fn deposit_log_digest_item( + _origin: OriginFor, + log: sp_runtime::generic::DigestItem, + ) -> DispatchResult { + >::deposit_log(log); + Ok(()) + } + + /// This call is validated as `ValidTransaction` with given priority. + #[pallet::call_index(7)] + #[pallet::weight(100)] + pub fn call_with_priority( + _origin: OriginFor, + _priority: TransactionPriority, + ) -> DispatchResult { + Ok(()) + } + + /// This call is validated as non-propagable `ValidTransaction`. + #[pallet::call_index(8)] + #[pallet::weight(100)] + pub fn call_do_not_propagate(_origin: OriginFor) -> DispatchResult { + Ok(()) + } + + /// Fill the block weight up to the given ratio. + #[pallet::call_index(9)] + #[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] + pub fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResult { + ensure_signed(origin)?; + Ok(()) + } + + /// Read X times from the state some data. + /// + /// Panics if it can not read `X` times. + #[pallet::call_index(10)] + #[pallet::weight(100)] + pub fn read(_origin: OriginFor, count: u32) -> DispatchResult { + Self::execute_read(count, false) + } + + /// Read X times from the state some data and then panic! + /// + /// Returns `Ok` if it didn't read anything. + #[pallet::call_index(11)] + #[pallet::weight(100)] + pub fn read_and_panic(_origin: OriginFor, count: u32) -> DispatchResult { + Self::execute_read(count, true) + } + } + + impl Pallet { + fn execute_read(read: u32, panic_at_end: bool) -> DispatchResult { + let mut next_key = vec![]; + for _ in 0..(read as usize) { + if let Some(next) = sp_io::storage::next_key(&next_key) { + // Read the value + sp_io::storage::get(&next); + + next_key = next; + } else { + if panic_at_end { + return Ok(()) + } else { + panic!("Could not read {read} times from the state"); + } + } + } + + if panic_at_end { + panic!("BYE") + } else { + Ok(()) + } + } + } + + #[pallet::validate_unsigned] + impl ValidateUnsigned for Pallet { + type Call = Call; + + fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity { + log::trace!(target: LOG_TARGET, "validate_unsigned {call:?}"); + match call { + // Some tests do not need to be complicated with signer and nonce, some need + // reproducible block hash (call signature can't be there). + // Offchain testing requires storage_change. + Call::deposit_log_digest_item { .. } | + Call::storage_change { .. } | + Call::read { .. } | + Call::read_and_panic { .. } => Ok(ValidTransaction { + provides: vec![BlakeTwo256::hash_of(&call).encode()], + ..Default::default() + }), + _ => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), + } + } + } +} + +pub fn validate_runtime_call(call: &pallet::Call) -> TransactionValidity { + log::trace!(target: LOG_TARGET, "validate_runtime_call {call:?}"); + match call { + Call::call_do_not_propagate {} => + Ok(ValidTransaction { propagate: false, ..Default::default() }), + Call::call_with_priority { priority } => + Ok(ValidTransaction { priority: *priority, ..Default::default() }), + _ => Ok(Default::default()), + } +} diff --git a/test-utils/runtime/transaction-pool/Cargo.toml b/test-utils/runtime/transaction-pool/Cargo.toml new file mode 100644 index 0000000..3cdaea6 --- /dev/null +++ b/test-utils/runtime/transaction-pool/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "substrate-test-runtime-transaction-pool" +version = "2.0.0" +authors.workspace = true +edition.workspace = true +license = "Apache-2.0" +homepage.workspace = true +repository.workspace = true +publish = false + +[lints] +workspace = true + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { workspace = true, default-features = true } +futures = { workspace = true } +log = { workspace = true } +parking_lot = { workspace = true, default-features = true } +thiserror = { workspace = true } +sc-transaction-pool = { workspace = true, default-features = true } +sc-transaction-pool-api = { workspace = true, default-features = true } +sp-blockchain = { workspace = true, default-features = true } +sp-runtime = { workspace = true, default-features = true } +substrate-test-runtime-client = { workspace = true } diff --git a/test-utils/runtime/transaction-pool/src/lib.rs b/test-utils/runtime/transaction-pool/src/lib.rs new file mode 100644 index 0000000..6a4f38f --- /dev/null +++ b/test-utils/runtime/transaction-pool/src/lib.rs @@ -0,0 +1,541 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Test utils for the transaction pool together with the test runtime. +//! +//! See [`TestApi`] for more information. + +use codec::Encode; +use futures::future::ready; +use parking_lot::RwLock; +use sc_transaction_pool::ChainApi; +use sp_blockchain::{CachedHeaderMetadata, HashAndNumber, TreeRoute}; +use sp_runtime::{ + generic::{self, BlockId}, + traits::{ + BlakeTwo256, Block as BlockT, Hash as HashT, Header as _, NumberFor, TrailingZeroInput, + }, + transaction_validity::{ + InvalidTransaction, TransactionSource, TransactionValidity, TransactionValidityError, + ValidTransaction, + }, +}; +use std::{ + collections::{BTreeMap, HashMap, HashSet}, + sync::Arc, +}; +use substrate_test_runtime_client::{ + runtime::{ + AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, + TransferData, + }, + AccountKeyring::{self, *}, +}; + +/// Error type used by [`TestApi`]. +#[derive(Debug, thiserror::Error)] +#[error(transparent)] +pub struct Error(#[from] pub sc_transaction_pool_api::error::Error); + +impl sc_transaction_pool_api::error::IntoPoolError for Error { + fn into_pool_error(self) -> Result { + Ok(self.0) + } +} + +pub enum IsBestBlock { + Yes, + No, +} + +impl IsBestBlock { + pub fn is_best(&self) -> bool { + matches!(self, Self::Yes) + } +} + +impl From for IsBestBlock { + fn from(is_best: bool) -> Self { + if is_best { + Self::Yes + } else { + Self::No + } + } +} + +#[derive(Default)] +pub struct ChainState { + pub block_by_number: BTreeMap>, + pub block_by_hash: HashMap, + pub nonces: HashMap>, + pub invalid_hashes: HashSet, + pub priorities: HashMap, +} + +/// Test Api for transaction pool. +pub struct TestApi { + valid_modifier: RwLock>, + chain: RwLock, + validation_requests: RwLock>, + enable_stale_check: bool, +} + +impl TestApi { + /// Test Api with Alice nonce set initially. + pub fn with_alice_nonce(nonce: u64) -> Self { + let api = Self::empty(); + assert_eq!(api.chain.read().block_by_hash.len(), 1); + assert_eq!(api.chain.read().nonces.len(), 1); + + api.chain + .write() + .nonces + .values_mut() + .nth(0) + .map(|h| h.insert(Alice.into(), nonce)); + + api + } + + /// Default Test Api + pub fn empty() -> Self { + let api = TestApi { + valid_modifier: RwLock::new(Box::new(|_| {})), + chain: Default::default(), + validation_requests: RwLock::new(Default::default()), + enable_stale_check: false, + }; + + // Push genesis block + api.push_block(0, Vec::new(), true); + + let hash0 = *api.chain.read().block_by_hash.keys().nth(0).unwrap(); + api.chain.write().nonces.insert(hash0, Default::default()); + + api + } + + pub fn enable_stale_check(mut self) -> Self { + self.enable_stale_check = true; + self + } + + /// Set hook on modify valid result of transaction. + pub fn set_valid_modifier(&self, modifier: Box) { + *self.valid_modifier.write() = modifier; + } + + /// Push block under given number. + pub fn push_block( + &self, + block_number: BlockNumber, + xts: Vec, + is_best_block: bool, + ) -> Header { + let parent_hash = { + let chain = self.chain.read(); + block_number + .checked_sub(1) + .and_then(|num| { + chain.block_by_number.get(&num).map(|blocks| blocks[0].0.header.hash()) + }) + .unwrap_or_default() + }; + + self.push_block_with_parent(parent_hash, xts, is_best_block) + } + + /// Push a block using the given `parent`. + /// + /// Panics if `parent` does not exists. + pub fn push_block_with_parent( + &self, + parent: Hash, + xts: Vec, + is_best_block: bool, + ) -> Header { + // `Hash::default()` is the genesis parent hash + let block_number = if parent == Hash::default() { + 0 + } else { + *self + .chain + .read() + .block_by_hash + .get(&parent) + .expect("`parent` exists") + .header() + .number() + 1 + }; + + let header = Header { + number: block_number, + digest: Default::default(), + extrinsics_root: Hash::random(), + parent_hash: parent, + state_root: Default::default(), + }; + + self.add_block(Block::new(header.clone(), xts), is_best_block); + + header + } + + /// Add a block to the internal state. + pub fn add_block(&self, block: Block, is_best_block: bool) { + let hash = block.header.hash(); + let block_number = block.header.number(); + + let mut chain = self.chain.write(); + chain.block_by_hash.insert(hash, block.clone()); + + if *block_number > 0 { + // copy nonces to new block + let prev_nonces = chain + .nonces + .get(block.header.parent_hash()) + .expect("there shall be nonces for parent block") + .clone(); + chain.nonces.insert(hash, prev_nonces); + } + + log::info!( + "add_block: {:?} {:?} {:?} nonces:{:#?}", + block_number, + hash, + block.header.parent_hash(), + chain.nonces + ); + + if is_best_block { + chain + .block_by_number + .entry(*block_number) + .or_default() + .iter_mut() + .for_each(|x| { + x.1 = IsBestBlock::No; + }); + } + + chain + .block_by_number + .entry(*block_number) + .or_default() + .push((block, is_best_block.into())); + } + + fn hash_and_length_inner(ex: &Extrinsic) -> (Hash, usize) { + let encoded = ex.encode(); + (BlakeTwo256::hash(&encoded), encoded.len()) + } + + /// Mark some transaction is invalid. + /// + /// Next time transaction pool will try to validate this + /// extrinsic, api will return invalid result. + pub fn add_invalid(&self, xts: &Extrinsic) { + self.chain.write().invalid_hashes.insert(Self::hash_and_length_inner(xts).0); + } + + /// Remove a transaction that was previously declared as invalid via `[Self::add_invalid]`. + /// + /// Next time transaction pool will try to validate this + /// extrinsic, api will succeed. + pub fn remove_invalid(&self, xts: &Extrinsic) { + self.chain.write().invalid_hashes.remove(&Self::hash_and_length_inner(xts).0); + } + + /// Set a transaction priority. + pub fn set_priority(&self, xts: &Extrinsic, priority: u64) { + self.chain + .write() + .priorities + .insert(Self::hash_and_length_inner(xts).0, priority); + } + + /// Query validation requests received. + pub fn validation_requests(&self) -> Vec { + self.validation_requests.read().clone() + } + + /// get a reference to the chain state + pub fn chain(&self) -> &RwLock { + &self.chain + } + + /// Set nonce in the inner state for given block. + pub fn set_nonce(&self, at: Hash, account: AccountId, nonce: u64) { + let mut chain = self.chain.write(); + chain.nonces.entry(at).and_modify(|h| { + h.insert(account, nonce); + }); + + log::debug!("set_nonce: {:?} nonces:{:#?}", at, chain.nonces); + } + + /// Increment nonce in the inner state for given block. + pub fn increment_nonce_at_block(&self, at: Hash, account: AccountId) { + let mut chain = self.chain.write(); + chain.nonces.entry(at).and_modify(|h| { + h.entry(account).and_modify(|n| *n += 1).or_insert(1); + }); + + log::debug!("increment_nonce_at_block: {:?} nonces:{:#?}", at, chain.nonces); + } + + /// Increment nonce in the inner state. + pub fn increment_nonce(&self, account: AccountId) { + let mut chain = self.chain.write(); + // if no particular block was given, then update nonce everywhere + chain.nonces.values_mut().for_each(|h| { + h.entry(account).and_modify(|n| *n += 1).or_insert(1); + }) + } + + /// Calculate a tree route between the two given blocks. + pub fn tree_route( + &self, + from: Hash, + to: Hash, + ) -> Result, Error> { + sp_blockchain::tree_route(self, from, to) + } + + /// Helper function for mapping block number to hash. Use if mapping shall not fail. + pub fn expect_hash_from_number(&self, n: BlockNumber) -> Hash { + self.block_id_to_hash(&BlockId::Number(n)).unwrap().unwrap() + } + + /// Helper function for getting genesis hash + pub fn genesis_hash(&self) -> Hash { + self.expect_hash_from_number(0) + } + + pub fn expect_hash_and_number(&self, n: BlockNumber) -> HashAndNumber { + HashAndNumber { hash: self.expect_hash_from_number(n), number: n } + } +} + +trait TagFrom { + fn tag_from(&self) -> u8; +} + +impl TagFrom for AccountId { + fn tag_from(&self) -> u8 { + let f = AccountKeyring::iter().enumerate().find(|k| AccountId::from(k.1) == *self); + u8::try_from(f.unwrap().0).unwrap() + } +} + +impl ChainApi for TestApi { + type Block = Block; + type Error = Error; + type ValidationFuture = futures::future::Ready>; + type BodyFuture = futures::future::Ready>, Error>>; + + fn validate_transaction( + &self, + at: ::Hash, + _source: TransactionSource, + uxt: Arc<::Extrinsic>, + ) -> Self::ValidationFuture { + let uxt = (*uxt).clone(); + self.validation_requests.write().push(uxt.clone()); + let block_number; + + match self.block_id_to_number(&BlockId::Hash(at)) { + Ok(Some(number)) => { + let found_best = self + .chain + .read() + .block_by_number + .get(&number) + .map(|blocks| blocks.iter().any(|b| b.1.is_best())) + .unwrap_or(false); + block_number = Some(number); + + // If there is no best block, we don't know based on which block we should validate + // the transaction. (This is not required for this test function, but in real + // environment it would fail because of this). + if !found_best { + return ready(Ok(Err(TransactionValidityError::Invalid( + InvalidTransaction::Custom(1), + )))) + } + }, + Ok(None) => + return ready(Ok(Err(TransactionValidityError::Invalid( + InvalidTransaction::Custom(2), + )))), + Err(e) => return ready(Err(e)), + } + + let (requires, provides) = if let Ok(transfer) = TransferData::try_from(&uxt) { + let chain_nonce = self + .chain + .read() + .nonces + .get(&at) + .expect("nonces must be there for every block") + .get(&transfer.from) + .cloned() + .unwrap_or(0); + let requires = if chain_nonce == transfer.nonce { + vec![] + } else { + if self.enable_stale_check { + vec![vec![transfer.from.tag_from(), (transfer.nonce - 1) as u8]] + } else { + vec![vec![(transfer.nonce - 1) as u8]] + } + }; + let provides = if self.enable_stale_check { + vec![vec![transfer.from.tag_from(), transfer.nonce as u8]] + } else { + vec![vec![transfer.nonce as u8]] + }; + + log::info!( + "test_api::validate_transaction: h:{:?} n:{:?} cn:{:?} tn:{:?} r:{:?} p:{:?}", + at, + block_number, + chain_nonce, + transfer.nonce, + requires, + provides, + ); + + if self.enable_stale_check && transfer.nonce < chain_nonce { + log::info!("test_api::validate_transaction: invalid_transaction(stale)...."); + return ready(Ok(Err(TransactionValidityError::Invalid(InvalidTransaction::Stale)))) + } + + (requires, provides) + } else { + (Vec::new(), vec![uxt.encode()]) + }; + + if self.chain.read().invalid_hashes.contains(&self.hash_and_length(&uxt).0) { + log::info!("test_api::validate_transaction: invalid_transaction...."); + return ready(Ok(Err(TransactionValidityError::Invalid(InvalidTransaction::Custom(0))))) + } + + let priority = self.chain.read().priorities.get(&self.hash_and_length(&uxt).0).cloned(); + let mut validity = ValidTransaction { + priority: priority.unwrap_or(1), + requires, + provides, + longevity: 64, + propagate: true, + }; + + (self.valid_modifier.read())(&mut validity); + + ready(Ok(Ok(validity))) + } + + fn validate_transaction_blocking( + &self, + _at: ::Hash, + _source: TransactionSource, + _uxt: Arc<::Extrinsic>, + ) -> Result { + unimplemented!(); + } + + fn block_id_to_number( + &self, + at: &BlockId, + ) -> Result>, Error> { + Ok(match at { + generic::BlockId::Hash(x) => + self.chain.read().block_by_hash.get(x).map(|b| *b.header.number()), + generic::BlockId::Number(num) => Some(*num), + }) + } + + fn block_id_to_hash( + &self, + at: &BlockId, + ) -> Result::Hash>, Error> { + Ok(match at { + generic::BlockId::Hash(x) => Some(*x), + generic::BlockId::Number(num) => + self.chain.read().block_by_number.get(num).and_then(|blocks| { + blocks.iter().find(|b| b.1.is_best()).map(|b| b.0.header().hash()) + }), + }) + } + + fn hash_and_length(&self, ex: &::Extrinsic) -> (Hash, usize) { + Self::hash_and_length_inner(ex) + } + + fn block_body(&self, hash: ::Hash) -> Self::BodyFuture { + futures::future::ready(Ok(self + .chain + .read() + .block_by_hash + .get(&hash) + .map(|b| b.extrinsics().to_vec()))) + } + + fn block_header( + &self, + hash: ::Hash, + ) -> Result::Header>, Self::Error> { + Ok(self.chain.read().block_by_hash.get(&hash).map(|b| b.header().clone())) + } + + fn tree_route( + &self, + from: ::Hash, + to: ::Hash, + ) -> Result, Self::Error> { + sp_blockchain::tree_route::(self, from, to).map_err(Into::into) + } +} + +impl sp_blockchain::HeaderMetadata for TestApi { + type Error = Error; + + fn header_metadata(&self, hash: Hash) -> Result, Self::Error> { + let chain = self.chain.read(); + let block = chain.block_by_hash.get(&hash).expect("Hash exists"); + + Ok(block.header().into()) + } + + fn insert_header_metadata(&self, _: Hash, _: CachedHeaderMetadata) { + unimplemented!("Not implemented for tests") + } + + fn remove_header_metadata(&self, _: Hash) { + unimplemented!("Not implemented for tests") + } +} + +/// Generate transfer extrinsic with a given nonce. +/// +/// Part of the test api. +pub fn uxt(who: AccountKeyring, nonce: Nonce) -> Extrinsic { + let dummy = codec::Decode::decode(&mut TrailingZeroInput::zeroes()).unwrap(); + let transfer = Transfer { from: who.into(), to: dummy, nonce, amount: 1 }; + ExtrinsicBuilder::new_transfer(transfer).build() +} From 5315d43027d8d438da7ddeea637faf7ace04f8db Mon Sep 17 00:00:00 2001 From: driemworks Date: Wed, 26 Feb 2025 18:35:50 -0600 Subject: [PATCH 02/21] update deps, add gossipsub to sealing logic wip --- client/consensus/randomness-beacon/Cargo.toml | 12 +--- .../randomness-beacon/src/instant_seal.rs | 60 +++++++++++++++---- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index 6e4319c..caf37c1 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -14,17 +14,7 @@ workspace = true [dependencies] codec.workspace = true serde = { workspace = true, features = ["derive"] } -libp2p = { version = "0.55.0", features = [ - "gossipsub", - "noise", - "tcp", - "ping", - "dns", - "async-std", - "tokio", - "websocket", - "yamux", -] } +libp2p.workspace = true prost = "0.13.4" prost-types = "0.13.4" log = { workspace = true } diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs index 9c524c7..25b0ec4 100644 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -14,9 +14,9 @@ * limitations under the License. */ -//! # Inherent-Data Sync based consensus mechanism +//! # Inherent-Data Sync based consensus mechanism //! -//! This consensus mechanism produces blocks whenever it has the necessary data as required by inherent data providers. +//! This consensus mechanism produces blocks whenever it has the necessary data as required by inherent data providers. //! Specifically, the goal is to author a block whenever there are N new messages in a queue //! @@ -31,11 +31,10 @@ // block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, // import_queue::{BasicQueue, BoxBlockImport, Verifier}, // }; +use crate::gossipsub::{GossipsubNetwork, GossipsubState, SharedState}; +use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; use sc_consensus_manual_seal::{ - consensus::ConsensusDataProvider, - EngineCommand, - ManualSealParams, - run_manual_seal + consensus::ConsensusDataProvider, run_manual_seal, EngineCommand, ManualSealParams, }; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; @@ -43,7 +42,11 @@ use sp_blockchain::HeaderBackend; // use sp_core::traits::SpawnNamed; use sp_inherents::CreateInherentDataProviders; use sp_runtime::{traits::Block as BlockT, ConsensusEngineId}; -use std::{marker::PhantomData, sync::Arc, time::Duration}; +use std::{ + marker::PhantomData, + sync::{Arc, Mutex}, + time::Duration, +}; const LOG_TARGET: &str = "drand-lock-step"; @@ -74,7 +77,6 @@ pub struct ConsensusParams, TP, SC, CI pub create_inherent_data_providers: CIDP, } - // /// runs the background authorship task for the randomness-beacon pulse-based seal engine. // /// It creates a new block for every N pulses from a randomness beacon ingested into a queue // pub async fn run( @@ -124,6 +126,7 @@ pub struct ConsensusParams, TP, SC, CI #[cfg(test)] mod tests { use super::*; + use futures::StreamExt; use sc_basic_authorship::ProposerFactory; use sc_consensus::{BlockImportParams, ImportedAux}; use sc_consensus_manual_seal::{CreatedBlock, Error}; @@ -131,12 +134,11 @@ mod tests { use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; use sp_inherents::InherentData; use sp_runtime::generic::{Digest, DigestItem}; + use substrate_test_runtime_client::AccountKeyring::Alice; use substrate_test_runtime_client::{ DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, }; - use substrate_test_runtime_client::AccountKeyring::Alice; use substrate_test_runtime_transaction_pool::{uxt, TestApi}; - use futures::StreamExt; fn api() -> Arc { Arc::new(TestApi::empty()) @@ -174,6 +176,34 @@ mod tests { } } + async fn run_gossipsub() -> SharedState { + let topic_str: &str = + "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; + + let maddr1: libp2p::Multiaddr = + "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); + + let maddr2: libp2p::Multiaddr = + "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); + + let local_identity: Keypair = Keypair::generate_ed25519(); + let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); + let gossipsub_config = GossipsubConfig::default(); + let mut gossipsub = + GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(); + + tokio::spawn(async move { + if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { + log::error!("Failed to run gossipsub network: {:?}", e); + } + }); + + state + } #[tokio::test] async fn instant_seal() { @@ -194,11 +224,18 @@ mod tests { genesis_hash, genesis_hash, )); + let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None); // this test checks that blocks are created as soon as transactions are imported into the // pool. let (sender, receiver) = futures::channel::oneshot::channel(); let mut sender = Arc::new(Some(sender)); + + // so we want to redefine the commands stream + let mut shared_state = run_gossipsub().await; + // shared_state. + + let commands_stream = pool.pool().validated_pool().import_notification_stream().map(move |_| { // we're only going to submit one tx so this fn will only be called once. @@ -248,5 +285,4 @@ mod tests { assert!(client.header(created_block.hash).unwrap().is_some()); assert_eq!(client.header(created_block.hash).unwrap().unwrap().number, 1) } - -} \ No newline at end of file +} From 25f0b814dfaaf8fed824c03439de9797250237d2 Mon Sep 17 00:00:00 2001 From: driemworks Date: Fri, 28 Feb 2025 14:58:20 -0600 Subject: [PATCH 03/21] update gossipsub testS --- Cargo.lock | 1 + Cargo.toml | 14 +- client/consensus/randomness-beacon/Cargo.toml | 1 + .../randomness-beacon/src/gossipsub.rs | 244 +++++++----------- .../randomness-beacon/src/instant_seal.rs | 58 ++--- 5 files changed, 132 insertions(+), 186 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fcbb0c..ac75028 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7859,6 +7859,7 @@ dependencies = [ "sc-consensus-manual-seal", "sc-transaction-pool", "sc-transaction-pool-api", + "sc-utils", "scale-info", "serde", "sp-api", diff --git a/Cargo.toml b/Cargo.toml index ad4bdbf..b78c234 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,9 +47,20 @@ extra-unused-type-parameters = { level = "allow", priority = 2 } # stylistic default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic [workspace.dependencies] -# Async & Concurrency +# Async, Concurrency, & Networking async-trait = "0.1.85" futures = "0.3" +libp2p = { version = "0.55.0", features = [ + "gossipsub", + "noise", + "tcp", + "ping", + "dns", + "async-std", + "tokio", + "websocket", + "yamux", +] } thiserror = { version = "1.0.64" } tokio = { version = "^1", features = ["full"] } @@ -81,6 +92,7 @@ sc-offchain = { version = "43.0.0", default-features = false } sc-service = { version = "0.49.0", default-features = false } sc-transaction-pool = { version = "38.1.0", default-features = false } sc-transaction-pool-api = { version = "38.1.0", default-features = false } +sc-utils = { version = "18.0.0", default-features = false } sp-api = { version = "35.0.0", default-features = false } sp-application-crypto = { version = "39.0.0", default-features = false } sp-blockchain = { version = "38.0.0", default-features = false } diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index caf37c1..e48b7e8 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -21,6 +21,7 @@ log = { workspace = true } futures.workspace = true scale-info.workspace = true sc-consensus-manual-seal.workspace = true +sc-utils.workspace = true sp-api.workspace = true sp-blockchain.workspace = true sp-inherents = {workspace = true, default-features = true } diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index f39d6c3..36753fa 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -28,7 +28,7 @@ //! ## Examples //! //! ``` no_run -//! use sc_consensus_randomness_beacon::gossipsub::{GossipsubNetwork, GossipsubState}; +//! use sc_consensus_randomness_beacon::gossipsub::GossipsubNetwork; //! use sc_consensus_randomness_beacon::types::*; //! use futures::StreamExt; //! use libp2p::{ @@ -40,6 +40,7 @@ //! swarm::{Swarm, SwarmEvent}, //! Multiaddr, SwarmBuilder, //! }; +//! use sc_utils::mpsc::tracing_unbounded; //! use prost::Message; //! use std::sync::{Arc, Mutex}; //! @@ -54,11 +55,11 @@ //! .parse() //! .expect("The string is a well-formatted multiaddress. qed."); //! let local_identity: Keypair = Keypair::generate_ed25519(); -//! let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); +//! let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); //! let gossipsub_config = GossipsubConfig::default(); -//! let mut gossipsub = GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(); +//! let mut gossipsub = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None).unwrap(); //! tokio::spawn(async move { -//! if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { +//! if let Err(e) = gossipsub.run(topic_str, vec![maddr1, maddr2]).await { //! log::error!("Failed to run gossipsub network: {:?}", e); //! } //! }); @@ -75,10 +76,10 @@ use libp2p::{ Multiaddr, SwarmBuilder, }; use prost::Message; -use std::sync::{Arc, Mutex}; +use sc_utils::mpsc::TracingUnboundedSender; /// The default address instructing libp2p to choose a random open port on the local machine -const RAND_LISTEN_ADDR: &str = "/ip4/0.0.0.0/tcp/0"; +const RAND_LISTEN_ADDR: &str = "/ip4/127.0.0.1/tcp/0"; /// Various errors that can be encountered #[derive(Debug, Clone, PartialEq)] @@ -93,38 +94,16 @@ pub enum Error { SwarmListenFailure, /// The swarm could not subscribe to the topic. GossipsubSubscriptionFailed, - /// The Mutex is locked and can not be accessed. - StateLocked, } -/// The Gossipsub State tracks the pulses ingested from a randomness beacon -/// during some given block's lifetime (i.e. the new pulses observed) -#[derive(Debug, Clone, PartialEq)] -pub struct GossipsubState { - /// An (unbounded) vec of pulses - pub pulses: Vec, -} - -impl GossipsubState { - /// Append a new pulse to the pulses vec. It returns Ok() if successful, otherwise gives an - /// error. - /// * `pulse`: The pulse to append - fn add_pulse(&mut self, pulse: Pulse) -> Result<(), Error> { - let opaque = pulse.try_into().map_err(|_| Error::SignatureBufferCapacityExceeded)?; - self.pulses.push(opaque); - Ok(()) - } -} - -/// A shared Gossipsub state between threads -pub type SharedState = Arc>; - /// A gossipsub network with any behaviour and shared state pub struct GossipsubNetwork { /// The behaviour config for the swam swarm: Swarm, - /// The shared state - state: SharedState, + /// The mpsc channel sender + sender: TracingUnboundedSender, + /// The number of peers the node is connected to + pub(crate) connected_peers: u8, } impl GossipsubNetwork { @@ -134,17 +113,17 @@ impl GossipsubNetwork { /// transport layer. /// /// * `key`: A libp2p keypair - /// * `state`: The shared state /// * `gossipsub_config`: A gossipsub config pub fn new( key: &Keypair, - state: SharedState, gossipsub_config: GossipsubConfig, + sender: TracingUnboundedSender, + listen_addr: Option<&Multiaddr>, ) -> Result { let message_authenticity = MessageAuthenticity::Signed(key.clone()); let gossipsub = GossipsubBehaviour::new(message_authenticity, gossipsub_config) .map_err(|_| Error::InvalidGossipsubNetworkBehaviour)?; - let swarm = SwarmBuilder::with_existing_identity(key.clone()) + let mut swarm = SwarmBuilder::with_existing_identity(key.clone()) .with_tokio() .with_tcp( libp2p::tcp::Config::default(), @@ -156,36 +135,32 @@ impl GossipsubNetwork { .expect("The behaviour is well defined.") .build(); - Ok(Self { swarm, state }) + // fallback to a randomly assigned open port if one was not provided + let fallback = &RAND_LISTEN_ADDR.parse().expect("The multiaddress is well-formatted;QED."); + let listen_addr = listen_addr.unwrap_or(fallback); + + swarm.listen_on(listen_addr.clone()).map_err(|_| Error::SwarmListenFailure)?; + + Ok(Self { swarm, sender, connected_peers: 0 }) } /// Start the gossipsub network. /// It waits for peers to establish a connection, then writes well-formed messages received /// from the gossipsub topic to the shared state. /// - /// * `topic_str`: The gossipsub topic to subscribe to - /// * `peers`: A list of peers to dial - /// * `listen_addr`: An address to listen on. If None, then a random local port is assigned. - pub async fn run( - &mut self, - topic_str: &str, - peers: Vec<&Multiaddr>, - listen_addr: Option<&Multiaddr>, - ) -> Result<(), Error> { - // fallback to a randomly assigned open port if one was not provided - let fallback = &RAND_LISTEN_ADDR.parse().expect("The multiaddress is well-formatted;QED."); - let listen_addr = listen_addr.unwrap_or(fallback); - self.swarm - .listen_on(listen_addr.clone()) - .map_err(|_| Error::SwarmListenFailure)?; - + /// * `topic_str`: The gossipsub topic to subscribe to. + /// * `peers`: A list of peers to dial. + pub async fn run(&mut self, topic_str: &str, peers: Vec) -> Result<(), Error> { for peer in &peers { self.swarm .dial((*peer).clone()) .map_err(|_| Error::PeerUnreachable { who: (*peer).clone() })?; } - self.wait_for_peers(peers.len()).await; + if !peers.is_empty() { + self.wait_for_peers(peers.len()).await; + } + self.subscribe(topic_str).await } @@ -199,6 +174,7 @@ impl GossipsubNetwork { connected_peers += 1; } } + self.connected_peers = connected_peers as u8; } /// Create a subscription to a gossipsub topic. @@ -209,6 +185,8 @@ impl GossipsubNetwork { async fn subscribe(&mut self, topic_str: &str) -> Result<(), Error> { let topic = IdentTopic::new(topic_str); + // let (tx, rx) = tracing_unbounded("drand-pulse-notification-queue", 1000000); + self.swarm .behaviour_mut() .subscribe(&topic) @@ -223,16 +201,9 @@ impl GossipsubNetwork { })) => { // ignore non-decodable messages if let Ok(pulse) = Pulse::decode(&*message.data) { - // The state could be locked here: https://github.com/ideal-lab5/idn-sdk/issues/59 - if let Ok(mut state) = self.state.lock() { - state.add_pulse(pulse.clone())?; - log::info!( - "Received pulse for round {:?} with message id: {} from peer: {:?}", - pulse.round, - message_id, - propagation_source - ); - } + let pulse: OpaquePulse = + pulse.try_into().map_err(|_| Error::SignatureBufferCapacityExceeded)?; + self.sender.unbounded_send(pulse.clone()).unwrap(); } // handle non-decodable messages: https://github.com/ideal-lab5/idn-sdk/issues/60 }, @@ -244,107 +215,57 @@ impl GossipsubNetwork { } } -#[cfg(feature = "e2e")] +#[cfg(not(feature = "e2e"))] #[cfg(test)] mod tests { use super::*; - use std::sync::{Arc, Mutex}; - use tokio::time::{sleep, Duration}; - - fn build_node() -> (GossipsubNetwork, SharedState) { + use libp2p::gossipsub::{ConfigBuilder, ValidationMode}; + use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; + use std::sync::Arc; + use tokio::{ + sync::Mutex, + time::{sleep, Duration}, + }; + + fn build_node() -> (GossipsubNetwork, TracingUnboundedReceiver) { let local_identity: Keypair = Keypair::generate_ed25519(); - let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); let gossipsub_config = GossipsubConfig::default(); - (GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(), state) + let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); + (GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None).unwrap(), rx) } #[tokio::test] - async fn can_subscribe_to_topic_and_deserialize_pulses_when_peers_connected() { - let topic_str: &str = - "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; - - let maddr1: libp2p::Multiaddr = - "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); - - let maddr2: libp2p::Multiaddr = - "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); - - let (mut gossipsub, state) = build_node(); - tokio::spawn(async move { - if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { - log::error!("Failed to run gossipsub network: {:?}", e); - } - }); - - // Sleep for 6 secs - sleep(Duration::from_millis(6000)).await; - let data_lock = state.lock().unwrap(); - let pulses = &data_lock.pulses; - assert!(pulses.len() >= 1); + async fn can_build_new_node() { + let (node, _rx) = build_node(); + assert!(node.connected_peers == 0, "There should be no connected peers."); } -} - -#[cfg(not(feature = "e2e"))] -#[cfg(test)] -mod tests { - use super::*; - use libp2p::gossipsub::{ConfigBuilder, ValidationMode}; - use std::sync::{Arc, Mutex}; - use tokio::time::{sleep, Duration}; - fn build_node() -> (GossipsubNetwork, SharedState) { + #[tokio::test] + async fn can_build_new_node_with_listen_addr() { let local_identity: Keypair = Keypair::generate_ed25519(); - let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); let gossipsub_config = GossipsubConfig::default(); - (GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(), state) - } - - #[test] - fn can_add_pulse_to_state() { - let mut state = GossipsubState { pulses: vec![] }; - let pulse = Pulse { round: 0, signature: ::prost::alloc::vec![1;48] }; - let res = state.add_pulse(pulse); - assert!(res.is_ok()); - assert_eq!(state.pulses.len(), 1); - } - - #[test] - fn can_not_pulse_to_state_if_sig_buff_too_big() { - let mut state = GossipsubState { pulses: vec![] }; - let pulse = Pulse { round: 0, signature: ::prost::alloc::vec![1;49] }; - let res = state.add_pulse(pulse); - assert!(res.is_err()); - assert_eq!(state.pulses.len(), 0); + let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); + let listen_addr: Multiaddr = "/ip4/0.0.0.0/tcp/4001".parse().unwrap(); + let node = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&listen_addr)).unwrap(); + assert!(node.connected_peers == 0, "There should be no connected peers."); } #[tokio::test] - async fn can_fail_on_invalid_gossipsub_network_behaviour() { - let local_identity: Keypair = Keypair::generate_ed25519(); - let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); + async fn can_build_node_and_run_without_peers() { + let topic_str = "test"; + let (mut node, _rx) = build_node(); - let gossipsub_config = ConfigBuilder::default() - .validation_mode(ValidationMode::Anonymous) - .build() - .unwrap(); + let mut is_err: bool = false; - let result = GossipsubNetwork::new(&local_identity, state, gossipsub_config); + tokio::spawn(async move { + if let Err(_e) = node.run(topic_str, vec![]).await { + is_err = true; + } + }); - assert!(result.is_err()); - assert!( - matches!(result, Err(Error::InvalidGossipsubNetworkBehaviour)), - "Expected InvalidGossipsubNetworkBehaviour error" - ); - } + sleep(Duration::from_secs(1)).await; - #[tokio::test] - async fn can_create_new_gossipsub_network() { - let (_gossipsub, state) = build_node(); - let data_lock = state.lock().unwrap(); - assert!(data_lock.pulses.is_empty()); + assert!(!is_err, "There should be no errors."); } #[tokio::test] @@ -354,29 +275,42 @@ mod tests { .parse() .unwrap(); - let (mut gossipsub, _s) = build_node(); - - let res = gossipsub.run("test", vec![], Some(&fake_listen_addr)).await; + let local_identity: Keypair = Keypair::generate_ed25519(); + let gossipsub_config = GossipsubConfig::default(); + let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); + let res = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&fake_listen_addr)); assert!(res.is_err()); assert!(matches!(res, Err(Error::SwarmListenFailure)), "Expected SwarmListenFailure error"); } + #[cfg(feature = "e2e")] #[tokio::test] - async fn can_fail_to_subscribe_to_topic_with_no_peers() { + async fn can_subscribe_to_topic_and_deserialize_pulses_when_peers_connected() { let topic_str: &str = "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; - let (mut gossipsub, state) = build_node(); + let maddr1: libp2p::Multiaddr = + "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); + + let maddr2: libp2p::Multiaddr = + "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); + + + let (mut gossipsub, mut rx) = build_node(); tokio::spawn(async move { - if let Err(e) = gossipsub.run(topic_str, vec![], None).await { + if let Err(e) = gossipsub.run(topic_str, vec![maddr1, maddr2]).await { log::error!("Failed to run gossipsub network: {:?}", e); } }); // Sleep for 6 secs - sleep(Duration::from_millis(6000)).await; - let data_lock = state.lock().unwrap(); - let pulses = &data_lock.pulses; - assert!(pulses.len() == 0); + sleep(Duration::from_millis(7000)).await; + let p1 = rx.next().await; + let p2 = rx.next().await; + assert!(p2.unwrap().round == p1.unwrap().round + 1, "rounds should be incremental."); } } diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs index 25b0ec4..ef67ef8 100644 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -31,8 +31,8 @@ // block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, // import_queue::{BasicQueue, BoxBlockImport, Verifier}, // }; -use crate::gossipsub::{GossipsubNetwork, GossipsubState, SharedState}; -use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; +// use crate::gossipsub::{GossipsubNetwork, GossipsubState, SharedState}; +// use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; use sc_consensus_manual_seal::{ consensus::ConsensusDataProvider, run_manual_seal, EngineCommand, ManualSealParams, }; @@ -176,34 +176,34 @@ mod tests { } } - async fn run_gossipsub() -> SharedState { - let topic_str: &str = - "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; + // async fn run_gossipsub() -> SharedState { + // let topic_str: &str = + // "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; - let maddr1: libp2p::Multiaddr = - "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); + // let maddr1: libp2p::Multiaddr = + // "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" + // .parse() + // .expect("The string is a well-formatted multiaddress. qed."); - let maddr2: libp2p::Multiaddr = - "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); + // let maddr2: libp2p::Multiaddr = + // "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" + // .parse() + // .expect("The string is a well-formatted multiaddress. qed."); - let local_identity: Keypair = Keypair::generate_ed25519(); - let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); - let gossipsub_config = GossipsubConfig::default(); - let mut gossipsub = - GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(); + // let local_identity: Keypair = Keypair::generate_ed25519(); + // let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); + // let gossipsub_config = GossipsubConfig::default(); + // let mut gossipsub = + // GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(); - tokio::spawn(async move { - if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { - log::error!("Failed to run gossipsub network: {:?}", e); - } - }); + // tokio::spawn(async move { + // if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { + // log::error!("Failed to run gossipsub network: {:?}", e); + // } + // }); - state - } + // state + // } #[tokio::test] async fn instant_seal() { @@ -232,10 +232,8 @@ mod tests { let mut sender = Arc::new(Some(sender)); // so we want to redefine the commands stream - let mut shared_state = run_gossipsub().await; - // shared_state. - - + // let mut shared_state = run_gossipsub().await; + // shared_state. let commands_stream = pool.pool().validated_pool().import_notification_stream().map(move |_| { // we're only going to submit one tx so this fn will only be called once. @@ -283,6 +281,6 @@ mod tests { ); // assert that there's a new block in the db. assert!(client.header(created_block.hash).unwrap().is_some()); - assert_eq!(client.header(created_block.hash).unwrap().unwrap().number, 1) + assert_eq!(client.header(created_block.hash).unwrap().unwrap().number, 1); } } From 5c48b7f745fbf47e572d3c2dde1a3545eede6e91 Mon Sep 17 00:00:00 2001 From: driemworks Date: Sat, 1 Mar 2025 08:28:08 -0600 Subject: [PATCH 04/21] drand-driven consensus test works --- .../randomness-beacon/src/gossipsub.rs | 2 +- .../randomness-beacon/src/instant_seal.rs | 89 ++++++++++--------- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 36753fa..0cb927f 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -312,5 +312,5 @@ mod tests { let p1 = rx.next().await; let p2 = rx.next().await; assert!(p2.unwrap().round == p1.unwrap().round + 1, "rounds should be incremental."); - } + } } diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs index ef67ef8..619c996 100644 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -31,8 +31,8 @@ // block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, // import_queue::{BasicQueue, BoxBlockImport, Verifier}, // }; -// use crate::gossipsub::{GossipsubNetwork, GossipsubState, SharedState}; -// use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; +use crate::gossipsub::GossipsubNetwork; +use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; use sc_consensus_manual_seal::{ consensus::ConsensusDataProvider, run_manual_seal, EngineCommand, ManualSealParams, }; @@ -126,12 +126,15 @@ pub struct ConsensusParams, TP, SC, CI #[cfg(test)] mod tests { use super::*; - use futures::StreamExt; + use crate::types::*; + // use crate::gossipsub::*; + use futures::{FutureExt, StreamExt}; use sc_basic_authorship::ProposerFactory; use sc_consensus::{BlockImportParams, ImportedAux}; use sc_consensus_manual_seal::{CreatedBlock, Error}; use sc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; + use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; use sp_inherents::InherentData; use sp_runtime::generic::{Digest, DigestItem}; use substrate_test_runtime_client::AccountKeyring::Alice; @@ -176,34 +179,36 @@ mod tests { } } - // async fn run_gossipsub() -> SharedState { - // let topic_str: &str = - // "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; + async fn run_gossipsub() -> TracingUnboundedReceiver { + let topic_str: &str = + "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; - // let maddr1: libp2p::Multiaddr = - // "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" - // .parse() - // .expect("The string is a well-formatted multiaddress. qed."); + let maddr1: libp2p::Multiaddr = + "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); - // let maddr2: libp2p::Multiaddr = - // "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" - // .parse() - // .expect("The string is a well-formatted multiaddress. qed."); + let maddr2: libp2p::Multiaddr = + "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" + .parse() + .expect("The string is a well-formatted multiaddress. qed."); - // let local_identity: Keypair = Keypair::generate_ed25519(); - // let state = Arc::new(Mutex::new(GossipsubState { pulses: vec![] })); - // let gossipsub_config = GossipsubConfig::default(); - // let mut gossipsub = - // GossipsubNetwork::new(&local_identity, state.clone(), gossipsub_config).unwrap(); + let local_identity: Keypair = Keypair::generate_ed25519(); - // tokio::spawn(async move { - // if let Err(e) = gossipsub.run(topic_str, vec![&maddr1, &maddr2], None).await { - // log::error!("Failed to run gossipsub network: {:?}", e); - // } - // }); + let (tx, rx) = tracing_unbounded("test", 1000000); - // state - // } + let gossipsub_config = GossipsubConfig::default(); + let mut gossipsub = + GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None).unwrap(); + + tokio::spawn(async move { + if let Err(e) = gossipsub.run(topic_str, vec![maddr1, maddr2]).await { + log::error!("Failed to run gossipsub network: {:?}", e); + } + }); + + rx + } #[tokio::test] async fn instant_seal() { @@ -226,26 +231,24 @@ mod tests { )); let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None); - // this test checks that blocks are created as soon as transactions are imported into the - // pool. + + // so now, let's do it simply whenever we get a new message from drand + // let size = 2; + let mut rx = run_gossipsub().await; let (sender, receiver) = futures::channel::oneshot::channel(); let mut sender = Arc::new(Some(sender)); - // so we want to redefine the commands stream - // let mut shared_state = run_gossipsub().await; - // shared_state. - let commands_stream = - pool.pool().validated_pool().import_notification_stream().map(move |_| { - // we're only going to submit one tx so this fn will only be called once. - let mut_sender = Arc::get_mut(&mut sender).unwrap(); - let sender = std::mem::take(mut_sender); - EngineCommand::SealNewBlock { - create_empty: false, - finalize: true, - parent_hash: None, - sender, - } - }); + // create a new block every time we see a new message in the channel + let mut commands_stream = rx.map(move |_msg| { + let mut_sender = Arc::get_mut(&mut sender).unwrap(); + let sender = std::mem::take(mut_sender); + EngineCommand::SealNewBlock { + create_empty: false, + finalize: true, + parent_hash: None, + sender, + } + }); // spawn the background authorship task tokio::spawn(run_manual_seal(ManualSealParams { From c65be3ed75c8f0a381d3accf90e23490702c807a Mon Sep 17 00:00:00 2001 From: driemworks Date: Sat, 1 Mar 2025 09:44:40 -0600 Subject: [PATCH 05/21] update deps --- Cargo.lock | 3 + Cargo.toml | 1 + client/consensus/randomness-beacon/Cargo.toml | 3 + .../randomness-beacon/src/instant_seal.rs | 151 ++++++++++-------- 4 files changed, 92 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac75028..2841666 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7855,6 +7855,7 @@ dependencies = [ "prost-types", "rand 0.8.5", "sc-basic-authorship", + "sc-client-api", "sc-consensus", "sc-consensus-manual-seal", "sc-transaction-pool", @@ -7865,6 +7866,8 @@ dependencies = [ "sp-api", "sp-ark-bls12-381", "sp-blockchain", + "sp-consensus", + "sp-consensus-randomness-beacon", "sp-core 35.0.0", "sp-inherents 35.0.0", "sp-runtime 40.1.0", diff --git a/Cargo.toml b/Cargo.toml index b78c234..4908d64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,6 +101,7 @@ sp-consensus = { version = "0.41.0", default-features = false } sp-consensus-aura = { version = "0.41.0", default-features = false } sp-consensus-babe = { version = "0.41.0", default-features = false } sp-consensus-grandpa = { version = "22.0.0", default-features = false } +sp-consensus-randomness-beacon = { path = "./primitives/consensus/randomness-beacon", default-features = false } sp-core = { version = "35.0.0", default-features = false } sp-crypto-hashing = { version = "0.1.0", default-features = false } sp-externalities = { version = "0.30.0", default-features = false } diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index e48b7e8..a5591b0 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -21,9 +21,12 @@ log = { workspace = true } futures.workspace = true scale-info.workspace = true sc-consensus-manual-seal.workspace = true +sc-client-api.workspace = true sc-utils.workspace = true sp-api.workspace = true sp-blockchain.workspace = true +sp-consensus.workspace = true +sp-consensus-randomness-beacon = { workspace = true, default-features = true } sp-inherents = {workspace = true, default-features = true } sp-runtime.workspace = true diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs index 619c996..07cd7e6 100644 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -20,33 +20,36 @@ //! Specifically, the goal is to author a block whenever there are N new messages in a queue //! -// use futures::prelude::*; -// use futures_timer::Delay; -// use prometheus_endpoint::Registry; -// use sc_client_api::{ -// backend::{Backend as ClientBackend, Finalizer}, -// client::BlockchainEvents, -// }; -// use sc_consensus::{ -// block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, -// import_queue::{BasicQueue, BoxBlockImport, Verifier}, -// }; use crate::gossipsub::GossipsubNetwork; +use futures::prelude::*; +use futures_timer::Delay; +// use prometheus_endpoint::Registry; +use sc_client_api::{ + backend::{Backend as ClientBackend, Finalizer}, + client::BlockchainEvents, +}; +use sc_consensus::{ + block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, + import_queue::{BasicQueue, BoxBlockImport, Verifier}, +}; +use sc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; +use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; use sc_consensus_manual_seal::{ consensus::ConsensusDataProvider, run_manual_seal, EngineCommand, ManualSealParams, }; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; -// use sp_consensus::{Environment, Proposer, SelectChain}; -// use sp_core::traits::SpawnNamed; +use sp_consensus::{Environment, Proposer, SelectChain}; +use sp_core::traits::SpawnNamed; use sp_inherents::CreateInherentDataProviders; use sp_runtime::{traits::Block as BlockT, ConsensusEngineId}; use std::{ marker::PhantomData, - sync::{Arc, Mutex}, + sync::Arc, time::Duration, }; +use tokio::sync::Mutex; const LOG_TARGET: &str = "drand-lock-step"; @@ -77,65 +80,62 @@ pub struct ConsensusParams, TP, SC, CI pub create_inherent_data_providers: CIDP, } -// /// runs the background authorship task for the randomness-beacon pulse-based seal engine. -// /// It creates a new block for every N pulses from a randomness beacon ingested into a queue -// pub async fn run( -// ConsensusParams { -// block_import, -// env, -// client, -// pool, -// select_chain, -// consensus_data_provider, -// create_inherent_data_providers, -// }: ConsensusParams, -// ) where -// B: BlockT + 'static, -// BI: BlockImport + Send + Sync + 'static, -// C: HeaderBackend + Finalizer + ProvideRuntimeApi + 'static, -// CB: ClientBackend + 'static, -// E: Environment + 'static, -// E::Proposer: Proposer, -// SC: SelectChain + 'static, -// TP: TransactionPool, -// CIDP: CreateInherentDataProviders, -// P: codec::Encode + Send + Sync + 'static, -// { -// // instant-seal creates blocks as soon as transactions are imported -// // into the transaction pool. -// let commands_stream = pool.import_notification_stream().map(|_| EngineCommand::SealNewBlock { -// create_empty: true, -// finalize: false, -// parent_hash: None, -// sender: None, -// }); - -// run_manual_seal(ManualSealParams { -// block_import, -// env, -// client, -// pool, -// commands_stream, -// select_chain, -// consensus_data_provider, -// create_inherent_data_providers, -// }) -// .await -// } +/// runs the background authorship task for the randomness-beacon pulse-based seal engine. +/// It creates a new block for every N pulses from a randomness beacon ingested into a queue +pub async fn run( + ConsensusParams { + block_import, + env, + client, + pool, + select_chain, + consensus_data_provider, + create_inherent_data_providers, + }: ConsensusParams, +) where + B: BlockT + 'static, + BI: BlockImport + Send + Sync + 'static, + C: HeaderBackend + Finalizer + ProvideRuntimeApi + 'static, + CB: ClientBackend + 'static, + E: Environment + 'static, + E::Proposer: Proposer, + SC: SelectChain + 'static, + TP: TransactionPool, + CIDP: CreateInherentDataProviders, + P: codec::Encode + Send + Sync + 'static, +{ + // instant-seal creates blocks as soon as transactions are imported + // into the transaction pool. + let commands_stream = pool.import_notification_stream().map(|_| EngineCommand::SealNewBlock { + create_empty: true, + finalize: false, + parent_hash: None, + sender: None, + }); + + run_manual_seal(ManualSealParams { + block_import, + env, + client, + pool, + commands_stream, + select_chain, + consensus_data_provider, + create_inherent_data_providers, + }) + .await +} #[cfg(test)] mod tests { use super::*; use crate::types::*; - // use crate::gossipsub::*; use futures::{FutureExt, StreamExt}; use sc_basic_authorship::ProposerFactory; use sc_consensus::{BlockImportParams, ImportedAux}; use sc_consensus_manual_seal::{CreatedBlock, Error}; - use sc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; - use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; - use sp_inherents::InherentData; + use sp_inherents::{InherentData, InherentDataProvider}; use sp_runtime::generic::{Digest, DigestItem}; use substrate_test_runtime_client::AccountKeyring::Alice; use substrate_test_runtime_client::{ @@ -239,9 +239,16 @@ mod tests { let mut sender = Arc::new(Some(sender)); // create a new block every time we see a new message in the channel - let mut commands_stream = rx.map(move |_msg| { + // a channel to relay pulses from the commands stream to the CIDP loop + let (mut pulse_tx, mut pulse_rx) = tracing_unbounded("pulses", 10000); + + // build a SealEngine command whenever we encounter a new message + let mut commands_stream = rx.map(move |pulse| { let mut_sender = Arc::get_mut(&mut sender).unwrap(); let sender = std::mem::take(mut_sender); + // update the shared state + pulse_tx.unbounded_send(pulse).unwrap(); + EngineCommand::SealNewBlock { create_empty: false, finalize: true, @@ -258,11 +265,23 @@ mod tests { pool: pool.clone(), commands_stream, select_chain, - create_inherent_data_providers: |_, _| async { Ok(()) }, + create_inherent_data_providers: |_, _| async move { + // we want to create a block whenever the required CIDP data is available. + // In this case, we want a single message to be available. + + // Q: how can we retrieve the message?? + // let pulse = rx.next().await.unwrap(); + let beacon = sp_consensus_randomness_beacon::inherents::InherentDataProvider::new( + // vec![pulse.serialize_to_vec()] + vec![vec![]] + ); + + Ok(beacon) + }, consensus_data_provider: None, })); - // submit a transaction to pool. + // submit a transaction to pool -> in practice this would be done by adding the inherent let result = pool.submit_one(genesis_hash, SOURCE, uxt(Alice, 0)).await; // assert that it was successfully imported assert!(result.is_ok()); From 2d916a6261b84ae4bf0ce8aca796526c38e2d71a Mon Sep 17 00:00:00 2001 From: driemworks Date: Sat, 1 Mar 2025 09:59:44 -0600 Subject: [PATCH 06/21] command stream driven by gossipsub works --- .../randomness-beacon/src/instant_seal.rs | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs index 07cd7e6..11b4793 100644 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ b/client/consensus/randomness-beacon/src/instant_seal.rs @@ -237,20 +237,16 @@ mod tests { let mut rx = run_gossipsub().await; let (sender, receiver) = futures::channel::oneshot::channel(); let mut sender = Arc::new(Some(sender)); - - // create a new block every time we see a new message in the channel - // a channel to relay pulses from the commands stream to the CIDP loop - let (mut pulse_tx, mut pulse_rx) = tracing_unbounded("pulses", 10000); - // build a SealEngine command whenever we encounter a new message let mut commands_stream = rx.map(move |pulse| { let mut_sender = Arc::get_mut(&mut sender).unwrap(); let sender = std::mem::take(mut_sender); - // update the shared state - pulse_tx.unbounded_send(pulse).unwrap(); - + // Note: here we allow create empty to be true + // in practice, this should always be false + // here we allow it to be empty so as to demonstrate that + // the engine is driven by new messages, not txs EngineCommand::SealNewBlock { - create_empty: false, + create_empty: true, finalize: true, parent_hash: None, sender, @@ -265,26 +261,16 @@ mod tests { pool: pool.clone(), commands_stream, select_chain, - create_inherent_data_providers: |_, _| async move { - // we want to create a block whenever the required CIDP data is available. - // In this case, we want a single message to be available. - - // Q: how can we retrieve the message?? - // let pulse = rx.next().await.unwrap(); - let beacon = sp_consensus_randomness_beacon::inherents::InherentDataProvider::new( - // vec![pulse.serialize_to_vec()] - vec![vec![]] - ); - - Ok(beacon) + create_inherent_data_providers: |_, _| async { + Ok(()) }, consensus_data_provider: None, })); // submit a transaction to pool -> in practice this would be done by adding the inherent - let result = pool.submit_one(genesis_hash, SOURCE, uxt(Alice, 0)).await; + // let result = pool.submit_one(genesis_hash, SOURCE, uxt(Alice, 0)).await; // assert that it was successfully imported - assert!(result.is_ok()); + // assert!(result.is_ok()); // assert that the background task returns ok let created_block = receiver.await.unwrap().unwrap(); assert_eq!( From b5f58b7a3c1e4dca1dba3ac727a0971be42ec8ce Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:14:29 -0600 Subject: [PATCH 07/21] update tests --- Cargo.lock | 6519 ++--------------- Cargo.toml | 37 +- client/consensus/randomness-beacon/Cargo.toml | 20 +- .../randomness-beacon/src/gossipsub.rs | 203 +- .../randomness-beacon/src/instant_seal.rs | 294 - client/consensus/randomness-beacon/src/lib.rs | 1 - pallets/randomness-beacon/Cargo.toml | 4 +- .../consensus/randomness-beacon/Cargo.toml | 10 +- .../randomness-beacon/src/inherents.rs | 9 + tarpaulin-report.html | 671 ++ tarpaulin.toml | 5 +- test-utils/client/Cargo.toml | 42 - test-utils/client/src/client_ext.rs | 206 - test-utils/client/src/lib.rs | 450 -- test-utils/runtime/Cargo.toml | 120 - test-utils/runtime/build.rs | 43 - test-utils/runtime/client/Cargo.toml | 28 - .../runtime/client/src/block_builder_ext.rs | 74 - test-utils/runtime/client/src/lib.rs | 214 - test-utils/runtime/client/src/trait_tests.rs | 546 -- test-utils/runtime/res/README.md | 24 - .../runtime/res/default_genesis_config.json | 113 - .../default_genesis_config_incomplete.json | 99 - .../res/default_genesis_config_invalid.json | 113 - .../res/default_genesis_config_invalid_2.json | 113 - test-utils/runtime/src/extrinsic.rs | 228 - test-utils/runtime/src/genesismap.rs | 179 - test-utils/runtime/src/lib.rs | 1534 ---- .../runtime/src/substrate_test_pallet.rs | 252 - .../runtime/transaction-pool/Cargo.toml | 27 - .../runtime/transaction-pool/src/lib.rs | 541 -- 31 files changed, 1288 insertions(+), 11431 deletions(-) delete mode 100644 client/consensus/randomness-beacon/src/instant_seal.rs create mode 100644 tarpaulin-report.html delete mode 100644 test-utils/client/Cargo.toml delete mode 100644 test-utils/client/src/client_ext.rs delete mode 100644 test-utils/client/src/lib.rs delete mode 100644 test-utils/runtime/Cargo.toml delete mode 100644 test-utils/runtime/build.rs delete mode 100644 test-utils/runtime/client/Cargo.toml delete mode 100644 test-utils/runtime/client/src/block_builder_ext.rs delete mode 100644 test-utils/runtime/client/src/lib.rs delete mode 100644 test-utils/runtime/client/src/trait_tests.rs delete mode 100644 test-utils/runtime/res/README.md delete mode 100644 test-utils/runtime/res/default_genesis_config.json delete mode 100644 test-utils/runtime/res/default_genesis_config_incomplete.json delete mode 100644 test-utils/runtime/res/default_genesis_config_invalid.json delete mode 100644 test-utils/runtime/res/default_genesis_config_invalid_2.json delete mode 100644 test-utils/runtime/src/extrinsic.rs delete mode 100644 test-utils/runtime/src/genesismap.rs delete mode 100644 test-utils/runtime/src/lib.rs delete mode 100644 test-utils/runtime/src/substrate_test_pallet.rs delete mode 100644 test-utils/runtime/transaction-pool/Cargo.toml delete mode 100644 test-utils/runtime/transaction-pool/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 2841666..3f269a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.1", + "gimli", ] [[package]] @@ -43,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -53,7 +44,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] @@ -65,21 +56,10 @@ checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", "aes", - "cipher 0.4.4", + "cipher", "ctr", "ghash", - "subtle 2.6.1", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.15", - "once_cell", - "version_check", + "subtle", ] [[package]] @@ -110,36 +90,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - [[package]] name = "anyhow" version = "1.0.96" @@ -446,30 +396,14 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "asn1-rs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" -dependencies = [ - "asn1-rs-derive 0.4.0", - "asn1-rs-impl 0.1.0", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror 1.0.69", - "time", -] - [[package]] name = "asn1-rs" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive 0.5.1", - "asn1-rs-impl 0.2.0", + "asn1-rs-derive", + "asn1-rs-impl", "displaydoc", "nom", "num-traits", @@ -478,34 +412,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607495ec7113b178fbba7a6166a27f99e774359ef4823adbefd756b5b81d7970" -dependencies = [ - "asn1-rs-derive 0.6.0", - "asn1-rs-impl 0.2.0", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror 2.0.11", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure 0.12.6", -] - [[package]] name = "asn1-rs-derive" version = "0.5.1" @@ -515,30 +421,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure 0.13.1", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", - "synstructure 0.13.1", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "synstructure", ] [[package]] @@ -552,12 +435,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "assert_matches" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" - [[package]] name = "async-channel" version = "1.9.0" @@ -633,7 +510,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.44", + "rustix", "slab", "tracing", "windows-sys 0.59.0", @@ -676,7 +553,7 @@ dependencies = [ "cfg-if", "event-listener 5.4.0", "futures-lite", - "rustix 0.38.44", + "rustix", "tracing", ] @@ -703,7 +580,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.44", + "rustix", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -746,9 +623,9 @@ dependencies = [ "async-trait", "futures-io", "futures-util", - "hickory-resolver 0.25.0-alpha.5", + "hickory-resolver", "pin-utils", - "socket2 0.5.8", + "socket2", ] [[package]] @@ -768,19 +645,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "asynchronous-codec" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite", -] - [[package]] name = "asynchronous-codec" version = "0.7.0" @@ -823,11 +687,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.2", + "addr2line", "cfg-if", "libc", "miniz_oxide", - "object 0.36.7", + "object", "rustc-demangle", "windows-targets 0.52.6", ] @@ -850,12 +714,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -879,28 +737,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bip39" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" -dependencies = [ - "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "unicode-normalization", -] - [[package]] name = "bitcoin-internals" version = "0.2.0" @@ -941,18 +777,6 @@ dependencies = [ "wyz", ] -[[package]] -name = "blake2" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" -dependencies = [ - "byte-tools", - "crypto-mac 0.7.0", - "digest 0.8.1", - "opaque-debug 0.2.3", -] - [[package]] name = "blake2" version = "0.10.6" @@ -973,37 +797,13 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "blake2s_simd" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90f7deecfac93095eb874a40febd69427776e24e1bd7f87f33ac62d6f0174df" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] - -[[package]] -name = "blake3" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1230237285e3e10cde447185e8975408ae24deaa67205ce684805c25bc0c7937" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1012,7 +812,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1028,18 +828,6 @@ dependencies = [ "piper", ] -[[package]] -name = "bounded-collections" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" -dependencies = [ - "log", - "parity-scale-codec", - "scale-info", - "serde", -] - [[package]] name = "bounded-collections" version = "0.2.3" @@ -1061,15 +849,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - [[package]] name = "bumpalo" version = "3.17.0" @@ -1082,12 +861,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "bytemuck" version = "1.21.0" @@ -1106,56 +879,12 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" -[[package]] -name = "c2-chacha" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" -dependencies = [ - "cipher 0.2.5", - "ppv-lite86", -] - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.25", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cc" version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ - "jobserver", - "libc", "shlex", ] @@ -1174,28 +903,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" -dependencies = [ - "byteorder", - "keystream", -] - [[package]] name = "chacha20" version = "0.9.1" @@ -1203,7 +916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] @@ -1215,153 +928,42 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20", - "cipher 0.4.4", + "cipher", "poly1305", "zeroize", ] [[package]] -name = "chrono" -version = "0.4.39" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "wasm-bindgen", - "windows-targets 0.52.6", + "crypto-common", + "inout", + "zeroize", ] [[package]] -name = "cid" -version = "0.9.0" +name = "common-path" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" -dependencies = [ - "core2", - "multibase", - "multihash 0.17.0", - "serde", - "unsigned-varint 0.7.2", -] +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] -name = "cid" -version = "0.10.1" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "core2", - "multibase", - "multihash 0.18.1", - "serde", - "unsigned-varint 0.7.2", + "crossbeam-utils", ] [[package]] -name = "cipher" -version = "0.2.5" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", - "zeroize", -] - -[[package]] -name = "clap" -version = "4.5.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" -dependencies = [ - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width 0.1.14", -] - -[[package]] -name = "common-path" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "console" -version = "0.15.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "unicode-width 0.2.0", - "windows-sys 0.59.0", -] - -[[package]] -name = "const-hex" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" -dependencies = [ - "cfg-if", - "cpufeatures", - "hex", - "proptest", - "serde", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" @@ -1431,16 +1033,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-foundation" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1456,15 +1048,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -1474,113 +1057,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" -dependencies = [ - "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "cranelift-isle", - "gimli 0.27.3", - "hashbrown 0.13.2", - "log", - "regalloc2 0.6.1", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" - -[[package]] -name = "cranelift-entity" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-frontend" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-isle" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" - -[[package]] -name = "cranelift-native" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" -dependencies = [ - "cranelift-codegen", - "libc", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.5", - "log", - "smallvec", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" version = "0.5.14" @@ -1627,9 +1103,9 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle", "zeroize", ] @@ -1639,39 +1115,19 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core 0.6.4", "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" -dependencies = [ - "generic-array 0.12.4", - "subtle 1.0.0", -] - [[package]] name = "crypto-mac" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", - "subtle 2.6.1", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.6.1", + "generic-array", + "subtle", ] [[package]] @@ -1680,20 +1136,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle 2.6.1", - "zeroize", + "cipher", ] [[package]] @@ -1708,7 +1151,7 @@ dependencies = [ "digest 0.10.7", "fiat-crypto", "rustc_version", - "subtle 2.6.1", + "subtle", "zeroize", ] @@ -1723,78 +1166,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "cxx" -version = "1.0.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc580dceb395cae0efdde0a88f034cfd8a276897e40c693a7b87bed17971d33" -dependencies = [ - "cc", - "cxxbridge-cmd", - "cxxbridge-flags", - "cxxbridge-macro", - "foldhash", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d8c1baedad72a7efda12ad8d7ad687b3e7221dfb304a12443fd69e9de8bb30" -dependencies = [ - "cc", - "codespan-reporting", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.98", -] - -[[package]] -name = "cxxbridge-cmd" -version = "1.0.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43afb0e3b2ef293492a31ecd796af902112460d53e5f923f7804f348a769f9c" -dependencies = [ - "clap", - "codespan-reporting", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0257ad2096a2474fe877e9e055ab69603851c3d6b394efcc7e0443899c2492ce" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46cbd7358a46b760609f1cb5093683328e58ca50e594a308716f5403fdc03e5" -dependencies = [ - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.98", -] - -[[package]] -name = "dashmap" -version = "5.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" -dependencies = [ - "cfg-if", - "hashbrown 0.14.5", - "lock_api", - "once_cell", - "parking_lot_core 0.9.10", -] - [[package]] name = "data-encoding" version = "2.8.0" @@ -1831,41 +1202,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" -dependencies = [ - "asn1-rs 0.5.2", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs 0.6.2", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - -[[package]] -name = "der-parser" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6" -dependencies = [ - "asn1-rs 0.7.0", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -1937,28 +1280,13 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "difflib" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1970,67 +1298,25 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.6.1", + "subtle", ] [[package]] -name = "directories" -version = "5.0.1" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "dirs-sys", + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] -name = "directories-next" -version = "2.0.0" +name = "docify" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "docify" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" dependencies = [ "docify_macros", ] @@ -2049,16 +1335,10 @@ dependencies = [ "regex", "syn 2.0.98", "termcolor", - "toml 0.8.20", + "toml", "walkdir", ] -[[package]] -name = "downcast" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" - [[package]] name = "dtoa" version = "1.0.9" @@ -2123,26 +1403,12 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.8", - "subtle 2.6.1", - "zeroize", -] - -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", + "subtle", "zeroize", ] @@ -2152,7 +1418,7 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "ed25519", "hashbrown 0.14.5", "hex", @@ -2177,59 +1443,28 @@ dependencies = [ "crypto-bigint", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array", "group", "pkcs8", "rand_core 0.6.4", "sec1", "serdect", - "subtle 2.6.1", + "subtle", "zeroize", ] -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-as-inner" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "environmental" version = "1.1.4" @@ -2279,22 +1514,13 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "exit-future" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" -dependencies = [ - "futures", -] - [[package]] name = "expander" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ - "blake2 0.10.6", + "blake2", "file-guard", "fs-err", "prettyplease", @@ -2303,18 +1529,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - [[package]] name = "fastrand" version = "2.3.0" @@ -2328,7 +1542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.6.1", + "subtle", ] [[package]] @@ -2347,44 +1561,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "file-per-thread-logger" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" -dependencies = [ - "env_logger", - "log", -] - -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.59.0", -] - -[[package]] -name = "finality-grandpa" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc" -dependencies = [ - "either", - "futures", - "futures-timer", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot 0.12.3", - "scale-info", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -2403,15 +1579,6 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" -[[package]] -name = "float-cmp" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] - [[package]] name = "fnv" version = "1.0.7" @@ -2424,15 +1591,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" -[[package]] -name = "fork-tree" -version = "13.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6736bef9fd175fafbb97495565456651c43ccac2ae550faee709e11534e3621" -dependencies = [ - "parity-scale-codec", -] - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2442,22 +1600,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "forwarded-header-value" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" -dependencies = [ - "nonempty", - "thiserror 1.0.69", -] - -[[package]] -name = "fragile" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" - [[package]] name = "frame-benchmarking" version = "39.0.0" @@ -2474,34 +1616,15 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto 39.0.0", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", "sp-runtime-interface 29.0.0", "sp-storage 22.0.0", "static_assertions", ] -[[package]] -name = "frame-executive" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c883a3f584c13832c6fa79f49ea19ae48694029408b0aa457da16424a2518e2" -dependencies = [ - "aquamarine", - "frame-support", - "frame-system", - "frame-try-runtime", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-tracing 17.0.1", -] - [[package]] name = "frame-metadata" version = "18.0.0" @@ -2514,23 +1637,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-metadata-hash-extension" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "014915e6982d15be6eedd8034daf020e62a057577f99d71e33ad2002367a35dc" -dependencies = [ - "array-bytes", - "const-hex", - "docify", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", -] - [[package]] name = "frame-support" version = "39.0.0" @@ -2557,19 +1663,19 @@ dependencies = [ "smallvec", "sp-api", "sp-arithmetic", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing-proc-macro", "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-genesis-builder", - "sp-inherents 35.0.0", - "sp-io 39.0.0", + "sp-inherents", + "sp-io", "sp-metadata-ir", - "sp-runtime 40.1.0", + "sp-runtime", "sp-staking", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-tracing 17.0.1", - "sp-trie 38.0.0", + "sp-trie", "sp-weights", "static_assertions", "tt-call", @@ -2589,7 +1695,7 @@ dependencies = [ "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", - "proc-macro-warning 1.84.1", + "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", @@ -2603,7 +1709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", @@ -2633,37 +1739,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-version", "sp-weights", ] -[[package]] -name = "frame-system-rpc-runtime-api" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9756d979251b162f1c9821a944b95e5fdd4d6c7aab8854a33b5820ce02a77af5" -dependencies = [ - "docify", - "parity-scale-codec", - "sp-api", -] - -[[package]] -name = "frame-try-runtime" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2224250e66348e71a952060f50b75bf02b7114241818602ccc46e0f905331193" -dependencies = [ - "frame-support", - "parity-scale-codec", - "sp-api", - "sp-runtime 40.1.0", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -2673,16 +1756,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" @@ -2704,16 +1777,6 @@ dependencies = [ "futures-util", ] -[[package]] -name = "futures-bounded" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b07bbbe7d7e78809544c6f718d875627addc73a7c3582447abc052cd3dc67e0" -dependencies = [ - "futures-timer", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.31" @@ -2772,16 +1835,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "futures-rustls" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" -dependencies = [ - "futures-io", - "rustls 0.21.12", -] - [[package]] name = "futures-rustls" version = "0.26.0" @@ -2789,7 +1842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.23", + "rustls", "rustls-pki-types", ] @@ -2829,15 +1882,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generator" version = "0.8.4" @@ -2851,15 +1895,6 @@ dependencies = [ "windows 0.58.0", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2912,31 +1947,10 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug 0.3.1", + "opaque-debug", "polyval", ] -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator 0.2.0", - "indexmap 1.9.3", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -dependencies = [ - "fallible-iterator 0.3.0", - "stable_deref_trait", -] - [[package]] name = "gimli" version = "0.31.1" @@ -2955,26 +1969,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "governor" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" -dependencies = [ - "cfg-if", - "dashmap", - "futures", - "futures-timer", - "no-std-compat", - "nonzero_ext", - "parking_lot 0.12.3", - "portable-atomic", - "quanta", - "rand 0.8.5", - "smallvec", - "spinning_top", -] - [[package]] name = "group" version = "0.13.0" @@ -2983,22 +1977,22 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle", ] [[package]] name = "h2" -version = "0.3.26" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.7.1", + "http 1.2.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -3006,27 +2000,8 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.2.0", - "indexmap 2.7.1", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "half" -version = "1.8.3" +name = "half" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" @@ -3045,22 +2020,13 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] - [[package]] name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -3069,7 +2035,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] @@ -3084,15 +2050,6 @@ dependencies = [ "foldhash", ] -[[package]] -name = "hashlink" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" -dependencies = [ - "hashbrown 0.14.5", -] - [[package]] name = "hashlink" version = "0.9.1" @@ -3102,12 +2059,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -3153,30 +2104,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" -[[package]] -name = "hickory-proto" -version = "0.24.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92652067c9ce6f66ce53cc38d1169daa36e6e7eb7dd3b63b5103bd9d97117248" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 1.0.3", - "ipnet", - "once_cell", - "rand 0.8.5", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - [[package]] name = "hickory-proto" version = "0.25.0-alpha.5" @@ -3187,15 +2114,15 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner 0.6.1", + "enum-as-inner", "futures-channel", "futures-io", "futures-util", - "idna 1.0.3", + "idna", "ipnet", "once_cell", "rand 0.9.0", - "socket2 0.5.8", + "socket2", "thiserror 2.0.11", "tinyvec", "tokio", @@ -3203,27 +2130,6 @@ dependencies = [ "url", ] -[[package]] -name = "hickory-resolver" -version = "0.24.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbb117a1ca520e111743ab2f6688eddee69db4e0ea242545a604dce8a66fd22e" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto 0.24.4", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.3", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "hickory-resolver" version = "0.25.0-alpha.5" @@ -3232,11 +2138,11 @@ checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" dependencies = [ "cfg-if", "futures-util", - "hickory-proto 0.25.0-alpha.5", + "hickory-proto", "ipconfig", "moka", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "rand 0.9.0", "resolv-conf", "smallvec", @@ -3260,17 +2166,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -3290,7 +2186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.7", + "generic-array", "hmac 0.8.1", ] @@ -3327,17 +2223,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -3357,7 +2242,7 @@ dependencies = [ "bytes", "futures-util", "http 1.2.0", - "http-body 1.0.1", + "http-body", "pin-project-lite", ] @@ -3367,42 +2252,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.8", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.6.0" @@ -3412,11 +2261,10 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.8", + "h2", "http 1.2.0", - "http-body 1.0.1", + "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", "smallvec", @@ -3424,25 +2272,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.27.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" -dependencies = [ - "futures-util", - "http 1.2.0", - "hyper 1.6.0", - "hyper-util", - "log", - "rustls 0.23.23", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -3453,38 +2282,15 @@ dependencies = [ "futures-channel", "futures-util", "http 1.2.0", - "http-body 1.0.1", - "hyper 1.6.0", + "http-body", + "hyper", "pin-project-lite", - "socket2 0.5.8", + "socket2", "tokio", "tower-service", "tracing", ] -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core 0.52.0", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "1.5.0" @@ -3607,27 +2413,6 @@ dependencies = [ name = "idn-traits" version = "0.0.1" -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -3666,7 +2451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ "async-io", - "core-foundation 0.9.4", + "core-foundation", "fnv", "futures", "if-addrs", @@ -3683,25 +2468,6 @@ dependencies = [ "windows 0.53.0", ] -[[package]] -name = "igd-next" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" -dependencies = [ - "async-trait", - "attohttpc", - "bytes", - "futures", - "http 0.2.12", - "hyper 0.14.32", - "log", - "rand 0.8.5", - "tokio", - "url", - "xmltree", -] - [[package]] name = "igd-next" version = "0.15.1" @@ -3714,7 +2480,7 @@ dependencies = [ "futures", "http 1.2.0", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "log", "rand 0.8.5", @@ -3723,15 +2489,6 @@ dependencies = [ "xmltree", ] -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - [[package]] name = "impl-codec" version = "0.7.1" @@ -3749,16 +2506,7 @@ checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" dependencies = [ "integer-sqrt", "num-traits", - "uint 0.10.0", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", + "uint", ] [[package]] @@ -3800,17 +2548,6 @@ dependencies = [ "quote", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - [[package]] name = "indexmap" version = "2.7.1" @@ -3827,16 +2564,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", + "generic-array", ] [[package]] @@ -3848,30 +2576,13 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "ip_network" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" - [[package]] name = "ipconfig" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.8", + "socket2", "widestring", "windows-sys 0.48.0", "winreg", @@ -3883,17 +2594,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" -[[package]] -name = "is-terminal" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" -dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "itertools" version = "0.10.5" @@ -3928,170 +2628,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] -name = "jobserver" -version = "0.1.32" +name = "js-sys" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ - "libc", + "once_cell", + "wasm-bindgen", ] [[package]] -name = "js-sys" -version = "0.3.77" +name = "k256" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", "once_cell", - "wasm-bindgen", + "serdect", + "sha2 0.10.8", ] [[package]] -name = "jsonrpsee" -version = "0.24.8" +name = "keccak" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834af00800e962dee8f7bfc0f60601de215e73e78e5497d733a2919da837d3c8" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ - "jsonrpsee-core", - "jsonrpsee-proc-macros", - "jsonrpsee-server", - "jsonrpsee-types", - "tokio", - "tracing", + "cpufeatures", ] [[package]] -name = "jsonrpsee-core" -version = "0.24.8" +name = "kv-log-macro" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76637f6294b04e747d68e69336ef839a3493ca62b35bf488ead525f7da75c5bb" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.2.0", - "http-body 1.0.1", - "http-body-util", - "jsonrpsee-types", - "parking_lot 0.12.3", - "rand 0.8.5", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-proc-macros" -version = "0.24.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcae0c6c159e11541080f1f829873d8f374f81eda0abc67695a13fc8dc1a580" -dependencies = [ - "heck 0.5.0", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "jsonrpsee-server" -version = "0.24.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b7a3df90a1a60c3ed68e7ca63916b53e9afa928e33531e87f61a9c8e9ae87b" -dependencies = [ - "futures-util", - "http 1.2.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.6.0", - "hyper-util", - "jsonrpsee-core", - "jsonrpsee-types", - "pin-project", - "route-recognizer", - "serde", - "serde_json", - "soketto", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tracing", -] - -[[package]] -name = "jsonrpsee-types" -version = "0.24.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddb81adb1a5ae9182df379e374a79e24e992334e7346af4d065ae5b2acb8d4c6" -dependencies = [ - "http 1.2.0", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "k256" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "serdect", - "sha2 0.10.8", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "keystream" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" dependencies = [ "log", ] -[[package]] -name = "kvdb" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d770dcb02bf6835887c3a979b5107a04ff4bbde97a5f0928d27404a155add9" -dependencies = [ - "smallvec", -] - -[[package]] -name = "kvdb-memorydb" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" -dependencies = [ - "kvdb", - "parking_lot 0.12.3", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -4104,49 +2681,6 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] -name = "libp2p" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94495eb319a85b70a68b85e2389a95bb3555c71c49025b78c691a854a7e6464" -dependencies = [ - "bytes", - "either", - "futures", - "futures-timer", - "getrandom 0.2.15", - "instant", - "libp2p-allow-block-list 0.2.0", - "libp2p-connection-limits 0.2.1", - "libp2p-core 0.40.1", - "libp2p-dns 0.40.1", - "libp2p-identify", - "libp2p-identity", - "libp2p-kad", - "libp2p-mdns 0.44.0", - "libp2p-metrics 0.13.1", - "libp2p-noise 0.43.2", - "libp2p-ping 0.43.1", - "libp2p-quic 0.9.3", - "libp2p-request-response", - "libp2p-swarm 0.43.7", - "libp2p-tcp 0.40.1", - "libp2p-upnp 0.1.1", - "libp2p-wasm-ext", - "libp2p-websocket 0.42.2", - "libp2p-yamux 0.44.1", - "multiaddr 0.18.2", - "pin-project", - "rw-stream-sink", - "thiserror 1.0.69", -] - [[package]] name = "libp2p" version = "0.55.0" @@ -4158,61 +2692,37 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.15", - "libp2p-allow-block-list 0.5.0", - "libp2p-connection-limits 0.5.0", - "libp2p-core 0.43.0", - "libp2p-dns 0.43.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-dns", "libp2p-gossipsub", "libp2p-identity", - "libp2p-mdns 0.47.0", - "libp2p-metrics 0.16.0", - "libp2p-noise 0.46.0", - "libp2p-ping 0.46.0", - "libp2p-quic 0.12.0", - "libp2p-swarm 0.46.0", - "libp2p-tcp 0.43.0", - "libp2p-upnp 0.4.0", - "libp2p-websocket 0.45.0", - "libp2p-yamux 0.47.0", - "multiaddr 0.18.2", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-upnp", + "libp2p-websocket", + "libp2p-yamux", + "multiaddr", "pin-project", "rw-stream-sink", "thiserror 2.0.11", ] -[[package]] -name = "libp2p-allow-block-list" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b46558c5c0bf99d3e2a1a38fd54ff5476ca66dd1737b12466a1824dd219311" -dependencies = [ - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "void", -] - [[package]] name = "libp2p-allow-block-list" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38944b7cb981cc93f2f0fb411ff82d0e983bd226fbcc8d559639a3a73236568b" dependencies = [ - "libp2p-core 0.43.0", - "libp2p-identity", - "libp2p-swarm 0.46.0", -] - -[[package]] -name = "libp2p-connection-limits" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5107ad45cb20b2f6c3628c7b6014b996fcb13a88053f4569c872c6e30abf58" -dependencies = [ - "libp2p-core 0.40.1", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.43.7", - "void", + "libp2p-swarm", ] [[package]] @@ -4221,37 +2731,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efe9323175a17caa8a2ed4feaf8a548eeef5e0b72d03840a0eab4bcb0210ce1c" dependencies = [ - "libp2p-core 0.43.0", - "libp2p-identity", - "libp2p-swarm 0.46.0", -] - -[[package]] -name = "libp2p-core" -version = "0.40.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd44289ab25e4c9230d9246c475a22241e301b23e8f4061d3bdef304a1a99713" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", + "libp2p-core", "libp2p-identity", - "log", - "multiaddr 0.18.2", - "multihash 0.19.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.3", - "pin-project", - "quick-protobuf", - "rand 0.8.5", - "rw-stream-sink", - "smallvec", - "thiserror 1.0.69", - "unsigned-varint 0.7.2", - "void", + "libp2p-swarm", ] [[package]] @@ -4265,11 +2747,11 @@ dependencies = [ "futures", "futures-timer", "libp2p-identity", - "multiaddr 0.18.2", - "multihash 0.19.3", + "multiaddr", + "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -4280,22 +2762,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "libp2p-dns" -version = "0.40.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" -dependencies = [ - "async-trait", - "futures", - "libp2p-core 0.40.1", - "libp2p-identity", - "log", - "parking_lot 0.12.3", - "smallvec", - "trust-dns-resolver", -] - [[package]] name = "libp2p-dns" version = "0.43.0" @@ -4305,10 +2771,10 @@ dependencies = [ "async-std-resolver", "async-trait", "futures", - "hickory-resolver 0.25.0-alpha.5", - "libp2p-core 0.43.0", + "hickory-resolver", + "libp2p-core", "libp2p-identity", - "parking_lot 0.12.3", + "parking_lot", "smallvec", "tracing", ] @@ -4320,7 +2786,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d558548fa3b5a8e9b66392f785921e363c57c05dcadfda4db0d41ae82d313e4a" dependencies = [ "async-channel 2.3.1", - "asynchronous-codec 0.7.0", + "asynchronous-codec", "base64 0.22.1", "byteorder", "bytes", @@ -4329,14 +2795,14 @@ dependencies = [ "futures", "futures-timer", "getrandom 0.2.15", - "hashlink 0.9.1", + "hashlink", "hex_fmt", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.46.0", - "prometheus-client 0.22.3", + "libp2p-swarm", + "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand 0.8.5", "regex", "sha2 0.10.8", @@ -4344,29 +2810,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "libp2p-identify" -version = "0.43.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a96638a0a176bec0a4bcaebc1afa8cf909b114477209d7456ade52c61cd9cd" -dependencies = [ - "asynchronous-codec 0.6.2", - "either", - "futures", - "futures-bounded", - "futures-timer", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "log", - "lru", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "smallvec", - "thiserror 1.0.69", - "void", -] - [[package]] name = "libp2p-identity" version = "0.2.10" @@ -4376,7 +2819,7 @@ dependencies = [ "bs58", "ed25519-dalek", "hkdf", - "multihash 0.19.3", + "multihash", "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", @@ -4385,56 +2828,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-kad" -version = "0.44.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" -dependencies = [ - "arrayvec", - "asynchronous-codec 0.6.2", - "bytes", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "log", - "quick-protobuf", - "quick-protobuf-codec 0.2.0", - "rand 0.8.5", - "sha2 0.10.8", - "smallvec", - "thiserror 1.0.69", - "uint 0.9.5", - "unsigned-varint 0.7.2", - "void", -] - -[[package]] -name = "libp2p-mdns" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" -dependencies = [ - "data-encoding", - "futures", - "if-watch", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "log", - "rand 0.8.5", - "smallvec", - "socket2 0.5.8", - "tokio", - "trust-dns-proto 0.22.0", - "void", -] - [[package]] name = "libp2p-mdns" version = "0.47.0" @@ -4444,35 +2837,18 @@ dependencies = [ "async-io", "async-std", "futures", - "hickory-proto 0.25.0-alpha.5", + "hickory-proto", "if-watch", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.46.0", + "libp2p-swarm", "rand 0.8.5", "smallvec", - "socket2 0.5.8", + "socket2", "tokio", "tracing", ] -[[package]] -name = "libp2p-metrics" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239ba7d28f8d0b5d77760dc6619c05c7e88e74ec8fbbe97f856f20a56745e620" -dependencies = [ - "instant", - "libp2p-core 0.40.1", - "libp2p-identify", - "libp2p-identity", - "libp2p-kad", - "libp2p-ping 0.43.1", - "libp2p-swarm 0.43.7", - "once_cell", - "prometheus-client 0.21.2", -] - [[package]] name = "libp2p-metrics" version = "0.16.0" @@ -4480,54 +2856,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ce58c64292e87af624fcb86465e7dd8342e46a388d71e8fec0ab37ee789630a" dependencies = [ "futures", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-gossipsub", "libp2p-identity", - "libp2p-ping 0.46.0", - "libp2p-swarm 0.46.0", + "libp2p-ping", + "libp2p-swarm", "pin-project", - "prometheus-client 0.22.3", + "prometheus-client", "web-time", ] -[[package]] -name = "libp2p-noise" -version = "0.43.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eeec39ad3ad0677551907dd304b2f13f17208ccebe333bef194076cd2e8921" -dependencies = [ - "bytes", - "curve25519-dalek 4.1.3", - "futures", - "libp2p-core 0.40.1", - "libp2p-identity", - "log", - "multiaddr 0.18.2", - "multihash 0.19.3", - "once_cell", - "quick-protobuf", - "rand 0.8.5", - "sha2 0.10.8", - "snow", - "static_assertions", - "thiserror 1.0.69", - "x25519-dalek", - "zeroize", -] - [[package]] name = "libp2p-noise" version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afcc133e0f3cea07acde6eb8a9665cb11b600bd61110b010593a0210b8153b16" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "futures", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-identity", - "multiaddr 0.18.2", - "multihash 0.19.3", + "multiaddr", + "multihash", "once_cell", "quick-protobuf", "rand 0.8.5", @@ -4539,24 +2890,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-ping" -version = "0.43.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e702d75cd0827dfa15f8fd92d15b9932abe38d10d21f47c50438c71dd1b5dae3" -dependencies = [ - "either", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "log", - "rand 0.8.5", - "void", -] - [[package]] name = "libp2p-ping" version = "0.46.0" @@ -4565,9 +2898,9 @@ checksum = "7b2529993ff22deb2504c0130a58b60fb77f036be555053922db1a0490b5798b" dependencies = [ "futures", "futures-timer", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.46.0", + "libp2p-swarm", "rand 0.8.5", "tracing", "web-time", @@ -4575,92 +2908,27 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.9.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130d451d83f21b81eb7b35b360bc7972aeafb15177784adc56528db082e6b927" +checksum = "41432a159b00424a0abaa2c80d786cddff81055ac24aa127e0cf375f7858d880" dependencies = [ - "bytes", + "async-std", "futures", "futures-timer", "if-watch", - "libp2p-core 0.40.1", + "libp2p-core", "libp2p-identity", - "libp2p-tls 0.2.1", - "log", - "parking_lot 0.12.3", - "quinn 0.10.2", + "libp2p-tls", + "quinn", "rand 0.8.5", - "ring 0.16.20", - "rustls 0.21.12", - "socket2 0.5.8", - "thiserror 1.0.69", - "tokio", -] - -[[package]] -name = "libp2p-quic" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41432a159b00424a0abaa2c80d786cddff81055ac24aa127e0cf375f7858d880" -dependencies = [ - "async-std", - "futures", - "futures-timer", - "if-watch", - "libp2p-core 0.43.0", - "libp2p-identity", - "libp2p-tls 0.6.0", - "quinn 0.11.6", - "rand 0.8.5", - "ring 0.17.9", - "rustls 0.23.23", - "socket2 0.5.8", - "thiserror 2.0.11", + "ring 0.17.9", + "rustls", + "socket2", + "thiserror 2.0.11", "tokio", "tracing", ] -[[package]] -name = "libp2p-request-response" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e3b4d67870478db72bac87bfc260ee6641d0734e0e3e275798f089c3fecfd4" -dependencies = [ - "async-trait", - "futures", - "instant", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm 0.43.7", - "log", - "rand 0.8.5", - "smallvec", - "void", -] - -[[package]] -name = "libp2p-swarm" -version = "0.43.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580189e0074af847df90e75ef54f3f30059aedda37ea5a1659e8b9fca05c0141" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.40.1", - "libp2p-identity", - "libp2p-swarm-derive", - "log", - "multistream-select", - "once_cell", - "rand 0.8.5", - "smallvec", - "tokio", - "void", -] - [[package]] name = "libp2p-swarm" version = "0.46.0" @@ -4672,7 +2940,7 @@ dependencies = [ "fnv", "futures", "futures-timer", - "libp2p-core 0.43.0", + "libp2p-core", "libp2p-identity", "lru", "multistream-select", @@ -4684,36 +2952,6 @@ dependencies = [ "web-time", ] -[[package]] -name = "libp2p-swarm-derive" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d5ec2a3df00c7836d7696c136274c9c59705bac69133253696a6c932cd1d74" -dependencies = [ - "heck 0.4.1", - "proc-macro-warning 0.4.2", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "libp2p-tcp" -version = "0.40.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b558dd40d1bcd1aaaed9de898e9ec6a436019ecc2420dd0016e712fbb61c5508" -dependencies = [ - "futures", - "futures-timer", - "if-watch", - "libc", - "libp2p-core 0.40.1", - "libp2p-identity", - "log", - "socket2 0.5.8", - "tokio", -] - [[package]] name = "libp2p-tcp" version = "0.43.0" @@ -4725,31 +2963,12 @@ dependencies = [ "futures-timer", "if-watch", "libc", - "libp2p-core 0.43.0", - "socket2 0.5.8", + "libp2p-core", + "socket2", "tokio", "tracing", ] -[[package]] -name = "libp2p-tls" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8218d1d5482b122ccae396bbf38abdcb283ecc96fa54760e1dfd251f0546ac61" -dependencies = [ - "futures", - "futures-rustls 0.24.0", - "libp2p-core 0.40.1", - "libp2p-identity", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-webpki 0.101.7", - "thiserror 1.0.69", - "x509-parser 0.15.1", - "yasna", -] - [[package]] name = "libp2p-tls" version = "0.6.0" @@ -4757,34 +2976,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcaebc1069dea12c5b86a597eaaddae0317c2c2cb9ec99dc94f82fd340f5c78b" dependencies = [ "futures", - "futures-rustls 0.26.0", - "libp2p-core 0.43.0", + "futures-rustls", + "libp2p-core", "libp2p-identity", - "rcgen 0.11.3", + "rcgen", "ring 0.17.9", - "rustls 0.23.23", + "rustls", "rustls-webpki 0.101.7", "thiserror 2.0.11", - "x509-parser 0.16.0", + "x509-parser", "yasna", ] -[[package]] -name = "libp2p-upnp" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82775a47b34f10f787ad3e2a22e2c1541e6ebef4fe9f28f3ac553921554c94c1" -dependencies = [ - "futures", - "futures-timer", - "igd-next 0.14.3", - "libp2p-core 0.40.1", - "libp2p-swarm 0.43.7", - "log", - "tokio", - "void", -] - [[package]] name = "libp2p-upnp" version = "0.4.0" @@ -4793,48 +2996,13 @@ checksum = "d457b9ecceb66e7199f049926fad447f1f17f040e8d29d690c086b4cab8ed14a" dependencies = [ "futures", "futures-timer", - "igd-next 0.15.1", - "libp2p-core 0.43.0", - "libp2p-swarm 0.46.0", + "igd-next", + "libp2p-core", + "libp2p-swarm", "tokio", "tracing", ] -[[package]] -name = "libp2p-wasm-ext" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5d8e3a9e07da0ef5b55a9f26c009c8fb3c725d492d8bb4b431715786eea79c" -dependencies = [ - "futures", - "js-sys", - "libp2p-core 0.40.1", - "send_wrapper", - "wasm-bindgen", - "wasm-bindgen-futures", -] - -[[package]] -name = "libp2p-websocket" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004ee9c4a4631435169aee6aad2f62e3984dc031c43b6d29731e8e82a016c538" -dependencies = [ - "either", - "futures", - "futures-rustls 0.24.0", - "libp2p-core 0.40.1", - "libp2p-identity", - "log", - "parking_lot 0.12.3", - "pin-project-lite", - "rw-stream-sink", - "soketto", - "thiserror 1.0.69", - "url", - "webpki-roots", -] - [[package]] name = "libp2p-websocket" version = "0.45.0" @@ -4843,10 +3011,10 @@ checksum = "2bf5d48a4d8fad8a49fbf23816a878cac25623549f415d74da8ef4327e6196a9" dependencies = [ "either", "futures", - "futures-rustls 0.26.0", - "libp2p-core 0.43.0", + "futures-rustls", + "libp2p-core", "libp2p-identity", - "parking_lot 0.12.3", + "parking_lot", "pin-project-lite", "rw-stream-sink", "soketto", @@ -4856,19 +3024,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "libp2p-yamux" -version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eedcb62824c4300efb9cfd4e2a6edaf3ca097b9e68b36dabe45a44469fd6a85" -dependencies = [ - "futures", - "libp2p-core 0.40.1", - "log", - "thiserror 1.0.69", - "yamux 0.12.1", -] - [[package]] name = "libp2p-yamux" version = "0.47.0" @@ -4877,24 +3032,13 @@ checksum = "f15df094914eb4af272acf9adaa9e287baa269943f32ea348ba29cfb9bfc60d8" dependencies = [ "either", "futures", - "libp2p-core 0.43.0", + "libp2p-core", "thiserror 2.0.11", "tracing", "yamux 0.12.1", "yamux 0.13.4", ] -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.8.0", - "libc", - "redox_syscall 0.5.8", -] - [[package]] name = "libsecp256k1" version = "0.7.1" @@ -4922,7 +3066,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.6.1", + "subtle", ] [[package]] @@ -4943,30 +3087,6 @@ dependencies = [ "libsecp256k1-core", ] -[[package]] -name = "link-cplusplus" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" -dependencies = [ - "cc", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "linregress" version = "0.5.4" @@ -4976,87 +3096,18 @@ dependencies = [ "nalgebra", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -[[package]] -name = "lioness" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" -dependencies = [ - "arrayref", - "blake2 0.8.1", - "chacha", - "keystream", -] - [[package]] name = "litemap" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" -[[package]] -name = "litep2p" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a3d13ee6af6f01bb2093aa6d5f29b79ede7de6277e5d0394e8f5d8eaa5a86" -dependencies = [ - "async-trait", - "bs58", - "bytes", - "cid 0.10.1", - "ed25519-dalek", - "futures", - "futures-timer", - "hex-literal", - "hickory-resolver 0.24.4", - "indexmap 2.7.1", - "libc", - "mockall 0.13.1", - "multiaddr 0.17.1", - "multihash 0.17.0", - "network-interface", - "parking_lot 0.12.3", - "pin-project", - "prost 0.12.6", - "prost-build", - "rand 0.8.5", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.20.9", - "serde", - "sha2 0.10.8", - "simple-dns", - "smallvec", - "snow", - "socket2 0.5.8", - "thiserror 2.0.11", - "tokio", - "tokio-stream", - "tokio-tungstenite", - "tokio-util", - "tracing", - "uint 0.10.0", - "unsigned-varint 0.8.0", - "url", - "x25519-dalek", - "x509-parser 0.17.0", - "yamux 0.13.4", - "yasna", - "zeroize", -] - [[package]] name = "lock_api" version = "0.4.12" @@ -5086,7 +3137,7 @@ dependencies = [ "generator", "scoped-tls", "tracing", - "tracing-subscriber 0.3.19", + "tracing-subscriber", ] [[package]] @@ -5098,43 +3149,6 @@ dependencies = [ "hashbrown 0.15.2", ] -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "lz4" -version = "1.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" -dependencies = [ - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.11.1+lz4-1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" version = "0.5.1" @@ -5189,15 +3203,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "matchers" version = "0.1.0" @@ -5207,12 +3212,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matrixmultiply" version = "0.3.9" @@ -5230,87 +3229,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "memfd" -version = "0.6.4" +name = "memory-db" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "rustix 0.38.44", + "hash-db", ] [[package]] -name = "memmap2" -version = "0.5.10" +name = "merlin" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ - "libc", + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", ] [[package]] -name = "memmap2" -version = "0.9.5" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" -dependencies = [ - "libc", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "memoffset" -version = "0.8.0" +name = "miniz_oxide" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memory-db" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" -dependencies = [ - "hash-db", -] - -[[package]] -name = "merkleized-metadata" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c592efaf1b3250df14c8f3c2d952233f0302bb81d3586db2f303666c1cd607" -dependencies = [ - "array-bytes", - "blake3", - "frame-metadata", - "parity-scale-codec", - "scale-decode", - "scale-info", -] - -[[package]] -name = "merlin" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" -dependencies = [ - "byteorder", - "keccak", - "rand_core 0.6.4", - "zeroize", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", ] @@ -5326,84 +3275,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "mixnet" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" -dependencies = [ - "arrayref", - "arrayvec", - "bitflags 1.3.2", - "blake2 0.10.6", - "c2-chacha", - "curve25519-dalek 4.1.3", - "either", - "hashlink 0.8.4", - "lioness", - "log", - "parking_lot 0.12.3", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_distr", - "subtle 2.6.1", - "thiserror 1.0.69", - "zeroize", -] - -[[package]] -name = "mockall" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "lazy_static", - "mockall_derive 0.11.4", - "predicates 2.1.5", - "predicates-tree", -] - -[[package]] -name = "mockall" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "mockall_derive 0.13.1", - "predicates 3.1.3", - "predicates-tree", -] - -[[package]] -name = "mockall_derive" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "mockall_derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "moka" version = "0.12.10" @@ -5414,7 +3285,7 @@ dependencies = [ "crossbeam-epoch", "crossbeam-utils", "loom", - "parking_lot 0.12.3", + "parking_lot", "portable-atomic", "rustc_version", "smallvec", @@ -5423,25 +3294,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "multiaddr" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "log", - "multibase", - "multihash 0.17.0", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.7.2", - "url", -] - [[package]] name = "multiaddr" version = "0.18.2" @@ -5453,7 +3305,7 @@ dependencies = [ "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.3", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -5472,40 +3324,6 @@ dependencies = [ "data-encoding-macro", ] -[[package]] -name = "multihash" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.7", - "multihash-derive", - "sha2 0.10.8", - "sha3", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "multihash" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.7", - "multihash-derive", - "sha2 0.10.8", - "sha3", - "unsigned-varint 0.7.2", -] - [[package]] name = "multihash" version = "0.19.3" @@ -5516,20 +3334,6 @@ dependencies = [ "unsigned-varint 0.8.0", ] -[[package]] -name = "multihash-derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" -dependencies = [ - "proc-macro-crate 1.1.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure 0.12.6", -] - [[package]] name = "multimap" version = "0.10.0" @@ -5630,18 +3434,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "network-interface" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" -dependencies = [ - "cc", - "libc", - "thiserror 1.0.69", - "winapi", -] - [[package]] name = "nix" version = "0.26.4" @@ -5653,12 +3445,6 @@ dependencies = [ "libc", ] -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5675,24 +3461,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nonempty" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" - -[[package]] -name = "nonzero_ext" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" - -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -5765,7 +3533,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -5778,27 +3545,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.30.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - [[package]] name = "object" version = "0.36.7" @@ -5808,31 +3554,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs 0.5.2", -] - [[package]] name = "oid-registry" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs 0.6.2", -] - -[[package]] -name = "oid-registry" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7" -dependencies = [ - "asn1-rs 0.7.0", + "asn1-rs", ] [[package]] @@ -5841,30 +3569,12 @@ version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "opaque-debug" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - [[package]] name = "overload" version = "0.1.1" @@ -5885,47 +3595,9 @@ dependencies = [ "scale-info", "sp-api", "sp-arithmetic", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-authorship" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452584dcccd8412609dea0d9e63e4b36564b66793e637420624b9f61aa1cf2e9" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-babe" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef195d55a068a8bd069d87d840d9153e1788fcb46b3c1b07c37f550918119374" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 39.0.0", - "sp-consensus-babe", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-session", - "sp-staking", + "sp-core", + "sp-io", + "sp-runtime", ] [[package]] @@ -5941,7 +3613,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -5956,8 +3628,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "staging-xcm", "staging-xcm-builder", @@ -5983,90 +3655,48 @@ dependencies = [ "sha2 0.10.8", "sp-ark-bls12-381", "sp-consensus-randomness-beacon", - "sp-core 35.0.0", - "sp-inherents 34.0.0", - "sp-io 39.0.0", - "sp-keystore 0.40.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", "timelock", ] [[package]] -name = "pallet-session" +name = "pallet-transaction-payment" version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69f96c09d4ae772ee095f1392ef33a8d46f5dfa5be8a217935e9effd2979c39" +checksum = "33ee68d52c4f65063624f02ac83691ca6e46b471c8eb3bfb6f60b441f24a23ab" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-session", - "sp-staking", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "serde", + "sp-core", + "sp-io", + "sp-runtime", ] [[package]] -name = "pallet-timestamp" -version = "38.0.0" +name = "pallet-xcm" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dcb0a659187a3b9364a1754fb30cc962109be0753e9689d92fe01e47c747a71" +checksum = "165300c258d4f6fd325d3195e3d68b976891d5710a6f0ac636b935906c22891c" dependencies = [ - "docify", + "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-inherents 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-storage 22.0.0", - "sp-timestamp", -] - -[[package]] -name = "pallet-transaction-payment" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ee68d52c4f65063624f02ac83691ca6e46b471c8eb3bfb6f60b441f24a23ab" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-xcm" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165300c258d4f6fd325d3195e3d68b976891d5710a6f0ac636b935906c22891c" -dependencies = [ - "bounded-collections 0.2.3", - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-balances", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-io", + "sp-runtime", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -6087,27 +3717,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "parity-db" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" -dependencies = [ - "blake2 0.10.6", - "crc32fast", - "fs2", - "hex", - "libc", - "log", - "lz4", - "memmap2 0.5.10", - "parking_lot 0.12.3", - "rand 0.8.5", - "siphasher", - "snap", - "winapi", -] - [[package]] name = "parity-scale-codec" version = "3.7.4" @@ -6131,7 +3740,7 @@ version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", @@ -6149,17 +3758,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -6167,21 +3765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -6192,17 +3776,11 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.8", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] -[[package]] -name = "partial_sort" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" - [[package]] name = "password-hash" version = "0.5.0" @@ -6211,7 +3789,7 @@ checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", "rand_core 0.6.4", - "subtle 2.6.1", + "subtle", ] [[package]] @@ -6220,15 +3798,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.0", -] - [[package]] name = "pbkdf2" version = "0.12.2" @@ -6239,15 +3808,6 @@ dependencies = [ "password-hash", ] -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "pem" version = "3.0.4" @@ -6271,7 +3831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset", - "indexmap 2.7.1", + "indexmap", ] [[package]] @@ -6327,12 +3887,6 @@ dependencies = [ "spki", ] -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "polkadot-core-primitives" version = "16.0.0" @@ -6341,8 +3895,8 @@ checksum = "fe728468f0519d4ae802cae85b21a50072730fb93ad47bedb34fbc01fa62f125" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-runtime", ] [[package]] @@ -6351,47 +3905,22 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d10a3da595ecd419e526a9cfcc013cd00bcd9a2c962991d6efb312df8307eaf" dependencies = [ - "bounded-collections 0.2.3", + "bounded-collections", "derive_more 0.99.19", "parity-scale-codec", "polkadot-core-primitives", "scale-info", "serde", - "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-runtime", "sp-weights", ] -[[package]] -name = "polkavm" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" -dependencies = [ - "libc", - "log", - "polkavm-assembler", - "polkavm-common 0.9.0", - "polkavm-linux-raw", -] - -[[package]] -name = "polkavm-assembler" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" -dependencies = [ - "log", -] - [[package]] name = "polkavm-common" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" -dependencies = [ - "log", -] [[package]] name = "polkavm-common" @@ -6461,27 +3990,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "polkavm-linker" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" -dependencies = [ - "gimli 0.28.1", - "hashbrown 0.14.5", - "log", - "object 0.32.2", - "polkavm-common 0.9.0", - "regalloc2 0.9.3", - "rustc-demangle", -] - -[[package]] -name = "polkavm-linux-raw" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" - [[package]] name = "polling" version = "3.7.4" @@ -6492,7 +4000,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.44", + "rustix", "tracing", "windows-sys 0.59.0", ] @@ -6504,7 +4012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug", "universal-hash", ] @@ -6516,7 +4024,7 @@ checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug 0.3.1", + "opaque-debug", "universal-hash", ] @@ -6541,46 +4049,6 @@ dependencies = [ "zerocopy 0.7.35", ] -[[package]] -name = "predicates" -version = "2.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" -dependencies = [ - "difflib", - "float-cmp", - "itertools 0.10.5", - "normalize-line-endings", - "predicates-core", - "regex", -] - -[[package]] -name = "predicates" -version = "3.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" -dependencies = [ - "anstyle", - "predicates-core", -] - -[[package]] -name = "predicates-core" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" - -[[package]] -name = "predicates-tree" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" -dependencies = [ - "predicates-core", - "termtree", -] - [[package]] name = "prettyplease" version = "0.2.29" @@ -6591,19 +4059,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec 0.6.0", - "impl-serde 0.4.0", - "scale-info", - "uint 0.9.5", -] - [[package]] name = "primitive-types" version = "0.13.1" @@ -6611,21 +4066,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ "fixed-hash", - "impl-codec 0.7.1", + "impl-codec", "impl-num-traits", - "impl-serde 0.5.0", + "impl-serde", "scale-info", - "uint 0.10.0", -] - -[[package]] -name = "proc-macro-crate" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" -dependencies = [ - "thiserror 1.0.69", - "toml 0.5.11", + "uint", ] [[package]] @@ -6661,17 +4106,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-warning" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "proc-macro-warning" version = "1.84.1" @@ -6702,22 +4136,10 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.3", + "parking_lot", "thiserror 1.0.69", ] -[[package]] -name = "prometheus-client" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c99afa9a01501019ac3a14d71d9f94050346f55ca471ce90c799a15c58f61e2" -dependencies = [ - "dtoa", - "itoa", - "parking_lot 0.12.3", - "prometheus-client-derive-encode", -] - [[package]] name = "prometheus-client" version = "0.22.3" @@ -6726,7 +4148,7 @@ checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.3", + "parking_lot", "prometheus-client-derive-encode", ] @@ -6741,32 +4163,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "proptest" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" -dependencies = [ - "bitflags 2.8.0", - "lazy_static", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.8.5", - "unarray", -] - -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive 0.12.6", -] - [[package]] name = "prost" version = "0.13.5" @@ -6774,7 +4170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "prost-derive 0.13.5", + "prost-derive", ] [[package]] @@ -6783,33 +4179,20 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "heck 0.5.0", + "heck", "itertools 0.14.0", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost 0.13.5", + "prost", "prost-types", "regex", "syn 2.0.98", "tempfile", ] -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "prost-derive" version = "0.13.5" @@ -6829,31 +4212,7 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" dependencies = [ - "prost 0.13.5", -] - -[[package]] -name = "psm" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" -dependencies = [ - "cc", -] - -[[package]] -name = "quanta" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", - "web-sys", - "winapi", + "prost", ] [[package]] @@ -6871,50 +4230,19 @@ dependencies = [ "byteorder", ] -[[package]] -name = "quick-protobuf-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "quick-protobuf", - "thiserror 1.0.69", - "unsigned-varint 0.7.2", -] - [[package]] name = "quick-protobuf-codec" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "quick-protobuf", "thiserror 1.0.69", "unsigned-varint 0.8.0", ] -[[package]] -name = "quinn" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" -dependencies = [ - "bytes", - "futures-io", - "pin-project-lite", - "quinn-proto 0.10.6", - "quinn-udp 0.4.1", - "rustc-hash 1.1.0", - "rustls 0.21.12", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "quinn" version = "0.11.6" @@ -6926,33 +4254,16 @@ dependencies = [ "bytes", "futures-io", "pin-project-lite", - "quinn-proto 0.11.9", - "quinn-udp 0.5.10", - "rustc-hash 2.1.1", - "rustls 0.23.23", - "socket2 0.5.8", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", "thiserror 2.0.11", "tokio", "tracing", ] -[[package]] -name = "quinn-proto" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" -dependencies = [ - "bytes", - "rand 0.8.5", - "ring 0.16.20", - "rustc-hash 1.1.0", - "rustls 0.21.12", - "slab", - "thiserror 1.0.69", - "tinyvec", - "tracing", -] - [[package]] name = "quinn-proto" version = "0.11.9" @@ -6963,8 +4274,8 @@ dependencies = [ "getrandom 0.2.15", "rand 0.8.5", "ring 0.17.9", - "rustc-hash 2.1.1", - "rustls 0.23.23", + "rustc-hash", + "rustls", "rustls-pki-types", "slab", "thiserror 2.0.11", @@ -6975,27 +4286,14 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" -dependencies = [ - "bytes", - "libc", - "socket2 0.5.8", - "tracing", - "windows-sys 0.48.0", -] - -[[package]] -name = "quinn-udp" -version = "0.5.10" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ - "cfg_aliases 0.2.1", + "cfg_aliases", "libc", "once_cell", - "socket2 0.5.8", + "socket2", "tracing", "windows-sys 0.59.0", ] @@ -7057,12 +4355,6 @@ dependencies = [ "rand_core 0.9.1", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -7082,43 +4374,6 @@ dependencies = [ "zerocopy 0.8.20", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_pcg" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "raw-cpuid" -version = "11.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529468c1335c1c03919960dfefdb1b3648858c20d7ec2d0663e728e4a717efbc" -dependencies = [ - "bitflags 2.8.0", -] - [[package]] name = "rawpointer" version = "0.2.1" @@ -7145,39 +4400,18 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" -dependencies = [ - "pem 1.1.1", - "ring 0.16.20", - "time", - "yasna", -] - [[package]] name = "rcgen" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ - "pem 3.0.4", + "pem", "ring 0.16.20", "time", "yasna", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.8" @@ -7187,17 +4421,6 @@ dependencies = [ "bitflags 2.8.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 1.0.69", -] - [[package]] name = "ref-cast" version = "1.0.23" @@ -7218,31 +4441,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "regalloc2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" -dependencies = [ - "fxhash", - "log", - "slice-group-by", - "smallvec", -] - -[[package]] -name = "regalloc2" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" -dependencies = [ - "hashbrown 0.13.2", - "log", - "rustc-hash 1.1.0", - "slice-group-by", - "smallvec", -] - [[package]] name = "regex" version = "1.11.1" @@ -7304,7 +4502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.6.1", + "subtle", ] [[package]] @@ -7336,12 +4534,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "route-recognizer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" - [[package]] name = "rtnetlink" version = "0.13.1" @@ -7367,12 +4559,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.1" @@ -7391,7 +4577,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.25", + "semver", ] [[package]] @@ -7403,20 +4589,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.38.44" @@ -7426,60 +4598,24 @@ dependencies = [ "bitflags 2.8.0", "errno", "libc", - "linux-raw-sys 0.4.15", + "linux-raw-sys", "windows-sys 0.59.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "ring 0.16.20", - "sct", - "webpki", -] - -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.9", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ - "log", "once_cell", "ring 0.17.9", "rustls-pki-types", "rustls-webpki 0.102.8", - "subtle 2.6.1", + "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" -dependencies = [ - "openssl-probe", - "rustls-pki-types", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pki-types" version = "1.11.0" @@ -7552,1022 +4688,24 @@ dependencies = [ ] [[package]] -name = "sc-allocator" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a63e577eb150187ddd444a0a6f01e1ece0a5cfc592aacb4204d9f79bdc5265d" -dependencies = [ - "log", - "sp-core 35.0.0", - "sp-wasm-interface 21.0.1", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-basic-authorship" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e135c7efa86a538c5edb6456e00ffa13816d3a1d53fdba8fa81d6e1d06c9c995" -dependencies = [ - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "sc-block-builder", - "sc-proposer-metrics", - "sc-telemetry", - "sc-transaction-pool-api", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-block-builder" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa58cf10d78568fa19d3cd723984bc864c19113fa83f2f252020c91f925b8480" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-trie 38.0.0", -] - -[[package]] -name = "sc-chain-spec" -version = "41.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f193a962c3bea44d03d6ec61ef3b54cc3d629a8058a25bcb181d06f1ac7b3a79" -dependencies = [ - "array-bytes", - "docify", - "log", - "memmap2 0.9.5", - "parity-scale-codec", - "sc-chain-spec-derive", - "sc-client-api", - "sc-executor", - "sc-network", - "sc-telemetry", - "serde", - "serde_json", - "sp-blockchain", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-genesis-builder", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "sp-tracing 17.0.1", -] - -[[package]] -name = "sc-chain-spec-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18cef11d2c69703e0d7c3528202ef4ed1cd2b47a6f063e9e17cad8255b1fa94" -dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "sc-client-api" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89717374ec68c01c2493d65f7e1854814c371ed9e8f9826a160ee9d0d473824" -dependencies = [ - "fnv", - "futures", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-executor", - "sc-transaction-pool-api", - "sc-utils", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-database", - "sp-externalities 0.30.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "sp-statement-store", - "sp-storage 22.0.0", - "sp-trie 38.0.0", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-client-db" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cfd3ac7c6d086ae3c5c4dc6e16c91d4a713618466d1ea3f5bec07eb19e0c6eb" -dependencies = [ - "hash-db", - "kvdb", - "kvdb-memorydb", - "linked-hash-map", - "log", - "parity-db", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-client-api", - "sc-state-db", - "schnellru", - "sp-arithmetic", - "sp-blockchain", - "sp-core 35.0.0", - "sp-database", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", -] - -[[package]] -name = "sc-consensus" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82287d29c4f569b7d6b0589ddb60a0cd5e41c82242b582f347d89a8f28bc305f" -dependencies = [ - "async-trait", - "futures", - "log", - "mockall 0.11.4", - "parking_lot 0.12.3", - "sc-client-api", - "sc-network-types", - "sc-utils", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-consensus-aura" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cae6c8dfa585db7cdb5057d72c27c67654a9b077c1cf38eeba6fc56ed0d885f" -dependencies = [ - "async-trait", - "futures", - "log", - "parity-scale-codec", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sc-consensus-slots", - "sc-telemetry", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-aura", - "sp-consensus-slots", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-consensus-babe" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6342aba8e37a25f20e0d57af9fdc05ac93369ee23a16ba486eb0c40a09a4047" -dependencies = [ - "async-trait", - "fork-tree", - "futures", - "log", - "num-bigint", - "num-rational", - "num-traits", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-client-api", - "sc-consensus", - "sc-consensus-epochs", - "sc-consensus-slots", - "sc-telemetry", - "sc-transaction-pool-api", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-inherents 35.0.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-consensus-epochs" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db49ba7a929e282406a03ed47b00011ef26525cab9bb0e2ce51026d93c411f8b" -dependencies = [ - "fork-tree", - "parity-scale-codec", - "sc-client-api", - "sc-consensus", - "sp-blockchain", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sc-consensus-manual-seal" -version = "0.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437a1da5fd1252ec2cb2c86fb7a51a44a0b6a3239b733440a2dce30f48d14ed2" -dependencies = [ - "assert_matches", - "async-trait", - "futures", - "futures-timer", - "jsonrpsee", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-consensus", - "sc-consensus-aura", - "sc-consensus-babe", - "sc-consensus-epochs", - "sc-transaction-pool", - "sc-transaction-pool-api", - "serde", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-consensus-slots", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-timestamp", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-consensus-randomness-beacon" -version = "1.0.0" +name = "sc-consensus-randomness-beacon" +version = "1.0.0" dependencies = [ "ark-bls12-381", "ark-serialize", - "async-std", - "futures", - "futures-timer", - "libp2p 0.55.0", - "log", - "parity-scale-codec", - "prost 0.13.5", - "prost-build", - "prost-types", - "rand 0.8.5", - "sc-basic-authorship", - "sc-client-api", - "sc-consensus", - "sc-consensus-manual-seal", - "sc-transaction-pool", - "sc-transaction-pool-api", - "sc-utils", - "scale-info", - "serde", - "sp-api", - "sp-ark-bls12-381", - "sp-blockchain", - "sp-consensus", - "sp-consensus-randomness-beacon", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "substrate-test-runtime-client", - "substrate-test-runtime-transaction-pool", - "tokio", -] - -[[package]] -name = "sc-consensus-slots" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3973057fb689d2fc626867858e6589d251c162c7f2d513189e39b104d2bb5c7" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-consensus", - "sc-telemetry", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-consensus-slots", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", -] - -[[package]] -name = "sc-executor" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b450573fc0ca024bdcb6d508d61c104f862519ca7f78c416bd8042c9db32975" -dependencies = [ - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-executor-common", - "sc-executor-polkavm", - "sc-executor-wasmtime", - "schnellru", - "sp-api", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-io 39.0.0", - "sp-panic-handler", - "sp-runtime-interface 29.0.0", - "sp-trie 38.0.0", - "sp-version", - "sp-wasm-interface 21.0.1", - "tracing", -] - -[[package]] -name = "sc-executor-common" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f5d872331b68ed4601488100f22e8aa16331de006b51d4c69353930c568a16" -dependencies = [ - "polkavm", - "sc-allocator", - "sp-maybe-compressed-blob", - "sp-wasm-interface 21.0.1", - "thiserror 1.0.69", - "wasm-instrument", -] - -[[package]] -name = "sc-executor-polkavm" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c4b3532c0f6dae1fcbe85f4582618042aefb9c8e2a03f855d298f56362daaa" -dependencies = [ - "log", - "polkavm", - "sc-executor-common", - "sp-wasm-interface 21.0.1", -] - -[[package]] -name = "sc-executor-wasmtime" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d04b8d98a96a83b56eeb1061cd4a7a1949b7c2c147d572d309c4e4d5c0d870f" -dependencies = [ - "anyhow", - "cfg-if", - "libc", - "log", - "parking_lot 0.12.3", - "rustix 0.36.17", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface 29.0.0", - "sp-wasm-interface 21.0.1", - "wasmtime", -] - -[[package]] -name = "sc-informant" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed07e72b3d6db0bee2c18b7737a07a6fbd21cc103e4067165cf71da40ae0f0e1" -dependencies = [ - "console", - "futures", - "futures-timer", - "log", - "sc-client-api", - "sc-network", - "sc-network-common", - "sc-network-sync", - "sp-blockchain", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sc-keystore" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bdd4b927614411c69cb62500790a7d93fced0e5a9824b71c36f957e0dae0f5" -dependencies = [ - "array-bytes", - "parking_lot 0.12.3", - "serde_json", - "sp-application-crypto 39.0.0", - "sp-core 35.0.0", - "sp-keystore 0.41.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-mixnet" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9465af602a26f73d129f70a6b979c44f4c6bd28c2fdfc018315df2125d179d60" -dependencies = [ - "array-bytes", - "arrayvec", - "blake2 0.10.6", - "bytes", - "futures", - "futures-timer", - "log", - "mixnet", - "multiaddr 0.18.2", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-client-api", - "sc-network", - "sc-network-types", - "sc-transaction-pool-api", - "sp-api", - "sp-consensus", - "sp-core 35.0.0", - "sp-keystore 0.41.0", - "sp-mixnet", - "sp-runtime 40.1.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-network" -version = "0.48.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3751a666e9e16c73bda5d2531b80e086392a66b6006214e2951e29747f2c5b06" -dependencies = [ - "array-bytes", - "async-channel 1.9.0", - "async-trait", - "asynchronous-codec 0.6.2", - "bytes", - "cid 0.9.0", - "either", - "fnv", - "futures", - "futures-timer", - "ip_network", - "libp2p 0.52.4", - "linked_hash_set", - "litep2p", - "log", - "mockall 0.11.4", - "once_cell", - "parity-scale-codec", - "parking_lot 0.12.3", - "partial_sort", - "pin-project", - "prost 0.12.6", - "prost-build", - "rand 0.8.5", - "sc-client-api", - "sc-network-common", - "sc-network-types", - "sc-utils", - "schnellru", - "serde", - "serde_json", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", - "tokio", - "tokio-stream", - "unsigned-varint 0.7.2", - "void", - "wasm-timer", - "zeroize", -] - -[[package]] -name = "sc-network-common" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "425b88da9cc89a85ddb6d693d93aee2a708ad9c230b73f8aa638dbad0c63b535" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "futures", - "libp2p-identity", - "parity-scale-codec", - "prost-build", - "sc-consensus", - "sc-network-types", - "sp-consensus", - "sp-consensus-grandpa", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sc-network-light" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da04be64a20ced7775f97014031dae5b5408f460e5abe4f3e733d559cb8a846a" -dependencies = [ - "array-bytes", - "async-channel 1.9.0", - "futures", - "log", - "parity-scale-codec", - "prost 0.12.6", - "prost-build", - "sc-client-api", - "sc-network", - "sc-network-types", - "sp-blockchain", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-network-sync" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce6a2562c9d4710bc56e0c2841653fd7596ef9708530b7e45e1444222b979b" -dependencies = [ - "array-bytes", - "async-channel 1.9.0", - "async-trait", - "fork-tree", - "futures", - "futures-timer", - "log", - "mockall 0.11.4", - "parity-scale-codec", - "prost 0.12.6", - "prost-build", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-types", - "sc-utils", - "schnellru", - "smallvec", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-consensus-grandpa", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", - "tokio", - "tokio-stream", -] - -[[package]] -name = "sc-network-transactions" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a069de44381e1329d7033877d212a8287d779a2f3ebd3748c4fec6ee465e55" -dependencies = [ - "array-bytes", - "futures", - "log", - "parity-scale-codec", - "sc-network", - "sc-network-common", - "sc-network-sync", - "sc-network-types", - "sc-utils", - "sp-consensus", - "sp-runtime 40.1.0", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-network-types" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3001bb4db4dbad087e72c851d983c7b9618e37dce382d86355130f7ec7b79f20" -dependencies = [ - "bs58", - "ed25519-dalek", - "libp2p-identity", - "litep2p", - "log", - "multiaddr 0.18.2", - "multihash 0.19.3", - "rand 0.8.5", - "thiserror 1.0.69", - "zeroize", -] - -[[package]] -name = "sc-offchain" -version = "43.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e0b1ad78caf4b34d4acbb3dbe4d13fbbdaafcf8cbed26766e028ac7393275" -dependencies = [ - "array-bytes", - "bytes", - "fnv", - "futures", - "futures-timer", - "http-body-util", - "hyper 1.6.0", - "hyper-rustls", - "hyper-util", - "log", - "num_cpus", - "once_cell", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "rustls 0.23.23", - "sc-client-api", - "sc-network", - "sc-network-common", - "sc-network-types", - "sc-transaction-pool-api", - "sc-utils", - "sp-api", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-keystore 0.41.0", - "sp-offchain", - "sp-runtime 40.1.0", - "threadpool", - "tracing", -] - -[[package]] -name = "sc-proposer-metrics" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f680a0bed67dab19898624246376ba85d5f70a89859ba030830aacd079c28d3c" -dependencies = [ - "log", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "sc-rpc" -version = "43.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ac6a01eb88a5ea7e2ed7e6348f332548262fd00247c263f5b081dff3d1432b" -dependencies = [ - "futures", - "jsonrpsee", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-mixnet", - "sc-rpc-api", - "sc-tracing", - "sc-transaction-pool-api", - "sc-utils", - "serde_json", - "sp-api", - "sp-blockchain", - "sp-core 35.0.0", - "sp-keystore 0.41.0", - "sp-offchain", - "sp-rpc", - "sp-runtime 40.1.0", - "sp-session", - "sp-statement-store", - "sp-version", - "tokio", -] - -[[package]] -name = "sc-rpc-api" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a45ebf7365e369bea319018dd2706929d4d8d8807829a1989dfaf3f1c7125d" -dependencies = [ - "jsonrpsee", - "parity-scale-codec", - "sc-chain-spec", - "sc-mixnet", - "sc-transaction-pool-api", - "scale-info", - "serde", - "serde_json", - "sp-core 35.0.0", - "sp-rpc", - "sp-runtime 40.1.0", - "sp-version", - "thiserror 1.0.69", -] - -[[package]] -name = "sc-rpc-server" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460bd636ce21bf431d7fffcf7a988c0f35369ecbd1aff00c8edbce42b13dc9e1" -dependencies = [ - "dyn-clone", - "forwarded-header-value", - "futures", - "governor", - "http 1.2.0", - "http-body-util", - "hyper 1.6.0", - "ip_network", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "serde_json", - "substrate-prometheus-endpoint", - "tokio", - "tower", - "tower-http", -] - -[[package]] -name = "sc-rpc-spec-v2" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4734b9d0f16e9d7dc45a75b7f413d58ab612b70b7c63a598eedff58255f88a" -dependencies = [ - "array-bytes", - "futures", - "futures-util", - "hex", - "itertools 0.11.0", - "jsonrpsee", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "sc-chain-spec", - "sc-client-api", - "sc-rpc", - "sc-transaction-pool-api", - "schnellru", - "serde", - "sp-api", - "sp-blockchain", - "sp-core 35.0.0", - "sp-rpc", - "sp-runtime 40.1.0", - "sp-version", - "thiserror 1.0.69", - "tokio", - "tokio-stream", -] - -[[package]] -name = "sc-service" -version = "0.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894407165874a8c81aa51ab5ff5823ca2a2eb7806f5f1b2ab1c2df9bb92cce62" -dependencies = [ - "async-trait", - "directories", - "exit-future", - "futures", - "futures-timer", - "jsonrpsee", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "pin-project", - "rand 0.8.5", - "sc-chain-spec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-informant", - "sc-keystore", - "sc-network", - "sc-network-common", - "sc-network-light", - "sc-network-sync", - "sc-network-transactions", - "sc-network-types", - "sc-rpc", - "sc-rpc-server", - "sc-rpc-spec-v2", - "sc-sysinfo", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", - "sc-utils", - "schnellru", - "serde", - "serde_json", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-session", - "sp-state-machine 0.44.0", - "sp-storage 22.0.0", - "sp-transaction-pool", - "sp-transaction-storage-proof", - "sp-trie 38.0.0", - "sp-version", - "static_init", - "substrate-prometheus-endpoint", - "tempfile", - "thiserror 1.0.69", - "tokio", - "tracing", - "tracing-futures", -] - -[[package]] -name = "sc-state-db" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b1bda0a8847a094dbd8aa379c3b6ce3c86f70ba29ad2f506b561a06b3d78fe" -dependencies = [ - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 35.0.0", -] - -[[package]] -name = "sc-sysinfo" -version = "41.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e636383d99aa72ab948ea0939df12273a5b0cfe977e71c09ab6cc0379c051c2" -dependencies = [ - "derive_more 0.99.19", - "futures", - "libc", - "log", - "rand 0.8.5", - "rand_pcg", - "regex", - "sc-telemetry", - "serde", - "serde_json", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-io 39.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "sc-telemetry" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f501f4b696b6497f0dd181892938bfc6ccf580636ae57b4ab2c05ea15d80f" -dependencies = [ - "chrono", - "futures", - "libp2p 0.52.4", - "log", - "parking_lot 0.12.3", - "pin-project", - "rand 0.8.5", - "sc-network", - "sc-utils", - "serde", - "serde_json", - "thiserror 1.0.69", - "wasm-timer", -] - -[[package]] -name = "sc-tracing" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7363a0fd9e950660db34440db8c29ac7ec14b3af43c649ad2f64e4d4a7b09413" -dependencies = [ - "chrono", - "console", - "is-terminal", - "libc", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "rustc-hash 1.1.0", - "sc-client-api", - "sc-tracing-proc-macro", - "serde", - "sp-api", - "sp-blockchain", - "sp-core 35.0.0", - "sp-rpc", - "sp-runtime 40.1.0", - "sp-tracing 17.0.1", - "thiserror 1.0.69", - "tracing", - "tracing-log 0.2.0", - "tracing-subscriber 0.3.19", -] - -[[package]] -name = "sc-tracing-proc-macro" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" -dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "sc-transaction-pool" -version = "38.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850d5f7e46e7b6943c2bcc627a82cf11d7604b95a24e2c0e0f28a24fbff4095c" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "indexmap 2.7.1", - "itertools 0.11.0", - "linked-hash-map", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-client-api", - "sc-transaction-pool-api", - "sc-utils", - "serde", - "sp-api", - "sp-blockchain", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-runtime 40.1.0", - "sp-tracing 17.0.1", - "sp-transaction-pool", - "substrate-prometheus-endpoint", - "thiserror 1.0.69", - "tokio", - "tokio-stream", -] - -[[package]] -name = "sc-transaction-pool-api" -version = "38.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894984d3ba3c6f51573dc395bcdeed02aaeb96d88c403a13c726852ed70a8584" -dependencies = [ - "async-trait", + "async-std", "futures", + "libp2p", "log", "parity-scale-codec", + "prost", + "prost-build", + "rand 0.8.5", + "sc-utils", + "scale-info", "serde", - "sp-blockchain", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "thiserror 1.0.69", + "sp-ark-bls12-381", + "tokio", ] [[package]] @@ -8580,34 +4718,11 @@ dependencies = [ "futures", "futures-timer", "log", - "parking_lot 0.12.3", + "parking_lot", "prometheus", "sp-arithmetic", ] -[[package]] -name = "scale-bits" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" -dependencies = [ - "parity-scale-codec", - "scale-type-resolver", -] - -[[package]] -name = "scale-decode" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" -dependencies = [ - "derive_more 0.99.19", - "parity-scale-codec", - "scale-bits", - "scale-type-resolver", - "smallvec", -] - [[package]] name = "scale-info" version = "2.11.6" @@ -8628,34 +4743,19 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "scale-type-resolver" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" - -[[package]] -name = "schannel" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "schnellru" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -8669,13 +4769,13 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek 4.1.3", + "curve25519-dalek", "getrandom_or_panic", "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle 2.6.1", + "subtle", "zeroize", ] @@ -8691,22 +4791,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scratch" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.9", - "untrusted 0.9.0", -] - [[package]] name = "sec1" version = "0.7.3" @@ -8715,10 +4799,10 @@ checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array", "pkcs8", "serdect", - "subtle 2.6.1", + "subtle", "zeroize", ] @@ -8749,58 +4833,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "security-framework" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" -dependencies = [ - "bitflags 2.8.0", - "core-foundation 0.10.0", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" -dependencies = [ - "serde", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" @@ -8893,7 +4930,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug", ] [[package]] @@ -8964,27 +5001,12 @@ dependencies = [ "wide", ] -[[package]] -name = "simple-dns" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee851d0e5e7af3721faea1843e8015e820a234f81fda3dea9247e15bac9a86a" -dependencies = [ - "bitflags 2.8.0", -] - [[package]] name = "simple-mermaid" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "slab" version = "0.4.9" @@ -8994,12 +5016,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "smallvec" version = "1.14.0" @@ -9023,12 +5039,6 @@ dependencies = [ "futures-lite", ] -[[package]] -name = "snap" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" - [[package]] name = "snow" version = "0.9.6" @@ -9036,24 +5046,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ "aes-gcm", - "blake2 0.10.6", + "blake2", "chacha20poly1305", - "curve25519-dalek 4.1.3", + "curve25519-dalek", "rand_core 0.6.4", "ring 0.17.9", "rustc_version", "sha2 0.10.8", - "subtle 2.6.1", -] - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", + "subtle", ] [[package]] @@ -9075,7 +5075,6 @@ dependencies = [ "base64 0.22.1", "bytes", "futures", - "http 1.2.0", "httparse", "log", "rand 0.8.5", @@ -9094,13 +5093,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core 35.0.0", + "sp-core", "sp-externalities 0.30.0", "sp-metadata-ir", - "sp-runtime 40.1.0", + "sp-runtime", "sp-runtime-interface 29.0.0", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-trie", "sp-version", "thiserror 1.0.69", ] @@ -9112,27 +5111,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37f8b9621cfa68a45d6f9c124e672b8f6780839a6c95279a7877d244fef8d1dc" dependencies = [ "Inflector", - "blake2 0.10.6", + "blake2", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "sp-application-crypto" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8133012faa5f75b2f0b1619d9f720c1424ac477152c143e5f7dbde2fe1a958" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 38.0.0", -] - [[package]] name = "sp-application-crypto" version = "39.0.0" @@ -9142,252 +5128,43 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", ] [[package]] name = "sp-arithmetic" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" -dependencies = [ - "docify", - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", -] - -[[package]] -name = "sp-ark-bls12-381" -version = "0.4.2" -source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" -dependencies = [ - "ark-bls12-381-ext", - "sp-crypto-ec-utils", -] - -[[package]] -name = "sp-block-builder" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d66b12f19243bac666aa84c1df18f12989b924b467377973b349ff4913c3e6" -dependencies = [ - "sp-api", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-blockchain" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c9a1cd459bac54920bac5e467609dadfdac3e3503be0a864539aeb11071b70" -dependencies = [ - "futures", - "parity-scale-codec", - "parking_lot 0.12.3", - "schnellru", - "sp-api", - "sp-consensus", - "sp-core 35.0.0", - "sp-database", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "thiserror 1.0.69", - "tracing", -] - -[[package]] -name = "sp-consensus" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068254c448b84efac1c4a5b15f650851ef24ba77bda21802da34f73410096c09" -dependencies = [ - "async-trait", - "futures", - "log", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sp-consensus-aura" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2174e77fed7a92c90f3d3e3603a0b4580ea311b2df8343aa62112c9597e2a97" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-consensus-slots", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1633fab9075508861b82999305a3d3d35f35a780feaf4e81f9d59aa6d62e5f7" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-consensus-slots", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-grandpa" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee1b89de331df0c7b1502d626540d455a058eb86fa49f58cef0364d1a02abda" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-core 35.0.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-consensus-randomness-beacon" -version = "0.0.1-dev" -dependencies = [ - "array-bytes", - "async-trait", - "parity-scale-codec", - "scale-info", - "serde", - "sp-inherents 35.0.0", - "tokio", -] - -[[package]] -name = "sp-consensus-slots" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d79170cc0a66b22d29adee140017a16c01257d61b5d713bbe47224eb7c3dd45" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-timestamp", -] - -[[package]] -name = "sp-core" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f230cb12575455070da0fc174815958423a0b9a641d5e304a9457113c7cb4007" -dependencies = [ - "array-bytes", - "bip39", - "bitflags 1.3.2", - "blake2 0.10.6", - "bounded-collections 0.1.9", - "bs58", - "dyn-clonable", - "ed25519-zebra 3.1.0", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde 0.4.0", - "itertools 0.10.5", - "libsecp256k1", - "log", - "merlin", - "parity-scale-codec", - "parking_lot 0.12.3", - "paste", - "primitive-types 0.12.2", - "rand 0.8.5", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface 24.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ss58-registry", - "substrate-bip39 0.4.6", - "thiserror 1.0.69", - "tracing", - "w3f-bls", - "zeroize", -] - -[[package]] -name = "sp-core" -version = "34.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" dependencies = [ - "array-bytes", - "bitflags 1.3.2", - "blake2 0.10.6", - "bounded-collections 0.2.3", - "bs58", - "dyn-clonable", - "ed25519-zebra 4.0.3", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde 0.4.0", - "itertools 0.11.0", - "k256", - "libsecp256k1", - "log", - "merlin", - "parity-bip39", + "docify", + "integer-sqrt", + "num-traits", "parity-scale-codec", - "parking_lot 0.12.3", - "paste", - "primitive-types 0.12.2", - "rand 0.8.5", "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", "serde", - "sp-crypto-hashing", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.29.0", - "sp-runtime-interface 28.0.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "ss58-registry", - "substrate-bip39 0.6.0", - "thiserror 1.0.69", - "tracing", - "w3f-bls", - "zeroize", + "static_assertions", +] + +[[package]] +name = "sp-ark-bls12-381" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-bls12-381-ext", + "sp-crypto-ec-utils", +] + +[[package]] +name = "sp-consensus-randomness-beacon" +version = "0.0.1-dev" +dependencies = [ + "array-bytes", + "async-trait", + "sp-inherents", + "tokio", ] [[package]] @@ -9398,15 +5175,15 @@ checksum = "4532774405a712a366a98080cbb4daa28c38ddff0ec595902ad6ee6a78a809f8" dependencies = [ "array-bytes", "bitflags 1.3.2", - "blake2 0.10.6", - "bounded-collections 0.2.3", + "blake2", + "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra 4.0.3", + "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.5.0", + "impl-serde", "itertools 0.11.0", "k256", "libsecp256k1", @@ -9414,9 +5191,9 @@ dependencies = [ "merlin", "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot", "paste", - "primitive-types 0.13.1", + "primitive-types", "rand 0.8.5", "scale-info", "schnorrkel", @@ -9430,27 +5207,13 @@ dependencies = [ "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage 22.0.0", "ss58-registry", - "substrate-bip39 0.6.0", + "substrate-bip39", "thiserror 1.0.69", "tracing", "w3f-bls", "zeroize", ] -[[package]] -name = "sp-core-hashing" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0f4990add7b2cefdeca883c0efa99bb4d912cb2196120e1500c0cc099553b0" -dependencies = [ - "blake2b_simd", - "byteorder", - "digest 0.10.7", - "sha2 0.10.8", - "sha3", - "twox-hash", -] - [[package]] name = "sp-crypto-ec-utils" version = "0.10.0" @@ -9468,7 +5231,7 @@ dependencies = [ "ark-ed-on-bls12-381-bandersnatch", "ark-ed-on-bls12-381-bandersnatch-ext", "ark-scale", - "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-runtime-interface 24.0.0", ] [[package]] @@ -9496,16 +5259,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "sp-database" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" -dependencies = [ - "kvdb", - "parking_lot 0.12.3", -] - [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -9527,18 +5280,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "sp-externalities" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63867ec85950ced90d4ab1bba902a47db1b1efdf2829f653945669b2bb470a9c" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-externalities" version = "0.25.0" @@ -9546,18 +5287,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0b dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", -] - -[[package]] -name = "sp-externalities" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-storage 21.0.0", + "sp-storage 19.0.0", ] [[package]] @@ -9581,21 +5311,7 @@ dependencies = [ "scale-info", "serde_json", "sp-api", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-inherents" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afffbddc380d99a90c459ba1554bbbc01d62e892de9f1485af6940b89c4c0d57" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-runtime 39.0.5", - "thiserror 1.0.69", + "sp-runtime", ] [[package]] @@ -9608,37 +5324,10 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] -[[package]] -name = "sp-io" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ef7eb561bb4839cc8424ce58c5ea236cbcca83f26fcc0426d8decfe8aa97d4" -dependencies = [ - "bytes", - "docify", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive 0.9.1", - "rustversion", - "secp256k1", - "sp-core 34.0.0", - "sp-crypto-hashing", - "sp-externalities 0.29.0", - "sp-keystore 0.40.0", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.43.0", - "sp-tracing 17.0.1", - "sp-trie 37.0.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "39.0.0" @@ -9654,54 +5343,18 @@ dependencies = [ "polkavm-derive 0.9.1", "rustversion", "secp256k1", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing", "sp-externalities 0.30.0", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime-interface 29.0.0", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-tracing 17.0.1", - "sp-trie 38.0.0", + "sp-trie", "tracing", "tracing-core", ] -[[package]] -name = "sp-keyring" -version = "40.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ca46ebad50bd836bb2ea8951c9436149b5610299ff538087dd7989174d8f831" -dependencies = [ - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "strum 0.26.3", -] - -[[package]] -name = "sp-keystore" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96806a28a62ed9ddecd0b28857b1344d029390f7c5c42a2ff9199cbf5638635c" -dependencies = [ - "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 28.0.0", - "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.69", -] - -[[package]] -name = "sp-keystore" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" -dependencies = [ - "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 34.0.0", - "sp-externalities 0.29.0", -] - [[package]] name = "sp-keystore" version = "0.41.0" @@ -9709,21 +5362,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1d41475fcdf253f9f0da839564c1b7f8a95c6a293ddfffd6e48e3671e76f33b" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 35.0.0", + "parking_lot", + "sp-core", "sp-externalities 0.30.0", ] -[[package]] -name = "sp-maybe-compressed-blob" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" -dependencies = [ - "thiserror 1.0.69", - "zstd 0.12.4", -] - [[package]] name = "sp-metadata-ir" version = "0.8.0" @@ -9735,29 +5378,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "sp-mixnet" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506bf9fd887c786d0e954543827b126ee78426e9c58e53cc868c65edd1201ff5" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto 39.0.0", -] - -[[package]] -name = "sp-offchain" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c18f168775c2e88cab262fd2c8c002a19eeac2ed804b03bd5b7c7c7b190b7061" -dependencies = [ - "sp-api", - "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - [[package]] name = "sp-panic-handler" version = "13.0.1" @@ -9768,44 +5388,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-rpc" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb69b45312efd9aeb87a6763aba24b1cb4d177b7a205a18905d1edd792c974f" -dependencies = [ - "rustc-hash 1.1.0", - "serde", - "sp-core 35.0.0", -] - -[[package]] -name = "sp-runtime" -version = "39.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e00503b83cf48fffe48746b91b9b832d6785d4e2eeb0941558371eac6baac6" -dependencies = [ - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto 38.0.0", - "sp-arithmetic", - "sp-core 34.0.0", - "sp-io 38.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights", - "tracing", -] - [[package]] name = "sp-runtime" version = "40.1.0" @@ -9825,36 +5407,17 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-arithmetic", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 38.0.0", + "sp-trie", "sp-weights", "tracing", "tuplex", ] -[[package]] -name = "sp-runtime-interface" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66b66d8cec3d785fa6289336c1d9cbd4305d5d84f7134378c4d79ed7983e6fb" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types 0.12.2", - "sp-externalities 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime-interface-proc-macro 17.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 19.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 16.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 20.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", -] - [[package]] name = "sp-runtime-interface" version = "24.0.0" @@ -9864,33 +5427,13 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.18.0", - "primitive-types 0.13.1", - "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "primitive-types", + "sp-externalities 0.25.0", + "sp-runtime-interface-proc-macro 17.0.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk)", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "polkavm-derive 0.9.1", - "primitive-types 0.12.2", - "sp-externalities 0.29.0", - "sp-runtime-interface-proc-macro 18.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-tracing 17.0.1", - "sp-wasm-interface 21.0.1", + "sp-storage 19.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", "static_assertions", ] @@ -9904,7 +5447,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive 0.9.1", - "primitive-types 0.13.1", + "primitive-types", "sp-externalities 0.30.0", "sp-runtime-interface-proc-macro 18.0.0", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -9914,20 +5457,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "17.0.0" @@ -9935,7 +5464,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0b dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", @@ -9949,60 +5478,24 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "sp-session" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9d8923ce9b19389c4a8d00059a3cf9f5c4014095edf0dec0fe32f6a60e02b5" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-core 35.0.0", - "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-staking", -] - [[package]] name = "sp-staking" version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16f953bf2c6702430f3374366b172ab024ee5e9fef5cccf29fa73a29161c2b0" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-state-machine" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930104d6ae882626e8880d9b1578da9300655d337a3ffb45e130c608b6c89660" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "smallvec", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-panic-handler", - "sp-trie 37.0.0", - "thiserror 1.0.69", - "tracing", - "trie-db", +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", ] [[package]] @@ -10014,43 +5507,18 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot", "rand 0.8.5", "smallvec", - "sp-core 35.0.0", + "sp-core", "sp-externalities 0.30.0", "sp-panic-handler", - "sp-trie 38.0.0", + "sp-trie", "thiserror 1.0.69", "tracing", "trie-db", ] -[[package]] -name = "sp-statement-store" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8959bbd46dca069b4b9cf9880e1534406b2bb9c09ac45b8367652db50f3eda" -dependencies = [ - "aes-gcm", - "curve25519-dalek 4.1.3", - "ed25519-dalek", - "hkdf", - "parity-scale-codec", - "rand 0.8.5", - "scale-info", - "sha2 0.10.8", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-externalities 0.30.0", - "sp-runtime 40.1.0", - "sp-runtime-interface 29.0.0", - "thiserror 1.0.69", - "x25519-dalek", -] - [[package]] name = "sp-std" version = "14.0.0" @@ -10062,84 +5530,31 @@ name = "sp-std" version = "14.0.0" source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" -[[package]] -name = "sp-storage" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb92d7b24033a8a856d6e20dd980b653cbd7af7ec471cc988b1b7c1d2e3a32b" -dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-storage" version = "19.0.0" source = "git+https://github.com/paritytech/polkadot-sdk#3dc3a11cd68762c2e5feb0beba0b61f448c4fc92" dependencies = [ - "impl-serde 0.5.0", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] -[[package]] -name = "sp-storage" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" -dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-storage" version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" dependencies = [ - "impl-serde 0.5.0", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sp-timestamp" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595d392536ab1d212749f1d937692df157a0debf9a8b96a5ff78d38485dd6ac5" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sp-tracing" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" -dependencies = [ - "parity-scale-codec", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing", - "tracing-core", - "tracing-subscriber 0.2.25", -] - [[package]] name = "sp-tracing" version = "16.0.0" @@ -10148,7 +5563,7 @@ dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.3.19", + "tracing-subscriber", ] [[package]] @@ -10160,56 +5575,7 @@ dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.3.19", -] - -[[package]] -name = "sp-transaction-pool" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a18b6735f4a24245afd32850bac08ba113bb1a228146d5093b4db9baeb2f6a" -dependencies = [ - "sp-api", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-transaction-storage-proof" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7c631a7407335e4c8747efa4023c1b927f6cccfb845f3d9b467779f6c38de5" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-trie 38.0.0", -] - -[[package]] -name = "sp-trie" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" -dependencies = [ - "ahash 0.8.11", - "hash-db", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "scale-info", - "schnellru", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "thiserror 1.0.69", - "tracing", - "trie-db", - "trie-root", + "tracing-subscriber", ] [[package]] @@ -10218,16 +5584,16 @@ version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1851c4929ae88932c6bcdb9e60f4063e478ca612012af3b6d365c7dc9c591f7f" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.3", + "parking_lot", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 35.0.0", + "sp-core", "sp-externalities 0.30.0", "thiserror 1.0.69", "tracing", @@ -10241,13 +5607,13 @@ version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7561e88742bc47b2f5fbdcab77a1cd98cf04117a3e163c1aadd58b9a592a18" dependencies = [ - "impl-serde 0.5.0", + "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-version-proc-macro", "thiserror 1.0.69", @@ -10260,26 +5626,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" dependencies = [ "parity-scale-codec", - "proc-macro-warning 1.84.1", + "proc-macro-warning", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "sp-wasm-interface" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmtime", -] - [[package]] name = "sp-wasm-interface" version = "20.0.0" @@ -10301,7 +5653,6 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "wasmtime", ] [[package]] @@ -10310,7 +5661,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" dependencies = [ - "bounded-collections 0.2.3", + "bounded-collections", "parity-scale-codec", "scale-info", "serde", @@ -10325,15 +5676,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.3" @@ -10372,7 +5714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3061478a487d11bc79a57c752a7021fa591906fd58108cf35925f8ed85c2bd4" dependencies = [ "array-bytes", - "bounded-collections 0.2.3", + "bounded-collections", "derivative", "environmental", "frame-support", @@ -10382,7 +5724,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights", "xcm-procedural", ] @@ -10403,8 +5745,8 @@ dependencies = [ "polkadot-parachain-primitives", "scale-info", "sp-arithmetic", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-io", + "sp-runtime", "sp-weights", "staging-xcm", "staging-xcm-executor", @@ -10423,9 +5765,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-arithmetic", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-weights", "staging-xcm", "tracing", @@ -10438,269 +5780,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "static_init" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" -dependencies = [ - "bitflags 1.3.2", - "cfg_aliases 0.1.1", - "libc", - "parking_lot 0.11.2", - "parking_lot_core 0.8.6", - "static_init_macro", - "winapi", -] - -[[package]] -name = "static_init_macro" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1389c88ddd739ec6d3f8f83343764a0e944cd23cfbf126a9796a714b0b6edd6f" -dependencies = [ - "cfg_aliases 0.1.1", - "memchr", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros 0.26.4", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.98", -] - -[[package]] -name = "substrate-bip39" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" -dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "substrate-bip39" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" -dependencies = [ - "hmac 0.12.1", - "pbkdf2 0.12.2", - "schnorrkel", - "sha2 0.10.8", - "zeroize", -] - -[[package]] -name = "substrate-prometheus-endpoint" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b6772e9c3621b8d067a706dfda6a20db6faa7cde39822c58ffc8588d16409c5" -dependencies = [ - "http-body-util", - "hyper 1.6.0", - "hyper-util", - "log", - "prometheus", - "thiserror 1.0.69", - "tokio", -] - -[[package]] -name = "substrate-test-client" -version = "2.0.1" -dependencies = [ - "array-bytes", - "async-trait", - "futures", - "parity-scale-codec", - "sc-client-api", - "sc-client-db", - "sc-consensus", - "sc-executor", - "sc-offchain", - "sc-service", - "serde", - "serde_json", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-keyring", - "sp-keystore 0.34.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "tokio", -] - -[[package]] -name = "substrate-test-runtime" -version = "2.0.0" -dependencies = [ - "array-bytes", - "frame-executive", - "frame-metadata-hash-extension", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "futures", - "log", - "pallet-babe", - "pallet-balances", - "pallet-timestamp", - "parity-scale-codec", - "sc-block-builder", - "sc-chain-spec", - "sc-executor", - "sc-executor-common", - "sc-service", - "scale-info", - "serde", - "serde_json", - "sp-api", - "sp-application-crypto 39.0.0", - "sp-block-builder", - "sp-consensus", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-consensus-grandpa", - "sp-core 35.0.0", - "sp-crypto-hashing", - "sp-externalities 0.30.0", - "sp-genesis-builder", - "sp-inherents 35.0.0", - "sp-io 39.0.0", - "sp-keyring", - "sp-offchain", - "sp-runtime 40.1.0", - "sp-session", - "sp-state-machine 0.44.0", - "sp-tracing 17.0.1", - "sp-transaction-pool", - "sp-trie 38.0.0", - "sp-version", - "substrate-test-runtime-client", - "substrate-wasm-builder", - "tracing", - "trie-db", -] - -[[package]] -name = "substrate-test-runtime-client" -version = "2.0.0" -dependencies = [ - "futures", - "sc-block-builder", - "sc-client-api", - "sc-consensus", - "sp-api", - "sp-blockchain", - "sp-consensus", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "substrate-test-client", - "substrate-test-runtime", -] - -[[package]] -name = "substrate-test-runtime-transaction-pool" -version = "2.0.0" -dependencies = [ - "futures", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "sc-transaction-pool", - "sc-transaction-pool-api", - "sp-blockchain", - "sp-runtime 40.1.0", - "substrate-test-runtime-client", - "thiserror 1.0.69", -] - -[[package]] -name = "substrate-wasm-builder" -version = "25.0.0" +name = "substrate-bip39" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfebe406eca8d18abd10bb29d7c6af2d656fa60b5d4a8033afd80b97795b9efb" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ - "array-bytes", - "build-helper", - "cargo_metadata", - "console", - "filetime", - "frame-metadata", - "jobserver", - "merkleized-metadata", - "parity-scale-codec", - "parity-wasm", - "polkavm-linker", - "sc-executor", - "shlex", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-maybe-compressed-blob", - "sp-tracing 17.0.1", - "sp-version", - "strum 0.26.3", - "tempfile", - "toml 0.8.20", - "walkdir", - "wasm-opt", + "hmac 0.12.1", + "pbkdf2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", ] -[[package]] -name = "subtle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" - [[package]] name = "subtle" version = "2.6.1" @@ -10729,18 +5820,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "synstructure" version = "0.13.1" @@ -10759,7 +5838,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.8.0", - "core-foundation 0.9.4", + "core-foundation", "system-configuration-sys", ] @@ -10785,12 +5864,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "tempfile" version = "3.17.1" @@ -10801,7 +5874,7 @@ dependencies = [ "fastrand", "getrandom 0.3.1", "once_cell", - "rustix 0.38.44", + "rustix", "windows-sys 0.59.0", ] @@ -10814,12 +5887,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "termtree" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" - [[package]] name = "thiserror" version = "1.0.69" @@ -10870,15 +5937,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.3.37" @@ -10926,7 +5984,7 @@ dependencies = [ "ark-std", "array-bytes", "chacha20poly1305", - "generic-array 0.14.7", + "generic-array", "parity-scale-codec", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -10983,10 +6041,10 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot 0.12.3", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.8", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -11002,44 +6060,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "tokio-rustls" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" -dependencies = [ - "rustls 0.23.23", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" -dependencies = [ - "futures-util", - "log", - "rustls 0.23.23", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tungstenite", -] - [[package]] name = "tokio-util" version = "0.7.13" @@ -11048,21 +6068,11 @@ checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.8.20" @@ -11090,50 +6100,13 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.1", + "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.8.0", - "bytes", - "http 1.2.0", - "http-body 1.0.1", - "http-body-util", - "pin-project-lite", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" version = "0.3.3" @@ -11173,27 +6146,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -11205,48 +6157,15 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers 0.0.1", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-serde", -] - [[package]] name = "tracing-subscriber" version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ - "matchers 0.1.0", + "matchers", "nu-ansi-term", "once_cell", - "parking_lot 0.12.3", "regex", "sharded-slab", "smallvec", @@ -11254,7 +6173,7 @@ dependencies = [ "time", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", ] [[package]] @@ -11278,78 +6197,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand 0.8.5", - "smallvec", - "socket2 0.4.10", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "smallvec", - "thiserror 1.0.69", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.3", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror 1.0.69", - "tokio", - "tracing", - "trust-dns-proto 0.23.2", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -11362,26 +6209,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "tungstenite" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" -dependencies = [ - "bytes", - "data-encoding", - "http 1.2.0", - "httparse", - "log", - "rand 0.9.0", - "rustls 0.23.23", - "rustls-pki-types", - "sha1", - "thiserror 2.0.11", - "url", - "utf-8", -] - [[package]] name = "tuplex" version = "0.1.2" @@ -11406,18 +6233,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "uint" version = "0.10.0" @@ -11430,18 +6245,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - -[[package]] -name = "unicode-bidi" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" - [[package]] name = "unicode-ident" version = "1.0.17" @@ -11457,18 +6260,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" - [[package]] name = "unicode-xid" version = "0.2.6" @@ -11482,7 +6273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.6.1", + "subtle", ] [[package]] @@ -11490,22 +6281,12 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "futures-io", - "futures-util", -] [[package]] name = "unsigned-varint" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" -dependencies = [ - "bytes", - "tokio-util", -] [[package]] name = "untrusted" @@ -11526,15 +6307,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", - "percent-encoding", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + "idna", + "percent-encoding", +] [[package]] name = "utf16_iter" @@ -11575,12 +6350,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "w3f-bls" version = "0.1.4" @@ -11710,275 +6479,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-instrument" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasm-opt" -version = "0.116.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" -dependencies = [ - "anyhow", - "libc", - "strum 0.24.1", - "strum_macros 0.24.3", - "tempfile", - "thiserror 1.0.69", - "wasm-opt-cxx-sys", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-cxx-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" -dependencies = [ - "anyhow", - "cxx", - "cxx-build", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" -dependencies = [ - "anyhow", - "cc", - "cxx", - "cxx-build", -] - -[[package]] -name = "wasm-timer" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" -dependencies = [ - "futures", - "js-sys", - "parking_lot 0.11.2", - "pin-utils", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmparser" -version = "0.102.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - -[[package]] -name = "wasmtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "rayon", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-cache", - "wasmtime-cranelift", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-cache" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" -dependencies = [ - "anyhow", - "base64 0.21.7", - "bincode", - "directories-next", - "file-per-thread-logger", - "log", - "rustix 0.36.17", - "serde", - "sha2 0.10.8", - "toml 0.5.11", - "windows-sys 0.45.0", - "zstd 0.11.2+zstd.1.5.2", -] - -[[package]] -name = "wasmtime-cranelift" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.27.3", - "log", - "object 0.30.4", - "target-lexicon", - "thiserror 1.0.69", - "wasmparser", - "wasmtime-cranelift-shared", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-cranelift-shared" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", - "target-lexicon", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror 1.0.69", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" -dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-debug", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "object 0.30.4", - "once_cell", - "rustix 0.36.17", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand 0.8.5", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-types" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror 1.0.69", - "wasmparser", -] - [[package]] name = "web-sys" version = "0.3.77" @@ -11999,16 +6499,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.9", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" version = "0.25.4" @@ -12082,15 +6572,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.53.0" @@ -12164,15 +6645,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -12200,21 +6672,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -12246,12 +6703,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -12264,12 +6715,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -12282,12 +6727,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -12306,12 +6745,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -12324,12 +6757,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -12342,12 +6769,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -12360,12 +6781,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -12433,63 +6848,29 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "rand_core 0.6.4", "serde", "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" -dependencies = [ - "asn1-rs 0.5.2", - "data-encoding", - "der-parser 8.2.0", - "lazy_static", - "nom", - "oid-registry 0.6.1", - "rusticata-macros", - "thiserror 1.0.69", - "time", -] - [[package]] name = "x509-parser" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs 0.6.2", + "asn1-rs", "data-encoding", - "der-parser 9.0.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.7.1", + "oid-registry", "rusticata-macros", "thiserror 1.0.69", "time", ] -[[package]] -name = "x509-parser" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460" -dependencies = [ - "asn1-rs 0.7.0", - "data-encoding", - "der-parser 10.0.0", - "lazy_static", - "nom", - "oid-registry 0.8.1", - "rusticata-macros", - "thiserror 2.0.11", - "time", -] - [[package]] name = "xcm-procedural" version = "11.0.0" @@ -12541,7 +6922,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot", "pin-project", "rand 0.8.5", "static_assertions", @@ -12556,7 +6937,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.3", + "parking_lot", "pin-project", "rand 0.8.5", "static_assertions", @@ -12593,7 +6974,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -12655,7 +7036,7 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.98", - "synstructure 0.13.1", + "synstructure", ] [[package]] @@ -12699,51 +7080,3 @@ dependencies = [ "quote", "syn 2.0.98", ] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe 6.0.6", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index 4908d64..a26a306 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,6 @@ members = [ "pallets/randomness-beacon", "pallets/idn-manager", "support/traits", - "test-utils/client", - "test-utils/runtime", ] resolver = "2" @@ -50,6 +48,7 @@ default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic # Async, Concurrency, & Networking async-trait = "0.1.85" futures = "0.3" +futures-timer = "3.0.3" libp2p = { version = "0.55.0", features = [ "gossipsub", "noise", @@ -79,11 +78,11 @@ frame-system-rpc-runtime-api = { version = "35.0.0", default-features = false } pallet-babe = { version = "39.0.0", default-features = false } pallet-balances = { version = "40.0.1", default-features = false } pallet-timestamp = { version = "38.0.0", default-features = false } -sc-basic-authorship = { version = "0.48.0", default-features = false } -sc-block-builder = { version = "0.43.0", default-features = false } -sc-client-api = { version = "38.0.0", default-features = false } -sc-consensus = { version = "0.47.0", default-features = false } -sc-consensus-manual-seal = { version = "0.49.0", default-features = false } +# sc-basic-authorship = { version = "0.48.0", default-features = false } +# sc-block-builder = { version = "0.43.0", default-features = false } +# sc-client-api = { version = "38.0.0", default-features = false } +# sc-consensus = { version = "0.47.0", default-features = false } +# sc-consensus-manual-seal = { version = "0.49.0", default-features = false } sc-chain-spec = { version = "41.0.0", default-features = false } sc-client-db = { version = "0.45.0", default-features = false } sc-executor = { version = "0.41.0", default-features = false } @@ -94,35 +93,13 @@ sc-transaction-pool = { version = "38.1.0", default-features = false } sc-transaction-pool-api = { version = "38.1.0", default-features = false } sc-utils = { version = "18.0.0", default-features = false } sp-api = { version = "35.0.0", default-features = false } -sp-application-crypto = { version = "39.0.0", default-features = false } -sp-blockchain = { version = "38.0.0", default-features = false } -sp-block-builder = { version = "35.0.0", default-features = false } -sp-consensus = { version = "0.41.0", default-features = false } -sp-consensus-aura = { version = "0.41.0", default-features = false } -sp-consensus-babe = { version = "0.41.0", default-features = false } -sp-consensus-grandpa = { version = "22.0.0", default-features = false } sp-consensus-randomness-beacon = { path = "./primitives/consensus/randomness-beacon", default-features = false } sp-core = { version = "35.0.0", default-features = false } -sp-crypto-hashing = { version = "0.1.0", default-features = false } -sp-externalities = { version = "0.30.0", default-features = false } -sp-genesis-builder = { version = "0.16.0", default-features = false } sp-inherents = { version = "35.0.0", default-features = false } sp-io = { version = "39.0.0", default-features = false } sp-keyring = { version = "40.0.0", default-features = false } -sp-keystore = { version = "0.34.0", default-features = false } -sp-offchain = { version = "35.0.0", default-features = false } +sp-keystore = { version = "0.41.0", default-features = false } sp-runtime = { version = "40.1.0", default-features = false } -sp-session = { version = "37.0.0", default-features = false } -sp-state-machine = { version = "0.44.0", default-features = false } -sp-tracing = { version = "17.0.1", default-features = false } -sp-trie = { version = "38.0.0", default-features = false } -sp-transaction-pool = { version = "35.0.0", default-features = false } -sp-version = { version = "38.0.0", default-features = false } -substrate-test-client = { path = "./test-utils/client" } # yanked from crates.io -substrate-test-runtime = { path = "./test-utils/runtime" } -substrate-test-runtime-transaction-pool = { path = "./test-utils/runtime/transaction-pool" } # yanked from crates.io -substrate-test-runtime-client = { path = "./test-utils/runtime/client" } # yanked from crates.io -substrate-wasm-builder = { version = "25.0.0", default-features = false } # Arkworks (crypto) sp-ark-bls12-381 = { git = "https://github.com/paritytech/arkworks-substrate", version = "0.4.2", default-features = false } diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index a5591b0..7050510 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -14,21 +14,13 @@ workspace = true [dependencies] codec.workspace = true serde = { workspace = true, features = ["derive"] } +tokio.workspace = true libp2p.workspace = true prost = "0.13.4" -prost-types = "0.13.4" log = { workspace = true } futures.workspace = true scale-info.workspace = true -sc-consensus-manual-seal.workspace = true -sc-client-api.workspace = true sc-utils.workspace = true -sp-api.workspace = true -sp-blockchain.workspace = true -sp-consensus.workspace = true -sp-consensus-randomness-beacon = { workspace = true, default-features = true } -sp-inherents = {workspace = true, default-features = true } -sp-runtime.workspace = true # arkworks dependencies sp-ark-bls12-381 = { workspace = true, optional = true } @@ -40,16 +32,10 @@ prost-build = "0.13.4" [dev-dependencies] async-std = "1.13.0" -futures-timer = "3.0.3" rand = "0.8.5" tokio.workspace = true -substrate-test-runtime-transaction-pool.workspace = true -substrate-test-runtime-client.workspace = true -sc-basic-authorship.workspace = true -sc-consensus.workspace = true -sc-transaction-pool.workspace = true -sc-transaction-pool-api.workspace = true -sp-core = { workspace = true, default-features = true } +# substrate-test-runtime-transaction-pool.workspace = true +# substrate-test-runtime-client.workspace = true [features] diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 0cb927f..6dd5e2e 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -86,14 +86,14 @@ const RAND_LISTEN_ADDR: &str = "/ip4/127.0.0.1/tcp/0"; pub enum Error { /// The signature buffer expects 48 bytes, but more were provided SignatureBufferCapacityExceeded, + /// The message did not follow the expected format + UnexpectedMessageFormat, /// The provided gossipsub behaviour is invalid InvalidGossipsubNetworkBehaviour, - /// The peer could not be dialed. - PeerUnreachable { who: Multiaddr }, + /// The multiaddress is invalid (likely the protocol is not supported) + InvalidMultiaddress { who: Multiaddr }, /// The swarm could not listen on the given port SwarmListenFailure, - /// The swarm could not subscribe to the topic. - GossipsubSubscriptionFailed, } /// A gossipsub network with any behaviour and shared state @@ -123,6 +123,8 @@ impl GossipsubNetwork { let message_authenticity = MessageAuthenticity::Signed(key.clone()); let gossipsub = GossipsubBehaviour::new(message_authenticity, gossipsub_config) .map_err(|_| Error::InvalidGossipsubNetworkBehaviour)?; + // setup a libp2p swarm with tcp transport, using noise protocol for encryption + // and yamux for multiplexing let mut swarm = SwarmBuilder::with_existing_identity(key.clone()) .with_tokio() .with_tcp( @@ -151,13 +153,12 @@ impl GossipsubNetwork { /// * `topic_str`: The gossipsub topic to subscribe to. /// * `peers`: A list of peers to dial. pub async fn run(&mut self, topic_str: &str, peers: Vec) -> Result<(), Error> { - for peer in &peers { - self.swarm - .dial((*peer).clone()) - .map_err(|_| Error::PeerUnreachable { who: (*peer).clone() })?; - } - if !peers.is_empty() { + for peer in &peers { + self.swarm.dial((*peer).clone()).map_err(|_| { + return Error::InvalidMultiaddress { who: (*peer).clone() }; + })?; + } self.wait_for_peers(peers.len()).await; } @@ -184,28 +185,26 @@ impl GossipsubNetwork { /// * `topic_str`: The gossipsub topic to subscribe to. async fn subscribe(&mut self, topic_str: &str) -> Result<(), Error> { let topic = IdentTopic::new(topic_str); - - // let (tx, rx) = tracing_unbounded("drand-pulse-notification-queue", 1000000); - + // *SRLabs: The error can never be encountered + // Q: Can we use an expect, or is this unsafe? + // Ref: https://docs.rs/libpp-gossipsub/0.48.0/src/libp2p_gossipsub/behaviour.rs.html#532 + // The error can only occur if the subscription filter rejects it, but we specify no filter. self.swarm .behaviour_mut() .subscribe(&topic) - .map_err(|_| Error::GossipsubSubscriptionFailed)?; + .expect("The libp2p gossipsub behavior has no subscription filter."); loop { match self.swarm.next().await { - Some(SwarmEvent::Behaviour(gossipsub::Event::Message { - propagation_source, - message_id, - message, - })) => { - // ignore non-decodable messages - if let Ok(pulse) = Pulse::decode(&*message.data) { - let pulse: OpaquePulse = - pulse.try_into().map_err(|_| Error::SignatureBufferCapacityExceeded)?; - self.sender.unbounded_send(pulse.clone()).unwrap(); + Some(SwarmEvent::Behaviour(gossipsub::Event::Message { message, .. })) => { + match try_handle_pulse(&message.data) { + Ok(pulse) => { + self.sender.unbounded_send(pulse.clone()).unwrap(); + }, + Err(_) => { + // handle non-decodable messages: https://github.com/ideal-lab5/idn-sdk/issues/60 + }, } - // handle non-decodable messages: https://github.com/ideal-lab5/idn-sdk/issues/60 }, _ => { // ignore all other events @@ -215,17 +214,76 @@ impl GossipsubNetwork { } } -#[cfg(not(feature = "e2e"))] +pub(crate) fn try_handle_pulse(data: &[u8]) -> Result { + let pulse = Pulse::decode(data).map_err(|_| Error::UnexpectedMessageFormat)?; + let pulse: OpaquePulse = + pulse.try_into().map_err(|_| Error::SignatureBufferCapacityExceeded)?; + + Ok(pulse) +} + #[cfg(test)] mod tests { use super::*; - use libp2p::gossipsub::{ConfigBuilder, ValidationMode}; use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; - use std::sync::Arc; - use tokio::{ - sync::Mutex, - time::{sleep, Duration}, - }; + use tokio::time::{sleep, Duration}; + + #[test] + fn can_convert_valid_data_to_opaque_pulse() { + let pulse = Pulse { + round: 14475418, + signature: [ + 146, 37, 87, 193, 37, 144, 182, 61, 73, 122, 248, 242, 242, 43, 61, 28, 75, 93, 37, + 95, 131, 38, 3, 203, 216, 6, 213, 241, 244, 90, 162, 208, 90, 104, 76, 235, 84, 49, + 223, 95, 22, 186, 113, 163, 202, 195, 230, 117, + ] + .to_vec(), + }; + let opaque: OpaquePulse = pulse.clone().try_into().unwrap(); + let mut data = Vec::new(); + pulse.encode(&mut data).unwrap(); + + let actual_opaque = try_handle_pulse(&data).unwrap(); + assert_eq!(opaque, actual_opaque, "The output should match the input"); + } + + #[test] + fn can_fail_when_data_not_decodable_to_pulse() { + let res = try_handle_pulse(&[1; 32]); + assert!(res.is_err()); + assert_eq!( + res, + Err(Error::UnexpectedMessageFormat), + "There should be an `UnexpectedMessageFormat` error." + ); + } + + #[test] + fn can_fail_when_pulse_signature_exceeds_buffer() { + let pulse = Pulse { + round: 14475418, + signature: [ + 146, 37, 87, 193, 37, 144, 182, 61, 73, 122, 248, 242, 242, 43, 61, 28, 75, 93, 37, + 95, 131, 38, 3, 203, 216, 6, 213, 241, 244, 90, 162, 208, 90, 104, 76, 235, 84, 49, + 223, 95, 22, 186, 113, 163, 202, 195, 230, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ] + .to_vec(), + }; + + let expected_error = Error::SignatureBufferCapacityExceeded; + + let mut data = Vec::new(); + pulse.encode(&mut data).unwrap(); + + let res = try_handle_pulse(&data); + assert!(res.is_err()); + assert_eq!( + res, + Err(expected_error), + "There should be an `SignatureBufferCapacityExceeded` error." + ); + } + // tokio::test fn build_node() -> (GossipsubNetwork, TracingUnboundedReceiver) { let local_identity: Keypair = Keypair::generate_ed25519(); @@ -234,6 +292,19 @@ mod tests { (GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None).unwrap(), rx) } + #[tokio::test] + async fn can_not_build_node_with_invalid_gossipsub_behavior() { + // supply a signing key but set anon validation, an invalid config + let local_identity: Keypair = Keypair::generate_ed25519(); + let gossipsub_config = libp2p::gossipsub::ConfigBuilder::default() + .validation_mode(libp2p::gossipsub::ValidationMode::Anonymous) + .build() + .unwrap(); + let (tx, _rx) = tracing_unbounded("drand-notification-channel", 100000); + let res = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None); + assert!(res.is_err()); + } + #[tokio::test] async fn can_build_new_node() { let (node, _rx) = build_node(); @@ -244,9 +315,10 @@ mod tests { async fn can_build_new_node_with_listen_addr() { let local_identity: Keypair = Keypair::generate_ed25519(); let gossipsub_config = GossipsubConfig::default(); - let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); + let (tx, _rx) = tracing_unbounded("drand-notification-channel", 100000); let listen_addr: Multiaddr = "/ip4/0.0.0.0/tcp/4001".parse().unwrap(); - let node = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&listen_addr)).unwrap(); + let node = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&listen_addr)) + .unwrap(); assert!(node.connected_peers == 0, "There should be no connected peers."); } @@ -268,6 +340,47 @@ mod tests { assert!(!is_err, "There should be no errors."); } + // #[tokio::test] + // async fn can_build_node_and_fail_with_bad_peers() { + // let topic_str = "test"; + // let (mut node, _rx) = build_node(); + + // let bad_addr: Multiaddr = "/dns4/example.com/udp/1234".parse().unwrap(); + // // let fake_listen_addr: Multiaddr = + // Multiaddr::empty().with(libp2p::multiaddr::Protocol::WebRTCDirect); + + // // Spawn the async task and capture the result + // let handle = tokio::spawn(async move { + // node.run(topic_str, vec![bad_addr]).await + // }); + + // sleep(Duration::from_secs(1)).await; + + // // Await the spawned task and assert that it failed + // let result = handle.await.expect("Task panicked"); + // assert!(result.is_err(), "Expected an error but got success."); + // } + + #[tokio::test] + async fn can_build_node_and_fail_with_random_peers() { + let topic_str = "test"; + let (mut node, _rx) = build_node(); + + let fake_peer: Multiaddr = Multiaddr::empty().with_p2p(libp2p::PeerId::random()).unwrap(); + + let mut is_err: bool = false; + + tokio::spawn(async move { + if let Err(_e) = node.run(topic_str, vec![fake_peer]).await { + is_err = true; + } + }); + + sleep(Duration::from_secs(2)).await; + + assert!(!is_err, "There should not be an error."); + } + #[tokio::test] async fn can_fail_when_bad_listen_addr_provided() { let fake_listen_addr: Multiaddr = @@ -277,13 +390,25 @@ mod tests { let local_identity: Keypair = Keypair::generate_ed25519(); let gossipsub_config = GossipsubConfig::default(); - let (tx, rx) = tracing_unbounded("drand-notification-channel", 100000); - let res = GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&fake_listen_addr)); + let (tx, _rx) = tracing_unbounded("drand-notification-channel", 100000); + let res = + GossipsubNetwork::new(&local_identity, gossipsub_config, tx, Some(&fake_listen_addr)); assert!(res.is_err()); assert!(matches!(res, Err(Error::SwarmListenFailure)), "Expected SwarmListenFailure error"); } - #[cfg(feature = "e2e")] + #[tokio::test] + async fn test_gossipsub_network_listen_failure() { + let key = Keypair::generate_ed25519(); + let (tx, _rx) = tracing_unbounded("drand-notification-channel", 100000); + let config = GossipsubConfig::default(); + let invalid_addr: Multiaddr = Multiaddr::empty(); + + let result = GossipsubNetwork::new(&key, config, tx, Some(&invalid_addr)); + assert!(result.is_err(), "Expected failure due to invalid listen address"); + } + + #[cfg(feature = "e2e ")] #[tokio::test] async fn can_subscribe_to_topic_and_deserialize_pulses_when_peers_connected() { let topic_str: &str = @@ -299,8 +424,8 @@ mod tests { .parse() .expect("The string is a well-formatted multiaddress. qed."); - let (mut gossipsub, mut rx) = build_node(); + tokio::spawn(async move { if let Err(e) = gossipsub.run(topic_str, vec![maddr1, maddr2]).await { log::error!("Failed to run gossipsub network: {:?}", e); @@ -312,5 +437,5 @@ mod tests { let p1 = rx.next().await; let p2 = rx.next().await; assert!(p2.unwrap().round == p1.unwrap().round + 1, "rounds should be incremental."); - } + } } diff --git a/client/consensus/randomness-beacon/src/instant_seal.rs b/client/consensus/randomness-beacon/src/instant_seal.rs deleted file mode 100644 index 11b4793..0000000 --- a/client/consensus/randomness-beacon/src/instant_seal.rs +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2025 by Ideal Labs, LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -//! # Inherent-Data Sync based consensus mechanism -//! -//! This consensus mechanism produces blocks whenever it has the necessary data as required by inherent data providers. -//! Specifically, the goal is to author a block whenever there are N new messages in a queue -//! - -use crate::gossipsub::GossipsubNetwork; -use futures::prelude::*; -use futures_timer::Delay; -// use prometheus_endpoint::Registry; -use sc_client_api::{ - backend::{Backend as ClientBackend, Finalizer}, - client::BlockchainEvents, -}; -use sc_consensus::{ - block_import::{BlockImport, BlockImportParams, ForkChoiceStrategy}, - import_queue::{BasicQueue, BoxBlockImport, Verifier}, -}; -use sc_transaction_pool::{BasicPool, FullChainApi, Options, RevalidationType}; -use sc_transaction_pool_api::{MaintainedTransactionPool, TransactionPool, TransactionSource}; -use libp2p::{gossipsub::Config as GossipsubConfig, identity::Keypair}; -use sc_consensus_manual_seal::{ - consensus::ConsensusDataProvider, run_manual_seal, EngineCommand, ManualSealParams, -}; -use sp_api::ProvideRuntimeApi; -use sp_blockchain::HeaderBackend; -use sp_consensus::{Environment, Proposer, SelectChain}; -use sp_core::traits::SpawnNamed; -use sp_inherents::CreateInherentDataProviders; -use sp_runtime::{traits::Block as BlockT, ConsensusEngineId}; -use std::{ - marker::PhantomData, - sync::Arc, - time::Duration, -}; -use tokio::sync::Mutex; - -const LOG_TARGET: &str = "drand-lock-step"; - -// / The `ConsensusEngineId` of Manual Seal. -// pub const MANUAL_SEAL_ENGINE_ID: ConsensusEngineId = [b'm', b'a', b'n', b'l']; - -/// Params required to start the data-sync sealing authorship task. -pub struct ConsensusParams, TP, SC, CIDP, P> { - /// Block import instance for well. importing blocks. - pub block_import: BI, - - /// The environment we are producing blocks for. - pub env: E, - - /// Client instance - pub client: Arc, - - /// Shared reference to the transaction pool. - pub pool: Arc, - - /// SelectChain strategy. - pub select_chain: SC, - - /// Digest provider for inclusion in blocks. - pub consensus_data_provider: Option>>, - - /// Something that can create the inherent data providers. - pub create_inherent_data_providers: CIDP, -} - -/// runs the background authorship task for the randomness-beacon pulse-based seal engine. -/// It creates a new block for every N pulses from a randomness beacon ingested into a queue -pub async fn run( - ConsensusParams { - block_import, - env, - client, - pool, - select_chain, - consensus_data_provider, - create_inherent_data_providers, - }: ConsensusParams, -) where - B: BlockT + 'static, - BI: BlockImport + Send + Sync + 'static, - C: HeaderBackend + Finalizer + ProvideRuntimeApi + 'static, - CB: ClientBackend + 'static, - E: Environment + 'static, - E::Proposer: Proposer, - SC: SelectChain + 'static, - TP: TransactionPool, - CIDP: CreateInherentDataProviders, - P: codec::Encode + Send + Sync + 'static, -{ - // instant-seal creates blocks as soon as transactions are imported - // into the transaction pool. - let commands_stream = pool.import_notification_stream().map(|_| EngineCommand::SealNewBlock { - create_empty: true, - finalize: false, - parent_hash: None, - sender: None, - }); - - run_manual_seal(ManualSealParams { - block_import, - env, - client, - pool, - commands_stream, - select_chain, - consensus_data_provider, - create_inherent_data_providers, - }) - .await -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::types::*; - use futures::{FutureExt, StreamExt}; - use sc_basic_authorship::ProposerFactory; - use sc_consensus::{BlockImportParams, ImportedAux}; - use sc_consensus_manual_seal::{CreatedBlock, Error}; - use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; - use sp_inherents::{InherentData, InherentDataProvider}; - use sp_runtime::generic::{Digest, DigestItem}; - use substrate_test_runtime_client::AccountKeyring::Alice; - use substrate_test_runtime_client::{ - DefaultTestClientBuilderExt, TestClientBuilder, TestClientBuilderExt, - }; - use substrate_test_runtime_transaction_pool::{uxt, TestApi}; - - fn api() -> Arc { - Arc::new(TestApi::empty()) - } - - const SOURCE: TransactionSource = TransactionSource::External; - - struct TestDigestProvider { - _client: Arc, - } - impl ConsensusDataProvider for TestDigestProvider - where - B: BlockT, - C: ProvideRuntimeApi + Send + Sync, - { - type Proof = (); - - fn create_digest( - &self, - _parent: &B::Header, - _inherents: &InherentData, - ) -> Result { - Ok(Digest { logs: vec![] }) - } - - fn append_block_import( - &self, - _parent: &B::Header, - params: &mut BlockImportParams, - _inherents: &InherentData, - _proof: Self::Proof, - ) -> Result<(), Error> { - params.post_digests.push(DigestItem::Other(vec![1])); - Ok(()) - } - } - - async fn run_gossipsub() -> TracingUnboundedReceiver { - let topic_str: &str = - "/drand/pubsub/v0.0.0/52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971"; - - let maddr1: libp2p::Multiaddr = - "/ip4/184.72.27.233/tcp/44544/p2p/12D3KooWBhAkxEn3XE7QanogjGrhyKBMC5GeM3JUTqz54HqS6VHG" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); - - let maddr2: libp2p::Multiaddr = - "/ip4/54.193.191.250/tcp/44544/p2p/12D3KooWQqDi3D3KLfDjWATQUUE4o5aSshwBFi9JM36wqEPMPD5y" - .parse() - .expect("The string is a well-formatted multiaddress. qed."); - - let local_identity: Keypair = Keypair::generate_ed25519(); - - let (tx, rx) = tracing_unbounded("test", 1000000); - - let gossipsub_config = GossipsubConfig::default(); - let mut gossipsub = - GossipsubNetwork::new(&local_identity, gossipsub_config, tx, None).unwrap(); - - tokio::spawn(async move { - if let Err(e) = gossipsub.run(topic_str, vec![maddr1, maddr2]).await { - log::error!("Failed to run gossipsub network: {:?}", e); - } - }); - - rx - } - - #[tokio::test] - async fn instant_seal() { - let builder = TestClientBuilder::new(); - let (client, select_chain) = builder.build_with_longest_chain(); - let client = Arc::new(client); - let spawner = sp_core::testing::TaskExecutor::new(); - let genesis_hash = client.info().genesis_hash; - let pool_api = Arc::new(FullChainApi::new(client.clone(), None, &spawner.clone())); - let pool = Arc::new(BasicPool::with_revalidation_type( - Options::default(), - true.into(), - pool_api, - None, - RevalidationType::Full, - spawner.clone(), - 0, - genesis_hash, - genesis_hash, - )); - - let env = ProposerFactory::new(spawner.clone(), client.clone(), pool.clone(), None, None); - - // so now, let's do it simply whenever we get a new message from drand - // let size = 2; - let mut rx = run_gossipsub().await; - let (sender, receiver) = futures::channel::oneshot::channel(); - let mut sender = Arc::new(Some(sender)); - // build a SealEngine command whenever we encounter a new message - let mut commands_stream = rx.map(move |pulse| { - let mut_sender = Arc::get_mut(&mut sender).unwrap(); - let sender = std::mem::take(mut_sender); - // Note: here we allow create empty to be true - // in practice, this should always be false - // here we allow it to be empty so as to demonstrate that - // the engine is driven by new messages, not txs - EngineCommand::SealNewBlock { - create_empty: true, - finalize: true, - parent_hash: None, - sender, - } - }); - - // spawn the background authorship task - tokio::spawn(run_manual_seal(ManualSealParams { - block_import: client.clone(), - env, - client: client.clone(), - pool: pool.clone(), - commands_stream, - select_chain, - create_inherent_data_providers: |_, _| async { - Ok(()) - }, - consensus_data_provider: None, - })); - - // submit a transaction to pool -> in practice this would be done by adding the inherent - // let result = pool.submit_one(genesis_hash, SOURCE, uxt(Alice, 0)).await; - // assert that it was successfully imported - // assert!(result.is_ok()); - // assert that the background task returns ok - let created_block = receiver.await.unwrap().unwrap(); - assert_eq!( - created_block, - CreatedBlock { - hash: created_block.hash, - aux: ImportedAux { - header_only: false, - clear_justification_requests: false, - needs_justification: false, - bad_justification: false, - is_new_best: true, - }, - proof_size: 0 - } - ); - // assert that there's a new block in the db. - assert!(client.header(created_block.hash).unwrap().is_some()); - assert_eq!(client.header(created_block.hash).unwrap().unwrap().number, 1); - } -} diff --git a/client/consensus/randomness-beacon/src/lib.rs b/client/consensus/randomness-beacon/src/lib.rs index cbf5541..b76c8cf 100644 --- a/client/consensus/randomness-beacon/src/lib.rs +++ b/client/consensus/randomness-beacon/src/lib.rs @@ -17,5 +17,4 @@ extern crate alloc; pub mod gossipsub; -pub mod instant_seal; pub mod types; diff --git a/pallets/randomness-beacon/Cargo.toml b/pallets/randomness-beacon/Cargo.toml index b849694..4ee39c5 100644 --- a/pallets/randomness-beacon/Cargo.toml +++ b/pallets/randomness-beacon/Cargo.toml @@ -40,8 +40,8 @@ timelock = { version = "0.0.1", default-features = false } [dev-dependencies] -sp-keystore = { version = "0.40.0", default-features = false } -sp-inherents = { version = "34.0.0" } +sp-keystore.workspace = true +sp-inherents.workspace = true [features] default = ["std"] diff --git a/primitives/consensus/randomness-beacon/Cargo.toml b/primitives/consensus/randomness-beacon/Cargo.toml index 6afbd9a..b6b66cd 100644 --- a/primitives/consensus/randomness-beacon/Cargo.toml +++ b/primitives/consensus/randomness-beacon/Cargo.toml @@ -16,9 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] async-trait = { optional = true, workspace = true } -codec.workspace = true -scale-info.workspace = true -serde = { workspace = true, features = ["derive"] } sp-inherents.workspace = true @@ -30,11 +27,8 @@ tokio.workspace = true default = ["std"] std = [ "async-trait", - "codec/std", "sp-inherents/std", - "scale-info/std", - "serde/std" ] -# Serde support without relying on std features. -serde = ["scale-info/serde"] +# # Serde support without relying on std features. +# serde = ["scale-info/serde"] diff --git a/primitives/consensus/randomness-beacon/src/inherents.rs b/primitives/consensus/randomness-beacon/src/inherents.rs index 03332b0..34a61ca 100644 --- a/primitives/consensus/randomness-beacon/src/inherents.rs +++ b/primitives/consensus/randomness-beacon/src/inherents.rs @@ -84,4 +84,13 @@ mod tests { let data = inherent_data.get_data::>>(&INHERENT_IDENTIFIER).unwrap().unwrap(); assert_eq!(extra_data, data) } + + #[tokio::test] + pub async fn try_handle_error_returns_none() { + let extra_data = vec![vec![1]]; + let mut inherent_data = InherentData::new(); + let provider = RandInherentDataProvider::new(extra_data.clone()); + let res = provider.try_handle_error(&[1u8; 8], &vec![1]).await; + assert!(res.is_none()); + } } diff --git a/tarpaulin-report.html b/tarpaulin-report.html new file mode 100644 index 0000000..98ac127 --- /dev/null +++ b/tarpaulin-report.html @@ -0,0 +1,671 @@ + + + + + + + +
+ + + + + + \ No newline at end of file diff --git a/tarpaulin.toml b/tarpaulin.toml index a3b33e8..39eda26 100644 --- a/tarpaulin.toml +++ b/tarpaulin.toml @@ -2,4 +2,7 @@ [test_config] # List of file paths to exclude from testing. -exclude-files = ["solochain/*", "pallets/drand/examples/solochain/*"] \ No newline at end of file +exclude-files = [""] + +[report] +out = ["Html"] \ No newline at end of file diff --git a/test-utils/client/Cargo.toml b/test-utils/client/Cargo.toml deleted file mode 100644 index ebd1eab..0000000 --- a/test-utils/client/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "substrate-test-client" -description = "Client testing utilities" -version = "2.0.1" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true -publish = false - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -array-bytes = { workspace = true, default-features = true } -async-trait = { workspace = true } -codec = { workspace = true, default-features = true } -futures = { workspace = true } -serde = { workspace = true, default-features = true } -serde_json = { workspace = true, default-features = true } -sc-client-api = { workspace = true, default-features = true } -sc-client-db = { features = [ - "test-helpers", -], workspace = true } -sc-consensus = { workspace = true, default-features = true } -sc-executor = { workspace = true, default-features = true } -sc-offchain = { workspace = true, default-features = true } -sc-service = { features = [ - "test-helpers", -], workspace = true } -sp-blockchain = { workspace = true, default-features = true } -sp-consensus = { workspace = true, default-features = true } -sp-core = { workspace = true, default-features = true } -sp-keyring = { workspace = true, default-features = true } -sp-keystore = { workspace = true, default-features = true } -sp-runtime = { workspace = true, default-features = true } -sp-state-machine = { workspace = true, default-features = true } -tokio = { features = ["sync"], workspace = true, default-features = true } diff --git a/test-utils/client/src/client_ext.rs b/test-utils/client/src/client_ext.rs deleted file mode 100644 index a4f91f2..0000000 --- a/test-utils/client/src/client_ext.rs +++ /dev/null @@ -1,206 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client extension for tests. - -use sc_client_api::{backend::Finalizer, client::BlockBackend}; -use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy}; -use sc_service::client::Client; -use sp_consensus::Error as ConsensusError; -use sp_runtime::{traits::Block as BlockT, Justification, Justifications}; - -pub use sp_consensus::BlockOrigin; - -/// Extension trait for a test client. -pub trait ClientExt: Sized { - /// Finalize a block. - fn finalize_block( - &self, - hash: Block::Hash, - justification: Option, - ) -> sp_blockchain::Result<()>; - - /// Returns hash of the genesis block. - fn genesis_hash(&self) -> ::Hash; -} - -/// Extension trait for a test client around block importing. -#[async_trait::async_trait] -pub trait ClientBlockImportExt: Sized { - /// Import block to the chain. No finality. - async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError>; - - /// Import a block and make it our best block if possible. - async fn import_as_best(&self, origin: BlockOrigin, block: Block) - -> Result<(), ConsensusError>; - - /// Import a block and finalize it. - async fn import_as_final( - &self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError>; - - /// Import block with justification(s), finalizes block. - async fn import_justified( - &self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError>; -} - -impl ClientExt for Client -where - B: sc_client_api::backend::Backend, - E: sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + 'static, - Self: BlockImport, - Block: BlockT, -{ - fn finalize_block( - &self, - hash: Block::Hash, - justification: Option, - ) -> sp_blockchain::Result<()> { - Finalizer::finalize_block(self, hash, justification, true) - } - - fn genesis_hash(&self) -> ::Hash { - self.block_hash(0u32.into()).unwrap().unwrap() - } -} - -/// This implementation is required, because of the weird api requirements around `BlockImport`. -#[async_trait::async_trait] -impl ClientBlockImportExt for std::sync::Arc -where - for<'r> &'r T: BlockImport, - T: Send + Sync, -{ - async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_best( - &self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_final( - &self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_justified( - &self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.justifications = Some(justifications); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } -} - -#[async_trait::async_trait] -impl ClientBlockImportExt for Client -where - Self: BlockImport, - RA: Send + Sync, - B: Send + Sync, - E: Send + Sync, -{ - async fn import(&self, origin: BlockOrigin, block: Block) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_best( - &self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_as_final( - &self, - origin: BlockOrigin, - block: Block, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::Custom(true)); - - BlockImport::import_block(self, import).await.map(|_| ()) - } - - async fn import_justified( - &self, - origin: BlockOrigin, - block: Block, - justifications: Justifications, - ) -> Result<(), ConsensusError> { - let (header, extrinsics) = block.deconstruct(); - let mut import = BlockImportParams::new(origin, header); - import.justifications = Some(justifications); - import.body = Some(extrinsics); - import.finalized = true; - import.fork_choice = Some(ForkChoiceStrategy::LongestChain); - - BlockImport::import_block(self, import).await.map(|_| ()) - } -} diff --git a/test-utils/client/src/lib.rs b/test-utils/client/src/lib.rs deleted file mode 100644 index c076406..0000000 --- a/test-utils/client/src/lib.rs +++ /dev/null @@ -1,450 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client testing utilities. - -#![warn(missing_docs)] - -pub mod client_ext; - -pub use self::client_ext::{BlockOrigin, ClientBlockImportExt, ClientExt}; -pub use sc_client_api::{execution_extensions::ExecutionExtensions, BadBlocks, ForkBlocks}; -pub use sc_client_db::{self, Backend, BlocksPruning}; -pub use sc_executor::{self, WasmExecutionMethod, WasmExecutor}; -pub use sc_service::{client, RpcHandlers}; -pub use sp_consensus; -pub use sp_keyring::{ - ed25519::Keyring as Ed25519Keyring, sr25519::Keyring as Sr25519Keyring, AccountKeyring, -}; -pub use sp_keystore::{Keystore, KeystorePtr}; -pub use sp_runtime::{Storage, StorageChild}; - -use futures::{future::Future, stream::StreamExt}; -use sc_client_api::BlockchainEvents; -use sc_service::client::{ClientConfig, LocalCallExecutor}; -use serde::Deserialize; -use sp_core::{storage::ChildInfo, testing::TaskExecutor}; -use sp_runtime::{ - codec::Encode, - traits::{Block as BlockT, Header}, - OpaqueExtrinsic, -}; -use std::{ - collections::{HashMap, HashSet}, - pin::Pin, - sync::Arc, -}; - -/// A genesis storage initialization trait. -pub trait GenesisInit: Default { - /// Construct genesis storage. - fn genesis_storage(&self) -> Storage; -} - -impl GenesisInit for () { - fn genesis_storage(&self) -> Storage { - Default::default() - } -} - -/// A builder for creating a test client instance. -pub struct TestClientBuilder { - genesis_init: G, - /// The key is an unprefixed storage key, this only contains - /// default child trie content. - child_storage_extension: HashMap, StorageChild>, - backend: Arc, - _executor: std::marker::PhantomData, - fork_blocks: ForkBlocks, - bad_blocks: BadBlocks, - enable_offchain_indexing_api: bool, - enable_import_proof_recording: bool, - no_genesis: bool, -} - -impl Default - for TestClientBuilder, G> -{ - fn default() -> Self { - Self::with_default_backend() - } -} - -impl - TestClientBuilder, G> -{ - /// Create new `TestClientBuilder` with default backend. - pub fn with_default_backend() -> Self { - let backend = Arc::new(Backend::new_test(std::u32::MAX, std::u64::MAX)); - Self::with_backend(backend) - } - - /// Create new `TestClientBuilder` with default backend and pruning window size - pub fn with_pruning_window(blocks_pruning: u32) -> Self { - let backend = Arc::new(Backend::new_test(blocks_pruning, 0)); - Self::with_backend(backend) - } - - /// Create new `TestClientBuilder` with default backend and storage chain mode - pub fn with_tx_storage(blocks_pruning: u32) -> Self { - let backend = - Arc::new(Backend::new_test_with_tx_storage(BlocksPruning::Some(blocks_pruning), 0)); - Self::with_backend(backend) - } -} - -impl - TestClientBuilder -{ - /// Create a new instance of the test client builder. - pub fn with_backend(backend: Arc) -> Self { - TestClientBuilder { - backend, - child_storage_extension: Default::default(), - genesis_init: Default::default(), - _executor: Default::default(), - fork_blocks: None, - bad_blocks: None, - enable_offchain_indexing_api: false, - no_genesis: false, - enable_import_proof_recording: false, - } - } - - /// Alter the genesis storage parameters. - pub fn genesis_init_mut(&mut self) -> &mut G { - &mut self.genesis_init - } - - /// Give access to the underlying backend of these clients - pub fn backend(&self) -> Arc { - self.backend.clone() - } - - /// Extend child storage - pub fn add_child_storage( - mut self, - child_info: &ChildInfo, - key: impl AsRef<[u8]>, - value: impl AsRef<[u8]>, - ) -> Self { - let storage_key = child_info.storage_key(); - let entry = self.child_storage_extension.entry(storage_key.to_vec()).or_insert_with(|| { - StorageChild { data: Default::default(), child_info: child_info.clone() } - }); - entry.data.insert(key.as_ref().to_vec(), value.as_ref().to_vec()); - self - } - - /// Sets custom block rules. - pub fn set_block_rules( - mut self, - fork_blocks: ForkBlocks, - bad_blocks: BadBlocks, - ) -> Self { - self.fork_blocks = fork_blocks; - self.bad_blocks = bad_blocks; - self - } - - /// Enable the offchain indexing api. - pub fn enable_offchain_indexing_api(mut self) -> Self { - self.enable_offchain_indexing_api = true; - self - } - - /// Enable proof recording on import. - pub fn enable_import_proof_recording(mut self) -> Self { - self.enable_import_proof_recording = true; - self - } - - /// Disable writing genesis. - pub fn set_no_genesis(mut self) -> Self { - self.no_genesis = true; - self - } - - /// Build the test client with the given native executor. - pub fn build_with_executor( - self, - executor: ExecutorDispatch, - ) -> ( - client::Client, - sc_consensus::LongestChain, - ) - where - ExecutorDispatch: - sc_client_api::CallExecutor + sc_executor::RuntimeVersionOf + Clone + 'static, - Backend: sc_client_api::backend::Backend, - >::OffchainStorage: 'static, - { - let storage = { - let mut storage = self.genesis_init.genesis_storage(); - // Add some child storage keys. - for (key, child_content) in self.child_storage_extension { - storage.children_default.insert( - key, - StorageChild { - data: child_content.data.into_iter().collect(), - child_info: child_content.child_info, - }, - ); - } - - storage - }; - - let client_config = ClientConfig { - enable_import_proof_recording: self.enable_import_proof_recording, - offchain_indexing_api: self.enable_offchain_indexing_api, - no_genesis: self.no_genesis, - ..Default::default() - }; - - let genesis_block_builder = sc_service::GenesisBlockBuilder::new( - &storage, - !client_config.no_genesis, - self.backend.clone(), - executor.clone(), - ) - .expect("Creates genesis block builder"); - - let spawn_handle = Box::new(TaskExecutor::new()); - - let client = client::Client::new( - self.backend.clone(), - executor, - spawn_handle, - genesis_block_builder, - self.fork_blocks, - self.bad_blocks, - None, - None, - client_config, - ) - .expect("Creates new client"); - - let longest_chain = sc_consensus::LongestChain::new(self.backend); - - (client, longest_chain) - } -} - -impl - TestClientBuilder>, Backend, G> -{ - /// Build the test client with the given native executor. - pub fn build_with_native_executor( - self, - executor: I, - ) -> ( - client::Client< - Backend, - client::LocalCallExecutor>, - Block, - RuntimeApi, - >, - sc_consensus::LongestChain, - ) - where - I: Into>>, - Backend: sc_client_api::backend::Backend + 'static, - H: sc_executor::HostFunctions, - { - let executor = executor.into().unwrap_or_else(|| WasmExecutor::::builder().build()); - let executor = LocalCallExecutor::new( - self.backend.clone(), - executor.clone(), - Default::default(), - ExecutionExtensions::new(None, Arc::new(executor)), - ) - .expect("Creates LocalCallExecutor"); - - self.build_with_executor(executor) - } -} - -/// The output of an RPC transaction. -pub struct RpcTransactionOutput { - /// The output string of the transaction if any. - pub result: String, - /// An async receiver if data will be returned via a callback. - pub receiver: tokio::sync::mpsc::Receiver, -} - -impl std::fmt::Debug for RpcTransactionOutput { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!(f, "RpcTransactionOutput {{ result: {:?}, receiver }}", self.result) - } -} - -/// An error for when the RPC call fails. -#[derive(Deserialize, Debug)] -pub struct RpcTransactionError { - /// A Number that indicates the error type that occurred. - pub code: i64, - /// A String providing a short description of the error. - pub message: String, - /// A Primitive or Structured value that contains additional information about the error. - pub data: Option, -} - -impl std::fmt::Display for RpcTransactionError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - std::fmt::Debug::fmt(self, f) - } -} - -/// An extension trait for `RpcHandlers`. -#[async_trait::async_trait] -pub trait RpcHandlersExt { - /// Send a transaction through the RpcHandlers. - async fn send_transaction( - &self, - extrinsic: OpaqueExtrinsic, - ) -> Result; -} - -#[async_trait::async_trait] -impl RpcHandlersExt for RpcHandlers { - async fn send_transaction( - &self, - extrinsic: OpaqueExtrinsic, - ) -> Result { - let (result, rx) = self - .rpc_query(&format!( - r#"{{ - "jsonrpc": "2.0", - "method": "author_submitExtrinsic", - "params": ["0x{}"], - "id": 0 - }}"#, - array_bytes::bytes2hex("", &extrinsic.encode()) - )) - .await - .expect("valid JSON-RPC request object; qed"); - parse_rpc_result(result, rx) - } -} - -pub(crate) fn parse_rpc_result( - result: String, - receiver: tokio::sync::mpsc::Receiver, -) -> Result { - let json: serde_json::Value = - serde_json::from_str(&result).expect("the result can only be a JSONRPC string; qed"); - let error = json.as_object().expect("JSON result is always an object; qed").get("error"); - - if let Some(error) = error { - return Err(serde_json::from_value(error.clone()) - .expect("the JSONRPC result's error is always valid; qed")) - } - - Ok(RpcTransactionOutput { result, receiver }) -} - -/// An extension trait for `BlockchainEvents`. -pub trait BlockchainEventsExt -where - C: BlockchainEvents, - B: BlockT, -{ - /// Wait for `count` blocks to be imported in the node and then exit. This function will not - /// return if no blocks are ever created, thus you should restrict the maximum amount of time of - /// the test execution. - fn wait_for_blocks(&self, count: usize) -> Pin + Send>>; -} - -impl BlockchainEventsExt for C -where - C: BlockchainEvents, - B: BlockT, -{ - fn wait_for_blocks(&self, count: usize) -> Pin + Send>> { - assert!(count > 0, "'count' argument must be greater than 0"); - - let mut import_notification_stream = self.import_notification_stream(); - let mut blocks = HashSet::new(); - - Box::pin(async move { - while let Some(notification) = import_notification_stream.next().await { - if notification.is_new_best { - blocks.insert(*notification.header.number()); - if blocks.len() == count { - break - } - } - } - }) - } -} - -#[cfg(test)] -mod tests { - #[test] - fn parses_error_properly() { - let (_, rx) = tokio::sync::mpsc::channel(1); - assert!(super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "result": 19, - "id": 1 - }"# - .to_string(), - rx - ) - .is_ok()); - - let (_, rx) = tokio::sync::mpsc::channel(1); - let error = super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "error": { - "code": -32601, - "message": "Method not found" - }, - "id": 1 - }"# - .to_string(), - rx, - ) - .unwrap_err(); - assert_eq!(error.code, -32601); - assert_eq!(error.message, "Method not found"); - assert!(error.data.is_none()); - - let (_, rx) = tokio::sync::mpsc::channel(1); - let error = super::parse_rpc_result( - r#"{ - "jsonrpc": "2.0", - "error": { - "code": -32601, - "message": "Method not found", - "data": 42 - }, - "id": 1 - }"# - .to_string(), - rx, - ) - .unwrap_err(); - assert_eq!(error.code, -32601); - assert_eq!(error.message, "Method not found"); - assert!(error.data.is_some()); - } -} diff --git a/test-utils/runtime/Cargo.toml b/test-utils/runtime/Cargo.toml deleted file mode 100644 index 1c82c73..0000000 --- a/test-utils/runtime/Cargo.toml +++ /dev/null @@ -1,120 +0,0 @@ -[package] -name = "substrate-test-runtime" -version = "2.0.0" -authors.workspace = true -edition.workspace = true -build = "build.rs" -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true -publish = false - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -sp-application-crypto = { features = ["serde"], workspace = true } -sp-consensus-aura = { features = ["serde"], workspace = true } -sp-consensus-babe = { features = ["serde"], workspace = true } -sp-genesis-builder = { workspace = true } -sp-block-builder = { workspace = true } -codec = { features = ["derive"], workspace = true } -scale-info = { features = ["derive"], workspace = true } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true } -sp-offchain = { workspace = true } -sp-core = { features = ["serde"], workspace = true } -sp-crypto-hashing = { workspace = true } -sp-io = { workspace = true } -frame-support = { workspace = true } -sp-version = { workspace = true } -sp-session = { workspace = true } -sp-api = { workspace = true } -sp-runtime = { features = ["serde"], workspace = true } -pallet-babe = { workspace = true } -pallet-balances = { workspace = true } -frame-executive = { workspace = true } -frame-metadata-hash-extension = { workspace = true } -frame-system = { workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -pallet-timestamp = { workspace = true } -sp-consensus-grandpa = { features = ["serde"], workspace = true } -sp-trie = { workspace = true } -sp-transaction-pool = { workspace = true } -trie-db = { workspace = true } -sc-service = { features = ["test-helpers"], optional = true, workspace = true } -sp-state-machine = { workspace = true } -sp-externalities = { workspace = true } - -# 3rd party -array-bytes = { optional = true, workspace = true, default-features = true } -serde_json = { workspace = true, features = ["alloc"] } -log = { workspace = true } -tracing = { workspace = true, default-features = false } - -[dev-dependencies] -futures = { workspace = true } -sc-block-builder = { workspace = true, default-features = true } -sc-chain-spec = { workspace = true, default-features = true } -sc-executor = { workspace = true, default-features = true } -sc-executor-common = { workspace = true, default-features = true } -sp-consensus = { workspace = true, default-features = true } -substrate-test-runtime-client = { workspace = true } -sp-tracing = { workspace = true, default-features = true } -serde = { features = ["alloc", "derive"], workspace = true } -serde_json = { features = ["alloc"], workspace = true } - -[build-dependencies] -substrate-wasm-builder = { optional = true, features = ["metadata-hash"], workspace = true, default-features = true } - -[features] -default = ["std"] - -std = [ - "array-bytes", - "codec/std", - "frame-executive/std", - "frame-metadata-hash-extension/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "log/std", - "pallet-babe/std", - "pallet-balances/std", - "pallet-timestamp/std", - "sc-executor/std", - "sc-service", - "scale-info/std", - "serde/std", - "serde_json/std", - "sp-api/std", - "sp-application-crypto/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-consensus-babe/std", - "sp-consensus-grandpa/std", - "sp-core/std", - "sp-crypto-hashing/std", - "sp-externalities/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-io/std", - "sp-keyring/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-state-machine/std", - "sp-tracing/std", - "sp-transaction-pool/std", - "sp-trie/std", - "sp-version/std", - "substrate-wasm-builder", - "tracing/std", - "trie-db/std", -] - -# Special feature to disable logging -disable-logging = ["sp-api/disable-logging"] diff --git a/test-utils/runtime/build.rs b/test-utils/runtime/build.rs deleted file mode 100644 index d38173f..0000000 --- a/test-utils/runtime/build.rs +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -fn main() { - #[cfg(feature = "std")] - { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - // Note that we set the stack-size to 1MB explicitly even though it is set - // to this value by default. This is because some of our tests - // (`restoration_of_globals`) depend on the stack-size. - .append_to_rust_flags("-Clink-arg=-zstack-size=1048576") - .enable_metadata_hash("TOKEN", 10) - .import_memory() - .build(); - } - - #[cfg(feature = "std")] - { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .set_file_name("wasm_binary_logging_disabled.rs") - .enable_feature("disable-logging") - .build(); - } -} diff --git a/test-utils/runtime/client/Cargo.toml b/test-utils/runtime/client/Cargo.toml deleted file mode 100644 index 5dd3c30..0000000 --- a/test-utils/runtime/client/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "substrate-test-runtime-client" -version = "2.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true -publish = false - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -futures = { workspace = true } -sc-block-builder = { workspace = true, default-features = true } -sc-client-api = { workspace = true, default-features = true } -sc-consensus = { workspace = true, default-features = true } -sp-api = { workspace = true, default-features = true } -sp-blockchain = { workspace = true, default-features = true } -sp-consensus = { workspace = true, default-features = true } -sp-core = { workspace = true, default-features = true } -sp-runtime = { workspace = true, default-features = true } -substrate-test-client = { workspace = true } -substrate-test-runtime = { workspace = true } diff --git a/test-utils/runtime/client/src/block_builder_ext.rs b/test-utils/runtime/client/src/block_builder_ext.rs deleted file mode 100644 index f7bf76b..0000000 --- a/test-utils/runtime/client/src/block_builder_ext.rs +++ /dev/null @@ -1,74 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Block Builder extensions for tests. - -use sc_block_builder::BlockBuilderApi; -use sp_api::{ApiExt, ProvideRuntimeApi}; -use substrate_test_runtime::*; - -/// Extension trait for test block builder. -pub trait BlockBuilderExt { - /// Add transfer extrinsic to the block. - fn push_transfer( - &mut self, - transfer: substrate_test_runtime::Transfer, - ) -> Result<(), sp_blockchain::Error>; - - /// Add unsigned storage change extrinsic to the block. - fn push_storage_change( - &mut self, - key: Vec, - value: Option>, - ) -> Result<(), sp_blockchain::Error>; - - /// Adds an extrinsic which pushes DigestItem to header's log - fn push_deposit_log_digest_item( - &mut self, - log: sp_runtime::generic::DigestItem, - ) -> Result<(), sp_blockchain::Error>; -} - -impl<'a, A> BlockBuilderExt for sc_block_builder::BlockBuilder<'a, substrate_test_runtime::Block, A> -where - A: ProvideRuntimeApi - + sp_api::CallApiAt - + 'a, - A::Api: BlockBuilderApi + ApiExt, -{ - fn push_transfer( - &mut self, - transfer: substrate_test_runtime::Transfer, - ) -> Result<(), sp_blockchain::Error> { - self.push(transfer.into_unchecked_extrinsic()) - } - - fn push_storage_change( - &mut self, - key: Vec, - value: Option>, - ) -> Result<(), sp_blockchain::Error> { - self.push(ExtrinsicBuilder::new_storage_change(key, value).build()) - } - - fn push_deposit_log_digest_item( - &mut self, - log: sp_runtime::generic::DigestItem, - ) -> Result<(), sp_blockchain::Error> { - self.push(ExtrinsicBuilder::new_deposit_log_digest_item(log).build()) - } -} diff --git a/test-utils/runtime/client/src/lib.rs b/test-utils/runtime/client/src/lib.rs deleted file mode 100644 index 435f3f5..0000000 --- a/test-utils/runtime/client/src/lib.rs +++ /dev/null @@ -1,214 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Client testing utilities. - -#![warn(missing_docs)] - -pub mod trait_tests; - -mod block_builder_ext; - -pub use sc_consensus::LongestChain; -use std::sync::Arc; -pub use substrate_test_client::*; -pub use substrate_test_runtime as runtime; - -pub use self::block_builder_ext::BlockBuilderExt; - -use sp_core::storage::ChildInfo; -use substrate_test_runtime::genesismap::GenesisStorageBuilder; - -/// A prelude to import in tests. -pub mod prelude { - // Trait extensions - pub use super::{ - BlockBuilderExt, ClientBlockImportExt, ClientExt, DefaultTestClientBuilderExt, - TestClientBuilderExt, - }; - // Client structs - pub use super::{ - Backend, ExecutorDispatch, TestClient, TestClientBuilder, WasmExecutionMethod, - }; - // Keyring - pub use super::{AccountKeyring, Sr25519Keyring}; -} - -/// Test client database backend. -pub type Backend = substrate_test_client::Backend; - -/// Test client executor. -pub type ExecutorDispatch = - client::LocalCallExecutor; - -/// Parameters of test-client builder with test-runtime. -#[derive(Default)] -pub struct GenesisParameters { - heap_pages_override: Option, - extra_storage: Storage, - wasm_code: Option>, -} - -impl GenesisParameters { - /// Set the wasm code that should be used at genesis. - pub fn set_wasm_code(&mut self, code: Vec) { - self.wasm_code = Some(code); - } - - /// Access extra genesis storage. - pub fn extra_storage(&mut self) -> &mut Storage { - &mut self.extra_storage - } -} - -impl GenesisInit for GenesisParameters { - fn genesis_storage(&self) -> Storage { - GenesisStorageBuilder::default() - .with_heap_pages(self.heap_pages_override) - .with_wasm_code(&self.wasm_code) - .with_extra_storage(self.extra_storage.clone()) - .build() - } -} - -/// A `TestClient` with `test-runtime` builder. -pub type TestClientBuilder = substrate_test_client::TestClientBuilder< - substrate_test_runtime::Block, - E, - B, - GenesisParameters, ->; - -/// Test client type with `WasmExecutor` and generic Backend. -pub type Client = client::Client< - B, - client::LocalCallExecutor, - substrate_test_runtime::Block, - substrate_test_runtime::RuntimeApi, ->; - -/// A test client with default backend. -pub type TestClient = Client; - -/// A `TestClientBuilder` with default backend and executor. -pub trait DefaultTestClientBuilderExt: Sized { - /// Create new `TestClientBuilder` - fn new() -> Self; -} - -impl DefaultTestClientBuilderExt for TestClientBuilder { - fn new() -> Self { - Self::with_default_backend() - } -} - -/// A `test-runtime` extensions to `TestClientBuilder`. -pub trait TestClientBuilderExt: Sized { - /// Returns a mutable reference to the genesis parameters. - fn genesis_init_mut(&mut self) -> &mut GenesisParameters; - - /// Override the default value for Wasm heap pages. - fn set_heap_pages(mut self, heap_pages: u64) -> Self { - self.genesis_init_mut().heap_pages_override = Some(heap_pages); - self - } - - /// Add an extra value into the genesis storage. - /// - /// # Panics - /// - /// Panics if the key is empty. - fn add_extra_child_storage>, V: Into>>( - mut self, - child_info: &ChildInfo, - key: K, - value: V, - ) -> Self { - let storage_key = child_info.storage_key().to_vec(); - let key = key.into(); - assert!(!storage_key.is_empty()); - assert!(!key.is_empty()); - self.genesis_init_mut() - .extra_storage - .children_default - .entry(storage_key) - .or_insert_with(|| StorageChild { - data: Default::default(), - child_info: child_info.clone(), - }) - .data - .insert(key, value.into()); - self - } - - /// Add an extra child value into the genesis storage. - /// - /// # Panics - /// - /// Panics if the key is empty. - fn add_extra_storage>, V: Into>>(mut self, key: K, value: V) -> Self { - let key = key.into(); - assert!(!key.is_empty()); - self.genesis_init_mut().extra_storage.top.insert(key, value.into()); - self - } - - /// Build the test client. - fn build(self) -> Client { - self.build_with_longest_chain().0 - } - - /// Build the test client and longest chain selector. - fn build_with_longest_chain( - self, - ) -> (Client, sc_consensus::LongestChain); - - /// Build the test client and the backend. - fn build_with_backend(self) -> (Client, Arc); -} - -impl TestClientBuilderExt - for TestClientBuilder, B> -where - B: sc_client_api::backend::Backend + 'static, -{ - fn genesis_init_mut(&mut self) -> &mut GenesisParameters { - Self::genesis_init_mut(self) - } - - fn build_with_longest_chain( - self, - ) -> (Client, sc_consensus::LongestChain) { - self.build_with_native_executor(None) - } - - fn build_with_backend(self) -> (Client, Arc) { - let backend = self.backend(); - (self.build_with_native_executor(None).0, backend) - } -} - -/// Creates new client instance used for tests. -pub fn new() -> Client { - TestClientBuilder::new().build() -} - -/// Create a new native executor. -#[deprecated(note = "Switch to `WasmExecutor:default()`.")] -pub fn new_native_or_wasm_executor() -> WasmExecutor { - WasmExecutor::default() -} diff --git a/test-utils/runtime/client/src/trait_tests.rs b/test-utils/runtime/client/src/trait_tests.rs deleted file mode 100644 index c3a5f17..0000000 --- a/test-utils/runtime/client/src/trait_tests.rs +++ /dev/null @@ -1,546 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! tests that should hold for all implementations of certain traits. -//! to test implementations without duplication. - -#![allow(missing_docs)] - -use std::sync::Arc; - -use crate::{ - AccountKeyring, BlockBuilderExt, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt, -}; -use futures::executor::block_on; -use sc_block_builder::BlockBuilderBuilder; -use sc_client_api::{ - backend, - blockchain::{Backend as BlockChainBackendT, HeaderBackend}, -}; -use sp_consensus::BlockOrigin; -use sp_runtime::traits::Block as BlockT; -use substrate_test_runtime::Transfer; - -/// helper to test the `leaves` implementation for various backends -pub fn test_leaves_for_backend(backend: Arc) -where - B: backend::Backend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - - let client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - - let genesis_hash = client.chain_info().genesis_hash; - - assert_eq!(blockchain.leaves().unwrap(), vec![genesis_hash]); - - // G -> A1 - let a1 = BlockBuilderBuilder::new(&client) - .on_parent_block(genesis_hash) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a1.hash()]); - - // A1 -> A2 - let a2 = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - assert_eq!(blockchain.leaves().unwrap(), vec![a2.hash()]); - - // A2 -> A3 - let a3 = BlockBuilderBuilder::new(&client) - .on_parent_block(a2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - assert_eq!(blockchain.leaves().unwrap(), vec![a3.hash()]); - - // A3 -> A4 - let a4 = BlockBuilderBuilder::new(&client) - .on_parent_block(a3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a4.hash()]); - - // A4 -> A5 - let a5 = BlockBuilderBuilder::new(&client) - .on_parent_block(a4.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash()]); - - // A1 -> B2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b2.hash()]); - - // B2 -> B3 - let b3 = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b3.hash()]); - - // B3 -> B4 - let b4 = BlockBuilderBuilder::new(&client) - .on_parent_block(b3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash()]); - - // // B2 -> C3 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash()]); - - // A1 -> D2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); - assert_eq!(blockchain.leaves().unwrap(), vec![a5.hash(), b4.hash(), c3.hash(), d2.hash()]); -} - -/// helper to test the `children` implementation for various backends -pub fn test_children_for_backend(backend: Arc) -where - B: backend::LocalBackend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - - let client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - let genesis_hash = client.chain_info().genesis_hash; - - // G -> A1 - let a1 = BlockBuilderBuilder::new(&client) - .on_parent_block(genesis_hash) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - - // A1 -> A2 - let a2 = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - // A2 -> A3 - let a3 = BlockBuilderBuilder::new(&client) - .on_parent_block(a2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - // A3 -> A4 - let a4 = BlockBuilderBuilder::new(&client) - .on_parent_block(a3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - - // A4 -> A5 - let a5 = BlockBuilderBuilder::new(&client) - .on_parent_block(a4.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - - // A1 -> B2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - - // B2 -> B3 - let b3 = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - - // B3 -> B4 - let b4 = BlockBuilderBuilder::new(&client) - .on_parent_block(b3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4)).unwrap(); - - // // B2 -> C3 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3.clone())).unwrap(); - - // A1 -> D2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2.clone())).unwrap(); - - let genesis_hash = client.chain_info().genesis_hash; - - let children1 = blockchain.children(a4.hash()).unwrap(); - assert_eq!(vec![a5.hash()], children1); - - let children2 = blockchain.children(a1.hash()).unwrap(); - assert_eq!(vec![a2.hash(), b2.hash(), d2.hash()], children2); - - let children3 = blockchain.children(genesis_hash).unwrap(); - assert_eq!(vec![a1.hash()], children3); - - let children4 = blockchain.children(b2.hash()).unwrap(); - assert_eq!(vec![b3.hash(), c3.hash()], children4); -} - -pub fn test_blockchain_query_by_number_gets_canonical(backend: Arc) -where - B: backend::LocalBackend, -{ - // block tree: - // G -> A1 -> A2 -> A3 -> A4 -> A5 - // A1 -> B2 -> B3 -> B4 - // B2 -> C3 - // A1 -> D2 - let client = TestClientBuilder::with_backend(backend.clone()).build(); - let blockchain = backend.blockchain(); - let genesis_hash = client.chain_info().genesis_hash; - - // G -> A1 - let a1 = BlockBuilderBuilder::new(&client) - .on_parent_block(genesis_hash) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a1.clone())).unwrap(); - - // A1 -> A2 - let a2 = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a2.clone())).unwrap(); - - // A2 -> A3 - let a3 = BlockBuilderBuilder::new(&client) - .on_parent_block(a2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a3.clone())).unwrap(); - - // A3 -> A4 - let a4 = BlockBuilderBuilder::new(&client) - .on_parent_block(a3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a4.clone())).unwrap(); - - // A4 -> A5 - let a5 = BlockBuilderBuilder::new(&client) - .on_parent_block(a4.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, a5.clone())).unwrap(); - - // A1 -> B2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise B2 has the same hash as A2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 41, - nonce: 0, - }) - .unwrap(); - let b2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, b2.clone())).unwrap(); - - // B2 -> B3 - let b3 = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b3.clone())).unwrap(); - - // B3 -> B4 - let b4 = BlockBuilderBuilder::new(&client) - .on_parent_block(b3.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap() - .build() - .unwrap() - .block; - block_on(client.import(BlockOrigin::Own, b4)).unwrap(); - - // // B2 -> C3 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(b2.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise C3 has the same hash as B3 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 1, - }) - .unwrap(); - let c3 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, c3)).unwrap(); - - // A1 -> D2 - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(a1.hash()) - .fetch_parent_block_number(&client) - .unwrap() - .build() - .unwrap(); - // this push is required as otherwise D2 has the same hash as B2 and won't get imported - builder - .push_transfer(Transfer { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Ferdie.into(), - amount: 1, - nonce: 0, - }) - .unwrap(); - let d2 = builder.build().unwrap().block; - block_on(client.import(BlockOrigin::Own, d2)).unwrap(); - - let genesis_hash = client.chain_info().genesis_hash; - - assert_eq!(blockchain.hash(0).unwrap().unwrap(), genesis_hash); - assert_eq!(blockchain.hash(1).unwrap().unwrap(), a1.hash()); - assert_eq!(blockchain.hash(2).unwrap().unwrap(), a2.hash()); - assert_eq!(blockchain.hash(3).unwrap().unwrap(), a3.hash()); - assert_eq!(blockchain.hash(4).unwrap().unwrap(), a4.hash()); - assert_eq!(blockchain.hash(5).unwrap().unwrap(), a5.hash()); -} diff --git a/test-utils/runtime/res/README.md b/test-utils/runtime/res/README.md deleted file mode 100644 index fdf94fd..0000000 --- a/test-utils/runtime/res/README.md +++ /dev/null @@ -1,24 +0,0 @@ -`default_genesis_config.json` file has been generated by the following code: -``` - use crate::genesismap::GenesisStorageBuilder; - #[test] - fn write_default_config_to_tmp_file() { - let j = json::to_string(&GenesisStorageBuilder::default().genesis_config()).unwrap().into_bytes(); - let mut file = fs::OpenOptions::new() - .create(true) - .write(true) - .open("/tmp/default_genesis_config.json").unwrap(); - file.write_all(&j); - } -``` - -`:code` field has been manually truncated to reduce file size. Test is only -comparing keys, not the values. - -`default_genesis_config_invalid.json` is just a broken copy of -`default_genesis_config.json` with `authorities` field renamed to -`renamed_authorities`. - - -`default_genesis_config_invalid.json` is just an incomplete copy of -`default_genesis_config.json` with `babe::authorities` field removed. diff --git a/test-utils/runtime/res/default_genesis_config.json b/test-utils/runtime/res/default_genesis_config.json deleted file mode 100644 index 95c7799..0000000 --- a/test-utils/runtime/res/default_genesis_config.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "system": {}, - "babe": { - "authorities": [ - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 1 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 1 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 1 - ] - ], - "epochConfig": { - "c": [ - 3, - 10 - ], - "allowed_slots": "PrimaryAndSecondaryPlainSlots" - } - }, - "substrateTest": { - "authorities": [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" - ] - }, - "balances": { - "balances": [ - [ - "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", - 100000000000000000 - ], - [ - "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", - 100000000000000000 - ], - [ - "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", - 100000000000000000 - ], - [ - "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", - 100000000000000000 - ], - [ - "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", - 100000000000000000 - ], - [ - "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", - 100000000000000000 - ], - [ - "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", - 100000000000000000 - ], - [ - "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", - 100000000000000000 - ], - [ - "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", - 100000000000000000 - ], - [ - "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", - 100000000000000000 - ], - [ - "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", - 100000000000000000 - ], - [ - "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", - 100000000000000000 - ], - [ - "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", - 100000000000000000 - ], - [ - "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", - 100000000000000000 - ], - [ - "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", - 100000000000000000 - ], - [ - "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", - 100000000000000000 - ], - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 100000000000000000 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 100000000000000000 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 100000000000000000 - ] - ] - } -} diff --git a/test-utils/runtime/res/default_genesis_config_incomplete.json b/test-utils/runtime/res/default_genesis_config_incomplete.json deleted file mode 100644 index 510ed87..0000000 --- a/test-utils/runtime/res/default_genesis_config_incomplete.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "system": {}, - "babe": { - "epochConfig": { - "c": [ - 3, - 10 - ], - "allowed_slots": "PrimaryAndSecondaryPlainSlots" - } - }, - "substrateTest": { - "authorities": [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" - ] - }, - "balances": { - "balances": [ - [ - "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", - 100000000000000000 - ], - [ - "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", - 100000000000000000 - ], - [ - "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", - 100000000000000000 - ], - [ - "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", - 100000000000000000 - ], - [ - "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", - 100000000000000000 - ], - [ - "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", - 100000000000000000 - ], - [ - "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", - 100000000000000000 - ], - [ - "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", - 100000000000000000 - ], - [ - "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", - 100000000000000000 - ], - [ - "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", - 100000000000000000 - ], - [ - "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", - 100000000000000000 - ], - [ - "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", - 100000000000000000 - ], - [ - "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", - 100000000000000000 - ], - [ - "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", - 100000000000000000 - ], - [ - "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", - 100000000000000000 - ], - [ - "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", - 100000000000000000 - ], - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 100000000000000000 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 100000000000000000 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 100000000000000000 - ] - ] - } -} diff --git a/test-utils/runtime/res/default_genesis_config_invalid.json b/test-utils/runtime/res/default_genesis_config_invalid.json deleted file mode 100644 index f8e06f9..0000000 --- a/test-utils/runtime/res/default_genesis_config_invalid.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "system": {}, - "babe": { - "renamed_authorities": [ - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 1 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 1 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 1 - ] - ], - "epochConfig": { - "c": [ - 3, - 10 - ], - "allowed_slots": "PrimaryAndSecondaryPlainSlots" - } - }, - "substrateTest": { - "authorities": [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" - ] - }, - "balances": { - "balances": [ - [ - "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", - 100000000000000000 - ], - [ - "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", - 100000000000000000 - ], - [ - "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", - 100000000000000000 - ], - [ - "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", - 100000000000000000 - ], - [ - "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", - 100000000000000000 - ], - [ - "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", - 100000000000000000 - ], - [ - "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", - 100000000000000000 - ], - [ - "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", - 100000000000000000 - ], - [ - "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", - 100000000000000000 - ], - [ - "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", - 100000000000000000 - ], - [ - "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", - 100000000000000000 - ], - [ - "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", - 100000000000000000 - ], - [ - "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", - 100000000000000000 - ], - [ - "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", - 100000000000000000 - ], - [ - "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", - 100000000000000000 - ], - [ - "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", - 100000000000000000 - ], - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 100000000000000000 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 100000000000000000 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 100000000000000000 - ] - ] - } -} diff --git a/test-utils/runtime/res/default_genesis_config_invalid_2.json b/test-utils/runtime/res/default_genesis_config_invalid_2.json deleted file mode 100644 index a134554..0000000 --- a/test-utils/runtime/res/default_genesis_config_invalid_2.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "system": {}, - "babex": { - "authorities": [ - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 1 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 1 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 1 - ] - ], - "epochConfig": { - "c": [ - 3, - 10 - ], - "allowed_slots": "PrimaryAndSecondaryPlainSlots" - } - }, - "substrateTest": { - "authorities": [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y" - ] - }, - "balances": { - "balances": [ - [ - "5D34dL5prEUaGNQtPPZ3yN5Y6BnkfXunKXXz6fo7ZJbLwRRH", - 100000000000000000 - ], - [ - "5GBNeWRhZc2jXu7D55rBimKYDk8PGk8itRYFTPfC8RJLKG5o", - 100000000000000000 - ], - [ - "5Dfis6XL8J2P6JHUnUtArnFWndn62SydeP8ee8sG2ky9nfm9", - 100000000000000000 - ], - [ - "5F4H97f7nQovyrbiq4ZetaaviNwThSVcFobcA5aGab6167dK", - 100000000000000000 - ], - [ - "5DiDShBWa1fQx6gLzpf3SFBhMinCoyvHM1BWjPNsmXS8hkrW", - 100000000000000000 - ], - [ - "5EFb84yH9tpcFuiKUcsmdoF7xeeY3ajG1ZLQimxQoFt9HMKR", - 100000000000000000 - ], - [ - "5DZLHESsfGrJ5YzT3HuRPXsSNb589xQ4Unubh1mYLodzKdVY", - 100000000000000000 - ], - [ - "5GHJzqvG6tXnngCpG7B12qjUvbo5e4e9z8Xjidk3CQZHxTPZ", - 100000000000000000 - ], - [ - "5CUnSsgAyLND3bxxnfNhgWXSe9Wn676JzLpGLgyJv858qhoX", - 100000000000000000 - ], - [ - "5CVKn7HAZW1Ky4r7Vkgsr7VEW88C2sHgUNDiwHY9Ct2hjU8q", - 100000000000000000 - ], - [ - "5H673aukQ4PeDe1U2nuv1bi32xDEziimh3PZz7hDdYUB7TNz", - 100000000000000000 - ], - [ - "5HTe9L15LJryjUAt1jZXZCBPnzbbGnpvFwbjE3NwCWaAqovf", - 100000000000000000 - ], - [ - "5D7LFzGpMwHPyDBavkRbWSKWTtJhCaPPZ379wWLT23bJwXJz", - 100000000000000000 - ], - [ - "5CLepMARnEgtVR1EkUuJVUvKh97gzergpSxUU3yKGx1v6EwC", - 100000000000000000 - ], - [ - "5Chb2UhfvZpmjjEziHbFbotM4quX32ZscRV6QJBt1rUKzz51", - 100000000000000000 - ], - [ - "5HmRp3i3ZZk7xsAvbi8hyXVP6whSMnBJGebVC4FsiZVhx52e", - 100000000000000000 - ], - [ - "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", - 100000000000000000 - ], - [ - "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", - 100000000000000000 - ], - [ - "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", - 100000000000000000 - ] - ] - } -} diff --git a/test-utils/runtime/src/extrinsic.rs b/test-utils/runtime/src/extrinsic.rs deleted file mode 100644 index 4c884d4..0000000 --- a/test-utils/runtime/src/extrinsic.rs +++ /dev/null @@ -1,228 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Provides utils for building the `Extrinsic` instances used with `substrate-test-runtime`. - -use crate::{ - substrate_test_pallet::pallet::Call as PalletCall, AccountId, Balance, BalancesCall, - CheckSubstrateCall, Extrinsic, Nonce, Pair, RuntimeCall, SignedPayload, TransferData, -}; -use codec::Encode; -use frame_metadata_hash_extension::CheckMetadataHash; -use frame_system::{CheckNonce, CheckWeight}; -use sp_core::crypto::Pair as TraitPair; -use sp_keyring::AccountKeyring; -use sp_runtime::{ - generic::Preamble, traits::TransactionExtension, transaction_validity::TransactionPriority, - Perbill, -}; - -/// Transfer used in test substrate pallet. Extrinsic is created and signed using this data. -#[derive(Clone)] -pub struct Transfer { - /// Transfer sender and signer of created extrinsic - pub from: Pair, - /// The recipient of the transfer - pub to: AccountId, - /// Amount of transfer - pub amount: Balance, - /// Sender's account nonce at which transfer is valid - pub nonce: u64, -} - -impl Transfer { - /// Convert into a signed unchecked extrinsic. - pub fn into_unchecked_extrinsic(self) -> Extrinsic { - ExtrinsicBuilder::new_transfer(self).build() - } -} - -impl Default for TransferData { - fn default() -> Self { - Self { - from: AccountKeyring::Alice.into(), - to: AccountKeyring::Bob.into(), - amount: 0, - nonce: 0, - } - } -} - -/// If feasible converts given `Extrinsic` to `TransferData` -impl TryFrom<&Extrinsic> for TransferData { - type Error = (); - fn try_from(uxt: &Extrinsic) -> Result { - match uxt { - Extrinsic { - function: RuntimeCall::Balances(BalancesCall::transfer_allow_death { dest, value }), - preamble: Preamble::Signed(from, _, ((CheckNonce(nonce), ..), ..)), - } => Ok(TransferData { from: *from, to: *dest, amount: *value, nonce: *nonce }), - Extrinsic { - function: RuntimeCall::SubstrateTest(PalletCall::bench_call { transfer }), - preamble: Preamble::Bare(_), - } => Ok(transfer.clone()), - _ => Err(()), - } - } -} - -/// Generates `Extrinsic` -pub struct ExtrinsicBuilder { - function: RuntimeCall, - signer: Option, - nonce: Option, - metadata_hash: Option<[u8; 32]>, -} - -impl ExtrinsicBuilder { - /// Create builder for given `RuntimeCall`. By default `Extrinsic` will be signed by `Alice`. - pub fn new(function: impl Into) -> Self { - Self { - function: function.into(), - signer: Some(AccountKeyring::Alice.pair()), - nonce: None, - metadata_hash: None, - } - } - - /// Create builder for given `RuntimeCall`. `Extrinsic` will be unsigned. - pub fn new_unsigned(function: impl Into) -> Self { - Self { function: function.into(), signer: None, nonce: None, metadata_hash: None } - } - - /// Create builder for `pallet_call::bench_transfer` from given `TransferData`. - pub fn new_bench_call(transfer: TransferData) -> Self { - Self::new_unsigned(PalletCall::bench_call { transfer }) - } - - /// Create builder for given `Transfer`. Transfer `nonce` will be used as `Extrinsic` nonce. - /// Transfer `from` will be used as Extrinsic signer. - pub fn new_transfer(transfer: Transfer) -> Self { - Self { - nonce: Some(transfer.nonce), - signer: Some(transfer.from.clone()), - metadata_hash: None, - ..Self::new(BalancesCall::transfer_allow_death { - dest: transfer.to, - value: transfer.amount, - }) - } - } - - /// Create builder for `PalletCall::include_data` call using given parameters - pub fn new_include_data(data: Vec) -> Self { - Self::new(PalletCall::include_data { data }) - } - - /// Create builder for `PalletCall::storage_change` call using given parameters. Will - /// create unsigned Extrinsic. - pub fn new_storage_change(key: Vec, value: Option>) -> Self { - Self::new_unsigned(PalletCall::storage_change { key, value }) - } - - /// Create builder for `PalletCall::offchain_index_set` call using given parameters - pub fn new_offchain_index_set(key: Vec, value: Vec) -> Self { - Self::new(PalletCall::offchain_index_set { key, value }) - } - - /// Create builder for `PalletCall::offchain_index_clear` call using given parameters - pub fn new_offchain_index_clear(key: Vec) -> Self { - Self::new(PalletCall::offchain_index_clear { key }) - } - - /// Create builder for `PalletCall::indexed_call` call using given parameters - pub fn new_indexed_call(data: Vec) -> Self { - Self::new(PalletCall::indexed_call { data }) - } - - /// Create builder for `PalletCall::new_deposit_log_digest_item` call using given `log` - pub fn new_deposit_log_digest_item(log: sp_runtime::generic::DigestItem) -> Self { - Self::new_unsigned(PalletCall::deposit_log_digest_item { log }) - } - - /// Create builder for `PalletCall::Call::new_deposit_log_digest_item` - pub fn new_fill_block(ratio: Perbill) -> Self { - Self::new(PalletCall::fill_block { ratio }) - } - - /// Create builder for `PalletCall::call_do_not_propagate` call using given parameters - pub fn new_call_do_not_propagate() -> Self { - Self::new(PalletCall::call_do_not_propagate {}) - } - - /// Create builder for `PalletCall::call_with_priority` call using given parameters - pub fn new_call_with_priority(priority: TransactionPriority) -> Self { - Self::new(PalletCall::call_with_priority { priority }) - } - - /// Create builder for `PalletCall::read` call using given parameters - pub fn new_read(count: u32) -> Self { - Self::new_unsigned(PalletCall::read { count }) - } - - /// Create builder for `PalletCall::read` call using given parameters - pub fn new_read_and_panic(count: u32) -> Self { - Self::new_unsigned(PalletCall::read_and_panic { count }) - } - - /// Unsigned `Extrinsic` will be created - pub fn unsigned(mut self) -> Self { - self.signer = None; - self - } - - /// Given `nonce` will be set in `Extrinsic` - pub fn nonce(mut self, nonce: Nonce) -> Self { - self.nonce = Some(nonce); - self - } - - /// Extrinsic will be signed by `signer` - pub fn signer(mut self, signer: Pair) -> Self { - self.signer = Some(signer); - self - } - - /// Metadata hash to put into the signed data of the extrinsic. - pub fn metadata_hash(mut self, metadata_hash: [u8; 32]) -> Self { - self.metadata_hash = Some(metadata_hash); - self - } - - /// Build `Extrinsic` using embedded parameters - pub fn build(self) -> Extrinsic { - if let Some(signer) = self.signer { - let tx_ext = ( - (CheckNonce::from(self.nonce.unwrap_or(0)), CheckWeight::new()), - CheckSubstrateCall {}, - self.metadata_hash - .map(CheckMetadataHash::new_with_custom_hash) - .unwrap_or_else(|| CheckMetadataHash::new(false)), - ); - let raw_payload = SignedPayload::from_raw( - self.function.clone(), - tx_ext.clone(), - tx_ext.implicit().unwrap(), - ); - let signature = raw_payload.using_encoded(|e| signer.sign(e)); - - Extrinsic::new_signed(self.function, signer.public(), signature, tx_ext) - } else { - Extrinsic::new_bare(self.function) - } - } -} diff --git a/test-utils/runtime/src/genesismap.rs b/test-utils/runtime/src/genesismap.rs deleted file mode 100644 index 9e97288..0000000 --- a/test-utils/runtime/src/genesismap.rs +++ /dev/null @@ -1,179 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tool for creating the genesis block. - -use super::{ - currency, substrate_test_pallet, wasm_binary_unwrap, AccountId, Balance, RuntimeGenesisConfig, -}; -use codec::Encode; -use sc_service::construct_genesis_block; -use sp_core::{ - sr25519, - storage::{well_known_keys, StateVersion, Storage}, - Pair, -}; -use sp_keyring::{AccountKeyring, Sr25519Keyring}; -use sp_runtime::{ - traits::{Block as BlockT, Hash as HashT, Header as HeaderT}, - BuildStorage, -}; - -/// Builder for generating storage from substrate-test-runtime genesis config. -/// -/// Default storage can be extended with additional key-value pairs. -pub struct GenesisStorageBuilder { - /// Authorities accounts used by any component requiring an authority set (e.g. babe). - authorities: Vec, - /// Accounts to be endowed with some funds. - balances: Vec<(AccountId, u64)>, - /// Override default number of heap pages. - heap_pages_override: Option, - /// Additional storage key pairs that will be added to the genesis map. - extra_storage: Storage, - /// Optional wasm code override. - wasm_code: Option>, -} - -impl Default for GenesisStorageBuilder { - /// Creates a builder with default settings for `substrate_test_runtime`. - fn default() -> Self { - Self::new( - vec![ - Sr25519Keyring::Alice.into(), - Sr25519Keyring::Bob.into(), - Sr25519Keyring::Charlie.into(), - ], - (0..16_usize) - .into_iter() - .map(|i| AccountKeyring::numeric(i).public()) - .chain(vec![ - AccountKeyring::Alice.into(), - AccountKeyring::Bob.into(), - AccountKeyring::Charlie.into(), - ]) - .collect(), - 1000 * currency::DOLLARS, - ) - } -} - -impl GenesisStorageBuilder { - /// Creates a storage builder for genesis config. `substrage test runtime` - /// [`RuntimeGenesisConfig`] is initialized with provided `authorities`, `endowed_accounts` with - /// given balance. Key-value pairs from `extra_storage` will be injected into built storage. - /// `HEAP_PAGES` key and value will also be placed into storage. - pub fn new( - authorities: Vec, - endowed_accounts: Vec, - balance: Balance, - ) -> Self { - GenesisStorageBuilder { - authorities, - balances: endowed_accounts.into_iter().map(|a| (a, balance)).collect(), - heap_pages_override: None, - extra_storage: Default::default(), - wasm_code: None, - } - } - - /// Override default wasm code to be placed into RuntimeGenesisConfig. - pub fn with_wasm_code(mut self, wasm_code: &Option>) -> Self { - self.wasm_code = wasm_code.clone(); - self - } - - pub fn with_heap_pages(mut self, heap_pages_override: Option) -> Self { - self.heap_pages_override = heap_pages_override; - self - } - - pub fn with_extra_storage(mut self, storage: Storage) -> Self { - self.extra_storage = storage; - self - } - - /// A `RuntimeGenesisConfig` from internal configuration - pub fn genesis_config(&self) -> RuntimeGenesisConfig { - let authorities_sr25519: Vec<_> = self - .authorities - .clone() - .into_iter() - .map(|id| sr25519::Public::from(id)) - .collect(); - - RuntimeGenesisConfig { - system: Default::default(), - babe: pallet_babe::GenesisConfig { - authorities: authorities_sr25519 - .clone() - .into_iter() - .map(|x| (x.into(), 1)) - .collect(), - ..Default::default() - }, - substrate_test: substrate_test_pallet::GenesisConfig { - authorities: authorities_sr25519.clone(), - ..Default::default() - }, - balances: pallet_balances::GenesisConfig { balances: self.balances.clone() }, - } - } - - /// Builds the `RuntimeGenesisConfig` and returns its storage. - pub fn build(self) -> Storage { - let mut storage = self - .genesis_config() - .build_storage() - .expect("Build storage from substrate-test-runtime RuntimeGenesisConfig"); - - if let Some(heap_pages) = self.heap_pages_override { - storage.top.insert(well_known_keys::HEAP_PAGES.into(), heap_pages.encode()); - } - - storage.top.insert( - well_known_keys::CODE.into(), - self.wasm_code.clone().unwrap_or(wasm_binary_unwrap().to_vec()), - ); - - storage.top.extend(self.extra_storage.top.clone()); - storage.children_default.extend(self.extra_storage.children_default.clone()); - - storage - } -} - -pub fn insert_genesis_block(storage: &mut Storage) -> sp_core::hash::H256 { - let child_roots = storage.children_default.iter().map(|(sk, child_content)| { - let state_root = - <<::Header as HeaderT>::Hashing as HashT>::trie_root( - child_content.data.clone().into_iter().collect(), - sp_runtime::StateVersion::V1, - ); - (sk.clone(), state_root.encode()) - }); - // add child roots to storage - storage.top.extend(child_roots); - let state_root = <<::Header as HeaderT>::Hashing as HashT>::trie_root( - storage.top.clone().into_iter().collect(), - sp_runtime::StateVersion::V1, - ); - let block: crate::Block = construct_genesis_block(state_root, StateVersion::V1); - let genesis_hash = block.header.hash(); - - genesis_hash -} diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs deleted file mode 100644 index 461d583..0000000 --- a/test-utils/runtime/src/lib.rs +++ /dev/null @@ -1,1534 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. - -#![cfg_attr(not(feature = "std"), no_std)] - -extern crate alloc; - -#[cfg(feature = "std")] -pub mod extrinsic; -#[cfg(feature = "std")] -pub mod genesismap; -pub mod substrate_test_pallet; - -#[cfg(not(feature = "std"))] -use alloc::{vec, vec::Vec}; -use codec::{Decode, Encode}; -use frame_support::{ - construct_runtime, derive_impl, - dispatch::DispatchClass, - genesis_builder_helper::{build_state, get_preset}, - parameter_types, - traits::{ConstU32, ConstU64}, - weights::{ - constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, - Weight, - }, -}; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - CheckNonce, CheckWeight, -}; -use scale_info::TypeInfo; -use sp_application_crypto::Ss58Codec; -use sp_keyring::AccountKeyring; - -use sp_application_crypto::{ecdsa, ed25519, sr25519, RuntimeAppPublic}; -use sp_core::{OpaqueMetadata, RuntimeDebug}; -use sp_trie::{ - trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, - PrefixedMemoryDB, StorageProof, -}; -use trie_db::{Trie, TrieMut}; - -use serde_json::json; -use sp_api::{decl_runtime_apis, impl_runtime_apis}; -pub use sp_core::hash::H256; -use sp_genesis_builder::PresetId; -use sp_inherents::{CheckInherentsResult, InherentData}; -use sp_runtime::{ - impl_opaque_keys, impl_tx_ext_default, - traits::{BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, NumberFor, Verify}, - transaction_validity::{ - TransactionSource, TransactionValidity, TransactionValidityError, ValidTransaction, - }, - ApplyExtrinsicResult, ExtrinsicInclusionMode, Perbill, -}; -#[cfg(any(feature = "std", test))] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; - -pub use sp_consensus_babe::{AllowedSlots, BabeEpochConfiguration, Slot}; - -pub use pallet_balances::Call as BalancesCall; - -pub type AuraId = sp_consensus_aura::sr25519::AuthorityId; -#[cfg(feature = "std")] -pub use extrinsic::{ExtrinsicBuilder, Transfer}; - -const LOG_TARGET: &str = "substrate-test-runtime"; - -// Include the WASM binary -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -#[cfg(feature = "std")] -pub mod wasm_binary_logging_disabled { - include!(concat!(env!("OUT_DIR"), "/wasm_binary_logging_disabled.rs")); -} - -/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. -#[cfg(feature = "std")] -pub fn wasm_binary_unwrap() -> &'static [u8] { - WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only supported with the flag - disabled.", - ) -} - -/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics. -#[cfg(feature = "std")] -pub fn wasm_binary_logging_disabled_unwrap() -> &'static [u8] { - wasm_binary_logging_disabled::WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only supported with the flag - disabled.", - ) -} - -/// Test runtime version. -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: alloc::borrow::Cow::Borrowed("test"), - impl_name: alloc::borrow::Cow::Borrowed("parity-test"), - authoring_version: 1, - spec_version: 2, - impl_version: 2, - apis: RUNTIME_API_VERSIONS, - transaction_version: 1, - system_version: 1, -}; - -fn version() -> RuntimeVersion { - VERSION -} - -/// Native version. -#[cfg(any(feature = "std", test))] -pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } -} - -/// Transfer data extracted from Extrinsic containing `Balances::transfer_allow_death`. -#[derive(Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] -pub struct TransferData { - pub from: AccountId, - pub to: AccountId, - pub amount: Balance, - pub nonce: Nonce, -} - -/// The address format for describing accounts. -pub type Address = sp_core::sr25519::Public; -pub type Signature = sr25519::Signature; -#[cfg(feature = "std")] -pub type Pair = sp_core::sr25519::Pair; - -// TODO: Remove after the Checks are migrated to TxExtension. -/// The extension to the basic transaction logic. -pub type TxExtension = ( - (CheckNonce, CheckWeight), - CheckSubstrateCall, - frame_metadata_hash_extension::CheckMetadataHash, -); -/// The payload being signed in transactions. -pub type SignedPayload = sp_runtime::generic::SignedPayload; -/// Unchecked extrinsic type as expected by this runtime. -pub type Extrinsic = - sp_runtime::generic::UncheckedExtrinsic; - -/// An identifier for an account on this system. -pub type AccountId = ::Signer; -/// A simple hash type for all our hashing. -pub type Hash = H256; -/// The hashing algorithm used. -pub type Hashing = BlakeTwo256; -/// The block number type used in this runtime. -pub type BlockNumber = u64; -/// Index of a transaction. -pub type Nonce = u64; -/// The item of a block digest. -pub type DigestItem = sp_runtime::generic::DigestItem; -/// The digest of a block. -pub type Digest = sp_runtime::generic::Digest; -/// A test block. -pub type Block = sp_runtime::generic::Block; -/// A test block's header. -pub type Header = sp_runtime::generic::Header; -/// Balance of an account. -pub type Balance = u64; - -decl_runtime_apis! { - #[api_version(2)] - pub trait TestAPI { - /// Return the balance of the given account id. - fn balance_of(id: AccountId) -> u64; - /// A benchmark function that adds one to the given value and returns the result. - fn benchmark_add_one(val: &u64) -> u64; - /// A benchmark function that adds one to each value in the given vector and returns the - /// result. - fn benchmark_vector_add_one(vec: &Vec) -> Vec; - /// A function for that the signature changed in version `2`. - #[changed_in(2)] - fn function_signature_changed() -> Vec; - /// The new signature. - fn function_signature_changed() -> u64; - /// trie no_std testing - fn use_trie() -> u64; - /// Calls function in the loop using never-inlined function pointer - fn benchmark_indirect_call() -> u64; - /// Calls function in the loop - fn benchmark_direct_call() -> u64; - /// Allocates vector with given capacity. - fn vec_with_capacity(size: u32) -> Vec; - /// Returns the initialized block number. - fn get_block_number() -> u64; - - /// Test that `ed25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ed25519` and the public key. - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic); - /// Test that `sr25519` crypto works in the runtime. - /// - /// Returns the signature generated for the message `sr25519`. - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic); - /// Test that `ecdsa` crypto works in the runtime. - /// - /// Returns the signature generated for the message `ecdsa`. - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic); - /// Run various tests against storage. - fn test_storage(); - /// Check a witness. - fn test_witness(proof: StorageProof, root: crate::Hash); - /// Test that ensures that we can call a function that takes multiple - /// arguments. - fn test_multiple_arguments(data: Vec, other: Vec, num: u32); - /// Traces log "Hey I'm runtime." - fn do_trace_log(); - /// Verify the given signature, public & message bundle. - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool; - /// Write the given `value` under the given `key` into the storage and then optional panic. - fn write_key_value(key: Vec, value: Vec, panic: bool); - } -} - -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, ->; - -#[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, TypeInfo)] -pub struct CheckSubstrateCall; - -impl sp_runtime::traits::Printable for CheckSubstrateCall { - fn print(&self) { - "CheckSubstrateCall".print() - } -} - -impl sp_runtime::traits::RefundWeight for CheckSubstrateCall { - fn refund(&mut self, _weight: frame_support::weights::Weight) {} -} -impl sp_runtime::traits::ExtensionPostDispatchWeightHandler - for CheckSubstrateCall -{ - fn set_extension_weight(&mut self, _info: &CheckSubstrateCall) {} -} - -impl sp_runtime::traits::Dispatchable for CheckSubstrateCall { - type RuntimeOrigin = RuntimeOrigin; - type Config = CheckSubstrateCall; - type Info = CheckSubstrateCall; - type PostInfo = CheckSubstrateCall; - - fn dispatch( - self, - _origin: Self::RuntimeOrigin, - ) -> sp_runtime::DispatchResultWithInfo { - panic!("This implementation should not be used for actual dispatch."); - } -} - -impl sp_runtime::traits::TransactionExtension for CheckSubstrateCall { - const IDENTIFIER: &'static str = "CheckSubstrateCall"; - type Implicit = (); - type Pre = (); - type Val = (); - impl_tx_ext_default!(RuntimeCall; weight prepare); - - fn validate( - &self, - origin: ::RuntimeOrigin, - call: &RuntimeCall, - _info: &DispatchInfoOf, - _len: usize, - _self_implicit: Self::Implicit, - _inherited_implication: &impl Encode, - _source: TransactionSource, - ) -> Result< - (ValidTransaction, Self::Val, ::RuntimeOrigin), - TransactionValidityError, - > { - log::trace!(target: LOG_TARGET, "validate"); - let v = match call { - RuntimeCall::SubstrateTest(ref substrate_test_call) => - substrate_test_pallet::validate_runtime_call(substrate_test_call)?, - _ => Default::default(), - }; - Ok((v, (), origin)) - } -} - -construct_runtime!( - pub enum Runtime - { - System: frame_system, - Babe: pallet_babe, - SubstrateTest: substrate_test_pallet::pallet, - Balances: pallet_balances, - } -); - -/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. -/// This is used to limit the maximal weight of a single extrinsic. -const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used -/// by Operational extrinsics. -const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// Max weight, actual value does not matter for test runtime. -const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX); - -parameter_types! { - pub const BlockHashCount: BlockNumber = 2400; - pub const Version: RuntimeVersion = VERSION; - - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); -} - -#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] -impl frame_system::pallet::Config for Runtime { - type BlockWeights = RuntimeBlockWeights; - type Nonce = Nonce; - type AccountId = AccountId; - type Lookup = sp_runtime::traits::IdentityLookup; - type Block = Block; - type AccountData = pallet_balances::AccountData; -} - -pub mod currency { - use crate::Balance; - const MILLICENTS: Balance = 1_000_000_000; - const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. - pub const DOLLARS: Balance = 100 * CENTS; -} - -parameter_types! { - pub const ExistentialDeposit: Balance = 1 * currency::DOLLARS; - // For weight estimation, we assume that the most locks on an individual account will be 50. - // This number may need to be adjusted in the future if this assumption no longer holds true. - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; -} - -impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type Balance = Balance; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; - type FreezeIdentifier = (); - type MaxFreezes = (); - type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = RuntimeFreezeReason; - type DoneSlashHandler = (); -} - -impl substrate_test_pallet::Config for Runtime {} - -// Required for `pallet_babe::Config`. -impl pallet_timestamp::Config for Runtime { - type Moment = u64; - type OnTimestampSet = Babe; - type MinimumPeriod = ConstU64<500>; - type WeightInfo = pallet_timestamp::weights::SubstrateWeight; -} - -parameter_types! { - pub const EpochDuration: u64 = 6; -} - -impl pallet_babe::Config for Runtime { - type EpochDuration = EpochDuration; - type ExpectedBlockTime = ConstU64<10_000>; - type EpochChangeTrigger = pallet_babe::SameAuthoritiesForever; - type DisabledValidators = (); - type KeyOwnerProof = sp_core::Void; - type EquivocationReportSystem = (); - type WeightInfo = (); - type MaxAuthorities = ConstU32<10>; - type MaxNominators = ConstU32<100>; -} - -/// Adds one to the given input and returns the final result. -#[inline(never)] -fn benchmark_add_one(i: u64) -> u64 { - i + 1 -} - -fn code_using_trie() -> u64 { - let pairs = [ - (b"0103000000000000000464".to_vec(), b"0400000000".to_vec()), - (b"0103000000000000000469".to_vec(), b"0401000000".to_vec()), - ] - .to_vec(); - - let mut mdb = PrefixedMemoryDB::default(); - let mut root = core::default::Default::default(); - { - let mut t = TrieDBMutBuilderV1::::new(&mut mdb, &mut root).build(); - for (key, value) in &pairs { - if t.insert(key, value).is_err() { - return 101 - } - } - } - - let trie = TrieDBBuilder::::new(&mdb, &root).build(); - let res = if let Ok(iter) = trie.iter() { iter.flatten().count() as u64 } else { 102 }; - - res -} - -impl_opaque_keys! { - pub struct SessionKeys { - pub ed25519: ed25519::AppPublic, - pub sr25519: sr25519::AppPublic, - pub ecdsa: ecdsa::AppPublic, - } -} - -pub const TEST_RUNTIME_BABE_EPOCH_CONFIGURATION: BabeEpochConfiguration = BabeEpochConfiguration { - c: (3, 10), - allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots, -}; - -impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - version() - } - - fn execute_block(block: Block) { - log::trace!(target: LOG_TARGET, "execute_block: {block:#?}"); - Executive::execute_block(block); - } - - fn initialize_block(header: &::Header) -> ExtrinsicInclusionMode { - log::trace!(target: LOG_TARGET, "initialize_block: {header:#?}"); - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - fn metadata_versions() -> alloc::vec::Vec { - Runtime::metadata_versions() - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - utx: ::Extrinsic, - block_hash: ::Hash, - ) -> TransactionValidity { - let validity = Executive::validate_transaction(source, utx.clone(), block_hash); - log::trace!(target: LOG_TARGET, "validate_transaction {:?} {:?}", utx, validity); - validity - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - log::trace!(target: LOG_TARGET, "finalize_block"); - Executive::finalize_block() - } - - fn inherent_extrinsics(_data: InherentData) -> Vec<::Extrinsic> { - vec![] - } - - fn check_inherents(_block: Block, _data: InherentData) -> CheckInherentsResult { - CheckInherentsResult::new() - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl self::TestAPI for Runtime { - fn balance_of(id: AccountId) -> u64 { - Balances::free_balance(id) - } - - fn benchmark_add_one(val: &u64) -> u64 { - val + 1 - } - - fn benchmark_vector_add_one(vec: &Vec) -> Vec { - let mut vec = vec.clone(); - vec.iter_mut().for_each(|v| *v += 1); - vec - } - - fn function_signature_changed() -> u64 { - 1 - } - - fn use_trie() -> u64 { - code_using_trie() - } - - fn benchmark_indirect_call() -> u64 { - let function = benchmark_add_one; - (0..1000).fold(0, |p, i| p + function(i)) - } - fn benchmark_direct_call() -> u64 { - (0..1000).fold(0, |p, i| p + benchmark_add_one(i)) - } - - fn vec_with_capacity(size: u32) -> Vec { - Vec::with_capacity(size as usize) - } - - fn get_block_number() -> u64 { - System::block_number() - } - - fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { - test_ed25519_crypto() - } - - fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { - test_sr25519_crypto() - } - - fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { - test_ecdsa_crypto() - } - - fn test_storage() { - test_read_storage(); - test_read_child_storage(); - } - - fn test_witness(proof: StorageProof, root: crate::Hash) { - test_witness(proof, root); - } - - fn test_multiple_arguments(data: Vec, other: Vec, num: u32) { - assert_eq!(&data[..], &other[..]); - assert_eq!(data.len(), num as usize); - } - - fn do_trace_log() { - log::trace!(target: "test", "Hey I'm runtime"); - - let data = "THIS IS TRACING"; - - tracing::trace!(target: "test", %data, "Hey, I'm tracing"); - } - - fn verify_ed25519(sig: ed25519::Signature, public: ed25519::Public, message: Vec) -> bool { - sp_io::crypto::ed25519_verify(&sig, &message, &public) - } - - fn write_key_value(key: Vec, value: Vec, panic: bool) { - sp_io::storage::set(&key, &value); - - if panic { - panic!("I'm just following my master"); - } - } - } - - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(1000) - } - - fn authorities() -> Vec { - SubstrateTest::authorities().into_iter().map(|auth| AuraId::from(auth)).collect() - } - } - - impl sp_consensus_babe::BabeApi for Runtime { - fn configuration() -> sp_consensus_babe::BabeConfiguration { - let epoch_config = Babe::epoch_config().unwrap_or(TEST_RUNTIME_BABE_EPOCH_CONFIGURATION); - sp_consensus_babe::BabeConfiguration { - slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), - c: epoch_config.c, - authorities: Babe::authorities().to_vec(), - randomness: Babe::randomness(), - allowed_slots: epoch_config.allowed_slots, - } - } - - fn current_epoch_start() -> Slot { - Babe::current_epoch_start() - } - - fn current_epoch() -> sp_consensus_babe::Epoch { - Babe::current_epoch() - } - - fn next_epoch() -> sp_consensus_babe::Epoch { - Babe::next_epoch() - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_babe::EquivocationProof< - ::Header, - >, - _key_owner_proof: sp_consensus_babe::OpaqueKeyOwnershipProof, - ) -> Option<()> { - None - } - - fn generate_key_ownership_proof( - _slot: sp_consensus_babe::Slot, - _authority_id: sp_consensus_babe::AuthorityId, - ) -> Option { - None - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - let ext = Extrinsic::new_bare( - substrate_test_pallet::pallet::Call::storage_change{ - key:b"some_key".encode(), - value:Some(header.number.encode()) - }.into(), - ); - sp_io::offchain::submit_transaction(ext.encode()).unwrap(); - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(_: Option>) -> Vec { - SessionKeys::generate(None) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl sp_consensus_grandpa::GrandpaApi for Runtime { - fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { - Vec::new() - } - - fn current_set_id() -> sp_consensus_grandpa::SetId { - 0 - } - - fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: sp_consensus_grandpa::EquivocationProof< - ::Hash, - NumberFor, - >, - _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, - ) -> Option<()> { - None - } - - fn generate_key_ownership_proof( - _set_id: sp_consensus_grandpa::SetId, - _authority_id: sp_consensus_grandpa::AuthorityId, - ) -> Option { - None - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn build_state(config: Vec) -> sp_genesis_builder::Result { - build_state::(config) - } - - fn get_preset(name: &Option) -> Option> { - get_preset::(name, |name| { - let patch = match name.as_ref() { - "staging" => { - let endowed_accounts: Vec = vec![ - AccountKeyring::Bob.public().into(), - AccountKeyring::Charlie.public().into(), - ]; - - json!({ - "balances": { - "balances": endowed_accounts.into_iter().map(|k| (k, 10 * currency::DOLLARS)).collect::>(), - }, - "substrateTest": { - "authorities": [ - AccountKeyring::Alice.public().to_ss58check(), - AccountKeyring::Ferdie.public().to_ss58check() - ], - } - }) - }, - "foobar" => json!({"foo":"bar"}), - _ => return None, - }; - Some(serde_json::to_string(&patch) - .expect("serialization to json is expected to work. qed.") - .into_bytes()) - }) - } - - fn preset_names() -> Vec { - vec![PresetId::from("foobar"), PresetId::from("staging")] - } - } -} - -fn test_ed25519_crypto() -> (ed25519::AppSignature, ed25519::AppPublic) { - let public0 = ed25519::AppPublic::generate_pair(None); - let public1 = ed25519::AppPublic::generate_pair(None); - let public2 = ed25519::AppPublic::generate_pair(None); - - let all = ed25519::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0.sign(&"ed25519").expect("Generates a valid `ed25519` signature."); - assert!(public0.verify(&"ed25519", &signature)); - (signature, public0) -} - -fn test_sr25519_crypto() -> (sr25519::AppSignature, sr25519::AppPublic) { - let public0 = sr25519::AppPublic::generate_pair(None); - let public1 = sr25519::AppPublic::generate_pair(None); - let public2 = sr25519::AppPublic::generate_pair(None); - - let all = sr25519::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0.sign(&"sr25519").expect("Generates a valid `sr25519` signature."); - assert!(public0.verify(&"sr25519", &signature)); - (signature, public0) -} - -fn test_ecdsa_crypto() -> (ecdsa::AppSignature, ecdsa::AppPublic) { - let public0 = ecdsa::AppPublic::generate_pair(None); - let public1 = ecdsa::AppPublic::generate_pair(None); - let public2 = ecdsa::AppPublic::generate_pair(None); - - let all = ecdsa::AppPublic::all(); - assert!(all.contains(&public0)); - assert!(all.contains(&public1)); - assert!(all.contains(&public2)); - - let signature = public0.sign(&"ecdsa").expect("Generates a valid `ecdsa` signature."); - - assert!(public0.verify(&"ecdsa", &signature)); - (signature, public0) -} - -fn test_read_storage() { - const KEY: &[u8] = b":read_storage"; - sp_io::storage::set(KEY, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::storage::read(KEY, &mut v, 0); - assert_eq!(r, Some(4)); - assert_eq!(&v, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::storage::read(KEY, &mut v, 4); - assert_eq!(r, Some(0)); - assert_eq!(&v, &[0, 0, 0, 0]); -} - -fn test_read_child_storage() { - const STORAGE_KEY: &[u8] = b"unique_id_1"; - const KEY: &[u8] = b":read_child_storage"; - sp_io::default_child_storage::set(STORAGE_KEY, KEY, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 0); - assert_eq!(r, Some(4)); - assert_eq!(&v, b"test"); - - let mut v = [0u8; 4]; - let r = sp_io::default_child_storage::read(STORAGE_KEY, KEY, &mut v, 8); - assert_eq!(r, Some(0)); - assert_eq!(&v, &[0, 0, 0, 0]); -} - -fn test_witness(proof: StorageProof, root: crate::Hash) { - use sp_externalities::Externalities; - let db: sp_trie::MemoryDB = proof.into_memory_db(); - let backend = sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); - let mut overlay = sp_state_machine::OverlayedChanges::default(); - let mut ext = sp_state_machine::Ext::new( - &mut overlay, - &backend, - #[cfg(feature = "std")] - None, - ); - assert!(ext.storage(b"value3").is_some()); - assert!(ext.storage_root(Default::default()).as_slice() == &root[..]); - ext.place_storage(vec![0], Some(vec![1])); - assert!(ext.storage_root(Default::default()).as_slice() != &root[..]); -} - -/// Some tests require the hashed keys of the storage. As the values of hashed keys are not trivial -/// to guess, this small module provides the values of the keys, and the code which is required to -/// generate the keys. -#[cfg(feature = "std")] -pub mod storage_key_generator { - use super::*; - use sp_core::Pair; - - /// Generate hex string without prefix - pub(super) fn hex(x: T) -> String - where - T: array_bytes::Hex, - { - x.hex(Default::default()) - } - - fn concat_hashes(input: &Vec<&[u8]>) -> String { - input.iter().map(|s| sp_crypto_hashing::twox_128(s)).map(hex).collect() - } - - fn twox_64_concat(x: &[u8]) -> Vec { - sp_crypto_hashing::twox_64(x).iter().chain(x.iter()).cloned().collect() - } - - /// Generate the hashed storage keys from the raw literals. These keys are expected to be in - /// storage with given substrate-test runtime. - pub fn generate_expected_storage_hashed_keys(custom_heap_pages: bool) -> Vec { - let mut literals: Vec<&[u8]> = vec![b":code", b":extrinsic_index"]; - - if custom_heap_pages { - literals.push(b":heappages"); - } - - let keys: Vec> = vec![ - vec![b"Babe", b":__STORAGE_VERSION__:"], - vec![b"Babe", b"Authorities"], - vec![b"Babe", b"EpochConfig"], - vec![b"Babe", b"NextAuthorities"], - vec![b"Babe", b"SegmentIndex"], - vec![b"Balances", b":__STORAGE_VERSION__:"], - vec![b"Balances", b"TotalIssuance"], - vec![b"SubstrateTest", b":__STORAGE_VERSION__:"], - vec![b"SubstrateTest", b"Authorities"], - vec![b"System", b":__STORAGE_VERSION__:"], - vec![b"System", b"LastRuntimeUpgrade"], - vec![b"System", b"ParentHash"], - vec![b"System", b"UpgradedToTripleRefCount"], - vec![b"System", b"UpgradedToU32RefCount"], - ]; - - let mut expected_keys = keys.iter().map(concat_hashes).collect::>(); - expected_keys.extend(literals.into_iter().map(hex)); - - let balances_map_keys = (0..16_usize) - .into_iter() - .map(|i| AccountKeyring::numeric(i).public().to_vec()) - .chain(vec![ - AccountKeyring::Alice.public().to_vec(), - AccountKeyring::Bob.public().to_vec(), - AccountKeyring::Charlie.public().to_vec(), - ]) - .map(|pubkey| { - sp_crypto_hashing::blake2_128(&pubkey) - .iter() - .chain(pubkey.iter()) - .cloned() - .collect::>() - }) - .map(|hash_pubkey| { - [concat_hashes(&vec![b"System", b"Account"]), hex(hash_pubkey)].concat() - }); - - expected_keys.extend(balances_map_keys); - - expected_keys.push( - [ - concat_hashes(&vec![b"System", b"BlockHash"]), - hex(0u64.using_encoded(twox_64_concat)), - ] - .concat(), - ); - - expected_keys.sort(); - expected_keys - } - - /// Provides the commented list of hashed keys. This contains a hard-coded list of hashed keys - /// that would be generated by `generate_expected_storage_hashed_keys`. This list is provided - /// for the debugging convenience only. Value of each hex-string is documented with the literal - /// origin. - /// - /// `custom_heap_pages`: Should be set to `true` when the state contains the `:heap_pages` key - /// aka when overriding the heap pages to be used by the executor. - pub fn get_expected_storage_hashed_keys(custom_heap_pages: bool) -> Vec<&'static str> { - let mut res = vec![ - //SubstrateTest|:__STORAGE_VERSION__: - "00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429", - //SubstrateTest|Authorities - "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", - //Babe|:__STORAGE_VERSION__: - "1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429", - //Babe|Authorities - "1cb6f36e027abb2091cfb5110ab5087f5e0621c4869aa60c02be9adcc98a0d1d", - //Babe|SegmentIndex - "1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4", - //Babe|NextAuthorities - "1cb6f36e027abb2091cfb5110ab5087faacf00b9b41fda7a9268821c2a2b3e4c", - //Babe|EpochConfig - "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", - //System|:__STORAGE_VERSION__: - "26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", - //System|UpgradedToU32RefCount - "26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", - //System|ParentHash - "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", - //System::BlockHash|0 - "26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746bb1bdbcacd6ac9340000000000000000", - //System|UpgradedToTripleRefCount - "26aa394eea5630e07c48ae0c9558cef7a7fd6c28836b9a28522dc924110cf439", - - // System|Account|blake2_128Concat("//11") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da901cae4e3edfbb32c91ed3f01ab964f4eeeab50338d8e5176d3141802d7b010a55dadcd5f23cf8aaafa724627e967e90e", - // System|Account|blake2_128Concat("//4") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da91b614bd4a126f2d5d294e9a8af9da25248d7e931307afb4b68d8d565d4c66e00d856c6d65f5fed6bb82dcfb60e936c67", - // System|Account|blake2_128Concat("//7") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94b21aff9fe1e8b2fc4b0775b8cbeff28ba8e2c7594dd74730f3ca835e95455d199261897edc9735d602ea29615e2b10b", - // System|Account|blake2_128Concat("//Bob") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da94f9aea1afa791265fae359272badc1cf8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48", - // System|Account|blake2_128Concat("//3") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95786a2916fcb81e1bd5dcd81e0d2452884617f575372edb5a36d85c04cdf2e4699f96fe33eb5f94a28c041b88e398d0c", - // System|Account|blake2_128Concat("//14") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95b8542d9672c7b7e779cc7c1e6b605691c2115d06120ea2bee32dd601d02f36367564e7ddf84ae2717ca3f097459652e", - // System|Account|blake2_128Concat("//6") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da996c30bdbfab640838e6b6d3c33ab4adb4211b79e34ee8072eab506edd4b93a7b85a14c9a05e5cdd056d98e7dbca87730", - // System|Account|blake2_128Concat("//9") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99dc65b1339ec388fbf2ca0cdef51253512c6cfd663203ea16968594f24690338befd906856c4d2f4ef32dad578dba20c", - // System|Account|blake2_128Concat("//8") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da99e6eb5abd62f5fd54793da91a47e6af6125d57171ff9241f07acaa1bb6a6103517965cf2cd00e643b27e7599ebccba70", - // System|Account|blake2_128Concat("//Charlie") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9b0edae20838083f2cde1c4080db8cf8090b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22", - // System|Account|blake2_128Concat("//10") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d0052993b6f3bd0544fd1f5e4125b9fbde3e789ecd53431fe5c06c12b72137153496dace35c695b5f4d7b41f7ed5763b", - // System|Account|blake2_128Concat("//1") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9d6b7e9a5f12bc571053265dade10d3b4b606fc73f57f03cdb4c932d475ab426043e429cecc2ffff0d2672b0df8398c48", - // System|Account|blake2_128Concat("//Alice") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9de1e86a9a8c739864cf3cc5ec2bea59fd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d", - // System|Account|blake2_128Concat("//2") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e1a35f56ee295d39287cbffcfc60c4b346f136b564e1fad55031404dd84e5cd3fa76bfe7cc7599b39d38fd06663bbc0a", - // System|Account|blake2_128Concat("//5") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9e2c1dc507e2035edbbd8776c440d870460c57f0008067cc01c5ff9eb2e2f9b3a94299a915a91198bd1021a6c55596f57", - // System|Account|blake2_128Concat("//0") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9eca0e653a94f4080f6311b4e7b6934eb2afba9278e30ccf6a6ceb3a8b6e336b70068f045c666f2e7f4f9cc5f47db8972", - // System|Account|blake2_128Concat("//13") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9ee8bf7ef90fc56a8aa3b90b344c599550c29b161e27ff8ba45bf6bad4711f326fc506a8803453a4d7e3158e993495f10", - // System|Account|blake2_128Concat("//12") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9f5d6f1c082fe63eec7a71fcad00f4a892e3d43b7b0d04e776e69e7be35247cecdac65504c579195731eaf64b7940966e", - // System|Account|blake2_128Concat("//15") - "26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9fbf0818841edf110e05228a6379763c4fc3c37459d9bdc61f58a5ebc01e9e2305a19d390c0543dc733861ec3cf1de01f", - // System|LastRuntimeUpgrade - "26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8", - // :code - "3a636f6465", - // :extrinsic_index - "3a65787472696e7369635f696e646578", - // Balances|:__STORAGE_VERSION__: - "c2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429", - // Balances|TotalIssuance - "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", - ]; - - if custom_heap_pages { - // :heappages - res.push("3a686561707061676573"); - } - - res - } - - #[test] - fn expected_keys_vec_are_matching() { - assert_eq!( - storage_key_generator::get_expected_storage_hashed_keys(false), - storage_key_generator::generate_expected_storage_hashed_keys(false), - ); - } -} - -#[cfg(test)] -mod tests { - use super::*; - use codec::Encode; - use frame_support::dispatch::DispatchInfo; - use sc_block_builder::BlockBuilderBuilder; - use sp_api::{ApiExt, ProvideRuntimeApi}; - use sp_consensus::BlockOrigin; - use sp_core::{storage::well_known_keys::HEAP_PAGES, traits::CallContext}; - use sp_runtime::{ - traits::{DispatchTransaction, Hash as _}, - transaction_validity::{InvalidTransaction, TransactionSource::External, ValidTransaction}, - }; - use substrate_test_runtime_client::{ - prelude::*, runtime::TestAPI, DefaultTestClientBuilderExt, TestClientBuilder, - }; - - #[test] - fn heap_pages_is_respected() { - // This tests that the on-chain `HEAP_PAGES` parameter is respected. - - // Create a client devoting only 8 pages of wasm memory. This gives us ~512k of heap memory. - let client = TestClientBuilder::new().set_heap_pages(8).build(); - let best_hash = client.chain_info().best_hash; - - // Try to allocate 1024k of memory on heap. This is going to fail since it is twice larger - // than the heap. - let mut runtime_api = client.runtime_api(); - // This is currently required to allocate the 1024k of memory as configured above. - runtime_api.set_call_context(CallContext::Onchain); - let ret = runtime_api.vec_with_capacity(best_hash, 1048576); - assert!(ret.is_err()); - - // Create a block that sets the `:heap_pages` to 32 pages of memory which corresponds to - // ~2048k of heap memory. - let (new_at_hash, block) = { - let mut builder = BlockBuilderBuilder::new(&client) - .on_parent_block(best_hash) - .with_parent_block_number(0) - .build() - .unwrap(); - builder.push_storage_change(HEAP_PAGES.to_vec(), Some(32u64.encode())).unwrap(); - let block = builder.build().unwrap().block; - let hash = block.header.hash(); - (hash, block) - }; - - futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap(); - - // Allocation of 1024k while having ~2048k should succeed. - let ret = client.runtime_api().vec_with_capacity(new_at_hash, 1048576); - assert!(ret.is_ok()); - } - - #[test] - fn test_storage() { - let client = TestClientBuilder::new().build(); - let runtime_api = client.runtime_api(); - let best_hash = client.chain_info().best_hash; - - runtime_api.test_storage(best_hash).unwrap(); - } - - fn witness_backend() -> (sp_trie::MemoryDB, crate::Hash) { - let mut root = crate::Hash::default(); - let mut mdb = sp_trie::MemoryDB::::default(); - { - let mut trie = - sp_trie::trie_types::TrieDBMutBuilderV1::new(&mut mdb, &mut root).build(); - trie.insert(b"value3", &[142]).expect("insert failed"); - trie.insert(b"value4", &[124]).expect("insert failed"); - }; - (mdb, root) - } - - #[test] - fn witness_backend_works() { - let (db, root) = witness_backend(); - let backend = - sp_state_machine::TrieBackendBuilder::<_, crate::Hashing>::new(db, root).build(); - let proof = sp_state_machine::prove_read(backend, vec![b"value3"]).unwrap(); - let client = TestClientBuilder::new().build(); - let runtime_api = client.runtime_api(); - let best_hash = client.chain_info().best_hash; - - runtime_api.test_witness(best_hash, proof, root).unwrap(); - } - - pub fn new_test_ext() -> sp_io::TestExternalities { - genesismap::GenesisStorageBuilder::new( - vec![AccountKeyring::One.public().into(), AccountKeyring::Two.public().into()], - vec![AccountKeyring::One.into(), AccountKeyring::Two.into()], - 1000 * currency::DOLLARS, - ) - .build() - .into() - } - - #[test] - fn validate_storage_keys() { - assert_eq!( - genesismap::GenesisStorageBuilder::default() - .build() - .top - .keys() - .cloned() - .map(storage_key_generator::hex) - .collect::>(), - storage_key_generator::get_expected_storage_hashed_keys(false) - ); - } - - #[test] - fn validate_unsigned_works() { - sp_tracing::try_init_simple(); - new_test_ext().execute_with(|| { - let failing_calls = vec![ - substrate_test_pallet::Call::bench_call { transfer: Default::default() }, - substrate_test_pallet::Call::include_data { data: vec![] }, - substrate_test_pallet::Call::fill_block { ratio: Perbill::from_percent(50) }, - ]; - let succeeding_calls = vec![ - substrate_test_pallet::Call::deposit_log_digest_item { - log: DigestItem::Other(vec![]), - }, - substrate_test_pallet::Call::storage_change { key: vec![], value: None }, - substrate_test_pallet::Call::read { count: 0 }, - substrate_test_pallet::Call::read_and_panic { count: 0 }, - ]; - - for call in failing_calls { - assert_eq!( - ::validate_unsigned( - TransactionSource::External, - &call, - ), - InvalidTransaction::Call.into(), - ); - } - - for call in succeeding_calls { - assert_eq!( - ::validate_unsigned( - TransactionSource::External, - &call, - ), - Ok(ValidTransaction { - provides: vec![BlakeTwo256::hash_of(&call).encode()], - ..Default::default() - }) - ); - } - }); - } - - #[test] - fn check_substrate_check_signed_extension_works() { - sp_tracing::try_init_simple(); - new_test_ext().execute_with(|| { - let x = AccountKeyring::Alice.into(); - let info = DispatchInfo::default(); - let len = 0_usize; - assert_eq!( - CheckSubstrateCall {} - .validate_only( - Some(x).into(), - &ExtrinsicBuilder::new_call_with_priority(16).build().function, - &info, - len, - External, - 0, - ) - .unwrap() - .0 - .priority, - 16 - ); - - assert_eq!( - CheckSubstrateCall {} - .validate_only( - Some(x).into(), - &ExtrinsicBuilder::new_call_do_not_propagate().build().function, - &info, - len, - External, - 0, - ) - .unwrap() - .0 - .propagate, - false - ); - }) - } - - mod genesis_builder_tests { - use super::*; - use crate::genesismap::GenesisStorageBuilder; - use sc_executor::{error::Result, WasmExecutor}; - use sc_executor_common::runtime_blob::RuntimeBlob; - use serde_json::json; - use sp_application_crypto::Ss58Codec; - use sp_core::traits::Externalities; - use sp_genesis_builder::Result as BuildResult; - use sp_state_machine::BasicExternalities; - use std::{fs, io::Write}; - use storage_key_generator::hex; - - pub fn executor_call( - ext: &mut dyn Externalities, - method: &str, - data: &[u8], - ) -> Result> { - let executor = WasmExecutor::::builder().build(); - executor.uncached_call( - RuntimeBlob::uncompress_if_needed(wasm_binary_unwrap()).unwrap(), - ext, - true, - method, - data, - ) - } - - #[test] - fn build_minimal_genesis_config_works() { - sp_tracing::try_init_simple(); - let default_minimal_json = r#"{"system":{},"babe":{"authorities":[],"epochConfig":{"c": [ 3, 10 ],"allowed_slots":"PrimaryAndSecondaryPlainSlots"}},"substrateTest":{"authorities":[]},"balances":{"balances":[]}}"#; - let mut t = BasicExternalities::new_empty(); - - executor_call(&mut t, "GenesisBuilder_build_state", &default_minimal_json.encode()) - .unwrap(); - - let mut keys = t.into_storages().top.keys().cloned().map(hex).collect::>(); - keys.sort(); - - let mut expected = [ - //SubstrateTest|Authorities - "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", - //Babe|SegmentIndex - "1cb6f36e027abb2091cfb5110ab5087f66e8f035c8adbe7f1547b43c51e6f8a4", - //Babe|EpochConfig - "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", - //System|UpgradedToU32RefCount - "26aa394eea5630e07c48ae0c9558cef75684a022a34dd8bfa2baaf44f172b710", - //System|ParentHash - "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", - //System::BlockHash|0 - "26aa394eea5630e07c48ae0c9558cef7a44704b568d21667356a5a050c118746bb1bdbcacd6ac9340000000000000000", - //System|UpgradedToTripleRefCount - "26aa394eea5630e07c48ae0c9558cef7a7fd6c28836b9a28522dc924110cf439", - - // System|LastRuntimeUpgrade - "26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8", - // :extrinsic_index - "3a65787472696e7369635f696e646578", - // Balances|TotalIssuance - "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", - - // added by on_genesis: - // Balances|:__STORAGE_VERSION__: - "c2261276cc9d1f8598ea4b6a74b15c2f4e7b9012096b41c4eb3aaf947f6ea429", - //System|:__STORAGE_VERSION__: - "26aa394eea5630e07c48ae0c9558cef74e7b9012096b41c4eb3aaf947f6ea429", - //Babe|:__STORAGE_VERSION__: - "1cb6f36e027abb2091cfb5110ab5087f4e7b9012096b41c4eb3aaf947f6ea429", - //SubstrateTest|:__STORAGE_VERSION__: - "00771836bebdd29870ff246d305c578c4e7b9012096b41c4eb3aaf947f6ea429", - ].into_iter().map(String::from).collect::>(); - expected.sort(); - - assert_eq!(keys, expected); - } - - #[test] - fn default_config_as_json_works() { - sp_tracing::try_init_simple(); - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_get_preset", &None::<&PresetId>.encode()) - .unwrap(); - let r = Option::>::decode(&mut &r[..]) - .unwrap() - .expect("default config is there"); - let json = String::from_utf8(r.into()).expect("returned value is json. qed."); - - let expected = r#"{"system":{},"babe":{"authorities":[],"epochConfig":{"c":[1,4],"allowed_slots":"PrimaryAndSecondaryVRFSlots"}},"substrateTest":{"authorities":[]},"balances":{"balances":[]}}"#; - assert_eq!(expected.to_string(), json); - } - - #[test] - fn preset_names_listing_works() { - sp_tracing::try_init_simple(); - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_preset_names", &vec![]).unwrap(); - let r = Vec::::decode(&mut &r[..]).unwrap(); - assert_eq!(r, vec![PresetId::from("foobar"), PresetId::from("staging"),]); - log::info!("r: {:#?}", r); - } - - #[test] - fn named_config_works() { - sp_tracing::try_init_simple(); - let f = |cfg_name: &str, expected: &str| { - let mut t = BasicExternalities::new_empty(); - let name = cfg_name.to_string(); - let r = executor_call( - &mut t, - "GenesisBuilder_get_preset", - &Some(name.as_bytes()).encode(), - ) - .unwrap(); - let r = Option::>::decode(&mut &r[..]).unwrap(); - let json = - String::from_utf8(r.unwrap().into()).expect("returned value is json. qed."); - log::info!("json: {:#?}", json); - assert_eq!(expected.to_string(), json); - }; - - f("foobar", r#"{"foo":"bar"}"#); - f( - "staging", - r#"{"balances":{"balances":[["5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",1000000000000000],["5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",1000000000000000]]},"substrateTest":{"authorities":["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY","5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL"]}}"#, - ); - } - - #[test] - fn build_config_from_json_works() { - sp_tracing::try_init_simple(); - let j = include_str!("../res/default_genesis_config.json"); - - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); - let r = BuildResult::decode(&mut &r[..]); - assert!(r.is_ok()); - - let mut keys = t.into_storages().top.keys().cloned().map(hex).collect::>(); - - // following keys are not placed during `::build` - // process, add them `keys` to assert against known keys. - keys.push(hex(b":code")); - keys.sort(); - - assert_eq!(keys, storage_key_generator::get_expected_storage_hashed_keys(false)); - } - - #[test] - fn build_config_from_invalid_json_fails() { - sp_tracing::try_init_simple(); - let j = include_str!("../res/default_genesis_config_invalid.json"); - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); - let r = BuildResult::decode(&mut &r[..]).unwrap(); - log::info!("result: {:#?}", r); - assert_eq!(r, Err( - "Invalid JSON blob: unknown field `renamed_authorities`, expected `authorities` or `epochConfig` at line 4 column 25".to_string(), - )); - } - - #[test] - fn build_config_from_invalid_json_fails_2() { - sp_tracing::try_init_simple(); - let j = include_str!("../res/default_genesis_config_invalid_2.json"); - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); - let r = BuildResult::decode(&mut &r[..]).unwrap(); - assert_eq!(r, Err( - "Invalid JSON blob: unknown field `babex`, expected one of `system`, `babe`, `substrateTest`, `balances` at line 3 column 9".to_string(), - )); - } - - #[test] - fn build_config_from_incomplete_json_fails() { - sp_tracing::try_init_simple(); - let j = include_str!("../res/default_genesis_config_incomplete.json"); - - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_build_state", &j.encode()).unwrap(); - let r = core::result::Result::<(), String>::decode(&mut &r[..]).unwrap(); - assert_eq!( - r, - Err("Invalid JSON blob: missing field `authorities` at line 11 column 3" - .to_string()) - ); - } - - #[test] - fn write_default_config_to_tmp_file() { - if std::env::var("WRITE_DEFAULT_JSON_FOR_STR_GC").is_ok() { - sp_tracing::try_init_simple(); - let mut file = fs::OpenOptions::new() - .create(true) - .write(true) - .open("/tmp/default_genesis_config.json") - .unwrap(); - - let j = serde_json::to_string(&GenesisStorageBuilder::default().genesis_config()) - .unwrap() - .into_bytes(); - file.write_all(&j).unwrap(); - } - } - - #[test] - fn build_genesis_config_with_patch_json_works() { - //this tests shows how to do patching on native side - sp_tracing::try_init_simple(); - - let mut t = BasicExternalities::new_empty(); - let r = executor_call(&mut t, "GenesisBuilder_get_preset", &None::<&PresetId>.encode()) - .unwrap(); - let r = Option::>::decode(&mut &r[..]) - .unwrap() - .expect("default config is there"); - let mut default_config: serde_json::Value = - serde_json::from_slice(&r[..]).expect("returned value is json. qed."); - - // Patch default json with some custom values: - let patch = json!({ - "babe": { - "epochConfig": { - "c": [ - 7, - 10 - ], - "allowed_slots": "PrimaryAndSecondaryPlainSlots" - } - }, - "substrateTest": { - "authorities": [ - AccountKeyring::Ferdie.public().to_ss58check(), - AccountKeyring::Alice.public().to_ss58check() - ], - } - }); - - sc_chain_spec::json_merge(&mut default_config, patch); - - // Build genesis config using custom json: - let mut t = BasicExternalities::new_empty(); - executor_call( - &mut t, - "GenesisBuilder_build_state", - &default_config.to_string().encode(), - ) - .unwrap(); - - // Ensure that custom values are in the genesis storage: - let storage = t.into_storages(); - let get_from_storage = |key: &str| -> Vec { - storage.top.get(&array_bytes::hex2bytes(key).unwrap()).unwrap().clone() - }; - - //SubstrateTest|Authorities - let value: Vec = get_from_storage( - "00771836bebdd29870ff246d305c578c5e0621c4869aa60c02be9adcc98a0d1d", - ); - let authority_key_vec = - Vec::::decode(&mut &value[..]).unwrap(); - assert_eq!(authority_key_vec.len(), 2); - assert_eq!(authority_key_vec[0], AccountKeyring::Ferdie.public()); - assert_eq!(authority_key_vec[1], AccountKeyring::Alice.public()); - - //Babe|Authorities - let value: Vec = get_from_storage( - "1cb6f36e027abb2091cfb5110ab5087fdc6b171b77304263c292cc3ea5ed31ef", - ); - assert_eq!( - BabeEpochConfiguration::decode(&mut &value[..]).unwrap(), - BabeEpochConfiguration { - c: (7, 10), - allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots - } - ); - - // Ensure that some values are default ones: - // Balances|TotalIssuance - let value: Vec = get_from_storage( - "c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80", - ); - assert_eq!(u64::decode(&mut &value[..]).unwrap(), 0); - - //System|ParentHash - let value: Vec = get_from_storage( - "26aa394eea5630e07c48ae0c9558cef78a42f33323cb5ced3b44dd825fda9fcc", - ); - assert_eq!(H256::decode(&mut &value[..]).unwrap(), [69u8; 32].into()); - } - } -} diff --git a/test-utils/runtime/src/substrate_test_pallet.rs b/test-utils/runtime/src/substrate_test_pallet.rs deleted file mode 100644 index 8375a68..0000000 --- a/test-utils/runtime/src/substrate_test_pallet.rs +++ /dev/null @@ -1,252 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! # substrate-test pallet -//! -//! Provides functionality used in unit-tests of numerous modules across substrate that require -//! functioning runtime. Some calls are allowed to be submitted as unsigned extrinsics, however most -//! of them requires signing. Refer to `pallet::Call` for further details. - -use alloc::{vec, vec::Vec}; -use frame_support::{pallet_prelude::*, storage}; -use sp_core::sr25519::Public; -use sp_runtime::{ - traits::Hash, - transaction_validity::{ - InvalidTransaction, TransactionSource, TransactionValidity, ValidTransaction, - }, -}; - -pub use self::pallet::*; - -const LOG_TARGET: &str = "substrate_test_pallet"; - -#[frame_support::pallet(dev_mode)] -pub mod pallet { - use super::*; - use crate::TransferData; - use frame_system::pallet_prelude::*; - use sp_core::storage::well_known_keys; - use sp_runtime::{traits::BlakeTwo256, transaction_validity::TransactionPriority, Perbill}; - - #[pallet::pallet] - #[pallet::without_storage_info] - pub struct Pallet(_); - - #[pallet::config] - pub trait Config: frame_system::Config {} - - #[pallet::storage] - #[pallet::getter(fn authorities)] - pub type Authorities = StorageValue<_, Vec, ValueQuery>; - - #[pallet::genesis_config] - #[derive(frame_support::DefaultNoBound)] - pub struct GenesisConfig { - pub authorities: Vec, - #[serde(skip)] - pub _config: core::marker::PhantomData, - } - - #[pallet::genesis_build] - impl BuildGenesisConfig for GenesisConfig { - fn build(&self) { - >::put(self.authorities.clone()); - } - } - - #[pallet::call] - impl Pallet { - /// Legacy call used in transaction pool benchmarks. - #[pallet::call_index(0)] - #[pallet::weight(100)] - pub fn bench_call(_origin: OriginFor, _transfer: TransferData) -> DispatchResult { - Ok(()) - } - - /// Implicitly fill a block body with some data. - #[pallet::call_index(1)] - #[pallet::weight(100)] - pub fn include_data(origin: OriginFor, _data: Vec) -> DispatchResult { - frame_system::ensure_signed(origin)?; - Ok(()) - } - - /// Put/delete some data from storage. Intended to use as an unsigned extrinsic. - #[pallet::call_index(2)] - #[pallet::weight(100)] - pub fn storage_change( - _origin: OriginFor, - key: Vec, - value: Option>, - ) -> DispatchResult { - match value { - Some(value) => storage::unhashed::put_raw(&key, &value), - None => storage::unhashed::kill(&key), - } - Ok(()) - } - - /// Write a key value pair to the offchain database. - #[pallet::call_index(3)] - #[pallet::weight(100)] - pub fn offchain_index_set( - origin: OriginFor, - key: Vec, - value: Vec, - ) -> DispatchResult { - frame_system::ensure_signed(origin)?; - sp_io::offchain_index::set(&key, &value); - Ok(()) - } - - /// Remove a key and an associated value from the offchain database. - #[pallet::call_index(4)] - #[pallet::weight(100)] - pub fn offchain_index_clear(origin: OriginFor, key: Vec) -> DispatchResult { - frame_system::ensure_signed(origin)?; - sp_io::offchain_index::clear(&key); - Ok(()) - } - - /// Create an index for this call. - #[pallet::call_index(5)] - #[pallet::weight(100)] - pub fn indexed_call(origin: OriginFor, data: Vec) -> DispatchResult { - frame_system::ensure_signed(origin)?; - let content_hash = sp_io::hashing::blake2_256(&data); - let extrinsic_index: u32 = - storage::unhashed::get(well_known_keys::EXTRINSIC_INDEX).unwrap(); - sp_io::transaction_index::index(extrinsic_index, data.len() as u32, content_hash); - Ok(()) - } - - /// Deposit given digest items into the system storage. They will be included in a header - /// during finalization. - #[pallet::call_index(6)] - #[pallet::weight(100)] - pub fn deposit_log_digest_item( - _origin: OriginFor, - log: sp_runtime::generic::DigestItem, - ) -> DispatchResult { - >::deposit_log(log); - Ok(()) - } - - /// This call is validated as `ValidTransaction` with given priority. - #[pallet::call_index(7)] - #[pallet::weight(100)] - pub fn call_with_priority( - _origin: OriginFor, - _priority: TransactionPriority, - ) -> DispatchResult { - Ok(()) - } - - /// This call is validated as non-propagable `ValidTransaction`. - #[pallet::call_index(8)] - #[pallet::weight(100)] - pub fn call_do_not_propagate(_origin: OriginFor) -> DispatchResult { - Ok(()) - } - - /// Fill the block weight up to the given ratio. - #[pallet::call_index(9)] - #[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] - pub fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResult { - ensure_signed(origin)?; - Ok(()) - } - - /// Read X times from the state some data. - /// - /// Panics if it can not read `X` times. - #[pallet::call_index(10)] - #[pallet::weight(100)] - pub fn read(_origin: OriginFor, count: u32) -> DispatchResult { - Self::execute_read(count, false) - } - - /// Read X times from the state some data and then panic! - /// - /// Returns `Ok` if it didn't read anything. - #[pallet::call_index(11)] - #[pallet::weight(100)] - pub fn read_and_panic(_origin: OriginFor, count: u32) -> DispatchResult { - Self::execute_read(count, true) - } - } - - impl Pallet { - fn execute_read(read: u32, panic_at_end: bool) -> DispatchResult { - let mut next_key = vec![]; - for _ in 0..(read as usize) { - if let Some(next) = sp_io::storage::next_key(&next_key) { - // Read the value - sp_io::storage::get(&next); - - next_key = next; - } else { - if panic_at_end { - return Ok(()) - } else { - panic!("Could not read {read} times from the state"); - } - } - } - - if panic_at_end { - panic!("BYE") - } else { - Ok(()) - } - } - } - - #[pallet::validate_unsigned] - impl ValidateUnsigned for Pallet { - type Call = Call; - - fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity { - log::trace!(target: LOG_TARGET, "validate_unsigned {call:?}"); - match call { - // Some tests do not need to be complicated with signer and nonce, some need - // reproducible block hash (call signature can't be there). - // Offchain testing requires storage_change. - Call::deposit_log_digest_item { .. } | - Call::storage_change { .. } | - Call::read { .. } | - Call::read_and_panic { .. } => Ok(ValidTransaction { - provides: vec![BlakeTwo256::hash_of(&call).encode()], - ..Default::default() - }), - _ => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)), - } - } - } -} - -pub fn validate_runtime_call(call: &pallet::Call) -> TransactionValidity { - log::trace!(target: LOG_TARGET, "validate_runtime_call {call:?}"); - match call { - Call::call_do_not_propagate {} => - Ok(ValidTransaction { propagate: false, ..Default::default() }), - Call::call_with_priority { priority } => - Ok(ValidTransaction { priority: *priority, ..Default::default() }), - _ => Ok(Default::default()), - } -} diff --git a/test-utils/runtime/transaction-pool/Cargo.toml b/test-utils/runtime/transaction-pool/Cargo.toml deleted file mode 100644 index 3cdaea6..0000000 --- a/test-utils/runtime/transaction-pool/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "substrate-test-runtime-transaction-pool" -version = "2.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true -publish = false - -[lints] -workspace = true - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -[dependencies] -codec = { workspace = true, default-features = true } -futures = { workspace = true } -log = { workspace = true } -parking_lot = { workspace = true, default-features = true } -thiserror = { workspace = true } -sc-transaction-pool = { workspace = true, default-features = true } -sc-transaction-pool-api = { workspace = true, default-features = true } -sp-blockchain = { workspace = true, default-features = true } -sp-runtime = { workspace = true, default-features = true } -substrate-test-runtime-client = { workspace = true } diff --git a/test-utils/runtime/transaction-pool/src/lib.rs b/test-utils/runtime/transaction-pool/src/lib.rs deleted file mode 100644 index 6a4f38f..0000000 --- a/test-utils/runtime/transaction-pool/src/lib.rs +++ /dev/null @@ -1,541 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Test utils for the transaction pool together with the test runtime. -//! -//! See [`TestApi`] for more information. - -use codec::Encode; -use futures::future::ready; -use parking_lot::RwLock; -use sc_transaction_pool::ChainApi; -use sp_blockchain::{CachedHeaderMetadata, HashAndNumber, TreeRoute}; -use sp_runtime::{ - generic::{self, BlockId}, - traits::{ - BlakeTwo256, Block as BlockT, Hash as HashT, Header as _, NumberFor, TrailingZeroInput, - }, - transaction_validity::{ - InvalidTransaction, TransactionSource, TransactionValidity, TransactionValidityError, - ValidTransaction, - }, -}; -use std::{ - collections::{BTreeMap, HashMap, HashSet}, - sync::Arc, -}; -use substrate_test_runtime_client::{ - runtime::{ - AccountId, Block, BlockNumber, Extrinsic, ExtrinsicBuilder, Hash, Header, Nonce, Transfer, - TransferData, - }, - AccountKeyring::{self, *}, -}; - -/// Error type used by [`TestApi`]. -#[derive(Debug, thiserror::Error)] -#[error(transparent)] -pub struct Error(#[from] pub sc_transaction_pool_api::error::Error); - -impl sc_transaction_pool_api::error::IntoPoolError for Error { - fn into_pool_error(self) -> Result { - Ok(self.0) - } -} - -pub enum IsBestBlock { - Yes, - No, -} - -impl IsBestBlock { - pub fn is_best(&self) -> bool { - matches!(self, Self::Yes) - } -} - -impl From for IsBestBlock { - fn from(is_best: bool) -> Self { - if is_best { - Self::Yes - } else { - Self::No - } - } -} - -#[derive(Default)] -pub struct ChainState { - pub block_by_number: BTreeMap>, - pub block_by_hash: HashMap, - pub nonces: HashMap>, - pub invalid_hashes: HashSet, - pub priorities: HashMap, -} - -/// Test Api for transaction pool. -pub struct TestApi { - valid_modifier: RwLock>, - chain: RwLock, - validation_requests: RwLock>, - enable_stale_check: bool, -} - -impl TestApi { - /// Test Api with Alice nonce set initially. - pub fn with_alice_nonce(nonce: u64) -> Self { - let api = Self::empty(); - assert_eq!(api.chain.read().block_by_hash.len(), 1); - assert_eq!(api.chain.read().nonces.len(), 1); - - api.chain - .write() - .nonces - .values_mut() - .nth(0) - .map(|h| h.insert(Alice.into(), nonce)); - - api - } - - /// Default Test Api - pub fn empty() -> Self { - let api = TestApi { - valid_modifier: RwLock::new(Box::new(|_| {})), - chain: Default::default(), - validation_requests: RwLock::new(Default::default()), - enable_stale_check: false, - }; - - // Push genesis block - api.push_block(0, Vec::new(), true); - - let hash0 = *api.chain.read().block_by_hash.keys().nth(0).unwrap(); - api.chain.write().nonces.insert(hash0, Default::default()); - - api - } - - pub fn enable_stale_check(mut self) -> Self { - self.enable_stale_check = true; - self - } - - /// Set hook on modify valid result of transaction. - pub fn set_valid_modifier(&self, modifier: Box) { - *self.valid_modifier.write() = modifier; - } - - /// Push block under given number. - pub fn push_block( - &self, - block_number: BlockNumber, - xts: Vec, - is_best_block: bool, - ) -> Header { - let parent_hash = { - let chain = self.chain.read(); - block_number - .checked_sub(1) - .and_then(|num| { - chain.block_by_number.get(&num).map(|blocks| blocks[0].0.header.hash()) - }) - .unwrap_or_default() - }; - - self.push_block_with_parent(parent_hash, xts, is_best_block) - } - - /// Push a block using the given `parent`. - /// - /// Panics if `parent` does not exists. - pub fn push_block_with_parent( - &self, - parent: Hash, - xts: Vec, - is_best_block: bool, - ) -> Header { - // `Hash::default()` is the genesis parent hash - let block_number = if parent == Hash::default() { - 0 - } else { - *self - .chain - .read() - .block_by_hash - .get(&parent) - .expect("`parent` exists") - .header() - .number() + 1 - }; - - let header = Header { - number: block_number, - digest: Default::default(), - extrinsics_root: Hash::random(), - parent_hash: parent, - state_root: Default::default(), - }; - - self.add_block(Block::new(header.clone(), xts), is_best_block); - - header - } - - /// Add a block to the internal state. - pub fn add_block(&self, block: Block, is_best_block: bool) { - let hash = block.header.hash(); - let block_number = block.header.number(); - - let mut chain = self.chain.write(); - chain.block_by_hash.insert(hash, block.clone()); - - if *block_number > 0 { - // copy nonces to new block - let prev_nonces = chain - .nonces - .get(block.header.parent_hash()) - .expect("there shall be nonces for parent block") - .clone(); - chain.nonces.insert(hash, prev_nonces); - } - - log::info!( - "add_block: {:?} {:?} {:?} nonces:{:#?}", - block_number, - hash, - block.header.parent_hash(), - chain.nonces - ); - - if is_best_block { - chain - .block_by_number - .entry(*block_number) - .or_default() - .iter_mut() - .for_each(|x| { - x.1 = IsBestBlock::No; - }); - } - - chain - .block_by_number - .entry(*block_number) - .or_default() - .push((block, is_best_block.into())); - } - - fn hash_and_length_inner(ex: &Extrinsic) -> (Hash, usize) { - let encoded = ex.encode(); - (BlakeTwo256::hash(&encoded), encoded.len()) - } - - /// Mark some transaction is invalid. - /// - /// Next time transaction pool will try to validate this - /// extrinsic, api will return invalid result. - pub fn add_invalid(&self, xts: &Extrinsic) { - self.chain.write().invalid_hashes.insert(Self::hash_and_length_inner(xts).0); - } - - /// Remove a transaction that was previously declared as invalid via `[Self::add_invalid]`. - /// - /// Next time transaction pool will try to validate this - /// extrinsic, api will succeed. - pub fn remove_invalid(&self, xts: &Extrinsic) { - self.chain.write().invalid_hashes.remove(&Self::hash_and_length_inner(xts).0); - } - - /// Set a transaction priority. - pub fn set_priority(&self, xts: &Extrinsic, priority: u64) { - self.chain - .write() - .priorities - .insert(Self::hash_and_length_inner(xts).0, priority); - } - - /// Query validation requests received. - pub fn validation_requests(&self) -> Vec { - self.validation_requests.read().clone() - } - - /// get a reference to the chain state - pub fn chain(&self) -> &RwLock { - &self.chain - } - - /// Set nonce in the inner state for given block. - pub fn set_nonce(&self, at: Hash, account: AccountId, nonce: u64) { - let mut chain = self.chain.write(); - chain.nonces.entry(at).and_modify(|h| { - h.insert(account, nonce); - }); - - log::debug!("set_nonce: {:?} nonces:{:#?}", at, chain.nonces); - } - - /// Increment nonce in the inner state for given block. - pub fn increment_nonce_at_block(&self, at: Hash, account: AccountId) { - let mut chain = self.chain.write(); - chain.nonces.entry(at).and_modify(|h| { - h.entry(account).and_modify(|n| *n += 1).or_insert(1); - }); - - log::debug!("increment_nonce_at_block: {:?} nonces:{:#?}", at, chain.nonces); - } - - /// Increment nonce in the inner state. - pub fn increment_nonce(&self, account: AccountId) { - let mut chain = self.chain.write(); - // if no particular block was given, then update nonce everywhere - chain.nonces.values_mut().for_each(|h| { - h.entry(account).and_modify(|n| *n += 1).or_insert(1); - }) - } - - /// Calculate a tree route between the two given blocks. - pub fn tree_route( - &self, - from: Hash, - to: Hash, - ) -> Result, Error> { - sp_blockchain::tree_route(self, from, to) - } - - /// Helper function for mapping block number to hash. Use if mapping shall not fail. - pub fn expect_hash_from_number(&self, n: BlockNumber) -> Hash { - self.block_id_to_hash(&BlockId::Number(n)).unwrap().unwrap() - } - - /// Helper function for getting genesis hash - pub fn genesis_hash(&self) -> Hash { - self.expect_hash_from_number(0) - } - - pub fn expect_hash_and_number(&self, n: BlockNumber) -> HashAndNumber { - HashAndNumber { hash: self.expect_hash_from_number(n), number: n } - } -} - -trait TagFrom { - fn tag_from(&self) -> u8; -} - -impl TagFrom for AccountId { - fn tag_from(&self) -> u8 { - let f = AccountKeyring::iter().enumerate().find(|k| AccountId::from(k.1) == *self); - u8::try_from(f.unwrap().0).unwrap() - } -} - -impl ChainApi for TestApi { - type Block = Block; - type Error = Error; - type ValidationFuture = futures::future::Ready>; - type BodyFuture = futures::future::Ready>, Error>>; - - fn validate_transaction( - &self, - at: ::Hash, - _source: TransactionSource, - uxt: Arc<::Extrinsic>, - ) -> Self::ValidationFuture { - let uxt = (*uxt).clone(); - self.validation_requests.write().push(uxt.clone()); - let block_number; - - match self.block_id_to_number(&BlockId::Hash(at)) { - Ok(Some(number)) => { - let found_best = self - .chain - .read() - .block_by_number - .get(&number) - .map(|blocks| blocks.iter().any(|b| b.1.is_best())) - .unwrap_or(false); - block_number = Some(number); - - // If there is no best block, we don't know based on which block we should validate - // the transaction. (This is not required for this test function, but in real - // environment it would fail because of this). - if !found_best { - return ready(Ok(Err(TransactionValidityError::Invalid( - InvalidTransaction::Custom(1), - )))) - } - }, - Ok(None) => - return ready(Ok(Err(TransactionValidityError::Invalid( - InvalidTransaction::Custom(2), - )))), - Err(e) => return ready(Err(e)), - } - - let (requires, provides) = if let Ok(transfer) = TransferData::try_from(&uxt) { - let chain_nonce = self - .chain - .read() - .nonces - .get(&at) - .expect("nonces must be there for every block") - .get(&transfer.from) - .cloned() - .unwrap_or(0); - let requires = if chain_nonce == transfer.nonce { - vec![] - } else { - if self.enable_stale_check { - vec![vec![transfer.from.tag_from(), (transfer.nonce - 1) as u8]] - } else { - vec![vec![(transfer.nonce - 1) as u8]] - } - }; - let provides = if self.enable_stale_check { - vec![vec![transfer.from.tag_from(), transfer.nonce as u8]] - } else { - vec![vec![transfer.nonce as u8]] - }; - - log::info!( - "test_api::validate_transaction: h:{:?} n:{:?} cn:{:?} tn:{:?} r:{:?} p:{:?}", - at, - block_number, - chain_nonce, - transfer.nonce, - requires, - provides, - ); - - if self.enable_stale_check && transfer.nonce < chain_nonce { - log::info!("test_api::validate_transaction: invalid_transaction(stale)...."); - return ready(Ok(Err(TransactionValidityError::Invalid(InvalidTransaction::Stale)))) - } - - (requires, provides) - } else { - (Vec::new(), vec![uxt.encode()]) - }; - - if self.chain.read().invalid_hashes.contains(&self.hash_and_length(&uxt).0) { - log::info!("test_api::validate_transaction: invalid_transaction...."); - return ready(Ok(Err(TransactionValidityError::Invalid(InvalidTransaction::Custom(0))))) - } - - let priority = self.chain.read().priorities.get(&self.hash_and_length(&uxt).0).cloned(); - let mut validity = ValidTransaction { - priority: priority.unwrap_or(1), - requires, - provides, - longevity: 64, - propagate: true, - }; - - (self.valid_modifier.read())(&mut validity); - - ready(Ok(Ok(validity))) - } - - fn validate_transaction_blocking( - &self, - _at: ::Hash, - _source: TransactionSource, - _uxt: Arc<::Extrinsic>, - ) -> Result { - unimplemented!(); - } - - fn block_id_to_number( - &self, - at: &BlockId, - ) -> Result>, Error> { - Ok(match at { - generic::BlockId::Hash(x) => - self.chain.read().block_by_hash.get(x).map(|b| *b.header.number()), - generic::BlockId::Number(num) => Some(*num), - }) - } - - fn block_id_to_hash( - &self, - at: &BlockId, - ) -> Result::Hash>, Error> { - Ok(match at { - generic::BlockId::Hash(x) => Some(*x), - generic::BlockId::Number(num) => - self.chain.read().block_by_number.get(num).and_then(|blocks| { - blocks.iter().find(|b| b.1.is_best()).map(|b| b.0.header().hash()) - }), - }) - } - - fn hash_and_length(&self, ex: &::Extrinsic) -> (Hash, usize) { - Self::hash_and_length_inner(ex) - } - - fn block_body(&self, hash: ::Hash) -> Self::BodyFuture { - futures::future::ready(Ok(self - .chain - .read() - .block_by_hash - .get(&hash) - .map(|b| b.extrinsics().to_vec()))) - } - - fn block_header( - &self, - hash: ::Hash, - ) -> Result::Header>, Self::Error> { - Ok(self.chain.read().block_by_hash.get(&hash).map(|b| b.header().clone())) - } - - fn tree_route( - &self, - from: ::Hash, - to: ::Hash, - ) -> Result, Self::Error> { - sp_blockchain::tree_route::(self, from, to).map_err(Into::into) - } -} - -impl sp_blockchain::HeaderMetadata for TestApi { - type Error = Error; - - fn header_metadata(&self, hash: Hash) -> Result, Self::Error> { - let chain = self.chain.read(); - let block = chain.block_by_hash.get(&hash).expect("Hash exists"); - - Ok(block.header().into()) - } - - fn insert_header_metadata(&self, _: Hash, _: CachedHeaderMetadata) { - unimplemented!("Not implemented for tests") - } - - fn remove_header_metadata(&self, _: Hash) { - unimplemented!("Not implemented for tests") - } -} - -/// Generate transfer extrinsic with a given nonce. -/// -/// Part of the test api. -pub fn uxt(who: AccountKeyring, nonce: Nonce) -> Extrinsic { - let dummy = codec::Decode::decode(&mut TrailingZeroInput::zeroes()).unwrap(); - let transfer = Transfer { from: who.into(), to: dummy, nonce, amount: 1 }; - ExtrinsicBuilder::new_transfer(transfer).build() -} From de7366f8f35b7e6f3278d166d889925bdae0bfc9 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:17:24 -0600 Subject: [PATCH 08/21] ignore tarpaulin report --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c786b7e..8958065 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ release.json rls*.log runtime/wasm/target/ substrate.code-workspace -target*/ \ No newline at end of file +target*/ +tarpaulin-report.html \ No newline at end of file From 6f81743aaf2defaa2364f7b5f39ff7fbaeb86487 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:48:49 -0600 Subject: [PATCH 09/21] cleanup unused deps --- Cargo.lock | 8 ++--- Cargo.toml | 29 ++++--------------- client/consensus/randomness-beacon/Cargo.toml | 2 -- pallets/randomness-beacon/Cargo.toml | 13 ++++----- .../consensus/randomness-beacon/Cargo.toml | 3 -- 5 files changed, 15 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5933295..37251ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3627,11 +3627,11 @@ dependencies = [ "pallet-xcm", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "staging-xcm", "staging-xcm-builder", diff --git a/Cargo.toml b/Cargo.toml index a26a306..e01599c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,54 +65,35 @@ tokio = { version = "^1", features = ["full"] } # Serialization array-bytes = { version = "6.2.2", default-features = false } +hex = { version = "0.4", features = ["serde"], default-features = false } serde = { version = "1.0.197", default-features = false } serde_json = { version = "1.0.132", default-features = false } # Polkadot & Substrate frame-benchmarking = { version = "39.0.0", default-features = false } frame-executive = { version = "39.0.0", default-features = false } -frame-metadata-hash-extension = { version = "0.7.0", default-features = false } frame-support = { version = "39.0.0", default-features = false } frame-system = { version = "39.1.0", default-features = false } -frame-system-rpc-runtime-api = { version = "35.0.0", default-features = false } -pallet-babe = { version = "39.0.0", default-features = false } -pallet-balances = { version = "40.0.1", default-features = false } -pallet-timestamp = { version = "38.0.0", default-features = false } -# sc-basic-authorship = { version = "0.48.0", default-features = false } -# sc-block-builder = { version = "0.43.0", default-features = false } -# sc-client-api = { version = "38.0.0", default-features = false } -# sc-consensus = { version = "0.47.0", default-features = false } -# sc-consensus-manual-seal = { version = "0.49.0", default-features = false } -sc-chain-spec = { version = "41.0.0", default-features = false } -sc-client-db = { version = "0.45.0", default-features = false } -sc-executor = { version = "0.41.0", default-features = false } -sc-executor-common = { version = "0.36.0", default-features = false } -sc-offchain = { version = "43.0.0", default-features = false } -sc-service = { version = "0.49.0", default-features = false } -sc-transaction-pool = { version = "38.1.0", default-features = false } -sc-transaction-pool-api = { version = "38.1.0", default-features = false } +sc-consensus-randomness-beacon = { path = "./client/consensus/randomness-beacon", default-features = false } sc-utils = { version = "18.0.0", default-features = false } -sp-api = { version = "35.0.0", default-features = false } sp-consensus-randomness-beacon = { path = "./primitives/consensus/randomness-beacon", default-features = false } sp-core = { version = "35.0.0", default-features = false } sp-inherents = { version = "35.0.0", default-features = false } sp-io = { version = "39.0.0", default-features = false } -sp-keyring = { version = "40.0.0", default-features = false } sp-keystore = { version = "0.41.0", default-features = false } sp-runtime = { version = "40.1.0", default-features = false } -# Arkworks (crypto) +# Arkworks & Crypto sp-ark-bls12-381 = { git = "https://github.com/paritytech/arkworks-substrate", version = "0.4.2", default-features = false } ark-bls12-381 = { version = "0.4.0", features = ["curve"], default-features = false } ark-serialize = { version = "0.4.0", features = ["derive"], default-features = false } ark-ec = { version = "0.4.0", default-features = false } ark-std = { version = "0.4.0", default-features = false } +sha2 = { version = "0.10.8" } +timelock = { version = "0.0.1", default-features = false } # Logging & Utilities log = { version = "0.4.21", default-features = false } -parking_lot = { version = "0.12.1", default-features = false } -tracing = { version = "0.1.41", default-features = false } -trie-db = { version = "0.29.1", default-features = false } # Parity SCALE Codec codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } diff --git a/client/consensus/randomness-beacon/Cargo.toml b/client/consensus/randomness-beacon/Cargo.toml index 7050510..aecbace 100644 --- a/client/consensus/randomness-beacon/Cargo.toml +++ b/client/consensus/randomness-beacon/Cargo.toml @@ -34,8 +34,6 @@ prost-build = "0.13.4" async-std = "1.13.0" rand = "0.8.5" tokio.workspace = true -# substrate-test-runtime-transaction-pool.workspace = true -# substrate-test-runtime-client.workspace = true [features] diff --git a/pallets/randomness-beacon/Cargo.toml b/pallets/randomness-beacon/Cargo.toml index 4ee39c5..1d111d1 100644 --- a/pallets/randomness-beacon/Cargo.toml +++ b/pallets/randomness-beacon/Cargo.toml @@ -18,26 +18,25 @@ targets = ["x86_64-unknown-linux-gnu"] codec.workspace = true scale-info.workspace = true serde = { workspace = true, features = ["derive"] } -sha2 = { version = "0.10.8" } +sha2.workspace = true log.workspace = true -hex = { version = "0.4", features = ["serde"], default-features = false } +hex.workspace = true # frame deps frame-benchmarking = { workspace = true, optional = true } frame-support.workspace = true frame-system.workspace = true -sc-consensus-randomness-beacon = { path = "../../client/consensus/randomness-beacon", default-features = false } -sp-consensus-randomness-beacon = { path = "../../primitives/consensus/randomness-beacon", default-features = false } +sc-consensus-randomness-beacon.workspace = true +sp-consensus-randomness-beacon.workspace = true sp-core.workspace = true sp-io.workspace = true sp-runtime.workspace = true -# arkworks dependencies +# crypto dependencies sp-ark-bls12-381 = { workspace = true, optional = true } ark-bls12-381.workspace = true ark-serialize.workspace = true ark-ec.workspace = true ark-std.workspace = true -timelock = { version = "0.0.1", default-features = false } - +timelock.workspace = true [dev-dependencies] sp-keystore.workspace = true diff --git a/primitives/consensus/randomness-beacon/Cargo.toml b/primitives/consensus/randomness-beacon/Cargo.toml index b6b66cd..c7dbd1c 100644 --- a/primitives/consensus/randomness-beacon/Cargo.toml +++ b/primitives/consensus/randomness-beacon/Cargo.toml @@ -29,6 +29,3 @@ std = [ "async-trait", "sp-inherents/std", ] - -# # Serde support without relying on std features. -# serde = ["scale-info/serde"] From 060fd45d013558966b2dc5e923fd2ecfdac3cac3 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:52:03 -0600 Subject: [PATCH 10/21] remove tarp report --- tarpaulin-report.html | 671 ------------------------------------------ 1 file changed, 671 deletions(-) delete mode 100644 tarpaulin-report.html diff --git a/tarpaulin-report.html b/tarpaulin-report.html deleted file mode 100644 index 98ac127..0000000 --- a/tarpaulin-report.html +++ /dev/null @@ -1,671 +0,0 @@ - - - - - - - -
- - - - - - \ No newline at end of file From 8d98f5732f58f623134aa638465eb4ce663b30f8 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:54:00 -0600 Subject: [PATCH 11/21] 127.0.0.1 -> 0.0.0.0 --- client/consensus/randomness-beacon/src/gossipsub.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 6dd5e2e..9584eff 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -79,7 +79,7 @@ use prost::Message; use sc_utils::mpsc::TracingUnboundedSender; /// The default address instructing libp2p to choose a random open port on the local machine -const RAND_LISTEN_ADDR: &str = "/ip4/127.0.0.1/tcp/0"; +const RAND_LISTEN_ADDR: &str = "/ip4/0.0.0.0/tcp/0"; /// Various errors that can be encountered #[derive(Debug, Clone, PartialEq)] From 8b5a8fd65b7be968df96a6a5b5b1a3b66336462c Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:55:04 -0600 Subject: [PATCH 12/21] cleanup test --- .../randomness-beacon/src/gossipsub.rs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 9584eff..6d4790a 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -283,7 +283,6 @@ mod tests { "There should be an `SignatureBufferCapacityExceeded` error." ); } - // tokio::test fn build_node() -> (GossipsubNetwork, TracingUnboundedReceiver) { let local_identity: Keypair = Keypair::generate_ed25519(); @@ -340,27 +339,6 @@ mod tests { assert!(!is_err, "There should be no errors."); } - // #[tokio::test] - // async fn can_build_node_and_fail_with_bad_peers() { - // let topic_str = "test"; - // let (mut node, _rx) = build_node(); - - // let bad_addr: Multiaddr = "/dns4/example.com/udp/1234".parse().unwrap(); - // // let fake_listen_addr: Multiaddr = - // Multiaddr::empty().with(libp2p::multiaddr::Protocol::WebRTCDirect); - - // // Spawn the async task and capture the result - // let handle = tokio::spawn(async move { - // node.run(topic_str, vec![bad_addr]).await - // }); - - // sleep(Duration::from_secs(1)).await; - - // // Await the spawned task and assert that it failed - // let result = handle.await.expect("Task panicked"); - // assert!(result.is_err(), "Expected an error but got success."); - // } - #[tokio::test] async fn can_build_node_and_fail_with_random_peers() { let topic_str = "test"; From ac6dba75d690475453e84480bcf70c7e774ad0bc Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 10:57:42 -0600 Subject: [PATCH 13/21] update comment --- client/consensus/randomness-beacon/src/gossipsub.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 6d4790a..5cc01c9 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -114,6 +114,8 @@ impl GossipsubNetwork { /// /// * `key`: A libp2p keypair /// * `gossipsub_config`: A gossipsub config + /// * `sender`: A `TracingUnboundedSender` that can send an `OpaquePulse` + /// * `listen_addr`: An optional address to listen on. If None, then a random local port will be assigned. pub fn new( key: &Keypair, gossipsub_config: GossipsubConfig, From 44605e0350104f8efb26be2b1a144f2a025e99a5 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 4 Mar 2025 11:12:47 -0600 Subject: [PATCH 14/21] fix comment length --- client/consensus/randomness-beacon/src/gossipsub.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/consensus/randomness-beacon/src/gossipsub.rs b/client/consensus/randomness-beacon/src/gossipsub.rs index 5cc01c9..8675d67 100644 --- a/client/consensus/randomness-beacon/src/gossipsub.rs +++ b/client/consensus/randomness-beacon/src/gossipsub.rs @@ -115,7 +115,7 @@ impl GossipsubNetwork { /// * `key`: A libp2p keypair /// * `gossipsub_config`: A gossipsub config /// * `sender`: A `TracingUnboundedSender` that can send an `OpaquePulse` - /// * `listen_addr`: An optional address to listen on. If None, then a random local port will be assigned. + /// * `listen_addr`: An optional address to listen on. If None, a random local port is assigned. pub fn new( key: &Keypair, gossipsub_config: GossipsubConfig, From 01295dd7f2d4fdc1dd2ac21e5e133f62f314cda6 Mon Sep 17 00:00:00 2001 From: driemworks Date: Thu, 6 Mar 2025 16:28:56 -0600 Subject: [PATCH 15/21] feat: configure max blocks per pulse and set genesis round --- pallets/randomness-beacon/src/lib.rs | 57 ++++++++++----- pallets/randomness-beacon/src/mock.rs | 2 +- pallets/randomness-beacon/src/tests.rs | 99 ++++++++++++++++++-------- 3 files changed, 112 insertions(+), 46 deletions(-) diff --git a/pallets/randomness-beacon/src/lib.rs b/pallets/randomness-beacon/src/lib.rs index 7c38b5a..6b9896c 100644 --- a/pallets/randomness-beacon/src/lib.rs +++ b/pallets/randomness-beacon/src/lib.rs @@ -131,8 +131,8 @@ pub mod pallet { type BeaconConfig: Get; /// something that knows how to aggregate and verify beacon pulses. type SignatureAggregator: SignatureAggregator; - /// The number of pulses per block. - type SignatureToBlockRatio: Get; + /// The number of signatures per block. + type MaxSigsPerBlock: Get; } /// A first round number for which a pulse was observed @@ -173,6 +173,10 @@ pub mod pallet { GenesisRoundNotSet, /// The genesis is already set. GenesisRoundAlreadySet, + /// There must be at least one signature to construct an asig + ZeroHeightProvided, + /// There number of aggregated signatures exceeds the maximum rounds we can verify per block. + ExcessiveHeightProvided, } #[pallet::inherent] @@ -184,9 +188,11 @@ pub mod pallet { sp_consensus_randomness_beacon::inherents::INHERENT_IDENTIFIER; fn create_inherent(data: &InherentData) -> Option { - // if we do not find any pulse data, then do nothing + // if we do not find any pulse data, then do nothing\ if let Ok(Some(raw_pulses)) = data.get_data::>>(&Self::INHERENT_IDENTIFIER) { + // ignores non-deserializable messages + // if all messages are invalid, it outputs 0 on the G1 curve (so serialization of asig always works) let asig = raw_pulses .iter() .filter_map(|rp| OpaquePulse::deserialize_from_vec(rp).ok()) @@ -194,14 +200,25 @@ pub mod pallet { .fold(zero_on_g1(), |acc, sig| (acc + sig).into()); let mut asig_bytes = Vec::with_capacity(SERIALIZED_SIG_SIZE); - if asig.serialize_compressed(&mut asig_bytes).is_err() { - log::error!("Failed to serialize the aggregated signature."); - return None; - } + // [SRLABS]: This error is untestable since we know the signature is correct here. + // Is it reasonable to use an expect? + asig.serialize_compressed(&mut asig_bytes) + .expect("The signature is well formatted."); + + // if the genesis round is not configured, then the first call sets it + let round = (GenesisRound::::get() == 0) + .then(|| { + // get the round from the first pulse observed + raw_pulses.iter().find_map(|rp| { + OpaquePulse::deserialize_from_vec(rp).ok().map(|p| p.round) + }) + }) + .unwrap_or(None); return Some(Call::try_submit_asig { asig: OpaqueSignature::truncate_from(asig_bytes), - round: None, + height: raw_pulses.len() as RoundNumber, + round, }); } else { log::info!("The node provided empty pulse data to the inherent!"); @@ -210,8 +227,11 @@ pub mod pallet { None } - fn check_inherent(_call: &Self::Call, _data: &InherentData) -> Result<(), Self::Error> { - Ok(()) + fn check_inherent(call: &Self::Call, _data: &InherentData) -> Result<(), Self::Error> { + match call { + Call::try_submit_asig { .. } => Ok(()), + _ => unreachable!("other calls are not inherents"), + } } fn is_inherent(call: &Self::Call) -> bool { @@ -225,6 +245,7 @@ pub mod pallet { /// /// * `origin`: A None origin /// * `asig`: An aggregated signature + /// * `height`: The number of sigs aggregated to construct asig /// * `round`: An optional genesis round number. It can only be set if the existing genesis /// round is 0. #[pallet::call_index(0)] @@ -232,15 +253,21 @@ pub mod pallet { pub fn try_submit_asig( origin: OriginFor, asig: OpaqueSignature, + height: RoundNumber, round: Option, ) -> DispatchResult { - // In the future, this will expected a signed payload - // https://github.com/ideal-lab5/idn-sdk/issues/117 ensure_none(origin)?; + let config = T::BeaconConfig::get(); let mut genesis_round = GenesisRound::::get(); let mut latest_round = LatestRound::::get(); + frame_support::ensure!(height > 0, Error::::ZeroHeightProvided); + frame_support::ensure!( + height <= T::MaxSigsPerBlock::get() as u64, + Error::::ExcessiveHeightProvided + ); + if let Some(r) = round { // if a round is provided and the genesis round is not set frame_support::ensure!(genesis_round == 0, Error::::GenesisRoundAlreadySet); @@ -260,14 +287,12 @@ pub mod pallet { config.public_key, asig, latest_round, - T::SignatureToBlockRatio::get() as u64, + height, AggregatedSignature::::get(), ) .map_err(|_| Error::::VerificationFailed)?; - LatestRound::::set( - latest_round.saturating_add(T::SignatureToBlockRatio::get() as u64), - ); + LatestRound::::set(latest_round.saturating_add(height)); AggregatedSignature::::set(Some(aggr)); diff --git a/pallets/randomness-beacon/src/mock.rs b/pallets/randomness-beacon/src/mock.rs index cbaae8d..fcd1275 100644 --- a/pallets/randomness-beacon/src/mock.rs +++ b/pallets/randomness-beacon/src/mock.rs @@ -63,7 +63,7 @@ impl pallet_drand_bridge::Config for Test { type WeightInfo = (); type BeaconConfig = QuicknetBeaconConfig; type SignatureAggregator = QuicknetAggregator; - type SignatureToBlockRatio = ConstU8<2>; + type MaxSigsPerBlock = ConstU8<2>; } // Build genesis storage according to the mock runtime. diff --git a/pallets/randomness-beacon/src/tests.rs b/pallets/randomness-beacon/src/tests.rs index 03b5b0c..2eeec58 100644 --- a/pallets/randomness-beacon/src/tests.rs +++ b/pallets/randomness-beacon/src/tests.rs @@ -12,12 +12,12 @@ fn can_construct_pallet_and_set_genesis_params() { } #[test] -fn can_fail_write_pulse_when_genesis_round_zero() { +fn can_fail_write_pulse_when_genesis_round_zero_and_none_provided() { let (sig, _pk) = get(vec![PULSE1000]); new_test_ext().execute_with(|| { System::set_block_number(1); assert_noop!( - Drand::try_submit_asig(RuntimeOrigin::none(), sig, None), + Drand::try_submit_asig(RuntimeOrigin::none(), sig, 1, None), Error::::GenesisRoundNotSet, ); }); @@ -31,7 +31,7 @@ fn can_submit_min_required_valid_pulses_on_genesis() { new_test_ext().execute_with(|| { System::set_block_number(1); - assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig.clone(), Some(round))); + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig.clone(), 2, Some(round))); // then the gensis round is set to `round` let genesis_round = GenesisRound::::get(); @@ -46,20 +46,30 @@ fn can_submit_min_required_valid_pulses_on_genesis() { }); } -// note: this test is equivalent to either specifying: -// a) an incorrect signature but correct round -// b) a correct signature but incorrect round #[test] -fn can_not_submit_less_than_min_required_valid_pulses_on_genesis() { +fn can_fail_when_sig_height_is_0() { let round = 1000u64; - let (asig, _apk) = get(vec![PULSE1000]); + let (asig, _apk) = get(vec![PULSE1000, PULSE1001]); new_test_ext().execute_with(|| { System::set_block_number(1); + assert_noop!( + Drand::try_submit_asig(RuntimeOrigin::none(), asig.clone(), 0, Some(round)), + Error::::ZeroHeightProvided + ); + }); +} +#[test] +fn can_fail_when_sig_height_is_exceeds_max() { + let round = 1000u64; + let (asig, _apk) = get(vec![PULSE1000, PULSE1001]); + + new_test_ext().execute_with(|| { + System::set_block_number(1); assert_noop!( - Drand::try_submit_asig(RuntimeOrigin::none(), asig.clone(), Some(round)), - Error::::VerificationFailed, + Drand::try_submit_asig(RuntimeOrigin::none(), asig.clone(), 10, Some(round)), + Error::::ExcessiveHeightProvided ); }); } @@ -77,8 +87,8 @@ fn can_submit_valid_sigs_in_sequence() { new_test_ext().execute_with(|| { System::set_block_number(1); - assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), Some(round1))); - assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig2.clone(), None)); + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1))); + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig2.clone(), 2, None)); // then the gensis round is set to `round` let genesis_round = GenesisRound::::get(); @@ -95,6 +105,7 @@ fn can_submit_valid_sigs_in_sequence() { assert_eq!(round2, actual_latest); }); } + #[test] fn can_fail_to_submit_invalid_sigs_in_sequence() { let round1 = 1000u64; @@ -104,13 +115,13 @@ fn can_fail_to_submit_invalid_sigs_in_sequence() { new_test_ext().execute_with(|| { System::set_block_number(1); - assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), Some(round1))); + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1))); assert_noop!( - Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), None), + Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, None), Error::::VerificationFailed, ); assert_noop!( - Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), Some(round1)), + Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1)), Error::::GenesisRoundAlreadySet, ); @@ -133,14 +144,12 @@ fn can_fail_to_submit_invalid_sigs_in_sequence() { /* Inherents Tests */ - -use ark_serialize::CanonicalSerialize; use sc_consensus_randomness_beacon::types::OpaquePulse; use sp_consensus_randomness_beacon::inherents::INHERENT_IDENTIFIER; use sp_inherents::InherentData; #[test] -fn can_create_inherent() { +fn can_create_inherent_and_set_genesis_round() { // setup the inherent data let (asig1, _apk1) = get(vec![PULSE1000]); let pulse1 = OpaquePulse { round: 1000u64, signature: asig1.to_vec().try_into().unwrap() }; @@ -155,8 +164,36 @@ fn can_create_inherent() { new_test_ext().execute_with(|| { let result = Drand::create_inherent(&inherent_data); - if let Some(Call::try_submit_asig { asig: actual_asig, round: None }) = result { - assert_eq!(actual_asig, asig); + if let Some(Call::try_submit_asig { asig: actual_asig, height, round: Some(1000) }) = result + { + assert_eq!(height, 2, "The asig height should equal the number of pulses."); + assert_eq!(actual_asig, asig, "The output should match the aggregated input."); + } else { + panic!("Expected Some(Call::try_submit_asig), got None"); + } + }); +} + +#[test] +fn can_create_inherent_when_genesis_round_is_set() { + // setup the inherent data + let (asig1, _apk1) = get(vec![PULSE1000]); + let pulse1 = OpaquePulse { round: 1000u64, signature: asig1.to_vec().try_into().unwrap() }; + let (asig2, _apk2) = get(vec![PULSE1001]); + let pulse2 = OpaquePulse { round: 1001u64, signature: asig2.to_vec().try_into().unwrap() }; + + let (asig, _apk) = get(vec![PULSE1000, PULSE1001]); + + let bytes: Vec> = vec![pulse1.serialize_to_vec(), pulse2.serialize_to_vec()]; + let mut inherent_data = InherentData::new(); + inherent_data.put_data(INHERENT_IDENTIFIER, &bytes.clone()).unwrap(); + + new_test_ext().execute_with(|| { + GenesisRound::::set(999); + let result = Drand::create_inherent(&inherent_data); + if let Some(Call::try_submit_asig { asig: actual_asig, height, round: None }) = result { + assert_eq!(height, 2, "The asig height should equal the number of pulses."); + assert_eq!(actual_asig, asig, "The output should match the aggregated input."); } else { panic!("Expected Some(Call::try_submit_asig), got None"); } @@ -173,20 +210,24 @@ fn can_not_create_inherent_when_data_is_unavailable() { } #[test] -fn can_create_inherent_when_data_is_non_decodable() { - // set bad inherent data - let bytes: Vec> = vec![vec![1, 2, 3, 4, 5]]; +fn can_check_inherent() { + // setup the inherent data + let (asig1, _apk1) = get(vec![PULSE1000]); + let pulse1 = OpaquePulse { round: 1000u64, signature: asig1.to_vec().try_into().unwrap() }; + let (asig2, _apk2) = get(vec![PULSE1001]); + let pulse2 = OpaquePulse { round: 1001u64, signature: asig2.to_vec().try_into().unwrap() }; + + let bytes: Vec> = vec![pulse1.serialize_to_vec(), pulse2.serialize_to_vec()]; let mut inherent_data = InherentData::new(); inherent_data.put_data(INHERENT_IDENTIFIER, &bytes.clone()).unwrap(); - let asig = crate::aggregator::zero_on_g1(); - let mut bytes = Vec::new(); - asig.serialize_compressed(&mut bytes).unwrap(); - new_test_ext().execute_with(|| { + GenesisRound::::set(999); let result = Drand::create_inherent(&inherent_data); - if let Some(Call::try_submit_asig { asig: actual_asig, round: None }) = result { - assert_eq!(actual_asig.to_vec(), bytes.to_vec()); + if let Some(call) = result { + assert!(Drand::is_inherent(&call), "The inherent should be allowed."); + let res = Drand::check_inherent(&call, &inherent_data); + assert!(res.is_ok(), "The inherent should be allowed."); } else { panic!("Expected Some(Call::try_submit_asig), got None"); } From 17a70e090f1bda7d7f1f2ed34262ff57af058145 Mon Sep 17 00:00:00 2001 From: driemworks Date: Fri, 7 Mar 2025 14:06:04 -0600 Subject: [PATCH 16/21] benchmarks wip --- pallets/randomness-beacon/src/aggregator.rs | 3 ++ pallets/randomness-beacon/src/benchmarking.rs | 49 +++++++++---------- pallets/randomness-beacon/src/lib.rs | 6 ++- pallets/randomness-beacon/src/tests.rs | 16 ++++++ 4 files changed, 47 insertions(+), 27 deletions(-) diff --git a/pallets/randomness-beacon/src/aggregator.rs b/pallets/randomness-beacon/src/aggregator.rs index b138bcd..394439e 100644 --- a/pallets/randomness-beacon/src/aggregator.rs +++ b/pallets/randomness-beacon/src/aggregator.rs @@ -108,6 +108,9 @@ impl SignatureAggregator for QuicknetAggregator { // compute new rounds let latest = start + height; let rounds = (start..latest).collect::>(); + + // TODO: Investigate lookup table for round numbers + // https://github.com/ideal-lab5/idn-sdk/issues/119 for r in rounds { let q = compute_round_on_g1(r)?; apk = (apk + q).into() diff --git a/pallets/randomness-beacon/src/benchmarking.rs b/pallets/randomness-beacon/src/benchmarking.rs index 5897a21..a326b76 100644 --- a/pallets/randomness-beacon/src/benchmarking.rs +++ b/pallets/randomness-beacon/src/benchmarking.rs @@ -18,7 +18,7 @@ use super::*; #[allow(unused)] -use crate::{pallet as pallet_drand, Pallet as Drand}; +use crate::{pallet as pallet_drand, mock::*, Pallet as Drand, types::*}; use ark_ec::Group; use ark_std::{ops::Mul, UniformRand}; use frame_benchmarking::v2::*; @@ -31,49 +31,48 @@ mod benchmarks { use super::*; use ark_std::test_rng; - #[benchmark] - fn set_beacon_config() { - let config = drand_quicknet_config(); - - #[extrinsic_call] - _(RawOrigin::Root, config.clone()); - - assert_eq!(BeaconConfig::::get(), Some(config)); - } - #[benchmark] fn try_submit_asig() { // we mock drand here - let sk = ::Scalar::rand(&mut test_rng()); - let pk = ::PublicKeyGroup::generator().mul(sk); - let mut pk_bytes = Vec::new(); - pk.serialize_compressed(&mut pk_bytes).unwrap(); + let sk = ::Scalar::from(1); + // let pk = ::PublicKeyGroup::generator().mul(sk); + // let mut pk_bytes = Vec::new(); + // pk.serialize_compressed(&mut pk_bytes).unwrap(); - let mut config = drand_quicknet_config(); - config.public_key = BoundedVec::truncate_from(pk_bytes); + // let mut config = drand_quicknet_config(); + // config.public_key = BoundedVec::truncate_from(pk_bytes); - pallet_drand::BeaconConfig::::set(Some(config)); + // pallet_drand::BeaconConfig::::set(Some(config)); - let block_number: BlockNumberFor = 1u32.into(); let start = 1; - let num_rounds = 1; + let num_rounds = 2; + + let mut asig = crate::aggregator::zero_on_g1(); + let mut apk = crate::verifier::zero_on_g1(); - let mut asig = crate::verifier::zero_on_g1(); for round in start..start + num_rounds { let q_id = crate::verifier::compute_round_on_g1(round).unwrap(); + apk = (apk + q_id).into(); asig = (asig + (q_id.mul(sk))).into(); } let mut asig_bytes = Vec::new(); asig.serialize_compressed(&mut asig_bytes).unwrap(); - let bounded_asig = BoundedVec::truncate_from(asig_bytes); + let bounded_asig = OpaqueSignature::truncate_from(asig_bytes); + + let mut apk_bytes = Vec::new(); + apk.serialize_compressed(&mut apk_bytes).unwrap(); + let bounded_message_hash = OpaqueSignature::truncate_from(apk_bytes); #[extrinsic_call] - _(RawOrigin::None, bounded_asig.clone(), start.clone(), num_rounds.clone()); + _(RawOrigin::None, bounded_asig.clone(), num_rounds.clone(), Some(start)); assert_eq!( - AggregatedSignatures::::get(block_number), - Some((bounded_asig, start, num_rounds)) + AggregatedSignature::::get(), + Some(Aggregate { + signature: bounded_asig, + message_hash: bounded_message_hash, + }) ); } diff --git a/pallets/randomness-beacon/src/lib.rs b/pallets/randomness-beacon/src/lib.rs index 6b9896c..3897490 100644 --- a/pallets/randomness-beacon/src/lib.rs +++ b/pallets/randomness-beacon/src/lib.rs @@ -188,7 +188,7 @@ pub mod pallet { sp_consensus_randomness_beacon::inherents::INHERENT_IDENTIFIER; fn create_inherent(data: &InherentData) -> Option { - // if we do not find any pulse data, then do nothing\ + // if we do not find any pulse data, then do nothing if let Ok(Some(raw_pulses)) = data.get_data::>>(&Self::INHERENT_IDENTIFIER) { // ignores non-deserializable messages @@ -257,6 +257,7 @@ pub mod pallet { round: Option, ) -> DispatchResult { ensure_none(origin)?; + // if called => reject; let config = T::BeaconConfig::get(); let mut genesis_round = GenesisRound::::get(); @@ -281,8 +282,9 @@ pub mod pallet { Error::::GenesisRoundNotSet ); } - // aggregate old asig/apk with the new one and verify the aggregation + // Q: do we care about the entire linear history of message hashes? + // https://github.com/ideal-lab5/idn-sdk/issues/119 let aggr = T::SignatureAggregator::aggregate_and_verify( config.public_key, asig, diff --git a/pallets/randomness-beacon/src/tests.rs b/pallets/randomness-beacon/src/tests.rs index 2eeec58..6876b47 100644 --- a/pallets/randomness-beacon/src/tests.rs +++ b/pallets/randomness-beacon/src/tests.rs @@ -1,3 +1,19 @@ +/* + * Copyright 2025 by Ideal Labs, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + use crate::{ aggregator::test::*, mock::*, AggregatedSignature, Call, Error, GenesisRound, LatestRound, }; From b2888de3f211a6b33544e8233d5f2d480443f13d Mon Sep 17 00:00:00 2001 From: driemworks Date: Fri, 7 Mar 2025 15:39:24 -0600 Subject: [PATCH 17/21] add check to limit extrinsic to one call per block --- pallets/randomness-beacon/src/lib.rs | 45 ++++++++++++++++++++---- pallets/randomness-beacon/src/tests.rs | 32 ++++++++++++++++- pallets/randomness-beacon/src/weights.rs | 4 +++ 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/pallets/randomness-beacon/src/lib.rs b/pallets/randomness-beacon/src/lib.rs index 3897490..a57062d 100644 --- a/pallets/randomness-beacon/src/lib.rs +++ b/pallets/randomness-beacon/src/lib.rs @@ -116,6 +116,7 @@ const SERIALIZED_SIG_SIZE: usize = 48; #[frame_support::pallet] pub mod pallet { use super::*; + use frame_support::ensure; use frame_system::pallet_prelude::*; #[pallet::pallet] @@ -148,6 +149,13 @@ pub mod pallet { #[pallet::storage] pub type AggregatedSignature = StorageValue<_, Aggregate, OptionQuery>; + /// Whether the asig has been updated in this block. + /// + /// This value is updated to `true` upon successful submission of an asig by a node. + /// It is then checked at the end of each block execution in the `on_finalize` hook. + #[pallet::storage] + pub(super) type DidUpdate = StorageValue<_, bool, ValueQuery>; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { @@ -177,6 +185,8 @@ pub mod pallet { ZeroHeightProvided, /// There number of aggregated signatures exceeds the maximum rounds we can verify per block. ExcessiveHeightProvided, + /// Only one aggregated signature can be provided per block + SignatureAlreadyVerified, } #[pallet::inherent] @@ -239,6 +249,26 @@ pub mod pallet { } } + #[pallet::hooks] + impl Hooks> for Pallet { + /// A dummy `on_initialize` to return the amount of weight that `on_finalize` requires to + /// execute. + fn on_initialize(_n: BlockNumberFor) -> Weight { + // weight of `on_finalize` + T::WeightInfo::on_finalize() + } + + /// At the end of block execution, the `on_finalize` hook checks that the timestamp was + /// updated. Upon success, it removes the boolean value from storage. If the value resolves + /// to `false`, the pallet will panic. + /// + /// ## Complexity + /// - `O(1)` + fn on_finalize(_n: BlockNumberFor) { + assert!(DidUpdate::::take(), "The aggregated siganture must be updated once in the block"); + } + } + #[pallet::call] impl Pallet { /// Write a set of pulses to the runtime @@ -257,27 +287,30 @@ pub mod pallet { round: Option, ) -> DispatchResult { ensure_none(origin)?; - // if called => reject; + ensure!( + !DidUpdate::::exists(), + Error::::SignatureAlreadyVerified, + ); let config = T::BeaconConfig::get(); let mut genesis_round = GenesisRound::::get(); let mut latest_round = LatestRound::::get(); - frame_support::ensure!(height > 0, Error::::ZeroHeightProvided); - frame_support::ensure!( + ensure!(height > 0, Error::::ZeroHeightProvided); + ensure!( height <= T::MaxSigsPerBlock::get() as u64, Error::::ExcessiveHeightProvided ); if let Some(r) = round { // if a round is provided and the genesis round is not set - frame_support::ensure!(genesis_round == 0, Error::::GenesisRoundAlreadySet); + ensure!(genesis_round == 0, Error::::GenesisRoundAlreadySet); GenesisRound::::set(r); genesis_round = r; latest_round = genesis_round; } else { // if the genesis round is not set and a round is not provided - frame_support::ensure!( + ensure!( GenesisRound::::get() > 0, Error::::GenesisRoundNotSet ); @@ -295,8 +328,8 @@ pub mod pallet { .map_err(|_| Error::::VerificationFailed)?; LatestRound::::set(latest_round.saturating_add(height)); - AggregatedSignature::::set(Some(aggr)); + DidUpdate::::put(true); Self::deposit_event(Event::::SignatureVerificationSuccess); diff --git a/pallets/randomness-beacon/src/tests.rs b/pallets/randomness-beacon/src/tests.rs index 6876b47..19a3d80 100644 --- a/pallets/randomness-beacon/src/tests.rs +++ b/pallets/randomness-beacon/src/tests.rs @@ -16,8 +16,9 @@ use crate::{ aggregator::test::*, mock::*, AggregatedSignature, Call, Error, GenesisRound, LatestRound, + weights::*, }; -use frame_support::{assert_noop, assert_ok, inherent::ProvideInherent}; +use frame_support::{assert_noop, assert_ok, inherent::ProvideInherent, traits::OnFinalize}; #[test] fn can_construct_pallet_and_set_genesis_params() { @@ -104,6 +105,10 @@ fn can_submit_valid_sigs_in_sequence() { System::set_block_number(1); assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1))); + + Drand::on_finalize(1); + System::set_block_number(2); + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig2.clone(), 2, None)); // then the gensis round is set to `round` @@ -122,6 +127,27 @@ fn can_submit_valid_sigs_in_sequence() { }); } +#[test] +fn can_fail_to_calls_to_try_submit_asig_per_block() { + let round1 = 1000u64; + let round2 = 1004u64; + + let (asig1, _apk1) = get(vec![PULSE1000, PULSE1001]); + let (asig2, _apk2) = get(vec![PULSE1002, PULSE1003]); + // the aggregated values + let (asig, apk) = get(vec![PULSE1000, PULSE1001, PULSE1002, PULSE1003]); + + new_test_ext().execute_with(|| { + System::set_block_number(1); + + assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1))); + assert_noop!( + Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, None), + Error::::SignatureAlreadyVerified, + ); + }); +} + #[test] fn can_fail_to_submit_invalid_sigs_in_sequence() { let round1 = 1000u64; @@ -132,6 +158,10 @@ fn can_fail_to_submit_invalid_sigs_in_sequence() { System::set_block_number(1); assert_ok!(Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, Some(round1))); + + Drand::on_finalize(1); + System::set_block_number(2); + assert_noop!( Drand::try_submit_asig(RuntimeOrigin::none(), asig1.clone(), 2, None), Error::::VerificationFailed, diff --git a/pallets/randomness-beacon/src/weights.rs b/pallets/randomness-beacon/src/weights.rs index bff1c99..d8925a8 100644 --- a/pallets/randomness-beacon/src/weights.rs +++ b/pallets/randomness-beacon/src/weights.rs @@ -18,10 +18,14 @@ use frame_support::weights::Weight; pub trait WeightInfo { + fn on_finalize() -> Weight; fn try_submit_asig() -> Weight; } impl WeightInfo for () { + fn on_finalize() -> Weight { + Weight::from_parts(2_956_000, 1627) + } fn try_submit_asig() -> Weight { Weight::from_parts(2_956_000, 1627) } From a0e0c003d391a9b264799462f0cfd2be9537ec6d Mon Sep 17 00:00:00 2001 From: driemworks Date: Mon, 10 Mar 2025 08:48:14 -0500 Subject: [PATCH 18/21] revert benchmarking changes --- pallets/randomness-beacon/src/benchmarking.rs | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/pallets/randomness-beacon/src/benchmarking.rs b/pallets/randomness-beacon/src/benchmarking.rs index a326b76..eac98ae 100644 --- a/pallets/randomness-beacon/src/benchmarking.rs +++ b/pallets/randomness-beacon/src/benchmarking.rs @@ -18,7 +18,7 @@ use super::*; #[allow(unused)] -use crate::{pallet as pallet_drand, mock::*, Pallet as Drand, types::*}; +use crate::{pallet as pallet_drand, Pallet as Drand}; use ark_ec::Group; use ark_std::{ops::Mul, UniformRand}; use frame_benchmarking::v2::*; @@ -31,50 +31,51 @@ mod benchmarks { use super::*; use ark_std::test_rng; + #[benchmark] + fn set_beacon_config() { + let config = drand_quicknet_config(); + + #[extrinsic_call] + _(RawOrigin::Root, config.clone()); + + assert_eq!(BeaconConfig::::get(), Some(config)); + } + #[benchmark] fn try_submit_asig() { // we mock drand here - let sk = ::Scalar::from(1); - // let pk = ::PublicKeyGroup::generator().mul(sk); - // let mut pk_bytes = Vec::new(); - // pk.serialize_compressed(&mut pk_bytes).unwrap(); + let sk = ::Scalar::rand(&mut test_rng()); + let pk = ::PublicKeyGroup::generator().mul(sk); + let mut pk_bytes = Vec::new(); + pk.serialize_compressed(&mut pk_bytes).unwrap(); - // let mut config = drand_quicknet_config(); - // config.public_key = BoundedVec::truncate_from(pk_bytes); + let mut config = drand_quicknet_config(); + config.public_key = BoundedVec::truncate_from(pk_bytes); - // pallet_drand::BeaconConfig::::set(Some(config)); + pallet_drand::BeaconConfig::::set(Some(config)); + let block_number: BlockNumberFor = 1u32.into(); let start = 1; - let num_rounds = 2; - - let mut asig = crate::aggregator::zero_on_g1(); - let mut apk = crate::verifier::zero_on_g1(); + let num_rounds = 1; + let mut asig = crate::verifier::zero_on_g1(); for round in start..start + num_rounds { let q_id = crate::verifier::compute_round_on_g1(round).unwrap(); - apk = (apk + q_id).into(); asig = (asig + (q_id.mul(sk))).into(); } let mut asig_bytes = Vec::new(); asig.serialize_compressed(&mut asig_bytes).unwrap(); - let bounded_asig = OpaqueSignature::truncate_from(asig_bytes); - - let mut apk_bytes = Vec::new(); - apk.serialize_compressed(&mut apk_bytes).unwrap(); - let bounded_message_hash = OpaqueSignature::truncate_from(apk_bytes); + let bounded_asig = BoundedVec::truncate_from(asig_bytes); #[extrinsic_call] - _(RawOrigin::None, bounded_asig.clone(), num_rounds.clone(), Some(start)); + _(RawOrigin::None, bounded_asig.clone(), start.clone(), num_rounds.clone()); assert_eq!( - AggregatedSignature::::get(), - Some(Aggregate { - signature: bounded_asig, - message_hash: bounded_message_hash, - }) + AggregatedSignatures::::get(block_number), + Some((bounded_asig, start, num_rounds)) ); } impl_benchmark_test_suite!(Drand, crate::mock::new_test_ext(), crate::mock::Test); -} +} \ No newline at end of file From 7dc27ecb81f9e6cd2cec2658a0c00c33a56176ca Mon Sep 17 00:00:00 2001 From: driemworks Date: Mon, 10 Mar 2025 09:17:05 -0500 Subject: [PATCH 19/21] formatting --- pallets/randomness-beacon/src/benchmarking.rs | 2 +- pallets/randomness-beacon/src/lib.rs | 21 +++++++++---------- pallets/randomness-beacon/src/tests.rs | 6 +++--- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/pallets/randomness-beacon/src/benchmarking.rs b/pallets/randomness-beacon/src/benchmarking.rs index eac98ae..5897a21 100644 --- a/pallets/randomness-beacon/src/benchmarking.rs +++ b/pallets/randomness-beacon/src/benchmarking.rs @@ -78,4 +78,4 @@ mod benchmarks { } impl_benchmark_test_suite!(Drand, crate::mock::new_test_ext(), crate::mock::Test); -} \ No newline at end of file +} diff --git a/pallets/randomness-beacon/src/lib.rs b/pallets/randomness-beacon/src/lib.rs index a57062d..9e56e48 100644 --- a/pallets/randomness-beacon/src/lib.rs +++ b/pallets/randomness-beacon/src/lib.rs @@ -183,7 +183,8 @@ pub mod pallet { GenesisRoundAlreadySet, /// There must be at least one signature to construct an asig ZeroHeightProvided, - /// There number of aggregated signatures exceeds the maximum rounds we can verify per block. + /// There number of aggregated signatures exceeds the maximum rounds we can verify per + /// block. ExcessiveHeightProvided, /// Only one aggregated signature can be provided per block SignatureAlreadyVerified, @@ -202,7 +203,8 @@ pub mod pallet { if let Ok(Some(raw_pulses)) = data.get_data::>>(&Self::INHERENT_IDENTIFIER) { // ignores non-deserializable messages - // if all messages are invalid, it outputs 0 on the G1 curve (so serialization of asig always works) + // if all messages are invalid, it outputs 0 on the G1 curve (so serialization of + // asig always works) let asig = raw_pulses .iter() .filter_map(|rp| OpaquePulse::deserialize_from_vec(rp).ok()) @@ -265,7 +267,10 @@ pub mod pallet { /// ## Complexity /// - `O(1)` fn on_finalize(_n: BlockNumberFor) { - assert!(DidUpdate::::take(), "The aggregated siganture must be updated once in the block"); + assert!( + DidUpdate::::take(), + "The aggregated siganture must be updated once in the block" + ); } } @@ -287,10 +292,7 @@ pub mod pallet { round: Option, ) -> DispatchResult { ensure_none(origin)?; - ensure!( - !DidUpdate::::exists(), - Error::::SignatureAlreadyVerified, - ); + ensure!(!DidUpdate::::exists(), Error::::SignatureAlreadyVerified,); let config = T::BeaconConfig::get(); let mut genesis_round = GenesisRound::::get(); @@ -310,10 +312,7 @@ pub mod pallet { latest_round = genesis_round; } else { // if the genesis round is not set and a round is not provided - ensure!( - GenesisRound::::get() > 0, - Error::::GenesisRoundNotSet - ); + ensure!(GenesisRound::::get() > 0, Error::::GenesisRoundNotSet); } // aggregate old asig/apk with the new one and verify the aggregation // Q: do we care about the entire linear history of message hashes? diff --git a/pallets/randomness-beacon/src/tests.rs b/pallets/randomness-beacon/src/tests.rs index 19a3d80..c992d89 100644 --- a/pallets/randomness-beacon/src/tests.rs +++ b/pallets/randomness-beacon/src/tests.rs @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + use crate::{ - aggregator::test::*, mock::*, AggregatedSignature, Call, Error, GenesisRound, LatestRound, - weights::*, + aggregator::test::*, mock::*, weights::*, AggregatedSignature, Call, Error, GenesisRound, + LatestRound, }; use frame_support::{assert_noop, assert_ok, inherent::ProvideInherent, traits::OnFinalize}; From b3edc025a21b3d1a05d95389aaa39428c42e1c48 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 11 Mar 2025 09:06:06 -0500 Subject: [PATCH 20/21] chore: fix typo --- pallets/randomness-beacon/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/randomness-beacon/src/lib.rs b/pallets/randomness-beacon/src/lib.rs index 9e56e48..fdff567 100644 --- a/pallets/randomness-beacon/src/lib.rs +++ b/pallets/randomness-beacon/src/lib.rs @@ -183,7 +183,7 @@ pub mod pallet { GenesisRoundAlreadySet, /// There must be at least one signature to construct an asig ZeroHeightProvided, - /// There number of aggregated signatures exceeds the maximum rounds we can verify per + /// The number of aggregated signatures exceeds the maximum rounds that we can verify per /// block. ExcessiveHeightProvided, /// Only one aggregated signature can be provided per block From f2af244c259661fc943de72e7d3e6971bcd07136 Mon Sep 17 00:00:00 2001 From: driemworks Date: Tue, 11 Mar 2025 10:22:48 -0500 Subject: [PATCH 21/21] remove tarp report --- tarpaulin-report.html | 671 ------------------------------------------ 1 file changed, 671 deletions(-) delete mode 100644 tarpaulin-report.html diff --git a/tarpaulin-report.html b/tarpaulin-report.html deleted file mode 100644 index ac7e428..0000000 --- a/tarpaulin-report.html +++ /dev/null @@ -1,671 +0,0 @@ - - - - - - - -
- - - - - - \ No newline at end of file