From 8180290be757057ee48d455566609f5c1bd6bdd6 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 6 Oct 2023 16:07:08 -0700 Subject: [PATCH] chain isn't ExactSizeIterator --- web3_proxy/src/rpcs/consensus.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/rpcs/consensus.rs b/web3_proxy/src/rpcs/consensus.rs index a772bc07..878c77c2 100644 --- a/web3_proxy/src/rpcs/consensus.rs +++ b/web3_proxy/src/rpcs/consensus.rs @@ -124,7 +124,6 @@ pub struct RankedRpcs { // TODO: could these be refs? The owning RankedRpcs lifetime might work. `stream!` might make it complicated pub struct RpcsForRequest { inner: Vec>, - outer: Vec>, request: Arc, } @@ -276,9 +275,11 @@ impl RankedRpcs { outer.sort_by_cached_key(|x| x.sort_for_load_balancing_on(max_block_needed, now)); } } + + inner.extend(outer); + Some(RpcsForRequest { inner, - outer, request: web3_request.clone(), }) } @@ -985,6 +986,7 @@ impl RpcsForRequest { // TODO: need an iter of self.inner, then self.outer + // we have to collect cuz apparently a Chain isn't sized for (rpc_a, rpc_b) in self.inner.iter().circular_tuple_windows() { trace!("{} vs {}", rpc_a, rpc_b); // TODO: ties within X% to the server with the smallest block_data_limit?