Add benchmarks for for import/validation/production (#2579)

* Add benchmarks

* Remove endowed accounts

* Fix group

* Remove duplicate code

* Comments

* Use execute_block instead of block import

* Apply suggestions from code review

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Add missing comments

* Clippy

* Reorganize utils

* Remove unused import

* Switch to compiled again

* Apply suggestions from code review

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Refactor local_testnet

* Do not write wasm blob to file

* Remove unnecessary block

* Add comment fixes

* fmt

* lock

---------

Co-authored-by: Anton <anton.kalyaev@gmail.com>
Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
Sebastian Kunert
2023-06-05 16:41:20 +02:00
committed by GitHub
parent 005b9d0989
commit c047ec900a
14 changed files with 1711 additions and 41 deletions
+524 -2
View File
@@ -1838,6 +1838,15 @@ dependencies = [
"strsim",
]
[[package]]
name = "clap_complete"
version = "4.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6b5c519bab3ea61843a7923d074b04245624bb84a64a8c150f5deb014e388b"
dependencies = [
"clap",
]
[[package]]
name = "clap_derive"
version = "4.3.1"
@@ -3116,6 +3125,7 @@ dependencies = [
"frame-system",
"frame-system-rpc-runtime-api",
"pallet-balances",
"pallet-glutton",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
@@ -3147,17 +3157,25 @@ dependencies = [
"cumulus-client-consensus-relay-chain",
"cumulus-client-pov-recovery",
"cumulus-client-service",
"cumulus-pallet-parachain-system",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-inprocess-interface",
"cumulus-relay-chain-interface",
"cumulus-relay-chain-minimal-node",
"cumulus-test-client",
"cumulus-test-relay-sproof-builder",
"cumulus-test-relay-validation-worker-provider",
"cumulus-test-runtime",
"frame-system",
"frame-system-rpc-runtime-api",
"futures",
"jsonrpsee",
"kitchensink-runtime",
"node-cli",
"node-primitives",
"pallet-im-online",
"pallet-timestamp",
"pallet-transaction-payment",
"parachains-common",
"parity-scale-codec",
@@ -3169,12 +3187,16 @@ dependencies = [
"polkadot-test-service",
"portpicker",
"rand 0.8.5",
"rococo-parachain-runtime",
"sc-basic-authorship",
"sc-block-builder",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-executor",
"sc-executor-common",
"sc-executor-wasmtime",
"sc-network",
"sc-service",
"sc-telemetry",
@@ -3182,8 +3204,12 @@ dependencies = [
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"sp-api",
"sp-arithmetic",
"sp-authority-discovery",
"sp-blockchain",
"sp-consensus",
"sp-consensus-grandpa",
"sp-core",
"sp-io",
"sp-keyring",
@@ -3194,6 +3220,7 @@ dependencies = [
"sp-trie",
"substrate-test-client",
"substrate-test-utils",
"tempfile",
"tokio",
"tracing",
"url",
@@ -4197,6 +4224,21 @@ dependencies = [
"thousands",
]
[[package]]
name = "frame-benchmarking-pallet-pov"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "frame-election-provider-solution-type"
version = "4.0.0-dev"
@@ -5083,6 +5125,17 @@ dependencies = [
"parity-scale-codec",
]
[[package]]
name = "impl-num-traits"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17"
dependencies = [
"integer-sqrt",
"num-traits",
"uint",
]
[[package]]
name = "impl-rlp"
version = "0.3.0"
@@ -5482,6 +5535,115 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
[[package]]
name = "kitchensink-runtime"
version = "3.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-benchmarking-pallet-pov",
"frame-election-provider-support",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"log",
"node-primitives",
"pallet-alliance",
"pallet-asset-conversion",
"pallet-asset-rate",
"pallet-asset-tx-payment",
"pallet-assets",
"pallet-authority-discovery",
"pallet-authorship",
"pallet-babe",
"pallet-bags-list",
"pallet-balances",
"pallet-bounties",
"pallet-child-bounties",
"pallet-collective",
"pallet-contracts",
"pallet-contracts-primitives",
"pallet-conviction-voting",
"pallet-core-fellowship",
"pallet-democracy",
"pallet-election-provider-multi-phase",
"pallet-election-provider-support-benchmarking",
"pallet-elections-phragmen",
"pallet-fast-unstake",
"pallet-glutton",
"pallet-grandpa",
"pallet-identity",
"pallet-im-online",
"pallet-indices",
"pallet-insecure-randomness-collective-flip",
"pallet-lottery",
"pallet-membership",
"pallet-message-queue",
"pallet-mmr",
"pallet-multisig",
"pallet-nft-fractionalization",
"pallet-nfts",
"pallet-nfts-runtime-api",
"pallet-nis",
"pallet-nomination-pools",
"pallet-nomination-pools-benchmarking",
"pallet-nomination-pools-runtime-api",
"pallet-offences",
"pallet-offences-benchmarking",
"pallet-preimage",
"pallet-proxy",
"pallet-ranked-collective",
"pallet-recovery",
"pallet-referenda",
"pallet-remark",
"pallet-root-testing",
"pallet-salary",
"pallet-scheduler",
"pallet-session",
"pallet-session-benchmarking",
"pallet-society",
"pallet-staking",
"pallet-staking-reward-curve",
"pallet-staking-runtime-api",
"pallet-state-trie-migration",
"pallet-statement",
"pallet-sudo",
"pallet-timestamp",
"pallet-tips",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-transaction-storage",
"pallet-treasury",
"pallet-uniques",
"pallet-utility",
"pallet-vesting",
"pallet-whitelist",
"parity-scale-codec",
"primitive-types",
"scale-info",
"sp-api",
"sp-authority-discovery",
"sp-block-builder",
"sp-consensus-babe",
"sp-consensus-grandpa",
"sp-core",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-staking",
"sp-statement-store",
"sp-std",
"sp-transaction-pool",
"sp-version",
"static_assertions",
"substrate-wasm-builder",
]
[[package]]
name = "kusama-runtime"
version = "0.9.41"
@@ -6800,6 +6962,158 @@ dependencies = [
"static_assertions",
]
[[package]]
name = "node-cli"
version = "3.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"array-bytes 4.2.0",
"clap",
"clap_complete",
"frame-benchmarking-cli",
"frame-system",
"frame-system-rpc-runtime-api",
"futures",
"jsonrpsee",
"kitchensink-runtime",
"log",
"node-executor",
"node-inspect",
"node-primitives",
"node-rpc",
"pallet-asset-conversion",
"pallet-asset-tx-payment",
"pallet-assets",
"pallet-balances",
"pallet-im-online",
"pallet-transaction-payment",
"parity-scale-codec",
"rand 0.8.5",
"sc-authority-discovery",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-consensus-babe",
"sc-consensus-grandpa",
"sc-consensus-slots",
"sc-executor",
"sc-network",
"sc-network-common",
"sc-network-statement",
"sc-network-sync",
"sc-rpc",
"sc-service",
"sc-statement-store",
"sc-storage-monitor",
"sc-sync-state-rpc",
"sc-sysinfo",
"sc-telemetry",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_json",
"sp-api",
"sp-authority-discovery",
"sp-consensus",
"sp-consensus-babe",
"sp-consensus-grandpa",
"sp-core",
"sp-inherents",
"sp-io",
"sp-keyring",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"sp-transaction-pool",
"sp-transaction-storage-proof",
"substrate-build-script-utils",
"substrate-frame-cli",
"try-runtime-cli",
]
[[package]]
name = "node-executor"
version = "3.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"kitchensink-runtime",
"node-primitives",
"parity-scale-codec",
"sc-executor",
"scale-info",
"sp-core",
"sp-keystore",
"sp-state-machine",
"sp-statement-store",
"sp-tracing",
"sp-trie",
]
[[package]]
name = "node-inspect"
version = "0.9.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"clap",
"parity-scale-codec",
"sc-cli",
"sc-client-api",
"sc-executor",
"sc-service",
"sp-blockchain",
"sp-core",
"sp-runtime",
"thiserror",
]
[[package]]
name = "node-primitives"
version = "2.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-core",
"sp-runtime",
]
[[package]]
name = "node-rpc"
version = "3.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"jsonrpsee",
"mmr-rpc",
"node-primitives",
"pallet-transaction-payment-rpc",
"sc-chain-spec",
"sc-client-api",
"sc-consensus-babe",
"sc-consensus-babe-rpc",
"sc-consensus-grandpa",
"sc-consensus-grandpa-rpc",
"sc-rpc",
"sc-rpc-api",
"sc-rpc-spec-v2",
"sc-sync-state-rpc",
"sc-transaction-pool-api",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-babe",
"sp-keystore",
"sp-runtime",
"sp-statement-store",
"substrate-frame-rpc-system",
"substrate-state-trie-migration-rpc",
]
[[package]]
name = "nohash-hasher"
version = "0.2.0"
@@ -7054,6 +7368,37 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-asset-conversion"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-arithmetic",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-asset-rate"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-asset-tx-payment"
version = "4.0.0-dev"
@@ -7472,6 +7817,24 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-core-fellowship"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"log",
"parity-scale-codec",
"scale-info",
"sp-arithmetic",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-democracy"
version = "4.0.0-dev"
@@ -7671,6 +8034,20 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-lottery"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-membership"
version = "4.0.0-dev"
@@ -7990,6 +8367,56 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-remark"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"serde",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-root-testing"
version = "1.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-support",
"frame-system",
"parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-salary"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"log",
"parity-scale-codec",
"scale-info",
"sp-arithmetic",
"sp-core",
"sp-io",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-scheduler"
version = "4.0.0-dev"
@@ -8127,6 +8554,24 @@ dependencies = [
"sp-std",
]
[[package]]
name = "pallet-statement"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-support",
"frame-system",
"log",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-core",
"sp-io",
"sp-runtime",
"sp-statement-store",
"sp-std",
]
[[package]]
name = "pallet-sudo"
version = "4.0.0-dev"
@@ -8223,6 +8668,26 @@ dependencies = [
"sp-weights",
]
[[package]]
name = "pallet-transaction-storage"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"log",
"pallet-balances",
"parity-scale-codec",
"scale-info",
"serde",
"sp-inherents",
"sp-io",
"sp-runtime",
"sp-std",
"sp-transaction-storage-proof",
]
[[package]]
name = "pallet-treasury"
version = "4.0.0-dev"
@@ -10516,6 +10981,7 @@ checksum = "5cfd65aea0c5fa0bfcc7c9e7ca828c921ef778f43d325325ec84bda371bfa75a"
dependencies = [
"fixed-hash",
"impl-codec",
"impl-num-traits",
"impl-rlp",
"impl-serde",
"scale-info",
@@ -12129,6 +12595,26 @@ dependencies = [
"thiserror",
]
[[package]]
name = "sc-network-statement"
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"array-bytes 4.2.0",
"async-channel",
"futures",
"libp2p",
"log",
"parity-scale-codec",
"pin-project",
"sc-network",
"sc-network-common",
"sp-consensus",
"sp-runtime",
"sp-statement-store",
"substrate-prometheus-endpoint",
]
[[package]]
name = "sc-network-sync"
version = "0.10.0-dev"
@@ -12388,6 +12874,29 @@ dependencies = [
"sp-core",
]
[[package]]
name = "sc-statement-store"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"async-trait",
"futures",
"futures-timer",
"log",
"parity-db",
"parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
"sp-api",
"sp-blockchain",
"sp-core",
"sp-runtime",
"sp-statement-store",
"sp-tracing",
"substrate-prometheus-endpoint",
"tokio",
]
[[package]]
name = "sc-storage-monitor"
version = "0.1.0"
@@ -14014,6 +14523,19 @@ dependencies = [
"platforms",
]
[[package]]
name = "substrate-frame-cli"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#31b57a1884b00ed979ba85343e308ed73756cb41"
dependencies = [
"clap",
"frame-support",
"frame-system",
"sc-cli",
"sp-core",
"sp-runtime",
]
[[package]]
name = "substrate-frame-rpc-system"
version = "4.0.0-dev"
@@ -14872,9 +15394,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "uint"
version = "0.9.1"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f"
checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52"
dependencies = [
"byteorder",
"crunchy",