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

Companion PR for substrate #7328 #1825

Merged
10 commits merged into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions node/core/proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use polkadot_primitives::v1::{
Block, Hash, Header,
};
use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
use sp_core::traits::SpawnNamed;
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_consensus::{Proposal, RecordProof};
Expand All @@ -25,12 +26,14 @@ pub struct ProposerFactory<TxPool, Backend, Client> {

impl<TxPool, Backend, Client> ProposerFactory<TxPool, Backend, Client> {
pub fn new(
spawn_handle: Box<dyn SpawnNamed>,
client: Arc<Client>,
transaction_pool: Arc<TxPool>,
overseer: OverseerHandler,
) -> Self {
ProposerFactory {
inner: sc_basic_authorship::ProposerFactory::new(
spawn_handle,
client,
transaction_pool,
None,
Expand Down
1 change: 1 addition & 0 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ pub fn new_full<RuntimeApi, Executor>(
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());

let proposer = ProposerFactory::new(
Box::new(task_manager.spawn_handle()),
cecton marked this conversation as resolved.
Show resolved Hide resolved
client.clone(),
transaction_pool,
overseer_handler.clone(),
Expand Down
1 change: 1 addition & 0 deletions node/test-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ inherents = { package = "sp-inherents", git = "https://github.com/paritytech/sub
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
4 changes: 2 additions & 2 deletions node/test-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ native_executor_instance!(
);

/// Create a new Polkadot test service for a full node.
#[sc_cli::prefix_logs_with(config.network.node_name.as_str())]
pub fn polkadot_test_new_full(
config: Configuration,
authority_discovery_disabled: bool,
Expand Down Expand Up @@ -112,14 +113,13 @@ pub fn node_config(
spec.set_storage(storage);

let mut network_config = NetworkConfiguration::new(
format!("Polkadot Test Node for: {}", key_seed),
key_seed.to_string(),
"network/test/0.1",
Default::default(),
None,
);
let informant_output_format = OutputFormat {
enable_color: false,
prefix: format!("[{}] ", key_seed),
};

network_config.boot_nodes = boot_nodes;
Expand Down
3 changes: 3 additions & 0 deletions validation/src/block_production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use std::{
use sp_blockchain::HeaderBackend;
use block_builder::{BlockBuilderApi, BlockBuilderProvider};
use consensus::{Proposal, RecordProof};
use primitives::traits::SpawnNamed;
use polkadot_primitives::v0::{NEW_HEADS_IDENTIFIER, Block, Header, AttestedCandidate};
use runtime_primitives::traits::{DigestFor, HashFor};
use txpool_api::TransactionPool;
Expand All @@ -47,11 +48,13 @@ pub struct ProposerFactory<Client, TxPool, Backend> {
impl<Client, TxPool, Backend> ProposerFactory<Client, TxPool, Backend> {
/// Create a new proposer factory.
pub fn new(
spawn_handle: Box<dyn SpawnNamed>,
client: Arc<Client>,
transaction_pool: Arc<TxPool>,
prometheus: Option<&PrometheusRegistry>,
) -> Self {
let factory = sc_basic_authorship::ProposerFactory::new(
spawn_handle,
client,
transaction_pool,
prometheus,
Expand Down