diff --git a/staking-miner-playground/Cargo.lock b/staking-miner-playground/Cargo.lock index 4375cb439..3ee20ee7c 100644 --- a/staking-miner-playground/Cargo.lock +++ b/staking-miner-playground/Cargo.lock @@ -426,7 +426,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", @@ -439,15 +439,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-lock" version = "3.3.0" @@ -1046,17 +1037,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "comfy-table" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" -dependencies = [ - "strum 0.25.0", - "strum_macros 0.25.3", - "unicode-width", -] - [[package]] name = "common-path" version = "1.0.0" @@ -2075,55 +2055,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "frame-benchmarking-cli" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c61d2fc05eb6a5b4d6324740165ae90840667a9e8ecc55e10c65343d259838c" -dependencies = [ - "Inflector", - "array-bytes 6.2.2", - "chrono", - "clap", - "comfy-table", - "frame-benchmarking", - "frame-support", - "frame-system", - "gethostname", - "handlebars", - "itertools", - "lazy_static", - "linked-hash-map", - "log", - "parity-scale-codec", - "rand 0.8.5", - "rand_pcg", - "sc-block-builder", - "sc-cli", - "sc-client-api", - "sc-client-db", - "sc-executor", - "sc-service", - "sc-sysinfo", - "serde", - "serde_json", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-database", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", - "sp-wasm-interface", - "thiserror", - "thousands", -] - [[package]] name = "frame-election-provider-solution-type" version = "12.0.0" @@ -2185,28 +2116,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-remote-externalities" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce6dcbe54a14394ba471f8f1c38a9b7b9bbccda9c23ef04de74403527ef4bf" -dependencies = [ - "futures", - "indicatif", - "jsonrpsee", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", -] - [[package]] name = "frame-support" version = "27.0.0" @@ -2508,16 +2417,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "gethostname" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "getrandom" version = "0.1.16" @@ -2616,20 +2515,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "handlebars" -version = "4.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" -dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "hash-db" version = "0.16.0" @@ -2862,7 +2747,6 @@ dependencies = [ "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.3", ] [[package]] @@ -3007,19 +2891,6 @@ dependencies = [ "hashbrown 0.14.3", ] -[[package]] -name = "indicatif" -version = "0.17.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb28741c9db9a713d93deb3bb9515c20788cef5815265bee4980e87bde7e0f25" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - [[package]] name = "inout" version = "0.1.3" @@ -3133,35 +3004,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", - "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", - "jsonrpsee-ws-client", "tracing", ] -[[package]] -name = "jsonrpsee-client-transport" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" -dependencies = [ - "futures-util", - "http", - "jsonrpsee-core", - "jsonrpsee-types", - "pin-project", - "rustls-native-certs", - "soketto", - "thiserror", - "tokio", - "tokio-rustls", - "tokio-util", - "tracing", - "webpki-roots 0.25.3", -] - [[package]] name = "jsonrpsee-core" version = "0.16.3" @@ -3170,11 +3018,9 @@ checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", - "async-lock 2.8.0", "async-trait", "beef", "futures-channel", - "futures-timer", "futures-util", "globset", "hyper", @@ -3190,25 +3036,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jsonrpsee-http-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", - "rustc-hash", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "jsonrpsee-proc-macros" version = "0.16.3" @@ -3258,18 +3085,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jsonrpsee-ws-client" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" -dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", -] - [[package]] name = "k256" version = "0.13.3" @@ -3742,7 +3557,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -4011,12 +3826,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -4467,12 +4276,6 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.30.4" @@ -4621,7 +4424,7 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-std", - "strum 0.24.1", + "strum", ] [[package]] @@ -4977,51 +4780,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "pest_meta" -version = "2.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.8", -] - [[package]] name = "petgraph" version = "0.6.4" @@ -5129,12 +4887,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - [[package]] name = "powerfmt" version = "0.2.0" @@ -5777,7 +5529,6 @@ dependencies = [ name = "runtime" version = "4.0.0-dev" dependencies = [ - "frame-benchmarking", "frame-election-provider-support", "frame-executive", "frame-support", @@ -7519,26 +7270,6 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-consensus-babe" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d248658f288676d2c814bcf79577a5bd0b9f386bfae5c4860bfed6ca71ab973b" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - [[package]] name = "sp-consensus-grandpa" version = "12.0.0" @@ -7736,7 +7467,7 @@ dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum 0.24.1", + "strum", ] [[package]] @@ -8151,17 +7882,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinners" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" -dependencies = [ - "lazy_static", - "maplit", - "strum 0.24.1", -] - [[package]] name = "spki" version = "0.7.3" @@ -8198,8 +7918,6 @@ name = "staking-miner-playground" version = "4.0.0-dev" dependencies = [ "clap", - "frame-benchmarking", - "frame-benchmarking-cli", "frame-system", "futures", "jsonrpsee", @@ -8236,7 +7954,6 @@ dependencies = [ "sp-timestamp", "substrate-build-script-utils", "substrate-frame-rpc-system", - "try-runtime-cli", ] [[package]] @@ -8285,15 +8002,9 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros 0.24.3", + "strum_macros", ] -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" - [[package]] name = "strum_macros" version = "0.24.3" @@ -8307,19 +8018,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.48", -] - [[package]] name = "substrate-bip39" version = "0.4.5" @@ -8371,20 +8069,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "substrate-rpc-client" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa0743d9665e00acaed5800e605ee7c977eafbb2dfa86cbceda2708fe8d6ac3" -dependencies = [ - "async-trait", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "sp-runtime", -] - [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" @@ -8396,7 +8080,7 @@ dependencies = [ "filetime", "parity-wasm", "sp-maybe-compressed-blob 4.1.0-dev", - "strum 0.24.1", + "strum", "tempfile", "toml 0.8.8", "walkdir", @@ -8540,12 +8224,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "thousands" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" - [[package]] name = "thread_local" version = "1.1.7" @@ -8658,17 +8336,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "tokio-retry" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" -dependencies = [ - "pin-project", - "rand 0.8.5", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -8962,42 +8629,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "try-runtime-cli" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e92846539e4704fd2ebf7edfd6f4ba76f49a430c0695616fe6eb74cf12c7d6f" -dependencies = [ - "async-trait", - "clap", - "frame-remote-externalities", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-rpc", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights", - "substrate-rpc-client", - "zstd 0.12.4", -] - [[package]] name = "tt-call" version = "1.0.9" @@ -9022,12 +8653,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - [[package]] name = "uint" version = "0.9.5" @@ -9286,8 +8911,8 @@ checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", - "strum 0.24.1", - "strum_macros 0.24.3", + "strum", + "strum_macros", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -9567,12 +9192,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "webpki-roots" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" - [[package]] name = "which" version = "4.4.2" diff --git a/staking-miner-playground/node/Cargo.toml b/staking-miner-playground/node/Cargo.toml index 5b6b37018..1661ac9c6 100644 --- a/staking-miner-playground/node/Cargo.toml +++ b/staking-miner-playground/node/Cargo.toml @@ -55,24 +55,13 @@ sp-block-builder = "25" substrate-frame-rpc-system = "27" pallet-transaction-payment-rpc = "29" -# These dependencies are used for runtime benchmarking -frame-benchmarking = "27" -frame-benchmarking-cli = "31" - # Local Dependencies runtime = { version = "4.0.0-dev", path = "../runtime" } lazy_static = "1.4.0" rand = "0.8.5" -# CLI-specific dependencies -try-runtime-cli = { version = "0.37", optional = true } - [build-dependencies] substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk" } [features] default = [] -runtime-benchmarks = ["runtime/runtime-benchmarks"] -# Enable features that allow the runtime to be tried and debugged. Name might be subject to change -# in the near future. -try-runtime = ["runtime/try-runtime", "try-runtime-cli"] diff --git a/staking-miner-playground/node/src/service.rs b/staking-miner-playground/node/src/service.rs index 682b71cee..0af407ec4 100644 --- a/staking-miner-playground/node/src/service.rs +++ b/staking-miner-playground/node/src/service.rs @@ -23,11 +23,6 @@ const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; pub struct ExecutorDispatch; impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { - /// Only enable the benchmarking host functions when we actually want to benchmark. - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - /// Otherwise we only use the default Substrate host functions. - #[cfg(not(feature = "runtime-benchmarks"))] type ExtendHostFunctions = (); fn dispatch(method: &str, data: &[u8]) -> Option> { diff --git a/staking-miner-playground/runtime/Cargo.toml b/staking-miner-playground/runtime/Cargo.toml index 203a28afd..fc285947a 100644 --- a/staking-miner-playground/runtime/Cargo.toml +++ b/staking-miner-playground/runtime/Cargo.toml @@ -49,8 +49,6 @@ sp-genesis-builder = { version = "0.6", default-features = false } frame-system-rpc-runtime-api = { version = "25", default-features = false } pallet-transaction-payment-rpc-runtime-api = { version = "27", default-features = false } -frame-benchmarking = { version = "27", default-features = false } - [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk" } @@ -87,8 +85,4 @@ std = [ "sp-transaction-pool/std", "sp-version/std", ] -runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", -] -try-runtime = [] test-trimming = [] diff --git a/staking-miner-playground/runtime/src/lib.rs b/staking-miner-playground/runtime/src/lib.rs index 98710cbcc..95578c897 100644 --- a/staking-miner-playground/runtime/src/lib.rs +++ b/staking-miner-playground/runtime/src/lib.rs @@ -322,8 +322,8 @@ impl ShouldEndSession // can still be the normal periodic sessions. let now = System::block_number(); let last_election = get_last_election(); - let will_change = ElectionProviderMultiPhase::queued_solution().is_some() - || (now - last_election) > PERIOD; + let will_change = ElectionProviderMultiPhase::queued_solution().is_some() || + (now - last_election) > PERIOD; if will_change { set_last_election() } @@ -841,22 +841,6 @@ impl_runtime_apis! { } } - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn benchmark_metadata(extra: bool) -> ( - Vec, - Vec, - ) { - unimplemented!(); - } - - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { - unimplemented!(); - } - } - impl sp_genesis_builder::GenesisBuilder for Runtime { fn create_default_config() -> Vec { create_default_config::()