From a92c93706bafad9bf4f656afbbda92113adda015 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 18 May 2023 13:47:00 -0700 Subject: [PATCH] dont check heads while waiting this isn't great. but should work better than what we have --- web3_proxy/src/rpcs/consensus.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/web3_proxy/src/rpcs/consensus.rs b/web3_proxy/src/rpcs/consensus.rs index 806dc448..1502966c 100644 --- a/web3_proxy/src/rpcs/consensus.rs +++ b/web3_proxy/src/rpcs/consensus.rs @@ -129,18 +129,19 @@ impl ConsensusWeb3Rpcs { needed_block_num: Option<&U64>, skip_rpcs: &[Arc], ) -> ShouldWaitForBlock { - if self - .head_rpcs - .iter() - .any(|rpc| self.rpc_will_work_eventually(rpc, needed_block_num, skip_rpcs)) - { - let head_num = self.head_block.number(); + // TODO: i think checking synced is always a waste of time. though i guess there could be a race + // if self + // .head_rpcs + // .iter() + // .any(|rpc| self.rpc_will_work_eventually(rpc, needed_block_num, skip_rpcs)) + // { + // let head_num = self.head_block.number(); - if Some(head_num) >= needed_block_num { - debug!("best (head) block: {}", head_num); - return ShouldWaitForBlock::Ready; - } - } + // if Some(head_num) >= needed_block_num { + // debug!("best (head) block: {}", head_num); + // return ShouldWaitForBlock::Ready; + // } + // } // all of the head rpcs are skipped