Update Polkadot & Substrate (#300)

This commit is contained in:
Cecile Tonglet
2021-01-20 17:35:05 +01:00
committed by GitHub
parent 3fd6ec6bf1
commit b31a6b38a9
9 changed files with 249 additions and 289 deletions
+2 -1
View File
@@ -14,11 +14,12 @@ sc-basic-authorship = { git = "https://github.com/paritytech/substrate", version
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
+9 -7
View File
@@ -73,13 +73,13 @@ pub fn new_partial(
(),
sp_consensus::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
sc_transaction_pool::FullPool<Block, TFullClient<Block, RuntimeApi, RuntimeExecutor>>,
(),
Option<sc_telemetry::TelemetrySpan>,
>,
sc_service::Error,
> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
let (client, backend, keystore_container, task_manager) =
let (client, backend, keystore_container, task_manager, telemetry_span) =
sc_service::new_full_parts::<Block, RuntimeApi, RuntimeExecutor>(&config)?;
let client = Arc::new(client);
@@ -109,7 +109,7 @@ pub fn new_partial(
transaction_pool,
inherent_data_providers,
select_chain: (),
other: (),
other: telemetry_span,
};
Ok(params)
@@ -118,7 +118,7 @@ pub fn new_partial(
/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.
///
/// This is the actual implementation that is abstract over the executor and the runtime api.
#[sc_cli::prefix_logs_with(parachain_config.network.node_name.as_str())]
#[sc_tracing::logging::prefix_logs_with(parachain_config.network.node_name.as_str())]
async fn start_node_impl<RB>(
parachain_config: Configuration,
collator_key: CollatorPair,
@@ -146,6 +146,7 @@ where
let mut parachain_config = prepare_node_config(parachain_config);
let params = new_partial(&mut parachain_config)?;
let telemetry_span = params.other;
params
.inherent_data_providers
.register_provider(sp_timestamp::InherentDataProvider)
@@ -193,25 +194,25 @@ where
Box::new(move |_, _| rpc_ext_builder(client.clone()))
};
let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
let (rpc_handlers, _) = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
on_demand: None,
remote_blockchain: None,
rpc_extensions_builder,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
task_manager: &mut task_manager,
telemetry_connection_sinks: Default::default(),
config: parachain_config,
keystore: params.keystore_container.sync_keystore(),
backend,
network: network.clone(),
network_status_sinks,
system_rpc_tx,
telemetry_span,
})?;
let announce_block = {
let network = network.clone();
Arc::new(move |hash, data| network.announce_block(hash, data))
Arc::new(move |hash, data| network.announce_block(hash, Some(data)))
};
let polkadot_full_node = polkadot_full_node.with_client(polkadot_test_service::TestClient);
@@ -415,6 +416,7 @@ pub fn node_config(
rpc_cors: None,
rpc_methods: Default::default(),
prometheus_config: None,
telemetry_handle: None,
telemetry_endpoints: None,
telemetry_external_transport: None,
default_heap_pages: None,
+3 -1
View File
@@ -22,7 +22,9 @@ use substrate_test_runtime_client::AccountKeyring::*;
#[substrate_test_utils::test]
async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExecutor) {
sc_cli::init_logger(Default::default()).expect("Sets up logger");
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
builder.with_colors(false);
let _ = builder.init();
let para_id = ParaId::from(100);