From de5674254b5328b0fd0cb45e12f7a62f2576d76d Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 7 Oct 2023 13:45:04 -0700 Subject: [PATCH] hopefully handle min_synced_rpcs properly --- web3_proxy/src/rpcs/consensus.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/web3_proxy/src/rpcs/consensus.rs b/web3_proxy/src/rpcs/consensus.rs index cbf1107d..c31b62cd 100644 --- a/web3_proxy/src/rpcs/consensus.rs +++ b/web3_proxy/src/rpcs/consensus.rs @@ -905,18 +905,12 @@ impl ConsensusFinder { let num_known = self.rpc_heads.len(); - if num_known < web3_rpcs.min_synced_rpcs { - // this keeps us from serving requests when the proxy first starts - info!(%num_known, min_synced_rpcs=%web3_rpcs.min_synced_rpcs, "not enough servers known"); - return Ok(None); - } - // TODO: also track the sum of *available* hard_limits? if any servers have no hard limits, use their soft limit or no limit? // TODO: struct for the value of the votes hashmap? let mut primary_votes: HashMap>, u32)> = - Default::default(); + HashMap::with_capacity(num_known); let mut backup_votes: HashMap>, u32)> = - Default::default(); + HashMap::with_capacity(num_known); for (rpc, rpc_head) in self.rpc_heads.iter() { let mut block_to_check = rpc_head.clone();