Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
split consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
gilescope committed Jul 10, 2021
1 parent deac632 commit a92d95d
Show file tree
Hide file tree
Showing 89 changed files with 776 additions and 528 deletions.
56 changes: 47 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ members = [
"client/chain-spec",
"client/chain-spec/derive",
"client/cli",
"client/consensus/api",
"client/consensus/aura",
"client/consensus/babe",
"client/consensus/babe/rpc",
Expand Down
1 change: 1 addition & 0 deletions bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sc-consensus-aura = { version = "0.9.0", path = "../../../client/consensus/aura"
sp-consensus-aura = { version = "0.9.0", path = "../../../primitives/consensus/aura" }
sp-consensus = { version = "0.9.0", path = "../../../primitives/consensus/common" }
sc-consensus = { version = "0.9.0", path = "../../../client/consensus/common" }
sc-consensus-api = { version = "0.9.0", path = "../../../client/consensus/api" }
sc-finality-grandpa = { version = "0.9.0", path = "../../../client/finality-grandpa" }
sp-finality-grandpa = { version = "3.0.0", path = "../../../primitives/finality-grandpa" }
sc-client-api = { version = "3.0.0", path = "../../../client/api" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;

pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponents<
FullClient, FullBackend, FullSelectChain,
sp_consensus::DefaultImportQueue<Block, FullClient>,
sc_consensus_api::DefaultImportQueue<Block, FullClient>,
sc_transaction_pool::FullPool<Block, FullClient>,
(
sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
Expand Down
1 change: 1 addition & 0 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ sc-consensus = { version = "0.9.0", path = "../../../client/consensus/common" }
sc-transaction-pool = { version = "3.0.0", path = "../../../client/transaction-pool" }
sc-transaction-pool-api = { version = "3.0.0", path = "../../../client/transaction-pool/api" }
sc-network = { version = "0.9.0", path = "../../../client/network" }
sc-consensus-api = { version = "0.9.0", path = "../../../client/consensus/api" }
sc-consensus-slots = { version = "0.9.0", path = "../../../client/consensus/slots" }
sc-consensus-babe = { version = "0.9.0", path = "../../../client/consensus/babe" }
sc-consensus-uncles = { version = "0.9.0", path = "../../../client/consensus/uncles" }
Expand Down
5 changes: 3 additions & 2 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn new_partial(
config: &Configuration,
) -> Result<sc_service::PartialComponents<
FullClient, FullBackend, FullSelectChain,
sp_consensus::DefaultImportQueue<Block, FullClient>,
sc_consensus_api::DefaultImportQueue<Block, FullClient>,
sc_transaction_pool::FullPool<Block, FullClient>,
(
impl Fn(
Expand Down Expand Up @@ -606,8 +606,9 @@ mod tests {
use sc_consensus_babe::{CompatibleDigestItem, BabeIntermediate, INTERMEDIATE_KEY};
use sc_consensus_epochs::descendent_query;
use sp_consensus::{
Environment, Proposer, BlockImportParams, BlockOrigin, ForkChoiceStrategy, BlockImport,
Environment, Proposer,
};
use sc_consensus_api::{BlockImportParams, BlockOrigin, ForkChoiceStrategy, BlockImport,};
use node_primitives::{Block, DigestItem, Signature};
use node_runtime::{BalancesCall, Call, UncheckedExtrinsic, Address};
use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION};
Expand Down
1 change: 1 addition & 0 deletions bin/node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pallet-transaction-payment = { version = "3.0.0", path = "../../../frame/transac
pallet-treasury = { version = "3.0.0", path = "../../../frame/treasury" }
sp-application-crypto = { version = "3.0.0", path = "../../../primitives/application-crypto" }
sp-consensus-babe = { version = "0.9.0", path = "../../../primitives/consensus/babe" }
sc-consensus-api = { version = "0.9.0", path = "../../../client/consensus/api" }
sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" }
sp-externalities = { version = "0.9.0", path = "../../../primitives/externalities" }
substrate-test-client = { version = "2.0.0", path = "../../../test-utils/client" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/executor/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,8 @@ fn full_wasm_block_import_works_with_changes_trie() {
fn should_import_block_with_test_client() {
use node_testing::client::{
ClientBlockImportExt, TestClientBuilderExt, TestClientBuilder,
sp_consensus::BlockOrigin,
};
use sc_consensus_api::BlockOrigin;

let mut client = TestClientBuilder::new().build();
let block1 = changes_trie_block();
Expand Down
1 change: 1 addition & 0 deletions bin/node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sp-runtime = { version = "3.0.0", path = "../../../primitives/runtime" }
pallet-staking = { version = "3.0.0", path = "../../../frame/staking" }
sc-executor = { version = "0.9.0", path = "../../../client/executor", features = ["wasmtime"] }
sp-consensus = { version = "0.9.0", path = "../../../primitives/consensus/common" }
sc-consensus-api = { version = "0.9.0", path = "../../../client/consensus/api" }
frame-system = { version = "3.0.0", path = "../../../frame/system" }
substrate-test-client = { version = "2.0.0", path = "../../../test-utils/client" }
pallet-timestamp = { version = "3.0.0", path = "../../../frame/timestamp" }
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::client::{Client, Backend};
use crate::keyring::*;
use sc_client_db::PruningMode;
use sc_executor::{NativeExecutor, WasmExecutionMethod};
use sp_consensus::{
use sc_consensus_api::{
BlockOrigin, BlockImport, BlockImportParams,
ForkChoiceStrategy, ImportResult, ImportedAux
};
Expand Down
1 change: 1 addition & 0 deletions client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
sp-consensus = { version = "0.9.0", path = "../../primitives/consensus/common" }
sc-consensus-api = { version = "0.9.0", path = "../consensus/api" }
derive_more = "0.99.2"
sc-executor = { version = "0.9.0", path = "../executor" }
sp-externalities = { version = "0.9.0", path = "../../primitives/externalities" }
Expand Down
4 changes: 2 additions & 2 deletions client/api/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ use crate::{
UsageInfo,
};
use sp_blockchain;
use sp_consensus::BlockOrigin;
use sc_consensus_api::BlockOrigin;
use parking_lot::RwLock;

pub use sp_state_machine::Backend as StateBackend;
pub use sp_consensus::ImportedState;
pub use sc_consensus_api::ImportedState;
use std::marker::PhantomData;

/// Extracts the state backend type for the given backend.
Expand Down
2 changes: 1 addition & 1 deletion client/api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use sp_runtime::{
generic::{BlockId, SignedBlock},
Justifications,
};
use sp_consensus::BlockOrigin;
use sc_consensus_api::BlockOrigin;

use crate::blockchain::Info;
use crate::notifications::StorageEventStream;
Expand Down
1 change: 1 addition & 0 deletions client/basic-authorship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ sc-proposer-metrics = { version = "0.9.0", path = "../proposer-metrics" }

[dev-dependencies]
sc-transaction-pool = { version = "3.0.0", path = "../transaction-pool" }
sc-consensus-api = { version = "0.9.0", path = "../consensus/api" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }
parking_lot = "0.11.1"
3 changes: 2 additions & 1 deletion client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ mod tests {
use super::*;

use parking_lot::Mutex;
use sp_consensus::{BlockOrigin, Proposer};
use sp_consensus::Proposer;
use sc_consensus_api::BlockOrigin;
use substrate_test_runtime_client::{
prelude::*, TestClientBuilder, runtime::{Extrinsic, Transfer}, TestClientBuilderExt,
};
Expand Down
Loading

0 comments on commit a92d95d

Please sign in to comment.