From f010166ee0463ab472cbf2e6548d0a7fad689c73 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 5 Dec 2022 14:45:12 -0800 Subject: [PATCH] better lag error --- web3_proxy/src/rpcs/connection.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web3_proxy/src/rpcs/connection.rs b/web3_proxy/src/rpcs/connection.rs index 3998f6c3..3e7cf6bd 100644 --- a/web3_proxy/src/rpcs/connection.rs +++ b/web3_proxy/src/rpcs/connection.rs @@ -617,7 +617,8 @@ impl Web3Connection { if let Some(x) = &*conn.head_block.read() { // if this block is too old, return an error so we reconnect if x.lag() > 0 { - return Err(anyhow::anyhow!("provider is lagged")); + // TODO: instead of a full reconnect, we should maybe just set it to None + return Err(anyhow::anyhow!("{} is lagged: {:?}", conn, x)); } }