mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: Prevent excessive file crawling when syncing the first block
This commit is contained in:
@ -275,6 +275,7 @@ impl BlockIngest {
|
|||||||
let engine_api = node.auth_server_handle().http_client();
|
let engine_api = node.auth_server_handle().http_client();
|
||||||
let mut evm_map = erc20_contract_to_spot_token(node.chain_spec().chain_id()).await?;
|
let mut evm_map = erc20_contract_to_spot_token(node.chain_spec().chain_id()).await?;
|
||||||
|
|
||||||
|
const MINIMUM_TIMESTAMP: u64 = 1739849780;
|
||||||
let current_block_timestamp: u64 = provider
|
let current_block_timestamp: u64 = provider
|
||||||
.block_by_number(head)
|
.block_by_number(head)
|
||||||
.expect("Failed to fetch current block in db")
|
.expect("Failed to fetch current block in db")
|
||||||
@ -282,6 +283,8 @@ impl BlockIngest {
|
|||||||
.into_header()
|
.into_header()
|
||||||
.timestamp();
|
.timestamp();
|
||||||
|
|
||||||
|
let current_block_timestamp = current_block_timestamp.max(MINIMUM_TIMESTAMP);
|
||||||
|
|
||||||
info!("Current height {height}, timestamp {current_block_timestamp}");
|
info!("Current height {height}, timestamp {current_block_timestamp}");
|
||||||
self.start_local_ingest_loop(height, current_block_timestamp).await;
|
self.start_local_ingest_loop(height, current_block_timestamp).await;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user