diff --git a/web3-proxy/src/connections.rs b/web3-proxy/src/connections.rs index 29c78588..c3c20f34 100644 --- a/web3-proxy/src/connections.rs +++ b/web3-proxy/src/connections.rs @@ -11,7 +11,7 @@ use std::fmt; use std::sync::atomic::{self, AtomicU64}; use std::sync::Arc; use tokio::sync::RwLock; -use tracing::{debug, info, trace, warn}; +use tracing::{debug, info, trace, warn, instrument}; use crate::config::Web3ConnectionConfig; use crate::connection::{ActiveRequestHandle, Web3Connection}; @@ -174,8 +174,12 @@ impl Web3Connections { } } + /// TODO: possible dead lock here. investigate more. probably refactor + #[instrument] pub async fn update_synced_rpcs(&self, rpc: &Arc) -> anyhow::Result<()> { + info!("Locking synced_connections") let mut synced_connections = self.synced_connections.write().await; + info!("Locked synced_connections") let new_block = rpc.head_block_number();