mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 06:27:58 +00:00
grandpa: avoid importing unnecessary justifications (#14423)
* grandpa: avoid importing unnecessary justifications * grandpa: make justification_import_period configurable * grandpa: keep the first justification * grandpa: add test for justification import period * grandpa: fix test
This commit is contained in:
@@ -54,6 +54,10 @@ type FullGrandpaBlockImport =
|
||||
/// The transaction pool type defintion.
|
||||
pub type TransactionPool = sc_transaction_pool::FullPool<Block, FullClient>;
|
||||
|
||||
/// The minimum period of blocks on which justifications will be
|
||||
/// imported and generated.
|
||||
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
|
||||
|
||||
/// Fetch the nonce of the given `account` from the chain state.
|
||||
///
|
||||
/// Note: Should only be used for tests.
|
||||
@@ -193,6 +197,7 @@ pub fn new_partial(
|
||||
|
||||
let (grandpa_block_import, grandpa_link) = grandpa::block_import(
|
||||
client.clone(),
|
||||
GRANDPA_JUSTIFICATION_PERIOD,
|
||||
&(client.clone() as Arc<_>),
|
||||
select_chain.clone(),
|
||||
telemetry.as_ref().map(|x| x.handle()),
|
||||
@@ -524,7 +529,7 @@ pub fn new_full_base(
|
||||
let grandpa_config = grandpa::Config {
|
||||
// FIXME #1578 make this available through chainspec
|
||||
gossip_duration: std::time::Duration::from_millis(333),
|
||||
justification_period: 512,
|
||||
justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD,
|
||||
name: Some(name),
|
||||
observer_enabled: false,
|
||||
keystore,
|
||||
|
||||
Reference in New Issue
Block a user