From 8e98eabebea18181b1c88f89b771bde8e0f1a745 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 27 Jun 2023 10:05:07 -0700 Subject: [PATCH] lower error log when starting --- web3_proxy/src/rpcs/blockchain.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/web3_proxy/src/rpcs/blockchain.rs b/web3_proxy/src/rpcs/blockchain.rs index dd8f4ddb..507bbe04 100644 --- a/web3_proxy/src/rpcs/blockchain.rs +++ b/web3_proxy/src/rpcs/blockchain.rs @@ -418,6 +418,8 @@ impl Web3Rpcs { // TODO: what timeout on block receiver? we want to keep consensus_finder fresh so that server tiers are correct let double_block_time = average_block_interval(self.chain_id).mul_f32(2.0); + let mut had_first_success = false; + loop { match timeout(double_block_time, block_receiver.recv_async()).await { Ok(Ok((new_block, rpc))) => { @@ -436,12 +438,19 @@ impl Web3Rpcs { ) .await { - Ok(Ok(_)) => {} + Ok(Ok(_)) => had_first_success = true, Ok(Err(err)) => { - error!( - "error while processing block from rpc {}: {:#?}", - rpc_name, err - ); + if had_first_success { + error!( + "error while processing block from rpc {}: {:#?}", + rpc_name, err + ); + } else { + debug!( + "startup error while processing block from rpc {}: {:#?}", + rpc_name, err + ); + } } Err(timeout) => { error!(