diff --git a/bench-tps/src/main.rs b/bench-tps/src/main.rs index bc4d604d6cad8c..5a51e0b157da30 100644 --- a/bench-tps/src/main.rs +++ b/bench-tps/src/main.rs @@ -47,7 +47,7 @@ fn create_connection_cache( client_node_id: &Keypair, stake: u64, total_stake: u64, -) -> Arc { +) -> ConnectionCache { match use_quic { true => { let staked_nodes = Arc::new(RwLock::new(StakedNodes::default())); @@ -65,9 +65,9 @@ fn create_connection_cache( Some((&staked_nodes, &client_node_id.pubkey())), ); - Arc::new(connection_cache) + connection_cache } - false => Arc::new(ConnectionCache::with_udp(tpu_connection_pool_size)), + false => ConnectionCache::with_udp(tpu_connection_pool_size), } } @@ -81,7 +81,7 @@ fn create_client( rpc_tpu_sockets: Option<(SocketAddr, SocketAddr)>, num_nodes: usize, target_node: Option, - connection_cache: Arc, + connection_cache: ConnectionCache, ) -> Arc { match external_client_type { ExternalClientType::RpcClient => Arc::new(RpcClient::new_with_commitment( @@ -89,6 +89,7 @@ fn create_client( CommitmentConfig::confirmed(), )), ExternalClientType::ThinClient => { + let connection_cache = Arc::new(connection_cache); if let Some((rpc, tpu)) = rpc_tpu_sockets { Arc::new(ThinClient::new(rpc, tpu, connection_cache)) } else {