Skip to content

Commit

Permalink
refactor: migrate to new ISA implementation (#588)
Browse files Browse the repository at this point in the history
This switches to a rewrite of indexer-selection that has been stripped
down to only concerning itself with picking candidates out of a valid
set. The new implementation removes a lot of long-standing
inefficiencies, and will be easier to iterate on changes to the ISA.

See https://github.com/edgeandnode/candidate-selection

A bunch of integration testing and production performance comparisons
will happen before this is released.
  • Loading branch information
Theodus authored Feb 14, 2024
1 parent 9198f26 commit f32e5f3
Show file tree
Hide file tree
Showing 30 changed files with 410 additions and 2,330 deletions.
50 changes: 28 additions & 22 deletions Cargo.lock

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

7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[workspace]
members = [
"graph-gateway",
"indexer-selection",
"gateway-common",
"gateway-framework",
]
members = ["graph-gateway", "gateway-common", "gateway-framework"]
resolver = "2"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion gateway-framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ alloy-sol-types = "0.6.2"
anyhow.workspace = true
axum.workspace = true
ethers = "2.0.13"
candidate-selection = { git = "ssh://[email protected]/edgeandnode/candidate-selection.git", rev = "c0b5efa" }
eventuals = "0.6.7"
gateway-common = { path = "../gateway-common" }
graphql-http.workspace = true
headers = "0.3.9"
hex.workspace = true
indexer-selection = { path = "../indexer-selection" }
itertools = "0.12.1"
lazy_static = "1.4.0"
maxminddb = "0.24"
Expand Down
2 changes: 1 addition & 1 deletion gateway-framework/src/budgets.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Duration;

use candidate_selection::criteria::decay::DecayBuffer;
use eventuals::{Eventual, EventualWriter};
use indexer_selection::decay::DecayBuffer;
use ordered_float::NotNan;
use tokio::time::interval;
use tokio::{select, spawn, sync::mpsc};
Expand Down
2 changes: 1 addition & 1 deletion graph-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ graphql.workspace = true
graphql-http.workspace = true
headers = "0.3.9"
hickory-resolver = "0.24.0"
indexer-selection = { path = "../indexer-selection" }
indexer-selection = { git = "ssh://[email protected]/edgeandnode/candidate-selection.git", rev = "0f711bc" }
indoc = "2.0.4"
itertools = "0.12.1"
num-traits = "0.2.18"
Expand Down
6 changes: 2 additions & 4 deletions graph-gateway/src/block_constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ use thegraph::types::BlockPointer;

use gateway_framework::{block_constraints::BlockConstraint, errors::Error};

pub fn block_constraints<'c>(
context: &'c Context<'c, String>,
) -> Result<BTreeSet<BlockConstraint>, Error> {
pub fn block_constraints(context: &Context<String>) -> Result<BTreeSet<BlockConstraint>, Error> {
let mut constraints = BTreeSet::new();
let vars = &context.variables;
// ba6c90f1-3baf-45be-ac1c-f60733404436
Expand Down Expand Up @@ -64,7 +62,7 @@ pub fn block_constraints<'c>(
}

pub fn make_query_deterministic(
mut ctx: Context<'_, String>,
mut ctx: Context<String>,
resolved: &BTreeSet<BlockPointer>,
latest: &BlockPointer,
) -> Result<String, Error> {
Expand Down
Loading

0 comments on commit f32e5f3

Please sign in to comment.