Skip to content

Commit

Permalink
hide private types
Browse files Browse the repository at this point in the history
  • Loading branch information
grooviegermanikus committed Jan 17, 2024
1 parent 5eca3b1 commit eea7363
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
7 changes: 1 addition & 6 deletions block_priofees/src/block_priofees.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::rpc_data::PrioFeesStats;
use crate::rpc_data::{PrioFeesStats, PrioFeesUpdateMessage};
use dashmap::DashMap;
use log::{error, info, trace, warn};
use solana_lite_rpc_core::types::BlockStream;
Expand Down Expand Up @@ -115,11 +115,6 @@ pub async fn start_block_priofees_task(
)

Check warning on line 115 in block_priofees/src/block_priofees.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/block_priofees/src/block_priofees.rs
}

#[derive(Clone, Debug)]
pub struct PrioFeesUpdateMessage {
pub slot: Slot,
pub priofees_stats: PrioFeesStats,
}

fn calculate_supp_info(
// Vec(prioritization_fees, cu_consumed)
Expand Down
4 changes: 3 additions & 1 deletion block_priofees/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pub mod block_priofees;
mod block_priofees;

pub mod rpc_data;
pub use block_priofees::{start_block_priofees_task, PrioFeesService};
9 changes: 8 additions & 1 deletion block_priofees/src/rpc_data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use jsonrpsee::core::Serialize;
use solana_sdk::clock::Slot;

// used as RPC DTO
#[derive(Clone, Serialize, Debug)]
pub struct PrioFeesStats {
pub p_min: u64,
Expand All @@ -9,3 +9,10 @@ pub struct PrioFeesStats {
pub p_90: u64,
pub p_max: u64,

Check warning on line 10 in block_priofees/src/rpc_data.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/block_priofees/src/rpc_data.rs
}


#[derive(Clone, Debug)]
pub struct PrioFeesUpdateMessage {
pub slot: Slot,
pub priofees_stats: PrioFeesStats,
}
4 changes: 2 additions & 2 deletions lite-rpc/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use crate::{
jsonrpsee_subscrption_handler_sink::JsonRpseeSubscriptionHandlerSink,

Check warning on line 42 in lite-rpc/src/bridge.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/lite-rpc/src/bridge.rs
rpc::LiteRpcServer,
};
use solana_lite_rpc_block_priofees::block_priofees::{PrioFeesService, PrioFeesUpdateMessage};
use solana_lite_rpc_block_priofees::rpc_data::PrioFeesStats;
use solana_lite_rpc_block_priofees::PrioFeesService;
use solana_lite_rpc_block_priofees::rpc_data::{PrioFeesStats, PrioFeesUpdateMessage};

lazy_static::lazy_static! {
static ref RPC_SEND_TX: IntCounter =
Expand Down
5 changes: 2 additions & 3 deletions lite-rpc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ use solana_lite_rpc_services::tpu_utils::tpu_service::{TpuService, TpuServiceCon
use solana_lite_rpc_services::transaction_replayer::TransactionReplayer;

Check warning on line 42 in lite-rpc/src/main.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/lite-rpc/src/main.rs
use solana_lite_rpc_services::tx_sender::TxSender;

use solana_lite_rpc_block_priofees::block_priofees;

use solana_rpc_client::nonblocking::rpc_client::RpcClient;
use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::signature::Keypair;
Expand All @@ -54,6 +52,7 @@ use std::time::Duration;
use tokio::sync::mpsc;

Check warning on line 52 in lite-rpc/src/main.rs

View workflow job for this annotation

GitHub Actions / lite-rpc full build

Diff in /home/runner/work/lite-rpc/lite-rpc/lite-rpc/src/main.rs
use tokio::sync::RwLock;
use tokio::time::{timeout, Instant};
use solana_lite_rpc_block_priofees::start_block_priofees_task;

async fn get_latest_block(
mut block_stream: BlockStream,
Expand Down Expand Up @@ -202,7 +201,7 @@ pub async fn start_lite_rpc(args: Config, rpc_client: Arc<RpcClient>) -> anyhow:
);

let (block_prio_fees_task, block_prio_fees_service) =
block_priofees::start_block_priofees_task(blocks_notifier.resubscribe()).await;
start_block_priofees_task(blocks_notifier.resubscribe()).await;

drop(blocks_notifier);

Expand Down

0 comments on commit eea7363

Please sign in to comment.