diff --git a/indexer-selection/src/lib.rs b/indexer-selection/src/lib.rs index a090202..14476fb 100644 --- a/indexer-selection/src/lib.rs +++ b/indexer-selection/src/lib.rs @@ -22,8 +22,6 @@ pub struct Candidate { /// seconds behind chain head pub seconds_behind: u32, pub slashable_grt: u64, - /// subgraph versions behind latest deployment - pub versions_behind: u8, pub zero_allocation: bool, } @@ -58,7 +56,6 @@ where score_latency(self.perf.latency_ms), score_seconds_behind(self.seconds_behind), score_slashable_grt(self.slashable_grt), - score_subgraph_versions_behind(self.versions_behind), score_zero_allocation(self.zero_allocation), ] .into_iter() @@ -109,7 +106,6 @@ where .recip() as u16; let seconds_behind = candidates.iter().map(|c| c.seconds_behind).max().unwrap(); let slashable_grt = candidates.iter().map(|c| c.slashable_grt).min().unwrap(); - let versions_behind = candidates.iter().map(|c| c.versions_behind).max().unwrap(); let zero_allocation = candidates.iter().all(|c| c.zero_allocation); [ @@ -117,7 +113,6 @@ where score_latency(latency), score_seconds_behind(seconds_behind), score_slashable_grt(slashable_grt), - score_subgraph_versions_behind(versions_behind), score_zero_allocation(zero_allocation), ] .into_iter() @@ -128,11 +123,6 @@ where // When picking curves to use consider the following reference: // https://en.wikipedia.org/wiki/Logistic_function -/// Avoid serving deployments behind latest version, unless newer versions have poor indexer support. -fn score_subgraph_versions_behind(versions_behind: u8) -> Normalized { - Normalized::new(0.25_f64.powi(versions_behind as i32)).unwrap() -} - /// https://www.desmos.com/calculator/gzmp7rbiai fn score_seconds_behind(seconds_behind: u32) -> Normalized { let b: f64 = 1e-6; diff --git a/indexer-selection/src/test.rs b/indexer-selection/src/test.rs index 0fcc41e..9a80fc0 100644 --- a/indexer-selection/src/test.rs +++ b/indexer-selection/src/test.rs @@ -47,7 +47,6 @@ prop_compose! { fee, seconds_behind: seconds_behind as u32, slashable_grt: slashable_grt as u64, - versions_behind, zero_allocation, } } @@ -97,7 +96,6 @@ fn sensitivity_seconds_behind() { fee: Normalized::ZERO, seconds_behind: 86400, slashable_grt: 1_000_000, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -110,7 +108,6 @@ fn sensitivity_seconds_behind() { fee: Normalized::ONE, seconds_behind: 120, slashable_grt: 100_000, - versions_behind: 0, zero_allocation: false, }, ]; @@ -141,7 +138,6 @@ fn sensitivity_seconds_behind_vs_latency() { fee: Normalized::ZERO, seconds_behind: 35_000_000, slashable_grt: 1_600_000, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -154,7 +150,6 @@ fn sensitivity_seconds_behind_vs_latency() { fee: Normalized::ZERO, seconds_behind: 120, slashable_grt: 100_000, - versions_behind: 0, zero_allocation: true, }, ]; @@ -185,7 +180,6 @@ fn multi_selection_preference() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 9445169, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -198,7 +192,6 @@ fn multi_selection_preference() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 1330801, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -211,7 +204,6 @@ fn multi_selection_preference() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 2675210, - versions_behind: 0, zero_allocation: false, }, ]; @@ -244,7 +236,6 @@ fn low_volume_response() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 100000, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -257,7 +248,6 @@ fn low_volume_response() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 100000, - versions_behind: 0, zero_allocation: false, }, Candidate { @@ -270,7 +260,6 @@ fn low_volume_response() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 100000, - versions_behind: 0, zero_allocation: true, }, ]; @@ -300,7 +289,6 @@ fn perf_decay() { fee: Normalized::ZERO, seconds_behind: 0, slashable_grt: 1_000_000, - versions_behind: 0, zero_allocation: false, };