Skip to content

Commit

Permalink
chore: upgrade indexer-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Apr 8, 2024
1 parent 10a8fe4 commit bbb697d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion graph-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gateway-common = { path = "../gateway-common" }
gateway-framework = { path = "../gateway-framework" }
graphql.workspace = true
headers = "0.3.9"
indexer-selection = { git = "https://github.com/edgeandnode/candidate-selection", rev = "bcd7909" }
indexer-selection = { git = "https://github.com/edgeandnode/candidate-selection", rev = "2c48a9b" }
indoc = "2.0.5"
itertools = "0.12.1"
num-traits = "0.2.18"
Expand Down
9 changes: 1 addition & 8 deletions graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ async fn handle_client_query_inner(
&block_requirements,
chain_head,
blocks_per_minute,
grt_per_usd,
budget,
indexing,
) {
Expand Down Expand Up @@ -552,7 +551,6 @@ fn prepare_candidate(
block_requirements: &BlockRequirements,
chain_head: BlockNumber,
blocks_per_minute: u64,
grt_per_usd: NotNan<f64>,
budget: u128,
indexing: Indexing,
) -> Result<Candidate, IndexerError> {
Expand Down Expand Up @@ -582,19 +580,14 @@ fn prepare_candidate(
}
}

let slashable_usd = ((info.staked_tokens as f64 * 1e-18) / *grt_per_usd) as u64;
if slashable_usd == 0 {
return Err(IndexerError::Unavailable(NoStake));
}

Ok(Candidate {
indexer: indexing.indexer,
deployment: indexing.deployment,
url: info.url.clone(),
perf: perf.response,
fee,
seconds_behind: perf.seconds_behind,
slashable_usd,
slashable_grt: (info.staked_tokens as f64 * 1e-18) as u64,
subgraph_versions_behind: *versions_behind.get(&indexing.deployment).unwrap_or(&0),
zero_allocation: info.allocated_tokens == 0,
})
Expand Down

0 comments on commit bbb697d

Please sign in to comment.