From 6919c3030cb28f77307565d23872098ac5a93585 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 23 Jul 2020 14:12:53 +0200 Subject: [PATCH] Companion PR for `Remove the service builder` (#1448) * Switch branch * Update branch * Change service code * Change light service stuff to be functions ^_^ * Update substrate branch * Remove accidental 'f' * Rework LightBackend/LightClient types * Update substrate branch * Remove unused imports in test-service * Add #[cfg(feature = full-node)] --- polkadot/Cargo.lock | 583 +++++++------- polkadot/node/service/src/lib.rs | 802 +++++++++---------- polkadot/node/test-service/src/lib.rs | 28 +- polkadot/service/src/lib.rs | 1030 ++++++++++++------------- 4 files changed, 1182 insertions(+), 1261 deletions(-) diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 1aa1be6491..4b7393a17e 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -637,15 +637,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "clear_on_drop" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9cc5db465b294c3fa986d5bbb0f3017cd850bff6dd6c52f9ccff8b4d21b7b08" -dependencies = [ - "cc", -] - [[package]] name = "cloudabi" version = "0.0.3" @@ -734,25 +725,23 @@ checksum = "6d375c433320f6c5057ae04a04376eef4d04ce2801448cf8863a78da99107be4" [[package]] name = "cranelift-bforest" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4425bb6c3f3d2f581c650f1a1fdd3196a975490149cf59bea9d34c3bea79eda" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d166b289fd30062ee6de86284750fc3fe5d037c6b864b3326ce153239b0626e1" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.20.0", + "gimli 0.21.0", "log 0.4.8", "regalloc", "serde", @@ -763,9 +752,8 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c9fb2306a36d41c5facd4bf3400bc6c157185c43a96eaaa503471c34c5144b" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -773,24 +761,21 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e0cfe9b1f97d9f836bca551618106c7d53b93b579029ecd38e73daa7eb689e" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" [[package]] name = "cranelift-entity" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "926a73c432e5ba9c891171ff50b75e7d992cd76cd271f0a0a0ba199138077472" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45f82e3446dd1ebb8c2c2f6a6b0e6cd6cd52965c7e5f7b1b35e9a9ace31ccde" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "cranelift-codegen", "log 0.4.8", @@ -800,9 +785,8 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488b5d481bb0996a143e55a9d1739ef425efa20d4a5e5e98c859a8573c9ead9a" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "cranelift-codegen", "raw-cpuid", @@ -811,9 +795,8 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.63.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00aa8dde71fd9fdb1958e7b0ef8f524c1560e2c6165e4ea54bc302b40551c161" +version = "0.66.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -821,7 +804,7 @@ dependencies = [ "log 0.4.8", "serde", "thiserror", - "wasmparser 0.51.4", + "wasmparser 0.59.0", ] [[package]] @@ -1181,21 +1164,6 @@ dependencies = [ "futures 0.3.5", ] -[[package]] -name = "faerie" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfef65b0e94693295c5d2fe2506f0ee6f43465342d4b5331659936aee8b16084" -dependencies = [ - "goblin", - "indexmap", - "log 0.4.8", - "scroll", - "string-interner", - "target-lexicon", - "thiserror", -] - [[package]] name = "failure" version = "0.1.8" @@ -1325,7 +1293,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", ] @@ -1333,7 +1301,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -1350,7 +1318,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "Inflector", "frame-benchmarking", @@ -1369,7 +1337,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -1384,7 +1352,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "11.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "serde", @@ -1395,7 +1363,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "bitmask", "frame-metadata", @@ -1420,7 +1388,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support-procedural-tools", "proc-macro2 1.0.18", @@ -1431,7 +1399,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1443,7 +1411,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", @@ -1453,7 +1421,7 @@ dependencies = [ [[package]] name = "frame-system" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1469,7 +1437,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -1483,7 +1451,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-api", @@ -1796,15 +1764,12 @@ dependencies = [ [[package]] name = "gimli" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dd6190aad0f05ddbbf3245c54ed14ca4aa6dd32f22312b70d8f168c3e3e633" +checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" dependencies = [ - "arrayvec 0.5.1", - "byteorder", "fallible-iterator", "indexmap", - "smallvec 1.4.1", "stable_deref_trait", ] @@ -1846,17 +1811,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "goblin" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081214398d39e4bd7f2c1975f0488ed04614ffdd976c6fc7a0708278552c0da" -dependencies = [ - "log 0.4.8", - "plain", - "scroll", -] - [[package]] name = "h2" version = "0.1.26" @@ -2191,6 +2145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" dependencies = [ "autocfg 1.0.0", + "serde", ] [[package]] @@ -3426,18 +3381,20 @@ dependencies = [ [[package]] name = "object" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5666bbb90bc4d1e5bdcb26c0afda1822d25928341e9384ab187a9b37ab69e36" -dependencies = [ - "target-lexicon", -] +checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" [[package]] name = "object" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +dependencies = [ + "crc32fast", + "indexmap", + "wasmparser 0.57.0", +] [[package]] name = "once_cell" @@ -3478,7 +3435,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3494,7 +3451,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3509,7 +3466,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3534,7 +3491,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3548,7 +3505,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3564,7 +3521,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3579,7 +3536,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3594,7 +3551,7 @@ dependencies = [ [[package]] name = "pallet-finality-tracker" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3610,7 +3567,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3632,7 +3589,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "enumflags2", "frame-benchmarking", @@ -3648,7 +3605,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3668,7 +3625,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3684,7 +3641,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3698,7 +3655,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3713,7 +3670,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3727,7 +3684,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3742,7 +3699,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3763,7 +3720,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3778,7 +3735,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3791,7 +3748,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "enumflags2", "frame-support", @@ -3806,7 +3763,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3821,7 +3778,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3841,7 +3798,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3857,7 +3814,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3871,7 +3828,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3893,7 +3850,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -3904,7 +3861,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3918,7 +3875,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3936,7 +3893,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "frame-system", @@ -3953,7 +3910,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -3971,7 +3928,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-support", "parity-scale-codec", @@ -3984,7 +3941,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -3999,7 +3956,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-benchmarking", "frame-support", @@ -4015,7 +3972,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4300,12 +4257,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - [[package]] name = "platforms" version = "0.2.1" @@ -5731,9 +5682,9 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.21" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b27b256b41986ac5141b37b8bbba85d314fbf546c182eb255af6720e07e4f804" +checksum = "3598bed0895fe0f72a9e0b00ef9e3a3c8af978a8401b2f2046dec5927de6364a" dependencies = [ "log 0.4.8", "rustc-hash", @@ -5946,7 +5897,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "bytes 0.5.5", "derive_more 0.99.9", @@ -5973,7 +5924,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -5997,7 +5948,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6014,7 +5965,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "impl-trait-for-tuples", "sc-chain-spec-derive", @@ -6030,7 +5981,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -6041,7 +5992,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6082,7 +6033,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "fnv", @@ -6118,7 +6069,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "blake2-rfc", "hash-db", @@ -6147,7 +6098,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "sc-client-api", "sp-blockchain", @@ -6158,7 +6109,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "fork-tree", @@ -6200,7 +6151,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -6224,7 +6175,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6237,7 +6188,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -6260,7 +6211,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "log 0.4.8", "sc-client-api", @@ -6274,7 +6225,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "lazy_static", @@ -6302,7 +6253,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "log 0.4.8", @@ -6319,7 +6270,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "log 0.4.8", "parity-scale-codec", @@ -6334,7 +6285,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "cranelift-codegen", "cranelift-wasm", @@ -6348,14 +6299,14 @@ dependencies = [ "sp-runtime-interface", "sp-wasm-interface", "substrate-wasmtime", - "substrate-wasmtime-runtime", "wasmtime-environ", + "wasmtime-runtime", ] [[package]] name = "sc-finality-grandpa" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "assert_matches", "derive_more 0.99.9", @@ -6393,7 +6344,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "finality-grandpa", @@ -6410,7 +6361,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "ansi_term 0.12.1", "futures 0.3.5", @@ -6428,7 +6379,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "hex", @@ -6444,7 +6395,7 @@ dependencies = [ [[package]] name = "sc-light" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "hash-db", "lazy_static", @@ -6463,7 +6414,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "bitflags", "bs58", @@ -6515,7 +6466,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -6530,7 +6481,7 @@ dependencies = [ [[package]] name = "sc-network-test" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "env_logger", "futures 0.3.5", @@ -6557,7 +6508,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "bytes 0.5.5", "fnv", @@ -6584,7 +6535,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "libp2p", @@ -6597,7 +6548,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "log 0.4.8", "substrate-prometheus-endpoint", @@ -6606,7 +6557,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "hash-db", @@ -6638,7 +6589,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -6662,7 +6613,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "jsonrpc-core", "jsonrpc-http-server", @@ -6678,7 +6629,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "directories", @@ -6740,7 +6691,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "log 0.4.8", "parity-scale-codec", @@ -6754,7 +6705,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -6775,7 +6726,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "erased-serde", "log 0.4.8", @@ -6792,7 +6743,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -6813,7 +6764,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -7245,7 +7196,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "log 0.4.8", @@ -7257,7 +7208,7 @@ dependencies = [ [[package]] name = "sp-api" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "hash-db", "parity-scale-codec", @@ -7272,7 +7223,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -7284,7 +7235,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "serde", @@ -7296,7 +7247,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "integer-sqrt", "num-traits 0.2.12", @@ -7309,7 +7260,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-api", @@ -7321,7 +7272,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -7332,7 +7283,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-api", @@ -7344,7 +7295,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "log 0.4.8", @@ -7361,7 +7312,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "serde", "serde_json", @@ -7370,7 +7321,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -7395,7 +7346,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-api", @@ -7409,7 +7360,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "merlin", "parity-scale-codec", @@ -7428,7 +7379,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -7437,7 +7388,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -7449,7 +7400,7 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "base58", "blake2-rfc", @@ -7492,7 +7443,7 @@ dependencies = [ [[package]] name = "sp-database" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -7501,7 +7452,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", @@ -7511,7 +7462,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "environmental", "parity-scale-codec", @@ -7522,7 +7473,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "finality-grandpa", "log 0.4.8", @@ -7538,7 +7489,7 @@ dependencies = [ [[package]] name = "sp-finality-tracker" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -7548,7 +7499,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "parity-scale-codec", @@ -7560,7 +7511,7 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "hash-db", @@ -7581,7 +7532,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "lazy_static", "sp-core", @@ -7592,7 +7543,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "serde", @@ -7604,7 +7555,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -7615,7 +7566,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "sp-api", "sp-core", @@ -7625,7 +7576,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "backtrace", "log 0.4.8", @@ -7634,7 +7585,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "serde", "sp-core", @@ -7643,7 +7594,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "either", "hash256-std-hasher", @@ -7665,7 +7616,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "primitive-types", @@ -7680,7 +7631,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "Inflector", "proc-macro-crate", @@ -7692,7 +7643,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "serde", "serde_json", @@ -7701,7 +7652,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-api", @@ -7714,7 +7665,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -7724,7 +7675,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "hash-db", "itertools 0.9.0", @@ -7745,12 +7696,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" [[package]] name = "sp-storage" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "impl-serde 0.2.3", "ref-cast", @@ -7762,7 +7713,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7776,7 +7727,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "log 0.4.8", "rental", @@ -7786,7 +7737,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "derive_more 0.99.9", "futures 0.3.5", @@ -7801,7 +7752,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "hash-db", "memory-db", @@ -7815,7 +7766,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "futures-core", @@ -7827,7 +7778,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "impl-serde 0.2.3", "parity-scale-codec", @@ -7839,7 +7790,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -7904,15 +7855,6 @@ dependencies = [ "bytes 0.4.12", ] -[[package]] -name = "string-interner" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd710eadff449a1531351b0e43eb81ea404336fa2f56c777427ab0e32a4cf183" -dependencies = [ - "serde", -] - [[package]] name = "strsim" version = "0.8.0" @@ -7979,10 +7921,9 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "chrono", - "clear_on_drop", "console_error_panic_hook", "console_log", "futures 0.1.29", @@ -8006,7 +7947,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "platforms", ] @@ -8014,7 +7955,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.5", @@ -8037,7 +7978,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.8.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "async-std", "derive_more 0.99.9", @@ -8051,7 +7992,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.1.29", "futures 0.3.5", @@ -8077,7 +8018,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "cfg-if", "frame-executive", @@ -8117,7 +8058,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0-rc5" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" dependencies = [ "futures 0.3.5", "parity-scale-codec", @@ -8138,7 +8079,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" -source = "git+https://github.com/paritytech/substrate#065b0f321f223b4cb3b22cee0e71fa6930034e2a" +source = "git+https://github.com/paritytech/substrate#ae579a841587919bc12940388e994ef799c37e6c" [[package]] name = "substrate-wasm-builder-runner" @@ -8148,93 +8089,28 @@ checksum = "d2a965994514ab35d3893e9260245f2947fd1981cdd4fffd2c6e6d1a9ce02e6a" [[package]] name = "substrate-wasmtime" -version = "0.16.0-threadsafe.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd62264edc1a5f3ef44d86fb0c11c9fb142894b9a2da034f34afae482080d7a" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "anyhow", "backtrace", "cfg-if", "lazy_static", "libc", + "log 0.4.8", "region", "rustc-demangle", - "substrate-wasmtime-jit", - "substrate-wasmtime-profiling", - "substrate-wasmtime-runtime", + "smallvec 1.4.1", "target-lexicon", - "wasmparser 0.52.2", + "wasmparser 0.59.0", "wasmtime-environ", + "wasmtime-jit", + "wasmtime-profiling", + "wasmtime-runtime", "wat", "winapi 0.3.9", ] -[[package]] -name = "substrate-wasmtime-jit" -version = "0.16.0-threadsafe.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ce43c159d4f3ef6b19641e1ae045847fd202d8e2cc74df7ccb2b6475e069d4a" -dependencies = [ - "anyhow", - "cfg-if", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.20.0", - "log 0.4.8", - "more-asserts", - "region", - "substrate-wasmtime-profiling", - "substrate-wasmtime-runtime", - "target-lexicon", - "thiserror", - "wasmparser 0.52.2", - "wasmtime-debug", - "wasmtime-environ", - "winapi 0.3.9", -] - -[[package]] -name = "substrate-wasmtime-profiling" -version = "0.16.0-threadsafe.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77f0ce539b5a09a54dc80a1cf0c7cd7e694df11029354fe50a2d5fe889bdb97" -dependencies = [ - "anyhow", - "cfg-if", - "gimli 0.20.0", - "lazy_static", - "libc", - "object 0.18.0", - "scroll", - "serde", - "substrate-wasmtime-runtime", - "target-lexicon", - "wasmtime-environ", -] - -[[package]] -name = "substrate-wasmtime-runtime" -version = "0.16.0-threadsafe.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46516af0a64a7d9b652c5aa7436b6ce13edfa54435a66ef177fc02d2283e2dc2" -dependencies = [ - "backtrace", - "cc", - "cfg-if", - "indexmap", - "lazy_static", - "libc", - "memoffset", - "more-asserts", - "region", - "thiserror", - "wasmtime-environ", - "winapi 0.3.9", -] - [[package]] name = "subtle" version = "1.0.0" @@ -9222,43 +9098,43 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.51.4" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" +checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" [[package]] name = "wasmparser" -version = "0.52.2" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733954023c0b39602439e60a65126fd31b003196d3a1e8e4531b055165a79b31" +checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" [[package]] name = "wasmtime-debug" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39ba645aee700b29ff0093028b4123556dd142a74973f04ed6225eedb40e77d" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "anyhow", - "faerie", - "gimli 0.20.0", + "gimli 0.21.0", "more-asserts", + "object 0.20.0", "target-lexicon", "thiserror", - "wasmparser 0.51.4", + "wasmparser 0.59.0", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed54fd9d64dfeeee7c285fd126174a6b5e6d4efc7e5a1566fdb635e60ff6a74e" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" dependencies = [ "anyhow", "base64 0.12.3", "bincode", + "cfg-if", "cranelift-codegen", "cranelift-entity", + "cranelift-frontend", "cranelift-wasm", "directories", "errno", @@ -9272,11 +9148,90 @@ dependencies = [ "sha2 0.8.2", "thiserror", "toml", - "wasmparser 0.51.4", + "wasmparser 0.59.0", "winapi 0.3.9", "zstd", ] +[[package]] +name = "wasmtime-jit" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.21.0", + "log 0.4.8", + "more-asserts", + "object 0.20.0", + "region", + "target-lexicon", + "thiserror", + "wasmparser 0.59.0", + "wasmtime-debug", + "wasmtime-environ", + "wasmtime-obj", + "wasmtime-profiling", + "wasmtime-runtime", + "winapi 0.3.9", +] + +[[package]] +name = "wasmtime-obj" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" +dependencies = [ + "anyhow", + "more-asserts", + "object 0.20.0", + "target-lexicon", + "wasmtime-debug", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-profiling" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" +dependencies = [ + "anyhow", + "cfg-if", + "gimli 0.21.0", + "lazy_static", + "libc", + "object 0.19.0", + "scroll", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-runtime", +] + +[[package]] +name = "wasmtime-runtime" +version = "0.19.0" +source = "git+https://github.com/paritytech/wasmtime?branch=update-upstream#f744c4e564b40a4cfce6a7090f093ec1726c68e9" +dependencies = [ + "backtrace", + "cc", + "cfg-if", + "indexmap", + "lazy_static", + "libc", + "log 0.4.8", + "memoffset", + "more-asserts", + "region", + "thiserror", + "wasmtime-environ", + "winapi 0.3.9", +] + [[package]] name = "wast" version = "21.0.0" diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index 6d5cdbda42..02907e151f 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -23,8 +23,7 @@ mod client; use std::sync::Arc; use std::time::Duration; use polkadot_primitives::v1::{AccountId, Nonce, Balance}; -#[cfg(feature = "full-node")] -use service::{error::Error as ServiceError, ServiceBuilder}; +use service::{error::Error as ServiceError}; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; use sc_executor::native_executor_instance; use log::info; @@ -93,7 +92,7 @@ pub trait RuntimeApiCollection: + authority_discovery_primitives::AuthorityDiscoveryApi where Extrinsic: RuntimeExtrinsic, - >::StateBackend: sp_api::StateBackend, + >::StateBackend: sp_api::StateBackend>, {} impl RuntimeApiCollection for Api @@ -111,7 +110,7 @@ where + sp_session::SessionKeys + authority_discovery_primitives::AuthorityDiscoveryApi, Extrinsic: RuntimeExtrinsic, - >::StateBackend: sp_api::StateBackend, + >::StateBackend: sp_api::StateBackend>, {} pub trait RuntimeExtrinsic: codec::Codec + Send + Sync + 'static {} @@ -145,129 +144,152 @@ fn set_prometheus_registry(config: &mut Configuration) -> Result<(), ServiceErro Ok(()) } -/// Starts a `ServiceBuilder` for a full service. -/// -/// Use this macro if you don't actually need the full service, but just the builder in order to -/// be able to perform chain operations. -macro_rules! new_full_start { - ($config:expr, $runtime:ty, $executor:ty) => {{ - set_prometheus_registry(&mut $config)?; +type FullBackend = service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; +type FullClient = service::TFullClient; +type FullGrandpaBlockImport = grandpa::GrandpaBlockImport< + FullBackend, Block, FullClient, FullSelectChain +>; - let mut import_setup = None; - let mut rpc_setup = None; - let inherent_data_providers = inherents::InherentDataProviders::new(); - let builder = service::ServiceBuilder::new_full::< - Block, $runtime, $executor - >($config)? - .with_select_chain(|_, backend| { - Ok(sc_consensus::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let pool_api = sc_transaction_pool::FullChainApi::new( - builder.client().clone(), - builder.prometheus_registry(), - ); - let pool = sc_transaction_pool::BasicPool::new_full( - builder.config().transaction_pool.clone(), - std::sync::Arc::new(pool_api), - builder.prometheus_registry(), - builder.spawn_handle(), - builder.client().clone(), - ); - Ok(pool) - })? - .with_import_queue(| - config, - client, - mut select_chain, - _, - spawn_task_handle, - registry, - | { - let select_chain = select_chain.take() - .ok_or_else(|| service::Error::SelectChainRequired)?; +type LightBackend = service::TLightBackendWithHash; - let grandpa_hard_forks = if config.chain_spec.is_kusama() { - grandpa_support::kusama_hard_forks() - } else { - Vec::new() - }; +type LightClient = + service::TLightClientWithBackend; - let (grandpa_block_import, grandpa_link) = - grandpa::block_import_with_authority_set_hard_forks( - client.clone(), - &(client.clone() as Arc<_>), - select_chain.clone(), - grandpa_hard_forks, - )?; +#[cfg(feature = "full-node")] +fn full_params(mut config: Configuration) -> Result<( + service::ServiceParams< + Block, + FullClient, + babe::BabeImportQueue>, + sc_transaction_pool::FullPool>, + polkadot_rpc::RpcExtension, + FullBackend, + >, + FullSelectChain, + ( + babe::BabeBlockImport< + Block, FullClient, FullGrandpaBlockImport + >, + grandpa::LinkHalf, FullSelectChain>, + babe::BabeLink + ), + inherents::InherentDataProviders, + grandpa::SharedVoterState, +), Error> + where + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi::RuntimeApi: + RuntimeApiCollection>, + Executor: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + set_prometheus_registry(&mut config)?; - let justification_import = grandpa_block_import.clone(); + let inherent_data_providers = inherents::InherentDataProviders::new(); - let (block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; - let import_queue = babe::import_queue( - babe_link.clone(), - block_import.clone(), - Some(Box::new(justification_import)), - None, - client, - select_chain, - inherent_data_providers.clone(), - spawn_task_handle, - registry, - )?; + let (client, backend, keystore, task_manager) = + service::new_full_parts::(&config)?; + let client = Arc::new(client); - import_setup = Some((block_import, grandpa_link, babe_link)); - Ok(import_queue) - })? - .with_rpc_extensions_builder(|builder| { - let grandpa_link = import_setup.as_ref().map(|s| &s.1) - .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let shared_authority_set = grandpa_link.shared_authority_set().clone(); - let shared_voter_state = grandpa::SharedVoterState::empty(); + let pool_api = sc_transaction_pool::FullChainApi::new( + client.clone(), config.prometheus_registry(), + ); + let transaction_pool = sc_transaction_pool::BasicPool::new_full( + config.transaction_pool.clone(), + std::sync::Arc::new(pool_api), + config.prometheus_registry(), + task_manager.spawn_handle(), + client.clone(), + ); - rpc_setup = Some((shared_voter_state.clone())); + let grandpa_hard_forks = if config.chain_spec.is_kusama() { + grandpa_support::kusama_hard_forks() + } else { + Vec::new() + }; - let babe_link = import_setup.as_ref().map(|s| &s.2) - .expect("BabeLink is present for full services or set up faile; qed."); + let (grandpa_block_import, grandpa_link) = + grandpa::block_import_with_authority_set_hard_forks( + client.clone(), + &(client.clone() as Arc<_>), + select_chain.clone(), + grandpa_hard_forks, + )?; - let babe_config = babe_link.config().clone(); - let shared_epoch_changes = babe_link.epoch_changes().clone(); + let justification_import = grandpa_block_import.clone(); - let client = builder.client().clone(); - let pool = builder.pool().clone(); - let select_chain = builder.select_chain().cloned() - .expect("SelectChain is present for full services or set up failed; qed."); - let keystore = builder.keystore().clone(); + let (block_import, babe_link) = babe::block_import( + babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; - Ok(move |deny_unsafe| -> polkadot_rpc::RpcExtension { - let deps = polkadot_rpc::FullDeps { - client: client.clone(), - pool: pool.clone(), - select_chain: select_chain.clone(), - deny_unsafe, - babe: polkadot_rpc::BabeDeps { - babe_config: babe_config.clone(), - shared_epoch_changes: shared_epoch_changes.clone(), - keystore: keystore.clone(), - }, - grandpa: polkadot_rpc::GrandpaDeps { - shared_voter_state: shared_voter_state.clone(), - shared_authority_set: shared_authority_set.clone(), - }, - }; + let import_queue = babe::import_queue( + babe_link.clone(), + block_import.clone(), + Some(Box::new(justification_import)), + None, + client.clone(), + select_chain.clone(), + inherent_data_providers.clone(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + )?; - polkadot_rpc::create_full(deps) - }) - })?; + let shared_authority_set = grandpa_link.shared_authority_set().clone(); + let shared_voter_state = grandpa::SharedVoterState::empty(); - (builder, import_setup, inherent_data_providers, rpc_setup) - }} + let import_setup = (block_import.clone(), grandpa_link, babe_link.clone()); + let rpc_setup = shared_voter_state.clone(); + + let babe_config = babe_link.config().clone(); + let shared_epoch_changes = babe_link.epoch_changes().clone(); + + let rpc_extensions_builder = { + let client = client.clone(); + let keystore = keystore.clone(); + let transaction_pool = transaction_pool.clone(); + let select_chain = select_chain.clone(); + + Box::new(move |deny_unsafe| -> polkadot_rpc::RpcExtension { + let deps = polkadot_rpc::FullDeps { + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: select_chain.clone(), + deny_unsafe, + babe: polkadot_rpc::BabeDeps { + babe_config: babe_config.clone(), + shared_epoch_changes: shared_epoch_changes.clone(), + keystore: keystore.clone(), + }, + grandpa: polkadot_rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + }, + }; + + polkadot_rpc::create_full(deps) + }) + }; + + let provider = client.clone() as Arc>; + let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider)) as _; + + let params = service::ServiceParams { + config, backend, client, import_queue, keystore, task_manager, rpc_extensions_builder, + transaction_pool, + block_announce_validator_builder: None, + finality_proof_provider: Some(finality_proof_provider), + finality_proof_request_builder: None, + on_demand: None, + remote_blockchain: None, + }; + + Ok((params, select_chain, import_setup, inherent_data_providers, rpc_setup)) } fn real_overseer( @@ -294,335 +316,331 @@ fn real_overseer( ).map_err(|e| ServiceError::Other(format!("Failed to create an Overseer: {:?}", e))) } -/// Builds a new service for a full client. -#[macro_export] -macro_rules! new_full { - ( - $config:expr, - $collating_for:expr, - $authority_discovery_disabled:expr, - $grandpa_pause:expr, - $runtime:ty, - $dispatch:ty, - ) => {{ - use sc_client_api::ExecutorProvider; - use sp_core::traits::BareCryptoStorePtr; +#[cfg(feature = "full-node")] +fn new_full( + config: Configuration, + collating_for: Option<(CollatorId, ParaId)>, + _max_block_data_size: Option, + _authority_discovery_disabled: bool, + _slot_duration: u64, + grandpa_pause: Option<(u32, u32)>, +) -> Result<( + TaskManager, + Arc>, +), Error> + where + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi::RuntimeApi: + RuntimeApiCollection>, + Executor: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + use sc_client_api::ExecutorProvider; + use sp_core::traits::BareCryptoStorePtr; - let is_collator = $collating_for.is_some(); - let role = $config.role.clone(); - let is_authority = role.is_authority() && !is_collator; - let force_authoring = $config.force_authoring; - let disable_grandpa = $config.disable_grandpa; - let name = $config.network.node_name.clone(); + let is_collator = collating_for.is_some(); + let role = config.role.clone(); + let is_authority = role.is_authority() && !is_collator; + let force_authoring = config.force_authoring; + let disable_grandpa = config.disable_grandpa; + let name = config.network.node_name.clone(); - let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = - new_full_start!($config, $runtime, $dispatch); + let (params, select_chain, import_setup, inherent_data_providers, rpc_setup) + = full_params::(config)?; - let ServiceComponents { - client, network, select_chain, keystore, transaction_pool, prometheus_registry, - task_manager, telemetry_on_connect_sinks, .. - } = builder - .with_finality_proof_provider(|client, backend| { - let provider = client as Arc>; - Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) - })? - .build_full()?; + let client = params.client.clone(); + let keystore = params.keystore.clone(); + let transaction_pool = params.transaction_pool.clone(); + let prometheus_registry = params.config.prometheus_registry().cloned(); - let (block_import, link_half, babe_link) = import_setup.take() - .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); + let ServiceComponents { + network, task_manager, telemetry_on_connect_sinks, .. + } = service::build(params)?; - let shared_voter_state = rpc_setup.take() - .expect("The SharedVoterState is present for Full Services or setup failed before. qed"); + let (block_import, link_half, babe_link) = import_setup; - let overseer_client = client.clone(); - let spawner = task_manager.spawn_handle(); - let leaves: Vec<_> = select_chain.clone().ok_or(ServiceError::SelectChainRequired)? - .leaves() - .unwrap_or_else(|_| vec![]) - .into_iter() - .filter_map(|hash| { - let number = client.number(hash).ok()??; - let parent_hash = client.header(&BlockId::Hash(hash)).ok()??.parent_hash; + let shared_voter_state = rpc_setup; - Some(BlockInfo { - hash, - parent_hash, - number, - }) + let overseer_client = client.clone(); + let spawner = task_manager.spawn_handle(); + let leaves: Vec<_> = select_chain.clone() + .leaves() + .unwrap_or_else(|_| vec![]) + .into_iter() + .filter_map(|hash| { + let number = client.number(hash).ok()??; + let parent_hash = client.header(&BlockId::Hash(hash)).ok()??.parent_hash; + + Some(BlockInfo { + hash, + parent_hash, + number, }) - .collect(); + }) + .collect(); - let (overseer, handler) = real_overseer(leaves, spawner)?; - let handler_clone = handler.clone(); + let (overseer, handler) = real_overseer(leaves, spawner)?; + let handler_clone = handler.clone(); - task_manager.spawn_essential_handle().spawn_blocking("overseer", Box::pin(async move { - use futures::{pin_mut, select, FutureExt}; + task_manager.spawn_essential_handle().spawn_blocking("overseer", Box::pin(async move { + use futures::{pin_mut, select, FutureExt}; - let forward = overseer::forward_events(overseer_client, handler); + let forward = overseer::forward_events(overseer_client, handler); - let forward = forward.fuse(); - let overseer_fut = overseer.run().fuse(); + let forward = forward.fuse(); + let overseer_fut = overseer.run().fuse(); - pin_mut!(overseer_fut); - pin_mut!(forward); + pin_mut!(overseer_fut); + pin_mut!(forward); - loop { - select! { - _ = forward => break, - _ = overseer_fut => break, - complete => break, - } + loop { + select! { + _ = forward => break, + _ = overseer_fut => break, + complete => break, } - })); - - if role.is_authority() { - let select_chain = select_chain.ok_or(ServiceError::SelectChainRequired)?; - let can_author_with = - consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone()); - - let proposer = ProposerFactory::new( - client.clone(), - transaction_pool, - handler_clone, - ); - - let babe_config = babe::BabeParams { - keystore: keystore.clone(), - client: client.clone(), - select_chain, - block_import, - env: proposer, - sync_oracle: network.clone(), - inherent_data_providers: inherent_data_providers.clone(), - force_authoring, - babe_link, - can_author_with, - }; - - let babe = babe::start_babe(babe_config)?; - task_manager.spawn_essential_handle().spawn_blocking("babe", babe); } + })); - // if the node isn't actively participating in consensus then it doesn't - // need a keystore, regardless of which protocol we use below. - let keystore = if is_authority { - Some(keystore.clone() as BareCryptoStorePtr) - } else { - None + if role.is_authority() { + let can_author_with = + consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone()); + + let proposer = ProposerFactory::new( + client.clone(), + transaction_pool, + handler_clone, + ); + + let babe_config = babe::BabeParams { + keystore: keystore.clone(), + client: client.clone(), + select_chain, + block_import, + env: proposer, + sync_oracle: network.clone(), + inherent_data_providers: inherent_data_providers.clone(), + force_authoring, + babe_link, + can_author_with, }; - let config = grandpa::Config { - // FIXME substrate#1578 make this available through chainspec - gossip_duration: Duration::from_millis(1000), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore, - is_authority: role.is_network_authority(), + let babe = babe::start_babe(babe_config)?; + task_manager.spawn_essential_handle().spawn_blocking("babe", babe); + } + + // if the node isn't actively participating in consensus then it doesn't + // need a keystore, regardless of which protocol we use below. + let keystore = if is_authority { + Some(keystore.clone() as BareCryptoStorePtr) + } else { + None + }; + + let config = grandpa::Config { + // FIXME substrate#1578 make this available through chainspec + gossip_duration: Duration::from_millis(1000), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_network_authority(), + }; + + let enable_grandpa = !disable_grandpa; + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: unlike in substrate we are currently running the full + // GRANDPA voter protocol for all full nodes (regardless of whether + // they're validators or not). at this point the full voter should + // provide better guarantees of block and vote data availability than + // the observer. + + // add a custom voting rule to temporarily stop voting for new blocks + // after the given pause block is finalized and restarting after the + // given delay. + let voting_rule = match grandpa_pause { + Some((block, delay)) => { + info!("GRANDPA scheduled voting pause set for block #{} with a duration of {} blocks.", + block, + delay, + ); + + grandpa::VotingRulesBuilder::default() + .add(grandpa_support::PauseAfterBlockFor(block, delay)) + .build() + }, + None => + grandpa::VotingRulesBuilder::default() + .build(), }; - let enable_grandpa = !disable_grandpa; - if enable_grandpa { - // start the full GRANDPA voter - // NOTE: unlike in substrate we are currently running the full - // GRANDPA voter protocol for all full nodes (regardless of whether - // they're validators or not). at this point the full voter should - // provide better guarantees of block and vote data availability than - // the observer. + let grandpa_config = grandpa::GrandpaParams { + config, + link: link_half, + network: network.clone(), + inherent_data_providers: inherent_data_providers.clone(), + telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), + voting_rule, + prometheus_registry: prometheus_registry, + shared_voter_state, + }; - // add a custom voting rule to temporarily stop voting for new blocks - // after the given pause block is finalized and restarting after the - // given delay. - let voting_rule = match $grandpa_pause { - Some((block, delay)) => { - info!("GRANDPA scheduled voting pause set for block #{} with a duration of {} blocks.", - block, - delay, - ); + task_manager.spawn_essential_handle().spawn_blocking( + "grandpa-voter", + grandpa::run_grandpa_voter(grandpa_config)? + ); + } else { + grandpa::setup_disabled_grandpa( + client.clone(), + &inherent_data_providers, + network.clone(), + )?; + } - grandpa::VotingRulesBuilder::default() - .add(grandpa_support::PauseAfterBlockFor(block, delay)) - .build() - }, - None => - grandpa::VotingRulesBuilder::default() - .build(), - }; - - let grandpa_config = grandpa::GrandpaParams { - config, - link: link_half, - network: network.clone(), - inherent_data_providers: inherent_data_providers.clone(), - telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), - voting_rule, - prometheus_registry: prometheus_registry, - shared_voter_state, - }; - - task_manager.spawn_essential_handle().spawn_blocking( - "grandpa-voter", - grandpa::run_grandpa_voter(grandpa_config)? - ); - } else { - grandpa::setup_disabled_grandpa( - client.clone(), - &inherent_data_providers, - network.clone(), - )?; - } - - (task_manager, client) - }} + Ok((task_manager, client)) } pub struct FullNodeHandles; /// Builds a new service for a light client. -#[macro_export] -macro_rules! new_light { - ($config:expr, $runtime:ty, $dispatch:ty) => {{ - crate::set_prometheus_registry(&mut $config)?; - let inherent_data_providers = inherents::InherentDataProviders::new(); +fn new_light(mut config: Configuration) -> Result + where + Runtime: 'static + Send + Sync + ConstructRuntimeApi>, + >>::RuntimeApi: + RuntimeApiCollection>, + Dispatch: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + crate::set_prometheus_registry(&mut config)?; + use sc_client_api::backend::RemoteBackend; - ServiceBuilder::new_light::($config)? - .with_select_chain(|_, backend| { - Ok(sc_consensus::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; - let pool_api = sc_transaction_pool::LightChainApi::new( - builder.client().clone(), - fetcher, - ); - let pool = Arc::new(sc_transaction_pool::BasicPool::new_light( - builder.config().transaction_pool.clone(), - Arc::new(pool_api), - builder.prometheus_registry(), - builder.spawn_handle(), - )); - Ok(pool) - })? - .with_import_queue_and_fprb(| - _config, - client, - backend, - fetcher, - mut select_chain, - _, - spawn_task_handle, - registry, - | { - let select_chain = select_chain.take() - .ok_or_else(|| service::Error::SelectChainRequired)?; + let (client, backend, keystore, task_manager, on_demand) = + service::new_light_parts::(&config)?; - let fetch_checker = fetcher - .map(|fetcher| fetcher.checker().clone()) - .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; + let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let grandpa_block_import = grandpa::light_block_import( - client.clone(), backend, &(client.clone() as Arc<_>), Arc::new(fetch_checker) - )?; + let pool_api = sc_transaction_pool::LightChainApi::new( + client.clone(), + on_demand.clone(), + ); + let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( + config.transaction_pool.clone(), + Arc::new(pool_api), + config.prometheus_registry(), + task_manager.spawn_handle(), + )); - let finality_proof_import = grandpa_block_import.clone(); - let finality_proof_request_builder = - finality_proof_import.create_finality_proof_request_builder(); + let grandpa_block_import = grandpa::light_block_import( + client.clone(), backend.clone(), &(client.clone() as Arc<_>), + Arc::new(on_demand.checker().clone()), + )?; - let (babe_block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; + let finality_proof_import = grandpa_block_import.clone(); + let finality_proof_request_builder = + finality_proof_import.create_finality_proof_request_builder(); - // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. - let import_queue = babe::import_queue( - babe_link, - babe_block_import, - None, - Some(Box::new(finality_proof_import)), - client, - select_chain, - inherent_data_providers.clone(), - spawn_task_handle, - registry, - )?; + let (babe_block_import, babe_link) = babe::block_import( + babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; - Ok((import_queue, finality_proof_request_builder)) - })? - .with_finality_proof_provider(|client, backend| { - let provider = client as Arc>; - Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, provider)) as _) - })? - .with_rpc_extensions(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start node RPC without active fetcher")?; - let remote_blockchain = builder.remote_backend() - .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; + let inherent_data_providers = inherents::InherentDataProviders::new(); - let light_deps = polkadot_rpc::LightDeps { - remote_blockchain, - fetcher, - client: builder.client().clone(), - pool: builder.pool(), - }; - Ok(polkadot_rpc::create_light(light_deps)) - })? - .build_light() - .map(|ServiceComponents { task_manager, .. }| task_manager) - }} + // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. + let import_queue = babe::import_queue( + babe_link, + babe_block_import, + None, + Some(Box::new(finality_proof_import)), + client.clone(), + select_chain.clone(), + inherent_data_providers.clone(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + )?; + + let provider = client.clone() as Arc>; + let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider)); + + let light_deps = polkadot_rpc::LightDeps { + remote_blockchain: backend.remote_blockchain(), + fetcher: on_demand.clone(), + client: client.clone(), + pool: transaction_pool.clone(), + }; + + let rpc_extensions = polkadot_rpc::create_light(light_deps); + + let ServiceComponents { task_manager, .. } = service::build(service::ServiceParams { + config, + block_announce_validator_builder: None, + finality_proof_request_builder: Some(finality_proof_request_builder), + finality_proof_provider: Some(finality_proof_provider), + on_demand: Some(on_demand), + remote_blockchain: Some(backend.remote_blockchain()), + rpc_extensions_builder: Box::new(service::NoopRpcExtensionBuilder(rpc_extensions)), + client: client.clone(), + transaction_pool: transaction_pool.clone(), + import_queue, keystore, backend, task_manager, + })?; + + Ok(task_manager) } /// Builds a new object suitable for chain operations. +#[cfg(feature = "full-node")] pub fn new_chain_ops(mut config: Configuration) -> Result< ( - Arc>, - Arc>, + Arc>, + Arc, consensus_common::import_queue::BasicQueue>, TaskManager, ), ServiceError > where - Runtime: ConstructRuntimeApi> + Send + Sync + 'static, + Runtime: ConstructRuntimeApi> + Send + Sync + 'static, Runtime::RuntimeApi: - RuntimeApiCollection, Block>>, + RuntimeApiCollection>, Dispatch: NativeExecutionDispatch + 'static, Extrinsic: RuntimeExtrinsic, { config.keystore = service::config::KeystoreConfig::InMemory; - let (builder, _, _, _) = new_full_start!(config, Runtime, Dispatch); - Ok(builder.to_chain_ops_parts()) + let (service::ServiceParams { client, backend, import_queue, task_manager, .. }, ..) + = full_params::(config)?; + Ok((client, backend, import_queue, task_manager)) } /// Create a new Polkadot service for a full node. #[cfg(feature = "full-node")] pub fn polkadot_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, ParaId)>, - _max_block_data_size: Option, - _authority_discovery_disabled: bool, - _slot_duration: u64, + max_block_data_size: Option, + authority_discovery_disabled: bool, + slot_duration: u64, grandpa_pause: Option<(u32, u32)>, ) -> Result<( TaskManager, Arc, + FullBackend, polkadot_runtime::RuntimeApi >>, FullNodeHandles, ), ServiceError> { - let (components, client) = new_full!( + let (components, client) = new_full::( config, collating_for, + max_block_data_size, authority_discovery_disabled, + slot_duration, grandpa_pause, - polkadot_runtime::RuntimeApi, - PolkadotExecutor, - ); + )?; Ok((components, client, FullNodeHandles)) } @@ -630,31 +648,31 @@ pub fn polkadot_new_full( /// Create a new Kusama service for a full node. #[cfg(feature = "full-node")] pub fn kusama_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, ParaId)>, - _max_block_data_size: Option, - _authority_discovery_disabled: bool, - _slot_duration: u64, + max_block_data_size: Option, + authority_discovery_disabled: bool, + slot_duration: u64, grandpa_pause: Option<(u32, u32)>, ) -> Result<( TaskManager, Arc, + FullBackend, kusama_runtime::RuntimeApi > >, FullNodeHandles, ), ServiceError> { - let (components, client) = new_full!( + let (components, client) = new_full::( config, collating_for, + max_block_data_size, authority_discovery_disabled, + slot_duration, grandpa_pause, - kusama_runtime::RuntimeApi, - KusamaExecutor, - ); + )?; Ok((components, client, FullNodeHandles)) } @@ -662,49 +680,49 @@ pub fn kusama_new_full( /// Create a new Kusama service for a full node. #[cfg(feature = "full-node")] pub fn westend_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, ParaId)>, - _max_block_data_size: Option, - _authority_discovery_disabled: bool, - _slot_duration: u64, + max_block_data_size: Option, + authority_discovery_disabled: bool, + slot_duration: u64, grandpa_pause: Option<(u32, u32)>, ) -> Result<( TaskManager, Arc, + FullBackend, westend_runtime::RuntimeApi >>, FullNodeHandles, ), ServiceError> { - let (components, client) = new_full!( + let (components, client) = new_full::( config, collating_for, + max_block_data_size, authority_discovery_disabled, + slot_duration, grandpa_pause, - westend_runtime::RuntimeApi, - WestendExecutor, - ); + )?; Ok((components, client, FullNodeHandles)) } /// Create a new Polkadot service for a light client. -pub fn polkadot_new_light(mut config: Configuration) -> Result +pub fn polkadot_new_light(config: Configuration) -> Result { - new_light!(config, polkadot_runtime::RuntimeApi, PolkadotExecutor) + new_light::(config) } /// Create a new Kusama service for a light client. -pub fn kusama_new_light(mut config: Configuration) -> Result +pub fn kusama_new_light(config: Configuration) -> Result { - new_light!(config, kusama_runtime::RuntimeApi, KusamaExecutor) + new_light::(config) } /// Create a new Westend service for a light client. -pub fn westend_new_light(mut config: Configuration, ) -> Result +pub fn westend_new_light(config: Configuration, ) -> Result { - new_light!(config, westend_runtime::RuntimeApi, KusamaExecutor) + new_light::(config) } diff --git a/polkadot/node/test-service/src/lib.rs b/polkadot/node/test-service/src/lib.rs index 1566f46876..3bdc741bac 100644 --- a/polkadot/node/test-service/src/lib.rs +++ b/polkadot/node/test-service/src/lib.rs @@ -21,17 +21,13 @@ mod chain_spec; pub use chain_spec::*; -use consensus_common::{block_validation::Chain, SelectChain}; use futures::future::Future; -use grandpa::FinalityProofProvider as GrandpaFinalityProofProvider; -use log::info; -use polkadot_network::{legacy::gossip::Known, protocol as network_protocol}; use polkadot_primitives::v0::{ - Block, BlockId, Hash, CollatorId, Id as ParaId, + Block, Hash, CollatorId, Id as ParaId, }; use polkadot_runtime_common::{parachains, registrar, BlockHashCount}; use polkadot_service::{ - new_full, new_full_start, FullNodeHandles, PolkadotClient, ServiceComponents, + new_full, FullNodeHandles, PolkadotClient, }; use polkadot_test_runtime::{RestrictFunctionality, Runtime, SignedExtra, SignedPayload, VERSION}; use sc_chain_spec::ChainSpec; @@ -54,7 +50,6 @@ use sp_keyring::Sr25519Keyring; use sp_runtime::{codec::Encode, generic}; use sp_state_machine::BasicExternalities; use std::sync::Arc; -use std::time::Duration; use substrate_test_client::{BlockchainEventsExt, RpcHandlersExt, RpcTransactionOutput, RpcTransactionError}; native_executor_instance!( @@ -81,15 +76,16 @@ pub fn polkadot_test_new_full( ), ServiceError, > { - let (task_manager, client, handles, network, rpc_handlers) = new_full!(test - config, - collating_for, - max_block_data_size, - authority_discovery_disabled, - slot_duration, - polkadot_test_runtime::RuntimeApi, - PolkadotTestExecutor, - ); + let (task_manager, client, handles, network, rpc_handlers) = + new_full::( + config, + collating_for, + max_block_data_size, + authority_discovery_disabled, + slot_duration, + None, + true, + )?; Ok((task_manager, client, handles, network, rpc_handlers)) } diff --git a/polkadot/service/src/lib.rs b/polkadot/service/src/lib.rs index 0140aae70f..a0b2fdcd22 100644 --- a/polkadot/service/src/lib.rs +++ b/polkadot/service/src/lib.rs @@ -25,7 +25,7 @@ use std::time::Duration; use polkadot_primitives::v0::{self as parachain, Hash, BlockId, AccountId, Nonce, Balance}; #[cfg(feature = "full-node")] use polkadot_network::{legacy::gossip::Known, protocol as network_protocol}; -use service::{error::Error as ServiceError, ServiceBuilder}; +use service::{error::Error as ServiceError}; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; use sc_executor::native_executor_instance; use log::info; @@ -135,603 +135,558 @@ impl IdentifyVariant for Box { } } -/// Starts a `ServiceBuilder` for a full service. -/// -/// Use this macro if you don't actually need the full service, but just the builder in order to -/// be able to perform chain operations. -#[macro_export] -macro_rules! new_full_start { - (prometheus_setup $config:expr) => {{ +type FullBackend = service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; +type FullClient = service::TFullClient; +type FullGrandpaBlockImport = grandpa::GrandpaBlockImport< + FullBackend, Block, FullClient, FullSelectChain +>; + +type LightBackend = service::TLightBackendWithHash; + +type LightClient = + service::TLightClientWithBackend; + +#[cfg(feature = "full-node")] +pub fn full_params(mut config: Configuration, test: bool) -> Result<( + service::ServiceParams< + Block, + FullClient, + babe::BabeImportQueue>, + sc_transaction_pool::FullPool>, + polkadot_rpc::RpcExtension, + FullBackend, + >, + FullSelectChain, + ( + babe::BabeBlockImport< + Block, FullClient, FullGrandpaBlockImport + >, + grandpa::LinkHalf, FullSelectChain>, + babe::BabeLink + ), + inherents::InherentDataProviders, + grandpa::SharedVoterState, +), Error> + where + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi::RuntimeApi: + RuntimeApiCollection>, + Executor: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + if !test { // If we're using prometheus, use a registry with a prefix of `polkadot`. - if let Some(PrometheusConfig { registry, .. }) = $config.prometheus_config.as_mut() { + if let Some(PrometheusConfig { registry, .. }) = config.prometheus_config.as_mut() { *registry = Registry::new_custom(Some("polkadot".into()), None)?; } - }}; - (start_builder $config:expr, $runtime:ty, $executor:ty $(,)?) => {{ - service::ServiceBuilder::new_full::< - Block, $runtime, $executor - >($config)? - .with_select_chain(|_, backend| { - Ok(sc_consensus::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let pool_api = sc_transaction_pool::FullChainApi::new( - builder.client().clone(), - builder.prometheus_registry(), - ); - let pool = sc_transaction_pool::BasicPool::new_full( - builder.config().transaction_pool.clone(), - std::sync::Arc::new(pool_api), - builder.prometheus_registry(), - builder.spawn_handle(), - builder.client().clone(), - ); - Ok(pool) - })? - }}; - (import_queue_setup - $builder:expr, $inherent_data_providers:expr, $import_setup:expr, $grandpa_hard_forks:expr, $(,)? - ) => {{ - $builder.with_import_queue(| - _config, - client, - mut select_chain, - _, - spawn_task_handle, - registry, - | { - let select_chain = select_chain.take() - .ok_or_else(|| service::Error::SelectChainRequired)?; + } - let (grandpa_block_import, grandpa_link) = - grandpa::block_import_with_authority_set_hard_forks( - client.clone(), - &(client.clone() as Arc<_>), - select_chain.clone(), - $grandpa_hard_forks, - )?; + let inherent_data_providers = inherents::InherentDataProviders::new(); - let justification_import = grandpa_block_import.clone(); - let (block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; + let (client, backend, keystore, task_manager) = + service::new_full_parts::(&config)?; + let client = Arc::new(client); - let import_queue = babe::import_queue( - babe_link.clone(), - block_import.clone(), - Some(Box::new(justification_import)), - None, - client, - select_chain, - $inherent_data_providers.clone(), - spawn_task_handle, - registry, - )?; + let select_chain = sc_consensus::LongestChain::new(backend.clone()); - $import_setup = Some((block_import, grandpa_link, babe_link)); - Ok(import_queue) - })? - }}; - (finish_builder_setup $builder:expr, $inherent_data_providers:expr, $import_setup:expr) => {{ - let mut rpc_setup = None; + let pool_api = sc_transaction_pool::FullChainApi::new( + client.clone(), config.prometheus_registry(), + ); + let transaction_pool = sc_transaction_pool::BasicPool::new_full( + config.transaction_pool.clone(), + std::sync::Arc::new(pool_api), + config.prometheus_registry(), + task_manager.spawn_handle(), + client.clone(), + ); - let builder = $builder.with_rpc_extensions_builder(|builder| { - let grandpa_link = $import_setup.as_ref().map(|s| &s.1) - .expect("GRANDPA LinkHalf is present for full services or set up failed; qed."); + let grandpa_hard_forks = if config.chain_spec.is_kusama() && !test { + crate::grandpa_support::kusama_hard_forks() + } else { + Vec::new() + }; - let shared_authority_set = grandpa_link.shared_authority_set().clone(); - let shared_voter_state = grandpa::SharedVoterState::empty(); + let (grandpa_block_import, grandpa_link) = + grandpa::block_import_with_authority_set_hard_forks( + client.clone(), + &(client.clone() as Arc<_>), + select_chain.clone(), + grandpa_hard_forks, + )?; - rpc_setup = Some((shared_voter_state.clone())); + let justification_import = grandpa_block_import.clone(); - let babe_link = $import_setup.as_ref().map(|s| &s.2) - .expect("BabeLink is present for full services or set up faile; qed."); + let (block_import, babe_link) = babe::block_import( + babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; - let babe_config = babe_link.config().clone(); - let shared_epoch_changes = babe_link.epoch_changes().clone(); + let import_queue = babe::import_queue( + babe_link.clone(), + block_import.clone(), + Some(Box::new(justification_import)), + None, + client.clone(), + select_chain.clone(), + inherent_data_providers.clone(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + )?; - let client = builder.client().clone(); - let pool = builder.pool().clone(); - let select_chain = builder.select_chain().cloned() - .expect("SelectChain is present for full services or set up failed; qed."); - let keystore = builder.keystore().clone(); + let shared_authority_set = grandpa_link.shared_authority_set().clone(); + let shared_voter_state = grandpa::SharedVoterState::empty(); - Ok(move |deny_unsafe| -> polkadot_rpc::RpcExtension { - let deps = polkadot_rpc::FullDeps { - client: client.clone(), - pool: pool.clone(), - select_chain: select_chain.clone(), - deny_unsafe, - babe: polkadot_rpc::BabeDeps { - babe_config: babe_config.clone(), - shared_epoch_changes: shared_epoch_changes.clone(), - keystore: keystore.clone(), - }, - grandpa: polkadot_rpc::GrandpaDeps { - shared_voter_state: shared_voter_state.clone(), - shared_authority_set: shared_authority_set.clone(), - }, - }; + let import_setup = (block_import.clone(), grandpa_link, babe_link.clone()); + let rpc_setup = shared_voter_state.clone(); - polkadot_rpc::create_full(deps) - }) - })?; + let babe_config = babe_link.config().clone(); + let shared_epoch_changes = babe_link.epoch_changes().clone(); - (builder, $import_setup, $inherent_data_providers, rpc_setup) - }}; - ($config:expr, $runtime:ty, $executor:ty $(,)?) => {{ - let inherent_data_providers = inherents::InherentDataProviders::new(); - let mut import_setup = None; - new_full_start!(prometheus_setup $config); - let grandpa_hard_forks = if $config.chain_spec.is_kusama() { - $crate::grandpa_support::kusama_hard_forks() - } else { - Vec::new() - }; - let builder = new_full_start!(start_builder $config, $runtime, $executor); - let builder = new_full_start!(import_queue_setup - builder, inherent_data_providers, import_setup, grandpa_hard_forks, - ); - new_full_start!(finish_builder_setup builder, inherent_data_providers, import_setup) - }}; - (test $config:expr, $runtime:ty, $executor:ty $(,)?) => {{ - let inherent_data_providers = inherents::InherentDataProviders::new(); - let mut import_setup = None; - let grandpa_hard_forks = Vec::new(); - let builder = new_full_start!(start_builder $config, $runtime, $executor); - let builder = new_full_start!(import_queue_setup - builder, inherent_data_providers, import_setup, grandpa_hard_forks, - ); - new_full_start!(finish_builder_setup builder, inherent_data_providers, import_setup) - }}; + let rpc_extensions_builder = { + let client = client.clone(); + let keystore = keystore.clone(); + let transaction_pool = transaction_pool.clone(); + let select_chain = select_chain.clone(); + + Box::new(move |deny_unsafe| -> polkadot_rpc::RpcExtension { + let deps = polkadot_rpc::FullDeps { + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: select_chain.clone(), + deny_unsafe, + babe: polkadot_rpc::BabeDeps { + babe_config: babe_config.clone(), + shared_epoch_changes: shared_epoch_changes.clone(), + keystore: keystore.clone(), + }, + grandpa: polkadot_rpc::GrandpaDeps { + shared_voter_state: shared_voter_state.clone(), + shared_authority_set: shared_authority_set.clone(), + }, + }; + + polkadot_rpc::create_full(deps) + }) + }; + + let provider = client.clone() as Arc>; + let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider)) as _; + + let params = service::ServiceParams { + config, backend, client, import_queue, keystore, task_manager, rpc_extensions_builder, + transaction_pool, + block_announce_validator_builder: None, + finality_proof_provider: Some(finality_proof_provider), + finality_proof_request_builder: None, + on_demand: None, + remote_blockchain: None, + }; + + Ok((params, select_chain, import_setup, inherent_data_providers, rpc_setup)) } -/// Builds a new service for a full client. -#[macro_export] -macro_rules! new_full { - ( - with_full_start - $config:expr, - $collating_for:expr, - $max_block_data_size:expr, - $authority_discovery_disabled:expr, - $slot_duration:expr, - $grandpa_pause:expr, - $new_full_start:expr $(,)? - ) => {{ - use sc_network::Event; - use sc_client_api::ExecutorProvider; - use futures::stream::StreamExt; - use sp_core::traits::BareCryptoStorePtr; +#[cfg(feature = "full-node")] +pub fn new_full( + config: Configuration, + collating_for: Option<(CollatorId, parachain::Id)>, + max_block_data_size: Option, + authority_discovery_disabled: bool, + slot_duration: u64, + grandpa_pause: Option<(u32, u32)>, + test: bool, +) -> Result<( + TaskManager, + Arc>, + FullNodeHandles, + Arc::Hash>>, + Arc, +), Error> + where + RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, + RuntimeApi::RuntimeApi: + RuntimeApiCollection>, + Executor: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + use sc_network::Event; + use sc_client_api::ExecutorProvider; + use futures::stream::StreamExt; + use sp_core::traits::BareCryptoStorePtr; - let is_collator = $collating_for.is_some(); - let role = $config.role.clone(); - let is_authority = role.is_authority() && !is_collator; - let force_authoring = $config.force_authoring; - let db_path = match $config.database.path() { - Some(path) => std::path::PathBuf::from(path), - None => return Err("Starting a Polkadot service with a custom database isn't supported".to_string().into()), - }; - let max_block_data_size = $max_block_data_size; - let disable_grandpa = $config.disable_grandpa; - let name = $config.network.node_name.clone(); - let authority_discovery_disabled = $authority_discovery_disabled; - let slot_duration = $slot_duration; + let is_collator = collating_for.is_some(); + let role = config.role.clone(); + let is_authority = role.is_authority() && !is_collator; + let force_authoring = config.force_authoring; + let db_path = match config.database.path() { + Some(path) => std::path::PathBuf::from(path), + None => return Err("Starting a Polkadot service with a custom database isn't supported".to_string().into()), + }; + let disable_grandpa = config.disable_grandpa; + let name = config.network.node_name.clone(); - let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) = $new_full_start; + let (params, select_chain, import_setup, inherent_data_providers, rpc_setup) + = full_params::(config, test)?; - let ServiceComponents { - client, network, select_chain, keystore, transaction_pool, prometheus_registry, - task_manager, telemetry_on_connect_sinks, rpc_handlers, .. - } = builder - .with_finality_proof_provider(|client, backend| { - let provider = client as Arc>; - Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _) - })? - .build_full()?; + let client = params.client.clone(); + let keystore = params.keystore.clone(); + let transaction_pool = params.transaction_pool.clone(); + let prometheus_registry = params.config.prometheus_registry().cloned(); - let (block_import, link_half, babe_link) = import_setup.take() - .expect("Link Half and Block Import are present for Full Services or setup failed before. qed"); + let ServiceComponents { + network, + task_manager, telemetry_on_connect_sinks, rpc_handlers, .. + } = service::build(params)?; - let shared_voter_state = rpc_setup.take() - .expect("The SharedVoterState is present for Full Services or setup failed before. qed"); + let (block_import, link_half, babe_link) = import_setup; - let known_oracle = client.clone(); + let shared_voter_state = rpc_setup; - let mut handles = FullNodeHandles::default(); - let select_chain = select_chain.ok_or(ServiceError::SelectChainRequired)?; - let gossip_validator_select_chain = select_chain.clone(); + let known_oracle = client.clone(); - let is_known = move |block_hash: &Hash| { - use consensus_common::BlockStatus; + let mut handles = FullNodeHandles::default(); + let gossip_validator_select_chain = select_chain.clone(); - match known_oracle.block_status(&BlockId::hash(*block_hash)) { - Err(_) | Ok(BlockStatus::Unknown) | Ok(BlockStatus::Queued) => None, - Ok(BlockStatus::KnownBad) => Some(Known::Bad), - Ok(BlockStatus::InChainWithState) | Ok(BlockStatus::InChainPruned) => { - match gossip_validator_select_chain.leaves() { - Err(_) => None, - Ok(leaves) => if leaves.contains(block_hash) { - Some(Known::Leaf) - } else { - Some(Known::Old) - }, - } + let is_known = move |block_hash: &Hash| { + use consensus_common::BlockStatus; + + match known_oracle.block_status(&BlockId::hash(*block_hash)) { + Err(_) | Ok(BlockStatus::Unknown) | Ok(BlockStatus::Queued) => None, + Ok(BlockStatus::KnownBad) => Some(Known::Bad), + Ok(BlockStatus::InChainWithState) | Ok(BlockStatus::InChainPruned) => { + match gossip_validator_select_chain.leaves() { + Err(_) => None, + Ok(leaves) => if leaves.contains(block_hash) { + Some(Known::Leaf) + } else { + Some(Known::Old) + }, } } + } + }; + + let polkadot_network_service = network_protocol::start( + network.clone(), + network_protocol::Config { + collating_for: collating_for, + }, + (is_known, client.clone()), + client.clone(), + task_manager.spawn_handle(), + ).map_err(|e| format!("Could not spawn network worker: {:?}", e))?; + + let authority_handles = if is_collator || role.is_authority() { + let availability_store = { + use std::path::PathBuf; + + let mut path = PathBuf::from(db_path); + path.push("availability"); + + #[cfg(not(target_os = "unknown"))] + { + av_store::Store::new( + ::av_store::Config { + cache_size: None, + path, + }, + polkadot_network_service.clone(), + )? + } + + #[cfg(target_os = "unknown")] + av_store::Store::new_in_memory(gossip) }; - let polkadot_network_service = network_protocol::start( - network.clone(), - network_protocol::Config { - collating_for: $collating_for, - }, - (is_known, client.clone()), + polkadot_network_service.register_availability_store(availability_store.clone()); + + let (validation_service_handle, validation_service) = consensus::ServiceBuilder { + client: client.clone(), + network: polkadot_network_service.clone(), + collators: polkadot_network_service.clone(), + spawner: task_manager.spawn_handle(), + availability_store: availability_store.clone(), + select_chain: select_chain.clone(), + keystore: keystore.clone(), + max_block_data_size, + }.build(); + + task_manager.spawn_essential_handle().spawn("validation-service", Box::pin(validation_service)); + + handles.validation_service_handle = Some(validation_service_handle.clone()); + + Some((validation_service_handle, availability_store)) + } else { + None + }; + + if role.is_authority() { + let (validation_service_handle, availability_store) = authority_handles + .clone() + .expect("Authority handles are set for authority nodes; qed"); + + let proposer = consensus::ProposerFactory::new( + client.clone(), + transaction_pool, + validation_service_handle, + slot_duration, + prometheus_registry.as_ref(), + ); + + let can_author_with = + consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone()); + + let block_import = availability_store.block_import( + block_import, client.clone(), task_manager.spawn_handle(), - ).map_err(|e| format!("Could not spawn network worker: {:?}", e))?; + keystore.clone(), + )?; - let authority_handles = if is_collator || role.is_authority() { - let availability_store = { - use std::path::PathBuf; - - let mut path = PathBuf::from(db_path); - path.push("availability"); - - #[cfg(not(target_os = "unknown"))] - { - av_store::Store::new( - ::av_store::Config { - cache_size: None, - path, - }, - polkadot_network_service.clone(), - )? - } - - #[cfg(target_os = "unknown")] - av_store::Store::new_in_memory(gossip) - }; - - polkadot_network_service.register_availability_store(availability_store.clone()); - - let (validation_service_handle, validation_service) = consensus::ServiceBuilder { - client: client.clone(), - network: polkadot_network_service.clone(), - collators: polkadot_network_service.clone(), - spawner: task_manager.spawn_handle(), - availability_store: availability_store.clone(), - select_chain: select_chain.clone(), - keystore: keystore.clone(), - max_block_data_size, - }.build(); - - task_manager.spawn_essential_handle().spawn("validation-service", Box::pin(validation_service)); - - handles.validation_service_handle = Some(validation_service_handle.clone()); - - Some((validation_service_handle, availability_store)) - } else { - None + let babe_config = babe::BabeParams { + keystore: keystore.clone(), + client: client.clone(), + select_chain, + block_import, + env: proposer, + sync_oracle: network.clone(), + inherent_data_providers: inherent_data_providers.clone(), + force_authoring, + babe_link, + can_author_with, }; - if role.is_authority() { - let (validation_service_handle, availability_store) = authority_handles - .clone() - .expect("Authority handles are set for authority nodes; qed"); + let babe = babe::start_babe(babe_config)?; + task_manager.spawn_essential_handle().spawn_blocking("babe", babe); + } - let proposer = consensus::ProposerFactory::new( - client.clone(), - transaction_pool, - validation_service_handle, - slot_duration, - prometheus_registry.as_ref(), - ); - - let can_author_with = - consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone()); - - let block_import = availability_store.block_import( - block_import, - client.clone(), - task_manager.spawn_handle(), - keystore.clone(), - )?; - - let babe_config = babe::BabeParams { - keystore: keystore.clone(), - client: client.clone(), - select_chain, - block_import, - env: proposer, - sync_oracle: network.clone(), - inherent_data_providers: inherent_data_providers.clone(), - force_authoring, - babe_link, - can_author_with, + if matches!(role, Role::Authority{..} | Role::Sentry{..}) { + if !authority_discovery_disabled { + let (sentries, authority_discovery_role) = match role { + Role::Authority { ref sentry_nodes } => ( + sentry_nodes.clone(), + authority_discovery::Role::Authority ( + keystore.clone(), + ), + ), + Role::Sentry {..} => ( + vec![], + authority_discovery::Role::Sentry, + ), + _ => unreachable!("Due to outer matches! constraint; qed."), }; - let babe = babe::start_babe(babe_config)?; - task_manager.spawn_essential_handle().spawn_blocking("babe", babe); + let network_event_stream = network.event_stream("authority-discovery"); + let dht_event_stream = network_event_stream.filter_map(|e| async move { match e { + Event::Dht(e) => Some(e), + _ => None, + }}).boxed(); + let authority_discovery = authority_discovery::AuthorityDiscovery::new( + client.clone(), + network.clone(), + sentries, + dht_event_stream, + authority_discovery_role, + prometheus_registry.clone(), + ); + + task_manager.spawn_handle().spawn("authority-discovery", authority_discovery); } + } - if matches!(role, Role::Authority{..} | Role::Sentry{..}) { - if !authority_discovery_disabled { - let (sentries, authority_discovery_role) = match role { - Role::Authority { ref sentry_nodes } => ( - sentry_nodes.clone(), - authority_discovery::Role::Authority ( - keystore.clone(), - ), - ), - Role::Sentry {..} => ( - vec![], - authority_discovery::Role::Sentry, - ), - _ => unreachable!("Due to outer matches! constraint; qed."), - }; + // if the node isn't actively participating in consensus then it doesn't + // need a keystore, regardless of which protocol we use below. + let keystore = if is_authority { + Some(keystore as BareCryptoStorePtr) + } else { + None + }; - let network_event_stream = network.event_stream("authority-discovery"); - let dht_event_stream = network_event_stream.filter_map(|e| async move { match e { - Event::Dht(e) => Some(e), - _ => None, - }}).boxed(); - let authority_discovery = authority_discovery::AuthorityDiscovery::new( - client.clone(), - network.clone(), - sentries, - dht_event_stream, - authority_discovery_role, - prometheus_registry.clone(), + let config = grandpa::Config { + // FIXME substrate#1578 make this available through chainspec + gossip_duration: Duration::from_millis(1000), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_network_authority(), + }; + + let enable_grandpa = !disable_grandpa; + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: unlike in substrate we are currently running the full + // GRANDPA voter protocol for all full nodes (regardless of whether + // they're validators or not). at this point the full voter should + // provide better guarantees of block and vote data availability than + // the observer. + + // add a custom voting rule to temporarily stop voting for new blocks + // after the given pause block is finalized and restarting after the + // given delay. + let voting_rule = match grandpa_pause { + Some((block, delay)) => { + info!("GRANDPA scheduled voting pause set for block #{} with a duration of {} blocks.", + block, + delay, ); - task_manager.spawn_handle().spawn("authority-discovery", authority_discovery); - } - } - - // if the node isn't actively participating in consensus then it doesn't - // need a keystore, regardless of which protocol we use below. - let keystore = if is_authority { - Some(keystore as BareCryptoStorePtr) - } else { - None + grandpa::VotingRulesBuilder::default() + .add(crate::grandpa_support::PauseAfterBlockFor(block, delay)) + .build() + }, + None => + grandpa::VotingRulesBuilder::default() + .build(), }; - let config = grandpa::Config { - // FIXME substrate#1578 make this available through chainspec - gossip_duration: Duration::from_millis(1000), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore, - is_authority: role.is_network_authority(), + let grandpa_config = grandpa::GrandpaParams { + config, + link: link_half, + network: network.clone(), + inherent_data_providers: inherent_data_providers.clone(), + telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), + voting_rule, + prometheus_registry: prometheus_registry.clone(), + shared_voter_state, }; - let enable_grandpa = !disable_grandpa; - if enable_grandpa { - // start the full GRANDPA voter - // NOTE: unlike in substrate we are currently running the full - // GRANDPA voter protocol for all full nodes (regardless of whether - // they're validators or not). at this point the full voter should - // provide better guarantees of block and vote data availability than - // the observer. + task_manager.spawn_essential_handle().spawn_blocking( + "grandpa-voter", + grandpa::run_grandpa_voter(grandpa_config)? + ); + } else { + grandpa::setup_disabled_grandpa( + client.clone(), + &inherent_data_providers, + network.clone(), + )?; + } - // add a custom voting rule to temporarily stop voting for new blocks - // after the given pause block is finalized and restarting after the - // given delay. - let voting_rule = match $grandpa_pause { - Some((block, delay)) => { - info!("GRANDPA scheduled voting pause set for block #{} with a duration of {} blocks.", - block, - delay, - ); - - grandpa::VotingRulesBuilder::default() - .add($crate::grandpa_support::PauseAfterBlockFor(block, delay)) - .build() - }, - None => - grandpa::VotingRulesBuilder::default() - .build(), - }; - - let grandpa_config = grandpa::GrandpaParams { - config, - link: link_half, - network: network.clone(), - inherent_data_providers: inherent_data_providers.clone(), - telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), - voting_rule, - prometheus_registry: prometheus_registry.clone(), - shared_voter_state, - }; - - task_manager.spawn_essential_handle().spawn_blocking( - "grandpa-voter", - grandpa::run_grandpa_voter(grandpa_config)? - ); - } else { - grandpa::setup_disabled_grandpa( - client.clone(), - &inherent_data_providers, - network.clone(), - )?; - } - - handles.polkadot_network = Some(polkadot_network_service); - (task_manager, client, handles, network, rpc_handlers) - }}; - ( - $config:expr, - $collating_for:expr, - $max_block_data_size:expr, - $authority_discovery_disabled:expr, - $slot_duration:expr, - $grandpa_pause:expr, - $runtime:ty, - $dispatch:ty, - ) => {{ - new_full!(with_full_start - $config, - $collating_for, - $max_block_data_size, - $authority_discovery_disabled, - $slot_duration, - $grandpa_pause, - new_full_start!($config, $runtime, $dispatch), - ) - }}; - ( - test - $config:expr, - $collating_for:expr, - $max_block_data_size:expr, - $authority_discovery_disabled:expr, - $slot_duration:expr, - $runtime:ty, - $dispatch:ty, - ) => {{ - new_full!(with_full_start - $config, - $collating_for, - $max_block_data_size, - $authority_discovery_disabled, - $slot_duration, - None, - new_full_start!(test $config, $runtime, $dispatch), - ) - }}; + handles.polkadot_network = Some(polkadot_network_service); + Ok((task_manager, client, handles, network, rpc_handlers)) } /// Builds a new service for a light client. -#[macro_export] -macro_rules! new_light { - ($config:expr, $runtime:ty, $dispatch:ty) => {{ - // If we're using prometheus, use a registry with a prefix of `polkadot`. - if let Some(PrometheusConfig { registry, .. }) = $config.prometheus_config.as_mut() { - *registry = Registry::new_custom(Some("polkadot".into()), None)?; - } - let inherent_data_providers = inherents::InherentDataProviders::new(); +fn new_light(mut config: Configuration) -> Result<(TaskManager, Arc), Error> + where + Runtime: 'static + Send + Sync + ConstructRuntimeApi>, + >>::RuntimeApi: + RuntimeApiCollection>, + Dispatch: NativeExecutionDispatch + 'static, + Extrinsic: RuntimeExtrinsic, +{ + use sc_client_api::backend::RemoteBackend; - ServiceBuilder::new_light::($config)? - .with_select_chain(|_, backend| { - Ok(sc_consensus::LongestChain::new(backend.clone())) - })? - .with_transaction_pool(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; - let pool_api = sc_transaction_pool::LightChainApi::new( - builder.client().clone(), - fetcher, - ); - let pool = Arc::new(sc_transaction_pool::BasicPool::new_light( - builder.config().transaction_pool.clone(), - Arc::new(pool_api), - builder.prometheus_registry(), - builder.spawn_handle(), - )); - Ok(pool) - })? - .with_import_queue_and_fprb(| - _config, - client, - backend, - fetcher, - mut select_chain, - _, - spawn_task_handle, - registry, - | { - let select_chain = select_chain.take() - .ok_or_else(|| service::Error::SelectChainRequired)?; + // If we're using prometheus, use a registry with a prefix of `polkadot`. + if let Some(PrometheusConfig { registry, .. }) = config.prometheus_config.as_mut() { + *registry = Registry::new_custom(Some("polkadot".into()), None)?; + } - let fetch_checker = fetcher - .map(|fetcher| fetcher.checker().clone()) - .ok_or_else(|| "Trying to start light import queue without active fetch checker")?; + let (client, backend, keystore, task_manager, on_demand) = + service::new_light_parts::(&config)?; - let grandpa_block_import = grandpa::light_block_import( - client.clone(), backend, &(client.clone() as Arc<_>), Arc::new(fetch_checker) - )?; + let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let finality_proof_import = grandpa_block_import.clone(); - let finality_proof_request_builder = - finality_proof_import.create_finality_proof_request_builder(); + let pool_api = sc_transaction_pool::LightChainApi::new( + client.clone(), + on_demand.clone(), + ); + let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( + config.transaction_pool.clone(), + Arc::new(pool_api), + config.prometheus_registry(), + task_manager.spawn_handle(), + )); - let (babe_block_import, babe_link) = babe::block_import( - babe::Config::get_or_compute(&*client)?, - grandpa_block_import, - client.clone(), - )?; + let grandpa_block_import = grandpa::light_block_import( + client.clone(), backend.clone(), &(client.clone() as Arc<_>), + Arc::new(on_demand.checker().clone()), + )?; - // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. - let import_queue = babe::import_queue( - babe_link, - babe_block_import, - None, - Some(Box::new(finality_proof_import)), - client, - select_chain, - inherent_data_providers.clone(), - spawn_task_handle, - registry, - )?; + let finality_proof_import = grandpa_block_import.clone(); + let finality_proof_request_builder = + finality_proof_import.create_finality_proof_request_builder(); - Ok((import_queue, finality_proof_request_builder)) - })? - .with_finality_proof_provider(|client, backend| { - let provider = client as Arc>; - Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, provider)) as _) - })? - .with_rpc_extensions(|builder| { - let fetcher = builder.fetcher() - .ok_or_else(|| "Trying to start node RPC without active fetcher")?; - let remote_blockchain = builder.remote_backend() - .ok_or_else(|| "Trying to start node RPC without active remote blockchain")?; + let (babe_block_import, babe_link) = babe::block_import( + babe::Config::get_or_compute(&*client)?, + grandpa_block_import, + client.clone(), + )?; - let light_deps = polkadot_rpc::LightDeps { - remote_blockchain, - fetcher, - client: builder.client().clone(), - pool: builder.pool(), - }; - Ok(polkadot_rpc::create_light(light_deps)) - })? - .build_light() - .map(|ServiceComponents { task_manager, rpc_handlers, .. }| { - (task_manager, rpc_handlers) - }) - }} + let inherent_data_providers = inherents::InherentDataProviders::new(); + + // FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`. + let import_queue = babe::import_queue( + babe_link, + babe_block_import, + None, + Some(Box::new(finality_proof_import)), + client.clone(), + select_chain.clone(), + inherent_data_providers.clone(), + &task_manager.spawn_handle(), + config.prometheus_registry(), + )?; + + let provider = client.clone() as Arc>; + let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider)); + + let light_deps = polkadot_rpc::LightDeps { + remote_blockchain: backend.remote_blockchain(), + fetcher: on_demand.clone(), + client: client.clone(), + pool: transaction_pool.clone(), + }; + + let rpc_extensions = polkadot_rpc::create_light(light_deps); + + let ServiceComponents { task_manager, rpc_handlers, .. } = service::build(service::ServiceParams { + config, + block_announce_validator_builder: None, + finality_proof_request_builder: Some(finality_proof_request_builder), + finality_proof_provider: Some(finality_proof_provider), + on_demand: Some(on_demand), + remote_blockchain: Some(backend.remote_blockchain()), + rpc_extensions_builder: Box::new(service::NoopRpcExtensionBuilder(rpc_extensions)), + client: client.clone(), + transaction_pool: transaction_pool.clone(), + import_queue, keystore, backend, task_manager, + })?; + + Ok((task_manager, rpc_handlers)) } /// Builds a new object suitable for chain operations. +#[cfg(feature = "full-node")] pub fn new_chain_ops(mut config: Configuration) -> Result< ( - Arc>, - Arc>, + Arc>, + Arc, consensus_common::import_queue::BasicQueue>, TaskManager, ), ServiceError > where - Runtime: ConstructRuntimeApi> + Send + Sync + 'static, + Runtime: ConstructRuntimeApi> + Send + Sync + 'static, Runtime::RuntimeApi: - RuntimeApiCollection, Block>>, + RuntimeApiCollection>, Dispatch: NativeExecutionDispatch + 'static, Extrinsic: RuntimeExtrinsic, { config.keystore = service::config::KeystoreConfig::InMemory; - let (builder, _, _, _) = new_full_start!(config, Runtime, Dispatch); - Ok(builder.to_chain_ops_parts()) + let (service::ServiceParams { client, backend, import_queue, task_manager, .. }, ..) + = full_params::(config, false)?; + Ok((client, backend, import_queue, task_manager)) } /// Create a new Polkadot service for a full node. #[cfg(feature = "full-node")] pub fn polkadot_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, parachain::Id)>, max_block_data_size: Option, authority_discovery_disabled: bool, @@ -742,22 +697,21 @@ pub fn polkadot_new_full( TaskManager, Arc, + FullBackend, polkadot_runtime::RuntimeApi >>, FullNodeHandles, ), ServiceError> { - let (service, client, handles, _, _) = new_full!( + let (service, client, handles, _, _) = new_full::( config, collating_for, max_block_data_size, authority_discovery_disabled, slot_duration, grandpa_pause, - polkadot_runtime::RuntimeApi, - PolkadotExecutor, - ); + false, + )?; Ok((service, client, handles)) } @@ -765,7 +719,7 @@ pub fn polkadot_new_full( /// Create a new Kusama service for a full node. #[cfg(feature = "full-node")] pub fn kusama_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, parachain::Id)>, max_block_data_size: Option, authority_discovery_disabled: bool, @@ -775,23 +729,22 @@ pub fn kusama_new_full( TaskManager, Arc, + FullBackend, kusama_runtime::RuntimeApi > >, FullNodeHandles ), ServiceError> { - let (service, client, handles, _, _) = new_full!( + let (service, client, handles, _, _) = new_full::( config, collating_for, max_block_data_size, authority_discovery_disabled, slot_duration, grandpa_pause, - kusama_runtime::RuntimeApi, - KusamaExecutor, - ); + false, + )?; Ok((service, client, handles)) } @@ -799,7 +752,7 @@ pub fn kusama_new_full( /// Create a new Kusama service for a full node. #[cfg(feature = "full-node")] pub fn westend_new_full( - mut config: Configuration, + config: Configuration, collating_for: Option<(CollatorId, parachain::Id)>, max_block_data_size: Option, authority_discovery_disabled: bool, @@ -810,22 +763,21 @@ pub fn westend_new_full( TaskManager, Arc, + FullBackend, westend_runtime::RuntimeApi >>, FullNodeHandles, ), ServiceError> { - let (service, client, handles, _, _) = new_full!( + let (service, client, handles, _, _) = new_full::( config, collating_for, max_block_data_size, authority_discovery_disabled, slot_duration, grandpa_pause, - westend_runtime::RuntimeApi, - WestendExecutor, - ); + false, + )?; Ok((service, client, handles)) } @@ -842,25 +794,25 @@ pub struct FullNodeHandles { } /// Create a new Polkadot service for a light client. -pub fn polkadot_new_light(mut config: Configuration) -> Result< +pub fn polkadot_new_light(config: Configuration) -> Result< (TaskManager, Arc), ServiceError > { - new_light!(config, polkadot_runtime::RuntimeApi, PolkadotExecutor) + new_light::(config) } /// Create a new Kusama service for a light client. -pub fn kusama_new_light(mut config: Configuration) -> Result< +pub fn kusama_new_light(config: Configuration) -> Result< (TaskManager, Arc), ServiceError > { - new_light!(config, kusama_runtime::RuntimeApi, KusamaExecutor) + new_light::(config) } /// Create a new Westend service for a light client. -pub fn westend_new_light(mut config: Configuration, ) -> Result< +pub fn westend_new_light(config: Configuration, ) -> Result< (TaskManager, Arc), ServiceError > { - new_light!(config, westend_runtime::RuntimeApi, KusamaExecutor) + new_light::(config) }