From 048ad2be28ae3c9740692bc70884f3a11f01bfc4 Mon Sep 17 00:00:00 2001 From: GroovieGermanikus Date: Wed, 31 Jan 2024 18:53:07 +0100 Subject: [PATCH] clippy+fmt --- Cargo.lock | 2 +- Cargo.toml | 2 +- examples/stream_blocks_single.rs | 11 ----------- rust-toolchain.toml | 2 +- src/grpc_subscription_autoreconnect_tasks.rs | 20 +++++++------------- 5 files changed, 10 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26d072e..df3c9b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1236,7 +1236,7 @@ dependencies = [ [[package]] name = "geyser-grpc-connector" -version = "0.50.1+yellowstone.1.12" +version = "0.10.1+yellowstone.1.12" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index 93b0e5b..f4a69f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "geyser-grpc-connector" -version = "0.50.1+yellowstone.1.12" +version = "0.10.1+yellowstone.1.12" edition = "2021" description = "Multiplexing and Reconnection on Yellowstone gRPC Geyser client streaming" diff --git a/examples/stream_blocks_single.rs b/examples/stream_blocks_single.rs index 0c29fc6..4abc002 100644 --- a/examples/stream_blocks_single.rs +++ b/examples/stream_blocks_single.rs @@ -137,17 +137,6 @@ pub async fn main() { warn!("Stream aborted"); }); - // let green_stream = create_geyser_reconnecting_stream( - // green_config.clone(), - // GeyserFilter(CommitmentConfig::confirmed()).blocks_meta(), - // // GeyserFilter(CommitmentConfig::confirmed()).blocks_and_txs(), - // ); - // let multiplex_stream = create_multiplexed_stream( - // vec![green_stream], - // BlockMiniExtractor(CommitmentConfig::confirmed()), - // ); - // start_example_blockmini_consumer(multiplex_stream); - // "infinite" sleep sleep(Duration::from_secs(1800)).await; } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f400973..8142c30 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.70" +channel = "1.73.0" diff --git a/src/grpc_subscription_autoreconnect_tasks.rs b/src/grpc_subscription_autoreconnect_tasks.rs index 176fcd1..55f6a4b 100644 --- a/src/grpc_subscription_autoreconnect_tasks.rs +++ b/src/grpc_subscription_autoreconnect_tasks.rs @@ -29,8 +29,6 @@ enum FatalErrorReason { ConfigurationError, NetworkError, SubscribeError, - // everything else - Misc, } /// connect to grpc source performing autoconect if required, @@ -101,21 +99,21 @@ pub fn create_geyser_autoconnection_task( } Err(GeyserGrpcClientError::TonicError(tonic_error)) => { warn!( - "! connect failed on {} - aborting: {:?}", + "connect failed on {} - aborting: {:?}", grpc_source, tonic_error ); ConnectionState::FatalError(attempt, FatalErrorReason::NetworkError) } Err(GeyserGrpcClientError::TonicStatus(tonic_status)) => { warn!( - "! connect failed on {} - retrying: {:?}", + "connect failed on {} - retrying: {:?}", grpc_source, tonic_status ); ConnectionState::RecoverableConnectionError(attempt) } Err(GeyserGrpcClientError::SubscribeSendError(send_error)) => { warn!( - "! connect failed with send error on {} - retrying: {:?}", + "connect failed with send error on {} - retrying: {:?}", grpc_source, send_error ); ConnectionState::RecoverableConnectionError(attempt) @@ -149,7 +147,7 @@ pub fn create_geyser_autoconnection_task( // non-recoverable Err(unrecoverable_error) => { error!( - "! subscribe to {} failed with unrecoverable error: {}", + "subscribe to {} failed with unrecoverable error: {}", grpc_source, unrecoverable_error ); ConnectionState::FatalError( @@ -161,7 +159,7 @@ pub fn create_geyser_autoconnection_task( } Err(_elapsed) => { warn!( - "! subscribe failed with timeout on {} - retrying", + "subscribe failed with timeout on {} - retrying", grpc_source ); ConnectionState::RecoverableConnectionError(attempt) @@ -171,7 +169,7 @@ pub fn create_geyser_autoconnection_task( ConnectionState::RecoverableConnectionError(attempt) => { let backoff_secs = 1.5_f32.powi(attempt as i32).min(15.0); info!( - "! waiting {} seconds, then reconnect to {}", + "waiting {} seconds, then reconnect to {}", backoff_secs, grpc_source ); sleep(Duration::from_secs_f32(backoff_secs)).await; @@ -194,15 +192,11 @@ pub fn create_geyser_autoconnection_task( warn!("fatal grpc subscribe error - aborting"); return; } - FatalErrorReason::Misc => { - error!("fatal misc error grpc connection - aborting"); - return; - } }, ConnectionState::WaitReconnect(attempt) => { let backoff_secs = 1.5_f32.powi(attempt as i32).min(15.0); info!( - "! waiting {} seconds, then reconnect to {}", + "waiting {} seconds, then reconnect to {}", backoff_secs, grpc_source ); sleep(Duration::from_secs_f32(backoff_secs)).await;