Skip to content

Commit

Permalink
fix: add optimistic progress to indexing status report (#887)
Browse files Browse the repository at this point in the history
This avoids an edge case where users receive a block number from an
indexer but then fail to make a subsequent query to the same indexer
because we think it hasn't hit that block yet.
  • Loading branch information
Theodus authored Jul 16, 2024
1 parent c23c073 commit 7a3bb3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn build_candidates_list(
// Infer the indexed range from the indexing progress information
let range = {
let (start, end) = indexing.progress.as_range();
start.unwrap_or(0)..=max(end, perf.latest_block + blocks_per_minute)
start.unwrap_or(0)..=(max(end, perf.latest_block) + blocks_per_minute)
};

let number_gte = block_requirements.number_gte.unwrap_or(0);
Expand All @@ -644,7 +644,7 @@ fn build_candidates_list(
indexing_id.indexer,
IndexerError::Unavailable(UnavailableReason::MissingBlock(MissingBlockError {
missing: Some(missing),
latest: None,
latest: Some(max(indexing.progress.latest_block, perf.latest_block)),
})),
);
continue;
Expand Down

0 comments on commit 7a3bb3b

Please sign in to comment.