From 3ac372bef8760bf58000b18873a921c096fe1727 Mon Sep 17 00:00:00 2001 From: Alexander Kalankhodzhaev Date: Wed, 28 Jun 2023 19:11:43 +0700 Subject: [PATCH] split trappist and stout builds (#241) --- .github/templates/free-space/action.yaml | 23 ++ .github/templates/setup-worker/action.yaml | 5 - .github/workflows/check.yml | 32 +- Cargo.lock | 366 +++++++++++---------- Cargo.toml | 1 - node/Cargo.toml | 13 +- node/src/benchmarking.rs | 2 + node/src/chain_spec/mod.rs | 3 + node/src/chain_spec/stout.rs | 2 +- node/src/command.rs | 221 ++++++++----- node/src/rpc.rs | 9 +- node/src/service.rs | 23 +- pallets/asset-registry/Cargo.toml | 2 +- pallets/benchmarks/Cargo.toml | 4 +- 14 files changed, 392 insertions(+), 314 deletions(-) create mode 100644 .github/templates/free-space/action.yaml diff --git a/.github/templates/free-space/action.yaml b/.github/templates/free-space/action.yaml new file mode 100644 index 00000000..9a78d16b --- /dev/null +++ b/.github/templates/free-space/action.yaml @@ -0,0 +1,23 @@ +name: free-space +description: | + This action frees up disk space on the runner. + +runs: + using: "composite" + + steps: + - name: Remove Android library + shell: bash + run: sudo rm -rf /usr/local/lib/android + + - name: Remove .NET runtime + shell: bash + run: sudo rm -rf /usr/share/dotnet + + - name: Remove CodeQL + shell: bash + run: sudo rm -rf /opt/hostedtoolcache/CodeQL + + - name: Removes cached Docker images + shell: bash + run: sudo docker image prune --all --force \ No newline at end of file diff --git a/.github/templates/setup-worker/action.yaml b/.github/templates/setup-worker/action.yaml index df6cf7e0..381feac9 100644 --- a/.github/templates/setup-worker/action.yaml +++ b/.github/templates/setup-worker/action.yaml @@ -3,11 +3,6 @@ description: | This action sets up a worker for use in other actions. It installs the necessary dependencies for building the project. -inputs: - rust-components: - description: Comma-separated list of components to be additionally installed for a new rust toolchain - required: false - runs: using: "composite" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f918afde..f977f1af 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,8 +18,6 @@ jobs: - name: Setup worker uses: "./.github/templates/setup-worker" - with: - rust-components: rustfmt - name: Check formatting run: cargo fmt --all -- --check @@ -42,29 +40,23 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-release + key: ${{ runner.os }}-cargo-release-0_9_37-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-release-0_9_37 - - name: Check Build Trappist Runtime + - name: Check Build Trappist node run: | - SKIP_WASM_BUILD=1 cargo check --release + SKIP_WASM_BUILD=1 cargo check --release --locked test: needs: lint runs-on: ubuntu-latest steps: - # Tests with benchmarks require a lot of disk space - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - android: true - dotnet: true - haskell: false - large-packages: false - swap-storage: false - - uses: actions/checkout@v3 + # Tests with benchmarks require a lot of disk space + - name: Free Disk Space + uses: "./.github/templates/free-space" + - name: Setup worker uses: "./.github/templates/setup-worker" @@ -77,9 +69,9 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-debug + key: ${{ runner.os }}-cargo-debug-0_9_37-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo-debug-0_9_37 - - name: Run tests + - name: Run Trappist tests run: | - cargo test --features runtime-benchmarks --jobs 1 + cargo test --workspace --exclude stout-runtime --no-default-features --features trappist/trappist-runtime,std,runtime-benchmarks --locked --jobs 1 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8c56080c..54c6d6a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.27.2", + "gimli 0.27.3", ] [[package]] @@ -90,9 +90,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher 0.4.4", @@ -120,7 +120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" dependencies = [ "aead 0.5.2", - "aes 0.8.2", + "aes 0.8.3", "cipher 0.4.4", "ctr 0.9.2", "ghash 0.5.0", @@ -223,15 +223,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -302,9 +302,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asn1-rs" @@ -414,7 +414,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.19", + "rustix 0.37.20", "slab", "socket2 0.4.9", "waker-fn", @@ -437,7 +437,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -662,7 +662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "constant_time_eq", ] @@ -673,18 +673,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "constant_time_eq", ] [[package]] name = "blake3" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" +checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "cc", "cfg-if", "constant_time_eq", @@ -1007,9 +1007,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.2" +version = "4.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" +checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" dependencies = [ "clap_builder", "clap_derive", @@ -1018,9 +1018,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" dependencies = [ "anstream", "anstyle", @@ -1038,7 +1038,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -1103,9 +1103,9 @@ checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" [[package]] name = "constant_time_eq" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "convert_case" @@ -1159,9 +1159,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -1181,7 +1181,7 @@ version = "0.88.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", @@ -1311,14 +1311,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset 0.9.0", "scopeguard", ] @@ -1334,9 +1334,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -1968,9 +1968,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109308c20e8445959c2792e81871054c6a17e6976489a93d2769641a2ba5839c" +checksum = "e88abab2f5abbe4c56e8f1fb431b784d710b709888f35755a160e62e33fe38e8" dependencies = [ "cc", "cxxbridge-flags", @@ -1980,9 +1980,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf4c6755cdf10798b97510e0e2b3edb9573032bd9379de8fffa59d68165494f" +checksum = "5c0c11acd0e63bae27dcd2afced407063312771212b7a823b4fd72d633be30fb" dependencies = [ "cc", "codespan-reporting", @@ -1990,24 +1990,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] name = "cxxbridge-flags" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882074421238e84fe3b4c65d0081de34e5b323bf64555d3e61991f76eb64a7bb" +checksum = "8d3816ed957c008ccd4728485511e3d9aaf7db419aa321e3d2c5a2f3411e36c8" [[package]] name = "cxxbridge-macro" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a076022ece33e7686fb76513518e219cca4fce5750a8ae6d1ce6c0f48fd1af9" +checksum = "a26acccf6f445af85ea056362561a24ef56cdc15fcc685f03aec50b9c702cb6d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2249,7 +2249,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2345,7 +2345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek 3.2.0", - "hashbrown", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -2409,7 +2409,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2420,7 +2420,7 @@ checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2455,6 +2455,12 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.2.8" @@ -2565,7 +2571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" dependencies = [ "expander 0.0.4", - "indexmap", + "indexmap 1.9.3", "proc-macro-crate", "proc-macro2", "quote", @@ -3062,7 +3068,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -3189,7 +3195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.6.0", + "polyval 0.6.1", ] [[package]] @@ -3199,15 +3205,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glob" @@ -3241,9 +3247,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -3251,7 +3257,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -3296,6 +3302,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" version = "0.4.1" @@ -3446,9 +3458,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -3598,10 +3610,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "indexmap-nostd" version = "0.4.0" @@ -3697,9 +3719,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" @@ -3709,7 +3731,7 @@ checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes 1.0.11", - "rustix 0.37.19", + "rustix 0.37.20", "windows-sys 0.48.0", ] @@ -3739,9 +3761,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -3788,7 +3810,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" dependencies = [ "anyhow", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "async-lock", "async-trait", "beef", @@ -3879,7 +3901,7 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -4049,9 +4071,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -4135,7 +4157,7 @@ dependencies = [ "rand 0.8.5", "rw-stream-sink", "sec1", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "thiserror", "unsigned-varint", @@ -4219,7 +4241,7 @@ dependencies = [ "multihash 0.17.0", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "zeroize", ] @@ -4230,7 +4252,7 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "asynchronous-codec", "bytes", "either", @@ -4244,7 +4266,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "thiserror", "uint", @@ -4319,7 +4341,7 @@ dependencies = [ "prost", "prost-build", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "snow", "static_assertions", "thiserror", @@ -4660,9 +4682,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "lru" @@ -4670,7 +4692,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -4763,7 +4785,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.37.19", + "rustix 0.37.20", ] [[package]] @@ -4786,9 +4808,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -4800,7 +4822,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -4989,7 +5011,7 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.6", + "sha2 0.10.7", "sha3", "unsigned-varint", ] @@ -5223,7 +5245,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "itoa", ] @@ -5276,8 +5298,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", - "hashbrown", - "indexmap", + "hashbrown 0.12.3", + "indexmap 1.9.3", "memchr", ] @@ -5381,7 +5403,7 @@ checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -5392,7 +5414,7 @@ checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ "ecdsa", "elliptic-curve", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -6654,11 +6676,11 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.5.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" +checksum = "2287753623c76f953acd29d15d8100bcab84d29db78fb6f352adb3c53e83b967" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "bitvec", "byte-slice-cast", "bytes", @@ -6669,9 +6691,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2b6937b5e67bfba3351b87b040d48352a2fcb6ad72f81855412ce97b45c8f110" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6801,9 +6823,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" +checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" dependencies = [ "thiserror", "ucd-trie", @@ -6811,9 +6833,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" +checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" dependencies = [ "pest", "pest_generator", @@ -6821,26 +6843,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" +checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] name = "pest_meta" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" +checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" dependencies = [ "once_cell", "pest", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -6850,7 +6872,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -6870,7 +6892,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -7105,7 +7127,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap", + "indexmap 1.9.3", "lru", "parity-scale-codec", "polkadot-erasure-coding", @@ -8029,7 +8051,7 @@ dependencies = [ "arrayvec 0.5.2", "fatality", "futures", - "indexmap", + "indexmap 1.9.3", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8093,9 +8115,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if", "cpufeatures", @@ -8226,9 +8248,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -8607,7 +8629,7 @@ checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -8922,9 +8944,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ "bitflags", "errno 0.3.1", @@ -8961,9 +8983,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -10071,9 +10093,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b569c32c806ec3abdf3b5869fb8bf1e0d275a7c1c9b0b05603d9464632649edf" +checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" dependencies = [ "bitvec", "cfg-if", @@ -10085,9 +10107,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53012eae69e5aa5c14671942a5dd47de59d4cdcff8532a6dd0e081faf1119482" +checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10280,14 +10302,14 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -10345,9 +10367,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -10477,7 +10499,7 @@ dependencies = [ "rand_core 0.6.4", "ring", "rustc_version 0.4.0", - "sha2 0.10.6", + "sha2 0.10.7", "subtle", ] @@ -10781,7 +10803,7 @@ dependencies = [ "blake2", "byteorder", "digest 0.10.7", - "sha2 0.10.6", + "sha2 0.10.7", "sha3", "sp-std", "twox-hash", @@ -11168,7 +11190,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "ahash", "hash-db", - "hashbrown", + "hashbrown 0.12.3", "lazy_static", "lru", "memory-db", @@ -11608,9 +11630,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" dependencies = [ "proc-macro2", "quote", @@ -11658,9 +11680,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" [[package]] name = "tempfile" @@ -11672,7 +11694,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.19", + "rustix 0.37.20", "windows-sys 0.48.0", ] @@ -11708,7 +11730,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -11820,7 +11842,7 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -11879,7 +11901,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -11931,17 +11953,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] @@ -12002,13 +12024,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -12281,7 +12303,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" dependencies = [ "hash-db", - "hashbrown", + "hashbrown 0.12.3", "log", "rustc-hex", "smallvec", @@ -12355,6 +12377,7 @@ source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.37#6f dependencies = [ "clap", "frame-remote-externalities", + "frame-try-runtime", "hex", "log", "parity-scale-codec", @@ -12529,9 +12552,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.3.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ "getrandom 0.2.10", ] @@ -12596,11 +12619,10 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -12624,9 +12646,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -12634,24 +12656,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -12661,9 +12683,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12671,22 +12693,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" @@ -12830,7 +12852,7 @@ version = "0.89.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" dependencies = [ - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -12851,7 +12873,7 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object 0.29.0", @@ -12929,7 +12951,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", - "indexmap", + "indexmap 1.9.3", "log", "object 0.29.0", "serde", @@ -12984,7 +13006,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -13014,9 +13036,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -13074,7 +13096,7 @@ dependencies = [ "sdp", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "stun", "thiserror", "time 0.3.22", @@ -13137,7 +13159,7 @@ dependencies = [ "sec1", "serde", "sha1", - "sha2 0.10.6", + "sha2 0.10.7", "signature", "subtle", "thiserror", @@ -13632,9 +13654,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] @@ -13848,7 +13870,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cf2fd383..bc1d9f97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ members = [ "primitives/xcm", ] exclude = [ - "contracts", "xcm-simulator" ] diff --git a/node/Cargo.toml b/node/Cargo.toml index 53e46fdb..5a76bbc4 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -7,7 +7,6 @@ license = { workspace = true } homepage = { workspace = true } repository = { workspace = true } edition = { workspace = true } -default-run = "trappist-node" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -26,8 +25,8 @@ log = { workspace = true } serde = { workspace = true } # Local Dependencies -trappist-runtime = { workspace = true } -stout-runtime = { workspace = true } +trappist-runtime = { workspace = true, optional = true } +stout-runtime = { workspace = true, optional = true } jsonrpsee = { workspace = true, features = ["server"] } # External Dependencies @@ -107,13 +106,13 @@ wait-timeout = { workspace = true } polkadot-cli = { workspace = true } [features] -default = [] +default = ["trappist-runtime", "stout-runtime"] runtime-benchmarks = [ - "trappist-runtime/runtime-benchmarks", - "stout-runtime/runtime-benchmarks", + "trappist-runtime?/runtime-benchmarks", + "stout-runtime?/runtime-benchmarks", "polkadot-cli/runtime-benchmarks" ] try-runtime = [ - "trappist-runtime/try-runtime", + "trappist-runtime?/try-runtime", "try-runtime-cli/try-runtime" ] diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index e3c811b5..9a77dd2b 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -41,6 +41,7 @@ impl RemarkBuilder { } } +#[cfg(feature = "trappist-runtime")] impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder { fn pallet(&self) -> &str { "system" @@ -104,6 +105,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder { fn pallet(&self) -> &str { "system" diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 23259ea2..5af8d4cf 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -21,7 +21,10 @@ use serde::{Deserialize, Serialize}; use sp_core::{Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; +#[cfg(feature = "stout-runtime")] pub mod stout; + +#[cfg(feature = "trappist-runtime")] pub mod trappist; /// The default XCM version to set in genesis config. diff --git a/node/src/chain_spec/stout.rs b/node/src/chain_spec/stout.rs index 13a6055f..f8663ce5 100644 --- a/node/src/chain_spec/stout.rs +++ b/node/src/chain_spec/stout.rs @@ -100,7 +100,7 @@ pub fn stout_local_testnet_config() -> ChainSpec { } /// Configure initial storage state for FRAME modules. -fn testnet_genesis( +pub fn testnet_genesis( invulnerables: Vec<(AccountId, AuraId)>, root_key: AccountId, endowed_accounts: Vec, diff --git a/node/src/command.rs b/node/src/command.rs index 04a9239e..7a6ea0f2 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -15,12 +15,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{ - benchmarking::{inherent_benchmark_data, RemarkBuilder}, - chain_spec, - cli::{Cli, RelayChainCli, Subcommand}, - service::{new_partial, Block, StoutRuntimeExecutor, TrappistRuntimeExecutor}, -}; +use std::{net::SocketAddr, path::PathBuf}; + use cumulus_client_cli::generate_genesis_block; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; @@ -34,18 +30,26 @@ use sc_cli::{ use sc_service::config::{BasePath, PrometheusConfig}; use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; -use std::{net::SocketAddr, path::PathBuf}; + +use crate::{ + benchmarking::{inherent_benchmark_data, RemarkBuilder}, + chain_spec, + cli::{Cli, RelayChainCli, Subcommand}, + service::{new_partial, Block}, +}; /// Dispatches the code to the currently selected runtime. macro_rules! dispatch_runtime { ($runtime:expr, |$alias: ident| $code:expr) => { match $runtime { + #[cfg(feature = "trappist-runtime")] Runtime::Trappist => { #[allow(unused_imports)] use trappist_runtime as $alias; $code }, + #[cfg(feature = "stout-runtime")] Runtime::Stout => { #[allow(unused_imports)] use stout_runtime as $alias; @@ -86,23 +90,43 @@ macro_rules! construct_async_run { /// Helper enum that is used for better distinction of different parachain/runtime configuration /// (it is based/calculated on ChainSpec's ID attribute) -#[derive(Debug, PartialEq, Default)] +#[derive(Debug, PartialEq)] enum Runtime { - #[default] + #[cfg(feature = "trappist-runtime")] Trappist, + #[cfg(feature = "stout-runtime")] Stout, } +#[cfg(feature = "trappist-runtime")] +impl Default for Runtime { + fn default() -> Self { + Runtime::Trappist + } +} + +#[cfg(all(feature = "stout-runtime", not(feature = "trappist-runtime")))] +impl Default for Runtime { + fn default() -> Self { + Runtime::Stout + } +} + impl From<&str> for Runtime { fn from(value: &str) -> Self { + #[cfg(feature = "trappist-runtime")] if value.starts_with("trappist") { - Runtime::Trappist - } else if value.starts_with("stout") { - Runtime::Stout - } else { - log::warn!("No specific runtime was recognized for ChainSpec's id: '{value}', so `Trappist` will be used as default."); - Runtime::default() + return Runtime::Trappist } + + #[cfg(feature = "stout-runtime")] + if value.starts_with("stout") { + return Runtime::Stout + } + + let fallback = Runtime::default(); + log::warn!("No specific runtime was recognized for ChainSpec's id: '{value}', so `{fallback:?}` will be used as default."); + fallback } } @@ -135,20 +159,25 @@ impl RuntimeResolver for PathBuf { fn load_spec(id: &str) -> std::result::Result, String> { Ok(match id { - "" => Box::new(chain_spec::trappist::trappist_live_config()), + #[cfg(feature = "trappist-runtime")] "dev" | "trappist-dev" => Box::new(chain_spec::trappist::development_config()), - "stout-dev" => unimplemented!("stout-dev chain spec is not available yet"), + #[cfg(feature = "trappist-runtime")] "trappist-local" => Box::new(chain_spec::trappist::trappist_local_testnet_config()), - "stout-local" => Box::new(chain_spec::stout::stout_local_testnet_config()), // Live chain spec for Rococo - Trappist] - "trappist-rococo" => Box::new(chain_spec::trappist::trappist_live_config()), + #[cfg(feature = "trappist-runtime")] + "" | "trappist-rococo" => Box::new(chain_spec::trappist::trappist_live_config()), + #[cfg(feature = "stout-runtime")] + "stout-dev" => unimplemented!("stout-dev chain spec is not available yet"), + #[cfg(feature = "stout-runtime")] + "stout-local" => Box::new(chain_spec::stout::stout_local_testnet_config()), // -- Loading a specific spec from disk path => { let path: PathBuf = path.into(); match path.runtime() { + #[cfg(feature = "trappist-runtime")] + Runtime::Trappist => Box::new(chain_spec::trappist::ChainSpec::from_json_file(path)?), + #[cfg(feature = "stout-runtime")] Runtime::Stout => Box::new(chain_spec::stout::ChainSpec::from_json_file(path)?), - Runtime::Trappist => - Box::new(chain_spec::trappist::ChainSpec::from_json_file(path)?), } }, }) @@ -313,8 +342,10 @@ pub fn run() -> Result<()> { } match config.chain_spec.runtime() { - Runtime::Trappist => cmd.run::(config), - Runtime::Stout => cmd.run::(config), + #[cfg(feature = "trappist-runtime")] + Runtime::Trappist => cmd.run::(config), + #[cfg(feature = "stout-runtime")] + Runtime::Stout => cmd.run::(config), } }, BenchmarkCmd::Block(cmd) => { @@ -590,16 +621,22 @@ impl CliConfiguration for RelayChainCli { #[cfg(test)] mod tests { - use crate::{ - chain_spec::{get_account_id_from_seed, get_collator_keys_from_seed}, - command::{Runtime, RuntimeResolver}, + use cumulus_primitives_core::ParaId; + use std::path::PathBuf; + + use parachains_common::{AccountId, AuraId}; + use sc_chain_spec::{ + ChainSpec, ChainSpecExtension, ChainSpecGroup, ChainType, Extension, GenericChainSpec, }; - use parachains_common::AuraId; - use sc_chain_spec::{ChainSpec, ChainSpecExtension, ChainSpecGroup, ChainType, Extension}; use serde::{Deserialize, Serialize}; use sp_core::sr25519; - use std::path::PathBuf; use tempfile::TempDir; + + use crate::{ + chain_spec::{get_account_id_from_seed, get_collator_keys_from_seed}, + command::{Runtime, RuntimeResolver}, + }; + #[derive( Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension, Default, )] @@ -619,41 +656,23 @@ mod tests { pub attribute_z: u32, } - fn store_configuration(dir: &TempDir, spec: Box) -> PathBuf { - let raw_output = true; - let json = sc_service::chain_ops::build_spec(&*spec, raw_output) - .expect("Failed to build json string"); - let mut cfg_file_path = dir.path().to_path_buf(); - cfg_file_path.push(spec.id()); - cfg_file_path.set_extension("json"); - std::fs::write(&cfg_file_path, json).expect("Failed to write to json file"); - cfg_file_path - } - - pub type DummyChainSpec = sc_service::GenericChainSpec; - - pub fn create_default_with_extensions( + pub fn create_default_with_extensions( id: &str, extension: E, - ) -> DummyChainSpec { - DummyChainSpec::from_genesis( + constructor: fn(Vec<(AccountId, AuraId)>, AccountId, Vec, ParaId) -> G, + ) -> GenericChainSpec { + GenericChainSpec::::from_genesis( "Dummy local testnet", id, ChainType::Local, move || { - crate::chain_spec::trappist::testnet_genesis( - vec![ - ( - get_account_id_from_seed::("Alice"), - get_collator_keys_from_seed::("Alice"), - ), - ( - get_account_id_from_seed::("Bob"), - get_collator_keys_from_seed::("Bob"), - ), - ], + constructor( + vec![( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), + )], get_account_id_from_seed::("Alice"), - vec![get_account_id_from_seed::("Alice")], + Vec::new(), 1000.into(), ) }, @@ -666,38 +685,64 @@ mod tests { ) } - #[test] - fn test_resolve_runtime_for_different_configuration_files() { + fn assert_resolved_runtime(runtime: Runtime, specs: Vec>) { + fn store_configuration(dir: &TempDir, spec: Box) -> PathBuf { + let raw_output = true; + let json = sc_service::chain_ops::build_spec(&*spec, raw_output) + .expect("Failed to build json string"); + let mut cfg_file_path = dir.path().to_path_buf(); + cfg_file_path.push(spec.id()); + cfg_file_path.set_extension("json"); + std::fs::write(&cfg_file_path, json).expect("Failed to write to json file"); + cfg_file_path + } + let temp_dir = tempfile::tempdir().expect("Failed to access tempdir"); - let path = store_configuration( - &temp_dir, - Box::new(create_default_with_extensions("trappist-1", Extensions1::default())), - ); - assert_eq!(Runtime::Trappist, path.runtime()); - - let path = store_configuration( - &temp_dir, - Box::new(create_default_with_extensions("trappist-2", Extensions2::default())), - ); - assert_eq!(Runtime::Trappist, path.runtime()); - - let path = store_configuration( - &temp_dir, - Box::new(create_default_with_extensions("stout-1", Extensions1::default())), - ); - assert_eq!(Runtime::Stout, path.runtime()); - - let path = store_configuration( - &temp_dir, - Box::new(create_default_with_extensions("stout-2", Extensions2::default())), - ); - assert_eq!(Runtime::Stout, path.runtime()); - - let path = store_configuration( - &temp_dir, - Box::new(crate::chain_spec::trappist::trappist_local_testnet_config()), - ); - assert_eq!(Runtime::Trappist, path.runtime()); + specs.into_iter().for_each(|spec| { + let path = store_configuration(&temp_dir, spec); + assert_eq!(runtime, path.runtime()); + }); + } + + #[test] + #[cfg(feature = "trappist-runtime")] + fn test_resolve_trappist_runtime_for_different_configuration_files() { + assert_resolved_runtime( + Runtime::Trappist, + vec![ + Box::new(create_default_with_extensions::( + "trappist-1", + Extensions1::default(), + crate::chain_spec::trappist::testnet_genesis, + )), + Box::new(create_default_with_extensions::( + "trappist-2", + Extensions2::default(), + crate::chain_spec::trappist::testnet_genesis, + )), + Box::new(crate::chain_spec::trappist::trappist_local_testnet_config()), + ], + ) + } + + #[test] + #[cfg(feature = "stout-runtime")] + fn test_resolve_stout_runtime_for_different_configuration_files() { + assert_resolved_runtime( + Runtime::Stout, + vec![ + Box::new(create_default_with_extensions( + "stout-1", + Extensions1::default(), + crate::chain_spec::stout::testnet_genesis, + )), + Box::new(create_default_with_extensions( + "stout-2", + Extensions2::default(), + crate::chain_spec::stout::testnet_genesis, + )), + ], + ) } } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 9f75958b..23722941 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -19,7 +19,7 @@ use std::sync::Arc; -use parachains_common::{AccountId, Balance, Block, Index as Nonce}; +use parachains_common::{AccountId, AssetId, Balance, Block, Index as Nonce}; use sc_client_api::AuxStore; pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; use sc_transaction_pool_api::TransactionPool; @@ -56,12 +56,7 @@ where C::Api: frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BlockBuilder, - C::Api: pallet_dex_rpc::DexRuntimeApi< - trappist_runtime::opaque::Block, - trappist_runtime::AssetId, - trappist_runtime::Balance, - trappist_runtime::AssetBalance, - >, + C::Api: pallet_dex_rpc::DexRuntimeApi, P: TransactionPool + Sync + Send + 'static, B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::backend::StateBackend>, diff --git a/node/src/service.rs b/node/src/service.rs index 2279d20c..c4f6e1fe 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -15,11 +15,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::{marker::PhantomData, sync::Arc, time::Duration}; + use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion}; use cumulus_client_consensus_common::{ ParachainBlockImport as TParachainBlockImport, ParachainCandidate, ParachainConsensus, }; +use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier; use cumulus_client_network::BlockAnnounceValidator; use cumulus_client_service::{ build_relay_chain_interface, prepare_node_config, start_collator, start_full_node, @@ -30,18 +33,12 @@ use cumulus_primitives_core::{ ParaId, }; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface}; -use parity_scale_codec::Codec; -use sp_core::Pair; - +use futures::lock::Mutex; use jsonrpsee::RpcModule; - -use crate::rpc; pub use parachains_common::{ AccountId, AssetId, Balance, Block, BlockNumber, Hash, Header, Index as Nonce, }; - -use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier; -use futures::lock::Mutex; +use parity_scale_codec::Codec; use sc_consensus::{ import_queue::{BasicQueue, Verifier as VerifierT}, BlockImportParams, ImportQueue, @@ -54,15 +51,17 @@ use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerH use sp_api::{ApiExt, ConstructRuntimeApi}; use sp_consensus::CacheKeyId; use sp_consensus_aura::AuraApi; +use sp_core::Pair; use sp_keystore::SyncCryptoStorePtr; use sp_runtime::{ app_crypto::AppKey, generic::BlockId, traits::{BlakeTwo256, Header as HeaderT}, }; -use std::{marker::PhantomData, sync::Arc, time::Duration}; use substrate_prometheus_endpoint::Registry; +use crate::rpc; + #[cfg(not(feature = "runtime-benchmarks"))] type HostFunctions = sp_io::SubstrateHostFunctions; @@ -78,8 +77,10 @@ type ParachainBlockImport = TParachainBlockImport>, ParachainBackend>; /// Native Stout executor instance. +#[cfg(feature = "stout-runtime")] pub struct StoutRuntimeExecutor; +#[cfg(feature = "stout-runtime")] impl sc_executor::NativeExecutionDispatch for StoutRuntimeExecutor { type ExtendHostFunctions = (); @@ -92,9 +93,11 @@ impl sc_executor::NativeExecutionDispatch for StoutRuntimeExecutor { } } -// Native Trappist executor instance. +/// Native Trappist executor instance. +#[cfg(feature = "trappist-runtime")] pub struct TrappistRuntimeExecutor; +#[cfg(feature = "trappist-runtime")] impl sc_executor::NativeExecutionDispatch for TrappistRuntimeExecutor { type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index f2d8a1c3..5b6f3ae8 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -12,7 +12,7 @@ edition = { workspace = true } targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ "derive" ] } +parity-scale-codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } diff --git a/pallets/benchmarks/Cargo.toml b/pallets/benchmarks/Cargo.toml index c6fceec1..147b4ece 100644 --- a/pallets/benchmarks/Cargo.toml +++ b/pallets/benchmarks/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { workspace = true, features = [ "derive" ] } +parity-scale-codec = { workspace = true, features = ["derive"] } scale-info = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } @@ -16,7 +16,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } xcm = { workspace = true } -xcm-executor= { workspace = true } +xcm-executor = { workspace = true } [dev-dependencies] sp-core = { workspace = true }