From 976948e9d97a12092841517b8d2cc9c28d4ff11f Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Fri, 21 Oct 2022 03:17:02 -0400 Subject: [PATCH] Update Cargo.tomls for substrate packages --- Cargo.lock | 56 ---------------------------------- substrate/consensus/Cargo.toml | 32 ++++++++----------- substrate/consensus/src/lib.rs | 2 +- substrate/node/Cargo.toml | 36 +++++++++++----------- substrate/runtime/Cargo.toml | 27 ++++++++-------- 5 files changed, 44 insertions(+), 109 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a929d337..dbaec9d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2591,21 +2591,6 @@ dependencies = [ "sp-weights", ] -[[package]] -name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/serai-dex/substrate#176b4e8cfc110f339d88ebd414602bc3833da3c3" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" @@ -6577,31 +6562,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sc-consensus-pow" -version = "0.10.0-dev" -source = "git+https://github.com/serai-dex/substrate#176b4e8cfc110f339d88ebd414602bc3833da3c3" -dependencies = [ - "async-trait", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-client-api", - "sc-consensus", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-pow", - "sp-core", - "sp-inherents", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - [[package]] name = "sc-executor" version = "0.10.0-dev" @@ -7430,7 +7390,6 @@ dependencies = [ "sc-basic-authorship", "sc-client-api", "sc-consensus", - "sc-consensus-pow", "sc-executor", "sc-network", "sc-service", @@ -7440,12 +7399,10 @@ dependencies = [ "sp-application-crypto", "sp-blockchain", "sp-consensus", - "sp-consensus-pow", "sp-core", "sp-inherents", "sp-runtime", "sp-timestamp", - "sp-trie", "substrate-prometheus-endpoint", "tendermint-machine", "tokio", @@ -7539,7 +7496,6 @@ dependencies = [ "frame-executive", "frame-support", "frame-system", - "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", "pallet-balances", @@ -7948,18 +7904,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sp-consensus-pow" -version = "0.10.0-dev" -source = "git+https://github.com/serai-dex/substrate#176b4e8cfc110f339d88ebd414602bc3833da3c3" -dependencies = [ - "parity-scale-codec", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" version = "6.0.0" diff --git a/substrate/consensus/Cargo.toml b/substrate/consensus/Cargo.toml index df8e54d9..f1bfb984 100644 --- a/substrate/consensus/Cargo.toml +++ b/substrate/consensus/Cargo.toml @@ -15,35 +15,27 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] async-trait = "0.1" +tokio = "1" + sp-core = { git = "https://github.com/serai-dex/substrate" } sp-application-crypto = { git = "https://github.com/serai-dex/substrate" } sp-inherents = { git = "https://github.com/serai-dex/substrate" } -sp-runtime = { git = "https://github.com/serai-dex/substrate" } -sp-blockchain = { git = "https://github.com/serai-dex/substrate" } -sp-api = { git = "https://github.com/serai-dex/substrate" } - -sp-consensus = { git = "https://github.com/serai-dex/substrate" } -sc-consensus = { git = "https://github.com/serai-dex/substrate" } - -tendermint-machine = { path = "../tendermint", features = ["substrate"] } - -# -- - -sp-trie = { git = "https://github.com/serai-dex/substrate" } sp-timestamp = { git = "https://github.com/serai-dex/substrate" } +sp-blockchain = { git = "https://github.com/serai-dex/substrate" } +sp-runtime = { git = "https://github.com/serai-dex/substrate" } +sp-api = { git = "https://github.com/serai-dex/substrate" } +sp-consensus = { git = "https://github.com/serai-dex/substrate" } + sc-transaction-pool = { git = "https://github.com/serai-dex/substrate" } sc-basic-authorship = { git = "https://github.com/serai-dex/substrate" } -sc-consensus-pow = { git = "https://github.com/serai-dex/substrate" } -sp-consensus-pow = { git = "https://github.com/serai-dex/substrate" } - +sc-executor = { git = "https://github.com/serai-dex/substrate" } sc-network = { git = "https://github.com/serai-dex/substrate" } -sc-service = { git = "https://github.com/serai-dex/substrate", features = ["wasmtime"] } -sc-executor = { git = "https://github.com/serai-dex/substrate", features = ["wasmtime"] } +sc-service = { git = "https://github.com/serai-dex/substrate" } +sc-client-api = { git = "https://github.com/serai-dex/substrate" } +sc-consensus = { git = "https://github.com/serai-dex/substrate" } substrate-prometheus-endpoint = { git = "https://github.com/serai-dex/substrate" } -sc-client-api = { git = "https://github.com/serai-dex/substrate" } +tendermint-machine = { path = "../tendermint", features = ["substrate"] } serai-runtime = { path = "../runtime" } - -tokio = "1" diff --git a/substrate/consensus/src/lib.rs b/substrate/consensus/src/lib.rs index 762f8c20..56734f57 100644 --- a/substrate/consensus/src/lib.rs +++ b/substrate/consensus/src/lib.rs @@ -42,7 +42,7 @@ pub fn import_queue( Ok(import_queue::import_queue( client.clone(), client, - Arc::new(|_, _| async { Ok(()) }), + Arc::new(|_, _| async { Ok(sp_timestamp::InherentDataProvider::from_system_time()) }), &task_manager.spawn_essential_handle(), registry, )) diff --git a/substrate/node/Cargo.toml b/substrate/node/Cargo.toml index 58c50785..a25473e7 100644 --- a/substrate/node/Cargo.toml +++ b/substrate/node/Cargo.toml @@ -13,41 +13,40 @@ name = "serai-node" [dependencies] clap = { version = "4", features = ["derive"] } +jsonrpsee = { version = "0.15", features = ["server"] } -sc-cli = { git = "https://github.com/serai-dex/substrate", features = ["wasmtime"] } sp-core = { git = "https://github.com/serai-dex/substrate" } -sc-executor = { git = "https://github.com/serai-dex/substrate", features = ["wasmtime"] } -sc-service = { git = "https://github.com/serai-dex/substrate", features = ["wasmtime"] } +sp-runtime = { git = "https://github.com/serai-dex/substrate" } +sp-timestamp = { git = "https://github.com/serai-dex/substrate" } +sp-inherents = { git = "https://github.com/serai-dex/substrate" } +sp-keyring = { git = "https://github.com/serai-dex/substrate" } +sp-api = { git = "https://github.com/serai-dex/substrate" } +sp-blockchain = { git = "https://github.com/serai-dex/substrate" } +sp-block-builder = { git = "https://github.com/serai-dex/substrate" } + +sc-cli = { git = "https://github.com/serai-dex/substrate" } +sc-executor = { git = "https://github.com/serai-dex/substrate" } +sc-service = { git = "https://github.com/serai-dex/substrate" } sc-telemetry = { git = "https://github.com/serai-dex/substrate" } sc-keystore = { git = "https://github.com/serai-dex/substrate" } sc-transaction-pool = { git = "https://github.com/serai-dex/substrate" } sc-transaction-pool-api = { git = "https://github.com/serai-dex/substrate" } sc-consensus = { git = "https://github.com/serai-dex/substrate" } sc-client-api = { git = "https://github.com/serai-dex/substrate" } -sp-runtime = { git = "https://github.com/serai-dex/substrate" } -sp-timestamp = { git = "https://github.com/serai-dex/substrate" } -sp-inherents = { git = "https://github.com/serai-dex/substrate" } -sp-keyring = { git = "https://github.com/serai-dex/substrate" } + frame-system = { git = "https://github.com/serai-dex/substrate" } +frame-benchmarking = { git = "https://github.com/serai-dex/substrate" } +frame-benchmarking-cli = { git = "https://github.com/serai-dex/substrate" } pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", default-features = false } -# These dependencies are used for the node template's RPCs -jsonrpsee = { version = "0.15", features = ["server"] } sc-rpc = { git = "https://github.com/serai-dex/substrate" } -sp-api = { git = "https://github.com/serai-dex/substrate" } sc-rpc-api = { git = "https://github.com/serai-dex/substrate" } -sp-blockchain = { git = "https://github.com/serai-dex/substrate" } -sp-block-builder = { git = "https://github.com/serai-dex/substrate" } + substrate-frame-rpc-system = { git = "https://github.com/serai-dex/substrate" } pallet-transaction-payment-rpc = { git = "https://github.com/serai-dex/substrate" } -# These dependencies are used for runtime benchmarking -frame-benchmarking = { git = "https://github.com/serai-dex/substrate" } -frame-benchmarking-cli = { git = "https://github.com/serai-dex/substrate" } - -# Local dependencies -serai-consensus = { path = "../consensus" } serai-runtime = { path = "../runtime" } +serai-consensus = { path = "../consensus" } [build-dependencies] substrate-build-script-utils = { git = "https://github.com/serai-dex/substrate.git" } @@ -57,5 +56,6 @@ default = [] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", + "serai-runtime/runtime-benchmarks" ] diff --git a/substrate/runtime/Cargo.toml b/substrate/runtime/Cargo.toml index 048039c8..76b42541 100644 --- a/substrate/runtime/Cargo.toml +++ b/substrate/runtime/Cargo.toml @@ -28,26 +28,22 @@ sp-block-builder = { git = "https://github.com/serai-dex/substrate", default-fea sp-runtime = { git = "https://github.com/serai-dex/substrate", default-features = false } sp-api = { git = "https://github.com/serai-dex/substrate", default-features = false } -frame-support = { git = "https://github.com/serai-dex/substrate", default-features = false } frame-system = { git = "https://github.com/serai-dex/substrate", default-features = false } +frame-support = { git = "https://github.com/serai-dex/substrate", default-features = false } frame-executive = { git = "https://github.com/serai-dex/substrate", default-features = false } +frame-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true } -pallet-randomness-collective-flip = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-timestamp = { git = "https://github.com/serai-dex/substrate", default-features = false } +pallet-randomness-collective-flip = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-balances = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-transaction-payment = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-contracts-primitives = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-contracts = { git = "https://github.com/serai-dex/substrate", default-features = false } -# Used for the node template's RPCs frame-system-rpc-runtime-api = { git = "https://github.com/serai-dex/substrate", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/serai-dex/substrate", default-features = false } -# Used for runtime benchmarking -frame-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true } -frame-system-benchmarking = { git = "https://github.com/serai-dex/substrate", default-features = false, optional = true } - [build-dependencies] substrate-wasm-builder = { git = "https://github.com/serai-dex/substrate" } @@ -67,28 +63,31 @@ std = [ "sp-runtime/std", "sp-api/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", "frame-system/std", + "frame-support/std", "frame-executive/std", - "pallet-randomness-collective-flip/std", "pallet-timestamp/std", + "pallet-randomness-collective-flip/std", "pallet-balances/std", "pallet-transaction-payment/std", - "pallet-transaction-payment-rpc-runtime-api/std", "pallet-contracts/std", "pallet-contracts-primitives/std", + + "frame-system-rpc-runtime-api/std", + "pallet-transaction-payment-rpc-runtime-api/std", ] runtime-benchmarks = [ "hex-literal", + "sp-runtime/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", "pallet-balances/runtime-benchmarks", ]