Skip to content

Commit 7e84923

Browse files
Seulgi Kimsgkim126
authored andcommitted
Increase the number of blocks and headers to import in a round
1 parent aa717c2 commit 7e84923

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/client/importer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ impl Importer {
9090

9191
/// This is triggered by a message coming from a block queue when the block is ready for insertion
9292
pub fn import_verified_blocks(&self, client: &Client) -> usize {
93-
let max_blocks_to_import = 4;
9493
let (imported_blocks, import_results, invalid_blocks, imported, duration, is_empty) = {
95-
let mut imported_blocks = Vec::with_capacity(max_blocks_to_import);
94+
const MAX_BLOCKS_TO_IMPORT: usize = 1_000;
95+
let mut imported_blocks = Vec::with_capacity(MAX_BLOCKS_TO_IMPORT);
9696
let mut invalid_blocks = HashSet::new();
97-
let mut import_results = Vec::with_capacity(max_blocks_to_import);
97+
let mut import_results = Vec::with_capacity(MAX_BLOCKS_TO_IMPORT);
9898

9999
let import_lock = self.import_lock.lock();
100-
let blocks = self.block_queue.drain(max_blocks_to_import);
100+
let blocks = self.block_queue.drain(MAX_BLOCKS_TO_IMPORT);
101101
if blocks.is_empty() {
102102
return 0
103103
}
@@ -370,9 +370,9 @@ impl Importer {
370370

371371
/// This is triggered by a message coming from a header queue when the header is ready for insertion
372372
pub fn import_verified_headers(&self, client: &Client) -> usize {
373-
let max_headers_to_import = 256;
373+
const MAX_HEADERS_TO_IMPORT: usize = 10_000;
374374
let lock = self.import_lock.lock();
375-
let headers = self.header_queue.drain(max_headers_to_import);
375+
let headers = self.header_queue.drain(MAX_HEADERS_TO_IMPORT);
376376
self.import_headers(&headers, client, &lock)
377377
}
378378

0 commit comments

Comments
 (0)