Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 31 additions & 4 deletions Cargo.lock

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

22 changes: 19 additions & 3 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,21 @@ macro_rules! new_full_start {
})?
.with_transaction_pool(|builder| {
let pool_api = sc_transaction_pool::FullChainApi::new(
builder.client().clone()
builder.client().clone(),
);
Ok(sc_transaction_pool::BasicPool::new(
builder.config().transaction_pool.clone(),
std::sync::Arc::new(pool_api),
builder.prometheus_registry(),
))
})?
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
.with_import_queue(|
_config,
client,
mut select_chain,
_transaction_pool,
registry,
| {
let select_chain = select_chain.take()
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;

Expand All @@ -63,6 +69,7 @@ macro_rules! new_full_start {
None,
client,
inherent_data_providers.clone(),
registry,
)?;

import_setup = Some((grandpa_block_import, grandpa_link));
Expand Down Expand Up @@ -209,7 +216,15 @@ pub fn new_light(config: Configuration)
);
Ok(pool)
})?
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| {
.with_import_queue_and_fprb(|
_config,
client,
backend,
fetcher,
_select_chain,
_tx_pool,
prometheus_registry,
| {
let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
Expand All @@ -230,6 +245,7 @@ pub fn new_light(config: Configuration)
Some(Box::new(finality_proof_import)),
client,
inherent_data_providers.clone(),
prometheus_registry,
)?;

Ok((import_queue, finality_proof_request_builder))
Expand Down
32 changes: 27 additions & 5 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,27 @@ macro_rules! new_full_start {
})?
.with_transaction_pool(|builder| {
let pool_api = sc_transaction_pool::FullChainApi::new(
builder.client().clone()
builder.client().clone(),
);
Ok(sc_transaction_pool::BasicPool::new(
builder.config().transaction_pool.clone(),
std::sync::Arc::new(pool_api),
builder.prometheus_registry(),
))
})?
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
.with_import_queue(|
_config,
client,
mut select_chain,
_transaction_pool,
prometheus_registry,
| {
let select_chain = select_chain.take()
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
let (grandpa_block_import, grandpa_link) = grandpa::block_import(
client.clone(),
&(client.clone() as Arc<_>),
select_chain,
select_chain.clone(),
)?;
let justification_import = grandpa_block_import.clone();

Expand All @@ -88,7 +94,9 @@ macro_rules! new_full_start {
Some(Box::new(justification_import)),
None,
client,
select_chain,
inherent_data_providers.clone(),
prometheus_registry,
)?;

import_setup = Some((block_import, grandpa_link, babe_link));
Expand Down Expand Up @@ -312,7 +320,7 @@ pub fn new_light(config: Configuration)
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
let pool_api = sc_transaction_pool::LightChainApi::new(
builder.client().clone(),
fetcher.clone()
fetcher,
);
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
builder.config().transaction_pool.clone(),
Expand All @@ -322,10 +330,22 @@ pub fn new_light(config: Configuration)
);
Ok(pool)
})?
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| {
.with_import_queue_and_fprb(|
_config,
client,
backend,
fetcher,
mut select_chain,
_tx_pool,
registry,
| {
let select_chain = select_chain.take()
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;

let fetch_checker = fetcher
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;

let grandpa_block_import = grandpa::light_block_import(
client.clone(),
backend,
Expand All @@ -349,7 +369,9 @@ pub fn new_light(config: Configuration)
None,
Some(Box::new(finality_proof_import)),
client.clone(),
select_chain,
inherent_data_providers.clone(),
registry,
)?;

Ok((import_queue, finality_proof_request_builder))
Expand Down
Loading