Skip to content
This repository was archived by the owner on Jul 4, 2022. It is now read-only.

Commit 4bf79f4

Browse files
authored
Upgrade babe to the latest (#124)
* Offchain Phragmén BREAKING. (#4517) commit: d123842 * Add cherry-picks Make all `PerThing` types implement all trait methods on the type (#5422) 871e128 Build for only one target for docs.rs (#5427) 31352af * support: add lateness trait (#5519) 0c7f8b2 * Revise docs on randomness (#5497) 3ac409b * Relax substrate licensing scheme (#5947) commit: dbf2163 * Add notes about safe uses of twox (#6082) commit: 73ff938 * Correct BABE randomness by calculating InOut bytes directly in pallet (#5876) commit: 2b67057 [ci skip] * Add changes for #5876 to compile & run tests * babe: report equivocations (#6362) commit: 18334ee [ci skip] * Add changes for #6362 to compile & run tests * Remove warnings, add a TODO * Bump spec version
1 parent 004d66a commit 4bf79f4

File tree

74 files changed

+3605
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3605
-730
lines changed

Cargo.lock

Lines changed: 31 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node-template/node/src/service.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,21 @@ macro_rules! new_full_start {
3737
})?
3838
.with_transaction_pool(|builder| {
3939
let pool_api = sc_transaction_pool::FullChainApi::new(
40-
builder.client().clone()
40+
builder.client().clone(),
4141
);
4242
Ok(sc_transaction_pool::BasicPool::new(
4343
builder.config().transaction_pool.clone(),
4444
std::sync::Arc::new(pool_api),
4545
builder.prometheus_registry(),
4646
))
4747
})?
48-
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
48+
.with_import_queue(|
49+
_config,
50+
client,
51+
mut select_chain,
52+
_transaction_pool,
53+
registry,
54+
| {
4955
let select_chain = select_chain.take()
5056
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
5157

@@ -63,6 +69,7 @@ macro_rules! new_full_start {
6369
None,
6470
client,
6571
inherent_data_providers.clone(),
72+
registry,
6673
)?;
6774

6875
import_setup = Some((grandpa_block_import, grandpa_link));
@@ -209,7 +216,15 @@ pub fn new_light(config: Configuration)
209216
);
210217
Ok(pool)
211218
})?
212-
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| {
219+
.with_import_queue_and_fprb(|
220+
_config,
221+
client,
222+
backend,
223+
fetcher,
224+
_select_chain,
225+
_tx_pool,
226+
prometheus_registry,
227+
| {
213228
let fetch_checker = fetcher
214229
.map(|fetcher| fetcher.checker().clone())
215230
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
@@ -230,6 +245,7 @@ pub fn new_light(config: Configuration)
230245
Some(Box::new(finality_proof_import)),
231246
client,
232247
inherent_data_providers.clone(),
248+
prometheus_registry,
233249
)?;
234250

235251
Ok((import_queue, finality_proof_request_builder))

bin/node/cli/src/service.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,27 @@ macro_rules! new_full_start {
5858
})?
5959
.with_transaction_pool(|builder| {
6060
let pool_api = sc_transaction_pool::FullChainApi::new(
61-
builder.client().clone()
61+
builder.client().clone(),
6262
);
6363
Ok(sc_transaction_pool::BasicPool::new(
6464
builder.config().transaction_pool.clone(),
6565
std::sync::Arc::new(pool_api),
6666
builder.prometheus_registry(),
6767
))
6868
})?
69-
.with_import_queue(|_config, client, mut select_chain, _transaction_pool| {
69+
.with_import_queue(|
70+
_config,
71+
client,
72+
mut select_chain,
73+
_transaction_pool,
74+
prometheus_registry,
75+
| {
7076
let select_chain = select_chain.take()
7177
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
7278
let (grandpa_block_import, grandpa_link) = grandpa::block_import(
7379
client.clone(),
7480
&(client.clone() as Arc<_>),
75-
select_chain,
81+
select_chain.clone(),
7682
)?;
7783
let justification_import = grandpa_block_import.clone();
7884

@@ -88,7 +94,9 @@ macro_rules! new_full_start {
8894
Some(Box::new(justification_import)),
8995
None,
9096
client,
97+
select_chain,
9198
inherent_data_providers.clone(),
99+
prometheus_registry,
92100
)?;
93101

94102
import_setup = Some((block_import, grandpa_link, babe_link));
@@ -312,7 +320,7 @@ pub fn new_light(config: Configuration)
312320
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
313321
let pool_api = sc_transaction_pool::LightChainApi::new(
314322
builder.client().clone(),
315-
fetcher.clone()
323+
fetcher,
316324
);
317325
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
318326
builder.config().transaction_pool.clone(),
@@ -322,10 +330,22 @@ pub fn new_light(config: Configuration)
322330
);
323331
Ok(pool)
324332
})?
325-
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| {
333+
.with_import_queue_and_fprb(|
334+
_config,
335+
client,
336+
backend,
337+
fetcher,
338+
mut select_chain,
339+
_tx_pool,
340+
registry,
341+
| {
342+
let select_chain = select_chain.take()
343+
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
344+
326345
let fetch_checker = fetcher
327346
.map(|fetcher| fetcher.checker().clone())
328347
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
348+
329349
let grandpa_block_import = grandpa::light_block_import(
330350
client.clone(),
331351
backend,
@@ -349,7 +369,9 @@ pub fn new_light(config: Configuration)
349369
None,
350370
Some(Box::new(finality_proof_import)),
351371
client.clone(),
372+
select_chain,
352373
inherent_data_providers.clone(),
374+
registry,
353375
)?;
354376

355377
Ok((import_queue, finality_proof_request_builder))

0 commit comments

Comments
 (0)