Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/fortuna/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/fortuna/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fortuna"
version = "7.4.2"
version = "7.4.3"
edition = "2021"

[lib]
Expand Down
1 change: 1 addition & 0 deletions apps/fortuna/src/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub async fn run_keeper_threads(
chain_state.clone(),
metrics.clone(),
fulfilled_requests_cache.clone(),
chain_eth_config.block_delays.clone(),
)
.in_current_span(),
);
Expand Down
35 changes: 29 additions & 6 deletions apps/fortuna/src/keeper/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ pub async fn process_new_blocks(
}

/// Processes the backlog_range for a chain.
/// It processes the backlog range for each configured block delay.
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(skip_all)]
pub async fn process_backlog(
backlog_range: BlockRange,
Expand All @@ -343,18 +345,39 @@ pub async fn process_backlog(
chain_state: BlockchainState,
metrics: Arc<KeeperMetrics>,
fulfilled_requests_cache: Arc<RwLock<HashSet<u64>>>,
block_delays: Vec<u64>,
) {
tracing::info!("Processing backlog");
// Process blocks immediately first
process_block_range(
backlog_range,
contract,
backlog_range.clone(),
Arc::clone(&contract),
gas_limit,
escalation_policy,
chain_state,
metrics,
fulfilled_requests_cache,
escalation_policy.clone(),
chain_state.clone(),
metrics.clone(),
fulfilled_requests_cache.clone(),
)
.in_current_span()
.await;

// Then process with each configured delay
for delay in &block_delays {
let adjusted_range = BlockRange {
from: backlog_range.from.saturating_sub(*delay),
to: backlog_range.to.saturating_sub(*delay),
};
process_block_range(
adjusted_range,
Arc::clone(&contract),
gas_limit,
escalation_policy.clone(),
chain_state.clone(),
metrics.clone(),
fulfilled_requests_cache.clone(),
)
.in_current_span()
.await;
}
tracing::info!("Backlog processed");
}
Loading