Skip to content

Commit

Permalink
PR changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
piohei committed Sep 25, 2024
1 parent 146d7d0 commit 82ed514
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/tasks/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const TIME_BETWEEN_FEE_ESTIMATION_SECONDS: u64 = 30;

const GAS_PRICE_FOR_METRICS_FACTOR: f64 = 1e-9;

const MAX_RECENT_BLOCKS_TO_CHECK: u64 = 60;

pub async fn index_chain(app: Arc<App>, chain_id: u64) -> eyre::Result<()> {
loop {
index_inner(app.clone(), chain_id).await?;
Expand Down Expand Up @@ -127,10 +129,8 @@ pub async fn backfill_to_block(
// Because we do not store all the blocks (we clean up older blocks) there is no need
// to scan ALL the blocks. Especially as this may take a lot of time... We are trying
// here to move back in time "enough" to get some estimates later.
let jump_back_blocks = 60u64;

if latest_block_number > jump_back_blocks {
latest_block_number - jump_back_blocks
if latest_block_number > MAX_RECENT_BLOCKS_TO_CHECK {
latest_block_number - MAX_RECENT_BLOCKS_TO_CHECK
} else {
0
}
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::app::App;
const BLOCK_PRUNING_INTERVAL: Duration = Duration::from_secs(60);
const TX_PRUNING_INTERVAL: Duration = Duration::from_secs(60);

const fn minutes(seconds: i64) -> i64 {
seconds * 60
const fn minutes(minutes: i64) -> i64 {
minutes * 60
}

const fn hours(hours: i64) -> i64 {
Expand Down

0 comments on commit 82ed514

Please sign in to comment.