Skip to content

Commit

Permalink
RPC-456 removing the warning of not been able to add items to queue a…
Browse files Browse the repository at this point in the history
…nd adding the log to see what json messages are failing (#6)
  • Loading branch information
dmitriy-helius authored Aug 27, 2024
1 parent 990fa4d commit ab77949
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/priority_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -495,13 +496,14 @@ impl PriorityFeeTracker {
4. choose maximum values for each percentile between all transactions and each account
*/
fn calculation2(&self, accounts: &Vec<Pubkey>, include_vote: bool, lookback_period: &Option<u32>) -> 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();

Expand Down
4 changes: 2 additions & 2 deletions src/temp_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -71,7 +71,7 @@ where
if let Some(params) = &req.params {
if let Err(err_val) = serde_json::from_str::<Vec<GetPriorityFeeEstimateRequestFake>>(params.get()) {
statsd_count!("rpc_payload_parse_failed", 1);
debug!("RPC parse error: {}, {}", err_val, params);
info!("RPC parse error: {}, {}", err_val, params);
}
}

Expand Down

0 comments on commit ab77949

Please sign in to comment.