diff --git a/src/main.rs b/src/main.rs index 9b5c290..c4d650c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,6 @@ use std::{ sync::{atomic::AtomicU64, Arc}, time::Duration, }; -use yellowstone_grpc_proto_original::geyser::SubscribeRequestPing; use crate::prometheus_sync::PrometheusSync; use block_info::BlockInfo; @@ -137,8 +136,7 @@ pub async fn start_tracking_banking_stage_errors( slot.store(s.slot, std::sync::atomic::Ordering::Relaxed); } }, - _=>{ - } + _=>{} } } error!("geyser banking stage connection failed {}", grpc_address); @@ -189,26 +187,11 @@ async fn start_tracking_blocks( Default::default(), None, Default::default(), - Some(SubscribeRequestPing { id: 0 }), + None, ) .await .unwrap(); - loop { - let res = tokio::time::timeout(Duration::from_secs(10), geyser_stream.next()).await; - let message_res = if let Ok(message) = res { - message - } else { - // restarting geyser block subscription because of timeout - error!("Restarting geyser block subscription because of timeout"); - break; - }; - let message = if let Some(message) = message_res { - message - } else { - error!("Restarting geyser block subscription because it is broken"); - break; - }; - + while let Some(message) = geyser_stream.next().await { let Ok(message) = message else { continue; }; diff --git a/src/postgres.rs b/src/postgres.rs index ec68efc..ae70f31 100644 --- a/src/postgres.rs +++ b/src/postgres.rs @@ -735,10 +735,9 @@ impl Postgres { for batch in batches { if let Err(err) = session .save_banking_transaction_results(batch.to_vec()) - .await - { - panic!("Error saving transaction infos {}", err); - } + .await { + panic!("saving transaction infos failed {}", err); + } } } }