Skip to content

Commit c6de6ae

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
fix: pass only block delays param and subtract delays
Co-Authored-By: Jayant Krishnamurthy <[email protected]>
1 parent db9439b commit c6de6ae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/fortuna/src/keeper.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ pub async fn run_keeper_threads(
357357
chain_eth_config.escalation_policy.clone(),
358358
metrics.clone(),
359359
fulfilled_requests_cache.clone(),
360-
chain_eth_config.clone(),
360+
chain_eth_config.block_delays.clone(),
361361
)
362362
.in_current_span(),
363363
);
@@ -979,7 +979,7 @@ pub async fn process_new_blocks(
979979
escalation_policy: EscalationPolicyConfig,
980980
metrics: Arc<KeeperMetrics>,
981981
fulfilled_requests_cache: Arc<RwLock<HashSet<u64>>>,
982-
chain_eth_config: EthereumConfig,
982+
block_delays: Vec<u64>,
983983
) {
984984
tracing::info!("Waiting for new block ranges to process");
985985
loop {
@@ -998,10 +998,10 @@ pub async fn process_new_blocks(
998998
.await;
999999

10001000
// Then process with each configured delay
1001-
for delay in &chain_eth_config.block_delays {
1001+
for delay in &block_delays {
10021002
let adjusted_range = BlockRange {
1003-
from: block_range.from + delay,
1004-
to: block_range.to + delay,
1003+
from: block_range.from.saturating_sub(*delay),
1004+
to: block_range.to.saturating_sub(*delay),
10051005
};
10061006
process_block_range(
10071007
adjusted_range,

0 commit comments

Comments
 (0)