don't dedupe rpc

This commit is contained in:
Bryan Stitt 2023-06-28 21:34:51 -07:00
parent fba41b9bc2
commit 0c389e43b4
2 changed files with 8 additions and 6 deletions

@ -281,7 +281,7 @@ impl RankedRpcs {
} }
} }
} }
warn!(%rpc, "no rpc data for this rpc. thats not promising"); warn!("no rpc data for this {}. thats not promising", rpc);
ShouldWaitForBlock::NeverReady ShouldWaitForBlock::NeverReady
} else { } else {
// if no needed_block_num was specified, then this should work // if no needed_block_num was specified, then this should work

@ -4,7 +4,7 @@ use super::provider::{connect_http, connect_ws, EthersHttpProvider, EthersWsProv
use super::request::{OpenRequestHandle, OpenRequestResult}; use super::request::{OpenRequestHandle, OpenRequestResult};
use crate::app::{flatten_handle, Web3ProxyJoinHandle}; use crate::app::{flatten_handle, Web3ProxyJoinHandle};
use crate::config::{BlockAndRpc, Web3RpcConfig}; use crate::config::{BlockAndRpc, Web3RpcConfig};
use crate::errors::{Web3ProxyError, Web3ProxyResult}; use crate::errors::{Web3ProxyError, Web3ProxyErrorContext, Web3ProxyResult};
use crate::frontend::authorization::Authorization; use crate::frontend::authorization::Authorization;
use crate::jsonrpc::{JsonRpcParams, JsonRpcResultData}; use crate::jsonrpc::{JsonRpcParams, JsonRpcResultData};
use crate::rpcs::request::RequestErrorHandler; use crate::rpcs::request::RequestErrorHandler;
@ -615,7 +615,7 @@ impl Web3Rpc {
break; break;
} }
warn!(rpc=%self, ?err, "subscribe err"); warn!(?err, "subscribe err on {}", self);
} else if self.should_disconnect() { } else if self.should_disconnect() {
break; break;
} }
@ -670,7 +670,9 @@ impl Web3Rpc {
trace!("starting subscriptions on {}", self); trace!("starting subscriptions on {}", self);
self.check_provider(chain_id).await?; self.check_provider(chain_id)
.await
.web3_context("failed check_provider")?;
let mut futures = vec![]; let mut futures = vec![];
@ -690,7 +692,7 @@ impl Web3Rpc {
disconnect_watch_rx.changed().await?; disconnect_watch_rx.changed().await?;
} }
info!(%rpc, "disconnect triggered"); info!("disconnect triggered on {}", rpc);
Ok(()) Ok(())
}; };
@ -723,7 +725,7 @@ impl Web3Rpc {
if let Err(err) = rpc.healthcheck(error_handler).await { if let Err(err) = rpc.healthcheck(error_handler).await {
// TODO: different level depending on the error handler // TODO: different level depending on the error handler
// TODO: if rate limit error, set "retry_at" // TODO: if rate limit error, set "retry_at"
warn!(%rpc, ?err, "health check failed"); warn!(?err, "health check on {} failed", rpc);
} }
} }