Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading