From 79075f99749bd89827b848dac3df4f76e1550762 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 20 Dec 2022 21:55:12 -0800 Subject: [PATCH] lowest log level for eth_sendRawTransaction these are showing up in sentry with things like 'not enough funds'. its an error for the user to see, not us --- web3_proxy/src/app/mod.rs | 2 ++ web3_proxy/src/rpcs/connections.rs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 53af7714..78f258c9 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -28,6 +28,7 @@ use futures::stream::FuturesUnordered; use futures::stream::StreamExt; use hashbrown::{HashMap, HashSet}; use ipnet::IpNet; +use log::Level; use log::{debug, error, info, warn}; use metered::{metered, ErrorCount, HitCount, ResponseTime, Throughput}; use migration::sea_orm::{self, ConnectionTrait, Database, DatabaseConnection}; @@ -989,6 +990,7 @@ impl Web3ProxyApp { request, Some(request_metadata.clone()), None, + Level::Trace, ) .await?; diff --git a/web3_proxy/src/rpcs/connections.rs b/web3_proxy/src/rpcs/connections.rs index 3598d290..bdce0589 100644 --- a/web3_proxy/src/rpcs/connections.rs +++ b/web3_proxy/src/rpcs/connections.rs @@ -312,6 +312,7 @@ impl Web3Connections { active_request_handles: Vec, method: &str, params: Option<&serde_json::Value>, + error_level: Level, // TODO: remove this box once i figure out how to do the options ) -> Result, ProviderError> { // TODO: if only 1 active_request_handles, do self.try_send_request? @@ -320,7 +321,7 @@ impl Web3Connections { .into_iter() .map(|active_request_handle| async move { let result: Result, _> = active_request_handle - .request(method, &json!(¶ms), Level::Error.into()) + .request(method, &json!(¶ms), error_level.into()) .await; result }) @@ -361,7 +362,7 @@ impl Web3Connections { } // TODO: what should we do if we get here? i don't think we will - panic!("i don't think this is possible") + unimplemented!("this shouldn't be possible") } /// get the best available rpc server @@ -732,6 +733,7 @@ impl Web3Connections { request: JsonRpcRequest, request_metadata: Option>, block_needed: Option<&U64>, + error_level: Level, ) -> anyhow::Result { loop { match self @@ -755,6 +757,7 @@ impl Web3Connections { active_request_handles, request.method.as_ref(), request.params.as_ref(), + error_level, ) .await?;