From f2802d7ba21d0831085d6dc04908a74887883113 Mon Sep 17 00:00:00 2001 From: sandreim <54316454+sandreim@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:56:25 +0200 Subject: [PATCH] Add support for wasm runtime metrics try #2 (#4483) * Add runtime metrics provider Signed-off-by: Andrei Sandu * Runner changes Signed-off-by: Andrei Sandu * Some sample metrics in paras_inherent Signed-off-by: Andrei Sandu * update cargo toml Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * bug Signed-off-by: Andrei Sandu * more fmt after merge Signed-off-by: Andrei Sandu * Refactor metric prefix override Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * remove bug comment Signed-off-by: Andrei Sandu * Add runtime metric primitives Signed-off-by: Andrei Sandu * Impl trace event parsing Signed-off-by: Andrei Sandu * Update metrics Signed-off-by: Andrei Sandu * cargo lock Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * Fix target check Signed-off-by: Andrei Sandu * Runtime metrics primitives Signed-off-by: Andrei Sandu * Review feedback Signed-off-by: Andrei Sandu * Runtime metrics crate Signed-off-by: Andrei Sandu * Node side runtime metric changes Signed-off-by: Andrei Sandu * use runtime CounterVec instead of macro Signed-off-by: Andrei Sandu * fmt nice Signed-off-by: Andrei Sandu * remove dead code Signed-off-by: Andrei Sandu * base58 decoding Signed-off-by: Andrei Sandu * base58 encoding Signed-off-by: Andrei Sandu * fix warn Signed-off-by: Andrei Sandu * typo Signed-off-by: Andrei Sandu * Review feedback Signed-off-by: Andrei Sandu * Finish label support Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * please compile Signed-off-by: Andrei Sandu * add feature gate Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * Comment cargo toml Signed-off-by: Andrei Sandu * Fix cargo toml description Signed-off-by: Andrei Sandu * Update doc. Signed-off-by: Andrei Sandu * switch to `runtime-metrics` feature Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * cargo toml Signed-off-by: Andrei Sandu * fix tests Signed-off-by: Andrei Sandu * fixes Signed-off-by: Andrei Sandu * better ux Signed-off-by: Andrei Sandu * from_utf8_unchecked is safe Signed-off-by: Andrei Sandu * fmt Signed-off-by: Andrei Sandu * Add Counter and refactor Signed-off-by: Andrei Sandu * Fixes Signed-off-by: Andrei Sandu * review fixes Signed-off-by: Andrei Sandu * more fixes Signed-off-by: Andrei Sandu * add integration test Signed-off-by: Andrei Sandu * dev deps Signed-off-by: Andrei Sandu * gitlab script update Signed-off-by: Andrei Sandu * review fixes Signed-off-by: Andrei Sandu * fix merge damage Signed-off-by: Andrei Sandu * Run tests twice Signed-off-by: Andrei Sandu * small fix Signed-off-by: Andrei Sandu * typo Signed-off-by: Andrei Sandu * cargo lock Signed-off-by: Andrei Sandu * tests Signed-off-by: Andrei Sandu * spellcheck happy ? Signed-off-by: Andrei Sandu * more fixes Signed-off-by: Andrei Sandu * Guard tracing init Signed-off-by: Andrei Sandu * missing copyright Signed-off-by: Andrei Sandu * update lockfile for substrate Co-authored-by: parity-processbot <> --- Cargo.lock | 371 ++++++++++-------- Cargo.toml | 3 +- cli/Cargo.toml | 2 + cli/src/command.rs | 19 +- node/client/Cargo.toml | 6 + node/metrics/Cargo.toml | 20 +- node/metrics/src/lib.rs | 14 + node/metrics/src/runtime.rs | 210 ++++++++++ node/metrics/src/tests.rs | 70 ++++ node/service/Cargo.toml | 8 + primitives/src/v1/metrics.rs | 139 +++++++ primitives/src/v1/mod.rs | 6 + runtime/kusama/Cargo.toml | 1 + runtime/metrics/Cargo.toml | 24 ++ runtime/metrics/src/lib.rs | 33 ++ runtime/metrics/src/with_runtime_metrics.rs | 126 ++++++ .../metrics/src/without_runtime_metrics.rs | 52 +++ runtime/parachains/Cargo.toml | 4 + runtime/parachains/src/paras_inherent/mod.rs | 82 +++- runtime/polkadot/Cargo.toml | 1 + runtime/rococo/Cargo.toml | 2 + runtime/westend/Cargo.toml | 1 + scripts/gitlab/test_linux_stable.sh | 5 +- 23 files changed, 1014 insertions(+), 185 deletions(-) create mode 100644 node/metrics/src/runtime.rs create mode 100644 node/metrics/src/tests.rs create mode 100644 primitives/src/v1/metrics.rs create mode 100644 runtime/metrics/Cargo.toml create mode 100644 runtime/metrics/src/lib.rs create mode 100644 runtime/metrics/src/with_runtime_metrics.rs create mode 100644 runtime/metrics/src/without_runtime_metrics.rs diff --git a/Cargo.lock b/Cargo.lock index a3d660223786..b9f8eb0db8a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -448,7 +448,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "beefy-primitives", "fnv", @@ -476,7 +476,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -496,12 +496,12 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -1845,7 +1845,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", ] @@ -1863,7 +1863,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -1884,7 +1884,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "Inflector", "chrono", @@ -1910,7 +1910,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -1924,7 +1924,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -1952,7 +1952,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "bitflags", "frame-metadata", @@ -1981,7 +1981,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -1993,7 +1993,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.1.0", @@ -2005,7 +2005,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro2", "quote", @@ -2015,7 +2015,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2038,7 +2038,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -2049,7 +2049,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "log", @@ -2066,7 +2066,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -2081,7 +2081,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "sp-api", @@ -2090,7 +2090,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "sp-api", @@ -2292,7 +2292,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "chrono", "frame-election-provider-support", @@ -4563,7 +4563,7 @@ checksum = "2386b4ebe91c2f7f51082d4cefa145d030e33a1842a96b12e4885cc3c01f7a55" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4577,7 +4577,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -4593,7 +4593,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -4608,7 +4608,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4632,7 +4632,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4652,7 +4652,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "clap", "frame-election-provider-support", @@ -4674,7 +4674,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4689,7 +4689,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "beefy-primitives", "frame-support", @@ -4705,7 +4705,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "beefy-merkle-tree", "beefy-primitives", @@ -4730,7 +4730,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4814,7 +4814,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4831,7 +4831,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4847,7 +4847,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4871,7 +4871,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4889,7 +4889,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4904,7 +4904,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4927,7 +4927,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4943,7 +4943,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4963,7 +4963,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4980,7 +4980,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -4997,7 +4997,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5015,7 +5015,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5031,7 +5031,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5048,7 +5048,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5063,7 +5063,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5077,7 +5077,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5094,7 +5094,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5117,7 +5117,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#b9cafba3d0e7a5950ac78d81e4ab7f2074938666" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5133,7 +5133,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5148,7 +5148,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5162,7 +5162,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5178,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5199,7 +5199,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5215,7 +5215,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5229,7 +5229,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5252,7 +5252,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -5263,7 +5263,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "sp-arithmetic", @@ -5272,7 +5272,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5286,7 +5286,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5304,7 +5304,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5323,7 +5323,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-support", "frame-system", @@ -5340,7 +5340,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -5357,7 +5357,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5368,7 +5368,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5385,7 +5385,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5401,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-benchmarking", "frame-support", @@ -5902,6 +5902,7 @@ dependencies = [ "futures 0.3.18", "log", "polkadot-node-core-pvf", + "polkadot-node-metrics", "polkadot-performance-test", "polkadot-service", "sc-cli", @@ -6398,10 +6399,23 @@ dependencies = [ name = "polkadot-node-metrics" version = "0.9.13" dependencies = [ + "assert_cmd", + "bs58", "futures 0.3.18", "futures-timer 3.0.2", + "hyper", + "log", "metered-channel", + "nix", + "parity-scale-codec", + "polkadot-primitives", + "sc-cli", + "sc-service", + "sc-tracing", "substrate-prometheus-endpoint", + "tempfile", + "tokio", + "tracing", ] [[package]] @@ -6824,6 +6838,17 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "polkadot-runtime-metrics" +version = "0.9.13" +dependencies = [ + "bs58", + "parity-scale-codec", + "polkadot-primitives", + "sp-std", + "sp-tracing", +] + [[package]] name = "polkadot-runtime-parachains" version = "0.9.13" @@ -6849,6 +6874,7 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives", "polkadot-primitives-test-helpers", + "polkadot-runtime-metrics", "rand 0.8.4", "rand_chacha 0.3.1", "rustc-hex", @@ -6865,6 +6891,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-tracing", "xcm", "xcm-executor", ] @@ -7781,7 +7808,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8072,7 +8099,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "sp-core", @@ -8083,7 +8110,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "derive_more", @@ -8110,7 +8137,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "futures-timer 3.0.2", @@ -8133,7 +8160,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8149,7 +8176,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8166,7 +8193,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -8177,7 +8204,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "chrono", "fdlimit", @@ -8215,7 +8242,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "fnv", "futures 0.3.18", @@ -8243,7 +8270,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "hash-db", "kvdb", @@ -8268,7 +8295,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "futures 0.3.18", @@ -8292,7 +8319,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "derive_more", @@ -8335,7 +8362,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "derive_more", "futures 0.3.18", @@ -8359,7 +8386,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8372,7 +8399,7 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "assert_matches", "async-trait", @@ -8406,7 +8433,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "futures 0.3.18", @@ -8432,7 +8459,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "sc-client-api", "sp-authorship", @@ -8443,7 +8470,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "lazy_static", "libsecp256k1", @@ -8471,7 +8498,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "derive_more", "environmental", @@ -8489,7 +8516,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "parity-scale-codec", @@ -8505,7 +8532,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8523,7 +8550,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "derive_more", @@ -8560,7 +8587,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "derive_more", "finality-grandpa", @@ -8584,7 +8611,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "ansi_term", "futures 0.3.18", @@ -8601,7 +8628,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "derive_more", @@ -8616,7 +8643,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-std", "async-trait", @@ -8667,7 +8694,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "futures-timer 3.0.2", @@ -8683,7 +8710,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "bytes 1.1.0", "fnv", @@ -8711,7 +8738,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "libp2p", @@ -8724,7 +8751,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8733,7 +8760,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "hash-db", @@ -8764,7 +8791,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "jsonrpc-core", @@ -8789,7 +8816,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "jsonrpc-core", @@ -8806,7 +8833,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "directories", @@ -8870,7 +8897,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "parity-scale-codec", @@ -8884,7 +8911,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8906,7 +8933,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "chrono", "futures 0.3.18", @@ -8924,7 +8951,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "ansi_term", "atty", @@ -8955,7 +8982,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -8966,7 +8993,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "intervalier", @@ -8993,7 +9020,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "derive_more", "futures 0.3.18", @@ -9007,7 +9034,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "futures-timer 3.0.2", @@ -9412,7 +9439,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "hash-db", "log", @@ -9429,7 +9456,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "blake2-rfc", "proc-macro-crate 1.1.0", @@ -9440,8 +9467,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9453,8 +9480,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "integer-sqrt", "num-traits", @@ -9469,7 +9496,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9482,7 +9509,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "parity-scale-codec", @@ -9494,7 +9521,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "sp-api", @@ -9506,7 +9533,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "log", @@ -9524,7 +9551,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "futures 0.3.18", @@ -9543,7 +9570,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "merlin", @@ -9566,7 +9593,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9578,7 +9605,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -9590,7 +9617,7 @@ dependencies = [ [[package]] name = "sp-core" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "base58", "bitflags", @@ -9638,7 +9665,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "blake2-rfc", "byteorder", @@ -9651,7 +9678,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro2", "quote", @@ -9662,7 +9689,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "kvdb", "parking_lot", @@ -9671,7 +9698,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro2", "quote", @@ -9681,7 +9708,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "environmental", "parity-scale-codec", @@ -9692,7 +9719,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "finality-grandpa", "log", @@ -9710,7 +9737,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9723,8 +9750,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "hash-db", @@ -9748,7 +9775,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "lazy_static", "sp-core", @@ -9758,8 +9785,8 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "0.10.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "derive_more", @@ -9776,7 +9803,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "zstd", ] @@ -9784,7 +9811,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9799,7 +9826,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -9810,7 +9837,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "sp-api", "sp-core", @@ -9819,8 +9846,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "backtrace", "lazy_static", @@ -9830,7 +9857,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "rustc-hash", "serde", @@ -9839,8 +9866,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "either", "hash256-std-hasher", @@ -9862,7 +9889,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -9879,7 +9906,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "Inflector", "proc-macro-crate 1.1.0", @@ -9891,7 +9918,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "serde", "serde_json", @@ -9900,7 +9927,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9914,7 +9941,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "scale-info", @@ -9924,8 +9951,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "0.10.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "hash-db", "log", @@ -9948,12 +9975,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" [[package]] name = "sp-storage" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9966,7 +9993,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "log", "sp-core", @@ -9979,7 +10006,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -9995,7 +10022,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "sp-std", @@ -10007,7 +10034,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "sp-api", "sp-runtime", @@ -10016,7 +10043,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "log", @@ -10031,8 +10058,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "hash-db", "memory-db", @@ -10047,7 +10074,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10063,7 +10090,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10074,7 +10101,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "impl-trait-for-tuples", "log", @@ -10287,7 +10314,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "platforms", ] @@ -10295,7 +10322,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.18", @@ -10317,7 +10344,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-std", "derive_more", @@ -10331,7 +10358,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "async-trait", "futures 0.3.18", @@ -10357,7 +10384,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "futures 0.3.18", "substrate-test-utils-derive", @@ -10367,7 +10394,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "proc-macro-crate 1.1.0", "proc-macro2", @@ -10378,7 +10405,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "ansi_term", "build-helper", @@ -10520,7 +10547,7 @@ dependencies = [ [[package]] name = "test-runner" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "frame-system", "futures 0.3.18", @@ -10961,7 +10988,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#49a4b1822e19e5b82c59ba5b36a1d7997f0a3929" +source = "git+https://github.com/paritytech/substrate?branch=master#fb08d15bcbea68415dd4ee90d11556b653096f10" dependencies = [ "jsonrpsee", "log", diff --git a/Cargo.toml b/Cargo.toml index 23c09ee45621..4db5d6e544ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ path = "src/main.rs" [package] name = "polkadot" -description = "Implementation of a https://polkadot.network node in Rust based on the Substrate framework." +description = "Implementation of a `https://polkadot.network` node in Rust based on the Substrate framework." license = "GPL-3.0-only" version = "0.9.13" authors = ["Parity Technologies "] @@ -118,6 +118,7 @@ panic = "unwind" runtime-benchmarks= [ "polkadot-cli/runtime-benchmarks" ] try-runtime = [ "polkadot-cli/try-runtime" ] disputes = [ "polkadot-cli/disputes" ] +runtime-metrics = [ "polkadot-cli/runtime-metrics" ] # Configuration for building a .deb package - for use with `cargo-deb` [package.metadata.deb] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 5ea6f80515f0..11848c8e0051 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -28,6 +28,7 @@ frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", bran try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } +polkadot-node-metrics = { path = "../node/metrics" } sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } # this crate is used only to enable `trie-memory-tracker` feature @@ -66,3 +67,4 @@ rococo-native = [ "service/rococo-native" ] malus = [ "full-node", "service/malus" ] disputes = [ "service/disputes" ] +runtime-metrics = ["service/runtime-metrics", "polkadot-node-metrics/runtime-metrics"] diff --git a/cli/src/command.rs b/cli/src/command.rs index f980dc426bea..10acbb1d7c01 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -234,11 +234,20 @@ fn host_perf_check() -> Result<()> { /// for integration tests as needed. #[cfg(feature = "malus")] pub fn run_node(run: Cli, overseer_gen: impl service::OverseerGen) -> Result<()> { - run_node_inner(run, overseer_gen) + run_node_inner(run, overseer_gen, |_logger_builder, _config| {}) } -fn run_node_inner(cli: Cli, overseer_gen: impl service::OverseerGen) -> Result<()> { - let runner = cli.create_runner(&cli.run.base).map_err(Error::from)?; +fn run_node_inner( + cli: Cli, + overseer_gen: impl service::OverseerGen, + logger_hook: F, +) -> Result<()> +where + F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration), +{ + let runner = cli + .create_runner_with_logger_hook::(&cli.run.base, logger_hook) + .map_err(Error::from)?; let chain_spec = &runner.config().chain_spec; set_default_ss58_version(chain_spec); @@ -281,10 +290,10 @@ fn run_node_inner(cli: Cli, overseer_gen: impl service::OverseerGen) -> Result<( /// Parses polkadot specific CLI arguments and run the service. pub fn run() -> Result<()> { - let cli = Cli::from_args(); + let cli: Cli = Cli::from_args(); match &cli.subcommand { - None => run_node_inner(cli, service::RealOverseerGen), + None => run_node_inner(cli, service::RealOverseerGen, polkadot_node_metrics::logger_hook()), Some(Subcommand::BuildSpec(cmd)) => { let runner = cli.create_runner(cmd)?; Ok(runner.sync_run(|config| cmd.run(config.chain_spec, config.network))?) diff --git a/node/client/Cargo.toml b/node/client/Cargo.toml index a17346f3eb08..265a0a81c030 100644 --- a/node/client/Cargo.toml +++ b/node/client/Cargo.toml @@ -45,3 +45,9 @@ polkadot = ["polkadot-runtime"] kusama = ["kusama-runtime"] rococo = ["rococo-runtime"] westend = ["westend-runtime"] +runtime-metrics = [ + "rococo-runtime/runtime-metrics", + "kusama-runtime/runtime-metrics", + "westend-runtime/runtime-metrics", + "polkadot-runtime/runtime-metrics", +] diff --git a/node/metrics/Cargo.toml b/node/metrics/Cargo.toml index 776cd72ce0d3..a4cc215afeed 100644 --- a/node/metrics/Cargo.toml +++ b/node/metrics/Cargo.toml @@ -3,15 +3,33 @@ name = "polkadot-node-metrics" version = "0.9.13" authors = ["Parity Technologies "] edition = "2018" -description = "Subsystem traits and message definitions" +description = "Subsystem metric helpers" [dependencies] futures = "0.3.17" futures-timer = "3.0.2" +tracing = "0.1.29" metered-channel = { path = "../metered-channel" } +# Both `sc-service` and `sc-cli` are required by runtime metrics `logger_hook()`. +sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } + substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } +codec = { package = "parity-scale-codec", version = "2.2.0" } +primitives = { package = "polkadot-primitives", path = "../../primitives/" } +bs58 = { version = "0.4.0", features = ["alloc"] } +log = "0.4.13" + +[dev-dependencies] +assert_cmd = "2.0.2" +nix = "0.23.0" +tempfile = "3.2.0" +hyper = { version = "0.14.14", default-features = false, features = ["http1", "tcp"] } +tokio = "1.13" [features] default = [] +runtime-metrics = [] diff --git a/node/metrics/src/lib.rs b/node/metrics/src/lib.rs index af635f621d73..cf8dc92b38c8 100644 --- a/node/metrics/src/lib.rs +++ b/node/metrics/src/lib.rs @@ -30,6 +30,17 @@ pub use metered_channel as metered; pub mod metronome; pub use self::metronome::Metronome; +#[cfg(feature = "runtime-metrics")] +pub mod runtime; +#[cfg(feature = "runtime-metrics")] +pub use self::runtime::logger_hook; + +/// Export a dummy logger hook when `wasm tracing` is not enabled. +#[cfg(not(feature = "runtime-metrics"))] +pub fn logger_hook() -> impl FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration) -> () { + |_logger_builder, _config| {} +} + /// This module reexports Prometheus types and defines the [`Metrics`] trait. pub mod metrics { /// Reexport Substrate Prometheus types. @@ -69,3 +80,6 @@ pub mod metrics { } } } + +#[cfg(test)] +mod tests; diff --git a/node/metrics/src/runtime.rs b/node/metrics/src/runtime.rs new file mode 100644 index 000000000000..f39abc910f7e --- /dev/null +++ b/node/metrics/src/runtime.rs @@ -0,0 +1,210 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Runtime Metrics helpers. +//! +//! A runtime metric provider implementation that builds on top of Substrate wasm +//! tracing support. This requires that the custom profiler (`TraceHandler`) to be +//! registered in substrate via a `logger_hook()`. Events emitted from runtime are +//! then captured/processed by the `TraceHandler` implementation. +#![cfg(feature = "runtime-metrics")] + +use codec::Decode; +use primitives::v1::{ + RuntimeMetricLabelValues, RuntimeMetricOp, RuntimeMetricRegisterParams, RuntimeMetricUpdate, +}; +use std::{ + collections::hash_map::HashMap, + sync::{Arc, Mutex, MutexGuard}, +}; +use substrate_prometheus_endpoint::{ + register, Counter, CounterVec, Opts, PrometheusError, Registry, U64, +}; + +const LOG_TARGET: &'static str = "metrics::runtime"; +const METRIC_PREFIX: &'static str = "polkadot"; + +/// Holds the registered Prometheus metric collections. +#[derive(Clone, Default)] +pub struct Metrics { + counter_vecs: Arc>>>, + counters: Arc>>>, +} + +/// Runtime metrics wrapper. +#[derive(Clone)] +pub struct RuntimeMetricsProvider(Registry, Metrics); + +impl RuntimeMetricsProvider { + /// Creates new instance. + pub fn new(metrics_registry: Registry) -> Self { + Self(metrics_registry, Metrics::default()) + } + + /// Register a counter vec metric. + pub fn register_countervec(&self, metric_name: &str, params: &RuntimeMetricRegisterParams) { + self.with_counter_vecs_lock_held(|mut hashmap| { + hashmap.entry(metric_name.to_owned()).or_insert(register( + CounterVec::new( + Opts::new(metric_name, params.description()), + ¶ms.labels().unwrap_or_default(), + )?, + &self.0, + )?); + Ok(()) + }) + } + + /// Register a counter metric. + pub fn register_counter(&self, metric_name: &str, params: &RuntimeMetricRegisterParams) { + self.with_counters_lock_held(|mut hashmap| { + hashmap + .entry(metric_name.to_owned()) + .or_insert(register(Counter::new(metric_name, params.description())?, &self.0)?); + return Ok(()) + }) + } + + /// Increment a counter with labels by a value. + pub fn inc_counter_vec_by(&self, name: &str, value: u64, labels: &RuntimeMetricLabelValues) { + self.with_counter_vecs_lock_held(|mut hashmap| { + hashmap.entry(name.to_owned()).and_modify(|counter_vec| { + counter_vec.with_label_values(&labels.as_str_vec()).inc_by(value) + }); + + Ok(()) + }); + } + + /// Increment a counter by a value. + pub fn inc_counter_by(&self, name: &str, value: u64) { + self.with_counters_lock_held(|mut hashmap| { + hashmap + .entry(name.to_owned()) + .and_modify(|counter_vec| counter_vec.inc_by(value)); + Ok(()) + }) + } + + fn with_counters_lock_held(&self, do_something: F) + where + F: FnOnce(MutexGuard<'_, HashMap>>) -> Result<(), PrometheusError>, + { + let _ = self.1.counters.lock().map(do_something).or_else(|error| { + tracing::error!( + target: LOG_TARGET, + "Cannot acquire the counter hashmap lock: {:?}", + error + ); + Err(error) + }); + } + + fn with_counter_vecs_lock_held(&self, do_something: F) + where + F: FnOnce(MutexGuard<'_, HashMap>>) -> Result<(), PrometheusError>, + { + let _ = self.1.counter_vecs.lock().map(do_something).or_else(|error| { + tracing::error!( + target: LOG_TARGET, + "Cannot acquire the countervec hashmap lock: {:?}", + error + ); + Err(error) + }); + } +} + +impl sc_tracing::TraceHandler for RuntimeMetricsProvider { + fn handle_span(&self, _span: &sc_tracing::SpanDatum) {} + fn handle_event(&self, event: &sc_tracing::TraceEvent) { + if event + .values + .string_values + .get("target") + .unwrap_or(&String::default()) + .ne("metrics") + { + return + } + + if let Some(update_op_bs58) = event.values.string_values.get("params") { + // Deserialize the metric update struct. + match RuntimeMetricUpdate::decode( + &mut RuntimeMetricsProvider::parse_event_params(&update_op_bs58) + .unwrap_or_default() + .as_slice(), + ) { + Ok(update_op) => { + self.parse_metric_update(update_op); + }, + Err(e) => { + tracing::error!(target: LOG_TARGET, "TraceEvent decode failed: {:?}", e); + }, + } + } + } +} + +impl RuntimeMetricsProvider { + // Parse end execute the update operation. + fn parse_metric_update(&self, update: RuntimeMetricUpdate) { + let metric_name = &format!("{}_{}", METRIC_PREFIX, update.metric_name()); + + match update.op { + RuntimeMetricOp::Register(ref params) => + if params.labels.is_none() { + self.register_counter(metric_name, ¶ms); + } else { + self.register_countervec(metric_name, ¶ms); + }, + RuntimeMetricOp::IncrementCounterVec(value, ref labels) => + self.inc_counter_vec_by(metric_name, value, labels), + RuntimeMetricOp::IncrementCounter(value) => self.inc_counter_by(metric_name, value), + } + } + + // Returns the `bs58` encoded metric update operation. + fn parse_event_params(event_params: &str) -> Option> { + // Shave " }" suffix. + let new_len = event_params.len().saturating_sub(2); + let event_params = &event_params[..new_len]; + + // Shave " { update_op: " prefix. + const SKIP_CHARS: &'static str = " { update_op: "; + if SKIP_CHARS.len() < event_params.len() { + if SKIP_CHARS.eq_ignore_ascii_case(&event_params[..SKIP_CHARS.len()]) { + return bs58::decode(&event_params[SKIP_CHARS.len()..].as_bytes()).into_vec().ok() + } + } + + // No event was parsed + None + } +} + +/// Returns the custom profiling closure that we'll apply to the `LoggerBuilder`. +pub fn logger_hook() -> impl FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration) -> () { + |logger_builder, config| { + if config.prometheus_registry().is_none() { + tracing::debug!(target: LOG_TARGET, "Prometheus registry is not configured.",); + return + } + let registry = config.prometheus_registry().cloned().unwrap(); + let metrics_provider = RuntimeMetricsProvider::new(registry); + logger_builder.with_custom_profiling(Box::new(metrics_provider)); + } +} diff --git a/node/metrics/src/tests.rs b/node/metrics/src/tests.rs new file mode 100644 index 000000000000..d0e632182470 --- /dev/null +++ b/node/metrics/src/tests.rs @@ -0,0 +1,70 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . +#![cfg(feature = "runtime-metrics")] +use assert_cmd::cargo::cargo_bin; +use std::{convert::TryInto, process::Command, thread, time::Duration}; +use tempfile::tempdir; + +#[test] +#[cfg(unix)] +fn runtime_can_publish_metrics() { + use hyper::{Client, Uri}; + use nix::{ + sys::signal::{kill, Signal::SIGINT}, + unistd::Pid, + }; + use std::convert::TryFrom; + + const RUNTIME_METRIC_NAME: &str = "polkadot_parachain_inherent_data_bitfields_processed"; + const DEFAULT_PROMETHEUS_PORT: u16 = 9615; + let metrics_uri = format!("http://localhost:{}/metrics", DEFAULT_PROMETHEUS_PORT); + + // Start the node with tracing enabled and forced wasm runtime execution. + let cmd = Command::new(cargo_bin("polkadot")) + // Runtime metrics require this trace target. + .args(&["--tracing-targets", "wasm_tracing=trace"]) + .args(&["--execution", "wasm"]) + .args(&["--dev", "-d"]) + .arg(tempdir().expect("failed to create temp dir.").path()) + .spawn() + .expect("failed to start the node process"); + + // Enough time to author one block. + thread::sleep(Duration::from_secs(10)); + + let runtime = tokio::runtime::Runtime::new().expect("failed to create tokio runtime"); + + runtime.block_on(async { + let client = Client::new(); + + let res = client + .get(Uri::try_from(&metrics_uri).expect("bad URI")) + .await + .expect("get request failed"); + + let body = String::from_utf8( + hyper::body::to_bytes(res).await.expect("can't get body as bytes").to_vec(), + ) + .expect("body is not an UTF8 string"); + + // Time to die. + kill(Pid::from_raw(cmd.id().try_into().unwrap()), SIGINT) + .expect("failed to kill the node process"); + + // If the node has authored at least 1 block this should pass. + assert!(body.contains(&RUNTIME_METRIC_NAME)); + }); +} diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index d80e3d5382cd..257c1bbe740e 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -179,3 +179,11 @@ try-runtime = [ ] malus = ["full-node"] disputes = ["polkadot-node-core-dispute-coordinator/disputes"] +runtime-metrics = [ + "polkadot-client/runtime-metrics", + "rococo-runtime/runtime-metrics", + "westend-runtime/runtime-metrics", + "kusama-runtime/runtime-metrics", + "polkadot-runtime/runtime-metrics", + "polkadot-runtime-parachains/runtime-metrics" +] \ No newline at end of file diff --git a/primitives/src/v1/metrics.rs b/primitives/src/v1/metrics.rs new file mode 100644 index 000000000000..c4464a004ead --- /dev/null +++ b/primitives/src/v1/metrics.rs @@ -0,0 +1,139 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Runtime metric primitives. + +use parity_scale_codec::{Decode, Encode}; +use sp_std::prelude::*; + +/// Metric registration parameters. +#[derive(Encode, Decode)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct RuntimeMetricRegisterParams { + /// Metric description. + description: Vec, + /// Only for counter vec. + pub labels: Option, +} + +/// Runtime metric operations. +#[derive(Encode, Decode)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum RuntimeMetricOp { + /// Register a new metric. + Register(RuntimeMetricRegisterParams), + /// Increment a counter metric with labels by value. + IncrementCounterVec(u64, RuntimeMetricLabelValues), + /// Increment a counter metric by value. + IncrementCounter(u64), +} + +impl RuntimeMetricRegisterParams { + /// Create new metric registration params. + pub fn new(description: Vec, labels: Option) -> Self { + Self { description, labels } + } +} + +/// Runtime metric update event. +#[derive(Encode, Decode)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct RuntimeMetricUpdate { + /// The name of the metric. + pub metric_name: Vec, + /// The operation applied to the metric. + pub op: RuntimeMetricOp, +} + +fn vec_to_str<'a>(v: &'a Vec, default: &'static str) -> &'a str { + return sp_std::str::from_utf8(v).unwrap_or(default) +} + +impl RuntimeMetricRegisterParams { + /// Returns the metric description. + pub fn description(&self) -> &str { + vec_to_str(&self.description, "No description provided.") + } + + /// Returns a label names as an `Option` of `Vec<&str>`. + pub fn labels(&self) -> Option> { + self.labels.as_ref().map(|labels| labels.as_str_vec()) + } +} + +impl RuntimeMetricLabels { + /// Returns a labels as `Vec<&str>`. + pub fn as_str_vec(&self) -> Vec<&str> { + self.0 + .iter() + .map(|label_vec| vec_to_str(&label_vec.0, "invalid_label")) + .collect() + } + + /// Return the inner values as vec. + pub fn clear(&mut self) { + self.0.clear(); + } +} + +impl From<&[&'static str]> for RuntimeMetricLabels { + fn from(v: &[&'static str]) -> RuntimeMetricLabels { + RuntimeMetricLabels( + v.iter().map(|label| RuntimeMetricLabel(label.as_bytes().to_vec())).collect(), + ) + } +} + +impl RuntimeMetricUpdate { + /// Returns the metric name. + pub fn metric_name(&self) -> &str { + vec_to_str(&self.metric_name, "invalid_metric_name") + } +} + +/// A set of metric labels. +#[derive(Clone, Default, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct RuntimeMetricLabels(Vec); + +/// A metric label. +#[derive(Clone, Default, Encode, Decode)] +#[cfg_attr(feature = "std", derive(Debug))] +pub struct RuntimeMetricLabel(Vec); + +/// A metric label value. +pub type RuntimeMetricLabelValue = RuntimeMetricLabel; + +/// A set of metric label values. +pub type RuntimeMetricLabelValues = RuntimeMetricLabels; + +/// Trait for converting Vec to `&str`. +pub trait AsStr { + /// Return a str reference. + fn as_str(&self) -> Option<&str>; +} + +impl AsStr for RuntimeMetricLabel { + fn as_str(&self) -> Option<&str> { + sp_std::str::from_utf8(&self.0).ok() + } +} + +impl From<&'static str> for RuntimeMetricLabel { + fn from(s: &'static str) -> Self { + Self(s.as_bytes().to_vec()) + } +} diff --git a/primitives/src/v1/mod.rs b/primitives/src/v1/mod.rs index 3b6af8c391d2..c27d4be7ba31 100644 --- a/primitives/src/v1/mod.rs +++ b/primitives/src/v1/mod.rs @@ -63,6 +63,12 @@ pub use sp_staking::SessionIndex; mod signed; pub use signed::{EncodeAs, Signed, UncheckedSigned}; +mod metrics; +pub use metrics::{ + RuntimeMetricLabel, RuntimeMetricLabelValue, RuntimeMetricLabelValues, RuntimeMetricLabels, + RuntimeMetricOp, RuntimeMetricRegisterParams, RuntimeMetricUpdate, +}; + /// A declarations of storage keys where an external observer can find some interesting data. pub mod well_known_keys { use super::{HrmpChannelId, Id}; diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index b5dd860d6fc6..8bc7f1bbbd88 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -270,3 +270,4 @@ disable-runtime-api = [] on-chain-release-build = [ "sp-api/disable-logging", ] +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] \ No newline at end of file diff --git a/runtime/metrics/Cargo.toml b/runtime/metrics/Cargo.toml new file mode 100644 index 000000000000..9c7431d779ba --- /dev/null +++ b/runtime/metrics/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "polkadot-runtime-metrics" +version = "0.9.13" +authors = ["Parity Technologies "] +edition = "2018" + +[dependencies] +sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false} +sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +parity-scale-codec = { version = "2.3.1", default-features = false } +primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false } + +bs58 = { version = "0.4.0", default-features = false, features = ["alloc"] } + +[features] +default = ["std"] +std = [ + "sp-std/std", + "sp-tracing/std", + "parity-scale-codec/std", + "primitives/std", + "bs58/std" +] +runtime-metrics = ["sp-tracing/with-tracing"] diff --git a/runtime/metrics/src/lib.rs b/runtime/metrics/src/lib.rs new file mode 100644 index 000000000000..a56b94404fa2 --- /dev/null +++ b/runtime/metrics/src/lib.rs @@ -0,0 +1,33 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Runtime metric interface similar to native Prometheus metrics. +//! +//! This is intended to be used only for testing and debugging and **must never +//! be used in production**. It requires the Substrate wasm tracing support +//! and command line configuration: `--tracing-targets wasm_tracing=trace`. + +#![cfg_attr(not(feature = "std"), no_std)] + +#[cfg(feature = "runtime-metrics")] +mod with_runtime_metrics; +#[cfg(feature = "runtime-metrics")] +pub use crate::with_runtime_metrics::*; + +#[cfg(not(feature = "runtime-metrics"))] +mod without_runtime_metrics; +#[cfg(not(feature = "runtime-metrics"))] +pub use crate::without_runtime_metrics::*; diff --git a/runtime/metrics/src/with_runtime_metrics.rs b/runtime/metrics/src/with_runtime_metrics.rs new file mode 100644 index 000000000000..003d228ab34b --- /dev/null +++ b/runtime/metrics/src/with_runtime_metrics.rs @@ -0,0 +1,126 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! This module provides an implementation for the runtime metrics types: `Counter` +//! and `CounterVec`. These types expose a Prometheus like interface and same functionality. +//! Each instance of a runtime metric is mapped to a Prometheus metric on the node side. + +const TRACING_TARGET: &'static str = "metrics"; + +use parity_scale_codec::Encode; +use primitives::v1::{ + RuntimeMetricLabelValues, RuntimeMetricOp, RuntimeMetricRegisterParams, RuntimeMetricUpdate, +}; +use sp_std::prelude::*; + +/// Holds a set of counters that have different values for their labels, +/// like Prometheus CounterVec. +pub struct CounterVec { + name: &'static str, + label_values: Option, +} + +/// A counter metric. +pub struct Counter { + name: &'static str, +} + +/// Convenience trait implemented for all metric types. +trait MetricEmitter { + fn emit(metric_op: &RuntimeMetricUpdate) { + sp_tracing::event!( + target: TRACING_TARGET, + sp_tracing::Level::TRACE, + update_op = bs58::encode(&metric_op.encode()).into_string().as_str() + ); + } +} + +impl MetricEmitter for CounterVec {} +impl MetricEmitter for Counter {} + +impl CounterVec { + /// Create a new metric with specified `name`, `description` and `labels`. + pub fn new(name: &'static str, description: &'static str, labels: &[&'static str]) -> Self { + // Send a register metric operation to node side. + let metric_update = RuntimeMetricUpdate { + metric_name: Vec::from(name), + op: RuntimeMetricOp::Register(RuntimeMetricRegisterParams::new( + Vec::from(description), + Some(labels.into()), + )), + }; + + Self::emit(&metric_update); + + CounterVec { name, label_values: None } + } + + /// Set the label values. Must be called before each increment operation. + pub fn with_label_values(&mut self, label_values: &[&'static str]) -> &mut Self { + self.label_values = Some(label_values.into()); + self + } + + /// Increment the counter by `value`. + pub fn inc_by(&mut self, value: u64) { + self.label_values.take().map(|label_values| { + let metric_update = RuntimeMetricUpdate { + metric_name: Vec::from(self.name), + op: RuntimeMetricOp::IncrementCounterVec(value, label_values), + }; + + Self::emit(&metric_update); + }); + } + + /// Increment the counter value. + pub fn inc(&mut self) { + self.inc_by(1); + } +} + +impl Counter { + /// Create a new counter metric with specified `name`, `description`. + pub fn new(name: &'static str, description: &'static str) -> Self { + // Send a register metric operation to node side. + let metric_update = RuntimeMetricUpdate { + metric_name: Vec::from(name), + op: RuntimeMetricOp::Register(RuntimeMetricRegisterParams::new( + Vec::from(description), + None, + )), + }; + + Self::emit(&metric_update); + Counter { name } + } + + /// Increment counter by `value`. + pub fn inc_by(&mut self, value: u64) { + let metric_update = RuntimeMetricUpdate { + metric_name: Vec::from(self.name), + op: RuntimeMetricOp::IncrementCounter(value), + }; + + Self::emit(&metric_update); + } + + /// Increment counter. + pub fn inc(&mut self) { + self.inc_by(1); + } +} diff --git a/runtime/metrics/src/without_runtime_metrics.rs b/runtime/metrics/src/without_runtime_metrics.rs new file mode 100644 index 000000000000..345d7039343a --- /dev/null +++ b/runtime/metrics/src/without_runtime_metrics.rs @@ -0,0 +1,52 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! Runtime metrics are usable from the wasm runtime only. The purpose of this module is to +//! provide a dummy implementation for the native runtime to avoid cluttering the runtime code +//! with `#[cfg(feature = "runtime-metrics")]`. + +/// A dummy Counter. +pub struct Counter; +/// A dummy CounterVec. +pub struct CounterVec; + +/// Dummy implementation. +impl CounterVec { + /// Constructor. + pub fn new(_name: &'static str, _description: &'static str, _labels: &[&'static str]) -> Self { + CounterVec + } + /// Sets label values, implementation is a `no op`. + pub fn with_label_values(&mut self, _label_values: &[&'static str]) -> &mut Self { + self + } + /// Increment counter by value, implementation is a `no op`. + pub fn inc_by(&mut self, _: u64) {} + /// Increment counter, implementation is a `no op`. + pub fn inc(&mut self) {} +} + +/// Dummy implementation. +impl Counter { + /// Constructor. + pub fn new(_name: &'static str, _description: &'static str) -> Self { + Counter + } + /// Increment counter by value, implementation is a `no op`. + pub fn inc_by(&mut self, _: u64) {} + /// Increment counter, implementation is a `no op`. + pub fn inc(&mut self) {} +} diff --git a/runtime/parachains/Cargo.toml b/runtime/parachains/Cargo.toml index 357bc5cbe2d7..d365f1af87bf 100644 --- a/runtime/parachains/Cargo.toml +++ b/runtime/parachains/Cargo.toml @@ -23,6 +23,7 @@ sp-session = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } +sp-tracing = { version = "4.0.0-dev", branch = "master", git = "https://github.com/paritytech/substrate", default-features = false, optional = true } pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -42,6 +43,7 @@ primitives = { package = "polkadot-primitives", path = "../../primitives", defau rand = { version = "0.8.3", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } +polkadot-runtime-metrics = { path = "../metrics", default-features = false} [dev-dependencies] futures = "0.3.17" @@ -82,6 +84,7 @@ std = [ "xcm/std", "xcm-executor/std", "log/std", + "polkadot-runtime-metrics/std", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -98,3 +101,4 @@ try-runtime = [ "pallet-timestamp/try-runtime", "pallet-vesting/try-runtime", ] +runtime-metrics = ["sp-tracing/with-tracing", "polkadot-runtime-metrics/runtime-metrics"] diff --git a/runtime/parachains/src/paras_inherent/mod.rs b/runtime/parachains/src/paras_inherent/mod.rs index 86fd19772efd..ad420b07830c 100644 --- a/runtime/parachains/src/paras_inherent/mod.rs +++ b/runtime/parachains/src/paras_inherent/mod.rs @@ -55,6 +55,7 @@ use sp_std::{ vec::Vec, }; +use polkadot_runtime_metrics::{Counter, CounterVec}; mod misc; mod weights; @@ -260,13 +261,41 @@ impl Pallet { parent_header, mut disputes, } = data; + #[cfg(feature = "runtime-metrics")] + sp_io::init_tracing(); - let parent_header_hash = parent_header.hash(); + let mut weight_metric = CounterVec::new( + "parachain_inherent_data_weight", + "Inherent data weight before and after filtering", + &["when"], + ); + + let mut bitfields_processed_metric = Counter::new( + "parachain_inherent_data_bitfields_processed", + "Counts the number of bitfields processed in `enter_inner`.", + ); + + let mut candidates_processed_metric = CounterVec::new( + "parachain_inherent_data_candidates_processed", + "Counts the number of parachain block candidates processed in `enter_inner`.", + &["category"], + ); + + let mut dispute_sets_processed_metric = CounterVec::new( + "parachain_inherent_data_dispute_sets_processed", + "Counts the number of dispute statements sets processed in `enter_inner`.", + &["category"], + ); + + let mut disputes_included_metric = Counter::new( + "parachain_inherent_data_disputes_included", + "Counts the number of dispute statements sets included in a block in `enter_inner`.", + ); log::debug!( target: LOG_TARGET, "[enter_inner] parent_header={:?} bitfields.len(): {}, backed_candidates.len(): {}, disputes.len(): {}", - parent_header_hash, + parent_header.hash(), signed_bitfields.len(), backed_candidates.len(), disputes.len() @@ -275,7 +304,7 @@ impl Pallet { // Check that the submitted parent header indeed corresponds to the previous block hash. let parent_hash = >::parent_hash(); ensure!( - parent_header_hash.as_ref() == parent_hash.as_ref(), + parent_header.hash().as_ref() == parent_hash.as_ref(), Error::::InvalidParentHeader, ); @@ -287,6 +316,10 @@ impl Pallet { let max_block_weight = ::BlockWeights::get().max_block; + weight_metric + .with_label_values(&["before-filter"]) + .inc_by(candidate_weight + bitfields_weight + disputes_weight); + // Potentially trim inherent data to ensure processing will be within weight limits let total_weight = { if candidate_weight @@ -333,11 +366,23 @@ impl Pallet { // Note that `provide_multi_dispute_data` will iterate, verify, and import each // dispute; so the input here must be reasonably bounded. let _ = T::DisputesHandler::provide_multi_dispute_data(disputes.clone())?; + dispute_sets_processed_metric + .with_label_values(&["imported"]) + .inc_by(disputes.len() as u64); + if T::DisputesHandler::is_frozen() { + // Relay chain freeze, at this point we will not include any parachain blocks. + dispute_sets_processed_metric.with_label_values(&["frozen"]).inc(); + // The relay chain we are currently on is invalid. Proceed no further on parachains. return Ok(Some(dispute_statements_weight::(&disputes)).into()) } + // Process the dispute sets of the current session. + dispute_sets_processed_metric + .with_label_values(&["current"]) + .inc_by(new_current_dispute_sets.len() as u64); + let mut freed_disputed = if !new_current_dispute_sets.is_empty() { let concluded_invalid_disputes = new_current_dispute_sets .iter() @@ -347,11 +392,17 @@ impl Pallet { .map(|(_, candidate)| *candidate) .collect::>(); - let freed_disputed = + // Count invalid dispute sets. + dispute_sets_processed_metric + .with_label_values(&["concluded_invalid"]) + .inc_by(concluded_invalid_disputes.len() as u64); + + let freed_disputed: Vec<_> = >::collect_disputed(&concluded_invalid_disputes) .into_iter() .map(|core| (core, FreedReason::Concluded)) .collect(); + freed_disputed } else { Vec::new() @@ -374,6 +425,7 @@ impl Pallet { disputed_bitfield }; + bitfields_processed_metric.inc_by(signed_bitfields.len() as u64); // Process new availability bitfields, yielding any availability cores whose // work has now concluded. let freed_concluded = >::process_bitfields( @@ -388,11 +440,17 @@ impl Pallet { T::DisputesHandler::note_included(current_session, *candidate_hash, now); } + candidates_processed_metric + .with_label_values(&["included"]) + .inc_by(freed_concluded.len() as u64); let freed = collect_all_freed_cores::(freed_concluded.iter().cloned()); >::clear(); >::schedule(freed, now); + candidates_processed_metric + .with_label_values(&["total"]) + .inc_by(backed_candidates.len() as u64); let scheduled = >::scheduled(); let backed_candidates = sanitize_backed_candidates::( parent_hash, @@ -403,6 +461,9 @@ impl Pallet { }, &scheduled[..], ); + candidates_processed_metric + .with_label_values(&["sanitized"]) + .inc_by(backed_candidates.len() as u64); // Process backed candidates according to scheduled cores. let parent_storage_root = parent_header.state_root().clone(); @@ -417,6 +478,8 @@ impl Pallet { full_check, )?; + disputes_included_metric.inc_by(disputes.len() as u64); + // The number of disputes included in a block is // limited by the weight as well as the number of candidate blocks. OnChainVotes::::put(ScrapedOnChainVotes::<::Hash> { @@ -432,6 +495,8 @@ impl Pallet { // this is max config.ump_service_total_weight let _ump_weight = >::process_pending_upward_messages(); + weight_metric.with_label_values(&vec!["after-filter"]).inc_by(total_weight); + Ok(Some(total_weight).into()) } } @@ -800,6 +865,12 @@ pub(crate) fn sanitize_bitfields( validators: &[ValidatorId], full_check: FullCheck, ) -> UncheckedSignedAvailabilityBitfields { + let mut bitfields_signature_checks_metric = CounterVec::new( + "create_inherent_bitfields_signature_checks", + "Counts the number of bitfields signature checked in `enter_inner`.", + &["validity"], + ); + let mut bitfields = Vec::with_capacity(unchecked_bitfields.len()); let mut last_index: Option = None; @@ -865,12 +936,15 @@ pub(crate) fn sanitize_bitfields( let validator_public = &validators[validator_index.0 as usize]; if let FullCheck::Yes = full_check { + // Validate bitfield signature. if let Ok(signed_bitfield) = unchecked_bitfield.try_into_checked(&signing_context, validator_public) { bitfields.push(signed_bitfield.into_unchecked()); + bitfields_signature_checks_metric.with_label_values(&["valid"]).inc(); } else { log::warn!(target: LOG_TARGET, "Invalid bitfield signature"); + bitfields_signature_checks_metric.with_label_values(&["invalid"]).inc(); }; } else { bitfields.push(unchecked_bitfield); diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index 8fb6586353b0..d815a3ab99c3 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -257,3 +257,4 @@ disable-runtime-api = [] on-chain-release-build = [ "sp-api/disable-logging", ] +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] \ No newline at end of file diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 854dc36296e7..73814d820fe8 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -204,3 +204,5 @@ try-runtime = [ "runtime-common/try-runtime", "pallet-multisig/try-runtime", ] + +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] \ No newline at end of file diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index c4bd0da416c4..71be76263cfd 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -254,3 +254,4 @@ try-runtime = [ # runtime without clashing with the runtime API exported functions # in WASM. disable-runtime-api = [] +runtime-metrics = ["runtime-parachains/runtime-metrics", "sp-io/with-tracing"] \ No newline at end of file diff --git a/scripts/gitlab/test_linux_stable.sh b/scripts/gitlab/test_linux_stable.sh index f7b36141af3a..6234cdbf6e88 100755 --- a/scripts/gitlab/test_linux_stable.sh +++ b/scripts/gitlab/test_linux_stable.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash -set -e +set -eux #shellcheck source=../common/lib.sh source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" time cargo test --release --locked -p polkadot-node-core-dispute-coordinator --features disputes -time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks +# Builds with the runtime benchmarks/metrics features are only to be used for testing. +time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks,runtime-metrics