Expose config max-round-blocks-to-import (#9439)
* Expose config max-round-blocks-to-import * Fix test
This commit is contained in:
@@ -262,13 +262,12 @@ impl Importer {
|
||||
|
||||
/// This is triggered by a message coming from a block queue when the block is ready for insertion
|
||||
pub fn import_verified_blocks(&self, client: &Client) -> usize {
|
||||
|
||||
// Shortcut out if we know we're incapable of syncing the chain.
|
||||
if !client.enabled.load(AtomicOrdering::Relaxed) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
let max_blocks_to_import = 4;
|
||||
let max_blocks_to_import = client.config.max_round_blocks_to_import;
|
||||
let (imported_blocks, import_results, invalid_blocks, imported, proposed_blocks, duration, is_empty) = {
|
||||
let mut imported_blocks = Vec::with_capacity(max_blocks_to_import);
|
||||
let mut invalid_blocks = HashSet::new();
|
||||
|
||||
@@ -121,6 +121,8 @@ pub struct ClientConfig {
|
||||
pub check_seal: bool,
|
||||
/// Maximal number of transactions queued for verification in a separate thread.
|
||||
pub transaction_verification_queue_size: usize,
|
||||
/// Maximal number of blocks to import at each round.
|
||||
pub max_round_blocks_to_import: usize,
|
||||
/// Snapshot configuration
|
||||
pub snapshot: SnapshotConfiguration,
|
||||
}
|
||||
@@ -147,6 +149,7 @@ impl Default for ClientConfig {
|
||||
history_mem: 32 * mb,
|
||||
check_seal: true,
|
||||
transaction_verification_queue_size: 8192,
|
||||
max_round_blocks_to_import: 12,
|
||||
snapshot: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user