From ab7794953b7edcedfb4a29465bc79039d209ff31 Mon Sep 17 00:00:00 2001 From: Dmitriy Khomitskiy Date: Tue, 27 Aug 2024 12:19:21 -0500 Subject: [PATCH] RPC-456 removing the warning of not been able to add items to queue and adding the log to see what json messages are failing (#6) --- src/priority_fee.rs | 10 ++++++---- src/temp_validator.rs | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/priority_fee.rs b/src/priority_fee.rs index 69d14cc..0c252b5 100644 --- a/src/priority_fee.rs +++ b/src/priority_fee.rs @@ -9,7 +9,7 @@ use solana_program_runtime::compute_budget::ComputeBudget; use solana_sdk::instruction::CompiledInstruction; use solana_sdk::{pubkey::Pubkey, slot_history::Slot}; use tokio::sync::mpsc::{channel, Receiver, Sender}; -use tracing::{error, warn}; +use tracing::{debug, error}; use yellowstone_grpc_proto::geyser::subscribe_update::UpdateOneof; use yellowstone_grpc_proto::geyser::SubscribeUpdate; @@ -439,9 +439,10 @@ impl PriorityFeeTracker { "get_priority_fee_estimates_time", start.elapsed().as_nanos() as u64 ); - if let Err(e) = self.sampling_sender.try_send((accounts.to_owned(), include_vote, lookback_period.to_owned())) + if let Err(e) = self.sampling_sender + .try_send((accounts.to_owned(), include_vote, lookback_period.to_owned())) { - warn!("Did not add sample for calculation {e}"); + debug!("Did not add sample for calculation, {:?}", e); } micro_lamport_priority_fee_estimates @@ -495,13 +496,14 @@ impl PriorityFeeTracker { 4. choose maximum values for each percentile between all transactions and each account */ fn calculation2(&self, accounts: &Vec, include_vote: bool, lookback_period: &Option) -> MicroLamportPriorityFeeEstimates { - let lookback = calculate_lookback_size(&lookback_period, self.slot_cache.len()); let mut slots_vec = Vec::with_capacity(self.slot_cache.len()); self.slot_cache.copy_slots(&mut slots_vec); slots_vec.sort(); slots_vec.reverse(); + let lookback = calculate_lookback_size(&lookback_period, self.slot_cache.len()); + let mut fees = vec![]; let mut micro_lamport_priority_fee_estimates = MicroLamportPriorityFeeEstimates::default(); diff --git a/src/temp_validator.rs b/src/temp_validator.rs index 60caf0a..f76a47d 100644 --- a/src/temp_validator.rs +++ b/src/temp_validator.rs @@ -5,7 +5,7 @@ use jsonrpsee::server::middleware::rpc::RpcServiceT; use jsonrpsee::types::Request; use serde::{Deserialize, Serialize}; use solana_transaction_status::UiTransactionEncoding; -use tracing::debug; +use tracing::info; #[derive(Serialize, Deserialize, Clone, Debug, Default)] #[serde( @@ -71,7 +71,7 @@ where if let Some(params) = &req.params { if let Err(err_val) = serde_json::from_str::>(params.get()) { statsd_count!("rpc_payload_parse_failed", 1); - debug!("RPC parse error: {}, {}", err_val, params); + info!("RPC parse error: {}, {}", err_val, params); } }