changes after groovies review
This commit is contained in:
parent
aff1c78d12
commit
73242ce9a6
|
@ -3,7 +3,7 @@ use async_trait::async_trait;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use solana_client::nonblocking::rpc_client::RpcClient;
|
use solana_client::nonblocking::rpc_client::RpcClient;
|
||||||
use solana_lite_rpc_core::{
|
use solana_lite_rpc_core::{
|
||||||
structures::leader_data::LeaderData, traits::leaders_fetcher_trait::LeaderFetcherInterface,
|
structures::leader_data::LeaderData, traits::leaders_fetcher_interface::LeaderFetcherInterface,
|
||||||
};
|
};
|
||||||
use std::{collections::VecDeque, sync::Arc};
|
use std::{collections::VecDeque, sync::Arc};
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
|
|
|
@ -5,8 +5,8 @@ use solana_sdk::slot_history::Slot;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
stores::{
|
stores::{
|
||||||
block_information_store::BlockInformationStore, cluster_info::ClusterInfo,
|
block_information_store::BlockInformationStore, cluster_info_store::ClusterInfo,
|
||||||
subscription_handler::SubscriptionHandler, tx_store::TxStore,
|
subscription_store::SubscriptionStore, tx_store::TxStore,
|
||||||
},
|
},
|
||||||
structures::{
|
structures::{
|
||||||
identity_stakes::IdentityStakes,
|
identity_stakes::IdentityStakes,
|
||||||
|
@ -26,7 +26,7 @@ pub struct SlotCache {
|
||||||
pub struct DataCache {
|
pub struct DataCache {
|
||||||
pub block_store: BlockInformationStore,
|
pub block_store: BlockInformationStore,
|
||||||
pub txs: TxStore,
|
pub txs: TxStore,
|
||||||
pub tx_subs: SubscriptionHandler,
|
pub tx_subs: SubscriptionStore,
|
||||||
pub slot_cache: SlotCache,
|
pub slot_cache: SlotCache,
|
||||||
pub identity_stakes: IdentityStakes,
|
pub identity_stakes: IdentityStakes,
|
||||||
pub cluster_info: ClusterInfo,
|
pub cluster_info: ClusterInfo,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
// this mod will contain all the different stores that are used by lite-rpc
|
||||||
|
|
||||||
pub mod block_information_store;
|
pub mod block_information_store;
|
||||||
pub mod cluster_info;
|
pub mod cluster_info_store;
|
||||||
pub mod data_cache;
|
pub mod data_cache;
|
||||||
pub mod subscription_handler;
|
pub mod subscription_store;
|
||||||
pub mod tx_store;
|
pub mod tx_store;
|
||||||
|
|
|
@ -1,21 +1,19 @@
|
||||||
use std::{sync::Arc, time::Duration};
|
use crate::{structures::processed_block::TransactionInfo, types::SubscptionHanderSink};
|
||||||
|
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
commitment_config::{CommitmentConfig, CommitmentLevel},
|
commitment_config::{CommitmentConfig, CommitmentLevel},
|
||||||
slot_history::Slot,
|
slot_history::Slot,
|
||||||
};
|
};
|
||||||
|
use std::{sync::Arc, time::Duration};
|
||||||
use tokio::time::Instant;
|
use tokio::time::Instant;
|
||||||
|
|
||||||
use crate::{structures::processed_block::TransactionInfo, types::SubscptionHanderSink};
|
|
||||||
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct SubscriptionHandler {
|
pub struct SubscriptionStore {
|
||||||
pub signature_subscribers:
|
pub signature_subscribers:
|
||||||
Arc<DashMap<(String, CommitmentConfig), (SubscptionHanderSink, Instant)>>,
|
Arc<DashMap<(String, CommitmentConfig), (SubscptionHanderSink, Instant)>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SubscriptionHandler {
|
impl SubscriptionStore {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub fn get_supported_commitment_config(
|
pub fn get_supported_commitment_config(
|
||||||
commitment_config: CommitmentConfig,
|
commitment_config: CommitmentConfig,
|
|
@ -1,3 +1,5 @@
|
||||||
|
// this mod will contain all the core structures that are defined for lite-rpc
|
||||||
|
|
||||||
pub mod identity_stakes;
|
pub mod identity_stakes;
|
||||||
pub mod leader_data;
|
pub mod leader_data;
|
||||||
pub mod notifications;
|
pub mod notifications;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
pub mod block_storage;
|
pub mod block_storage_interface;
|
||||||
pub mod leaders_fetcher_trait;
|
pub mod leaders_fetcher_interface;
|
||||||
pub mod subscription_sink;
|
pub mod subscription_sink;
|
||||||
|
|
|
@ -18,9 +18,9 @@ use solana_lite_rpc_core::keypair_loader::load_identity_keypair;
|
||||||
use solana_lite_rpc_core::quic_connection_utils::QuicConnectionParameters;
|
use solana_lite_rpc_core::quic_connection_utils::QuicConnectionParameters;
|
||||||
use solana_lite_rpc_core::stores::{
|
use solana_lite_rpc_core::stores::{
|
||||||
block_information_store::{BlockInformation, BlockInformationStore},
|
block_information_store::{BlockInformation, BlockInformationStore},
|
||||||
cluster_info::ClusterInfo,
|
cluster_info_store::ClusterInfo,
|
||||||
data_cache::{DataCache, SlotCache},
|
data_cache::{DataCache, SlotCache},
|
||||||
subscription_handler::SubscriptionHandler,
|
subscription_store::SubscriptionStore,
|
||||||
tx_store::TxStore,
|
tx_store::TxStore,
|
||||||
};
|
};
|
||||||
use solana_lite_rpc_core::structures::{
|
use solana_lite_rpc_core::structures::{
|
||||||
|
@ -123,7 +123,7 @@ pub async fn start_lite_rpc(args: Args, rpc_client: Arc<RpcClient>) -> anyhow::R
|
||||||
cluster_info: ClusterInfo::default(),
|
cluster_info: ClusterInfo::default(),
|
||||||
identity_stakes: IdentityStakes::new(validator_identity.pubkey()),
|
identity_stakes: IdentityStakes::new(validator_identity.pubkey()),
|
||||||
slot_cache: SlotCache::new(finalized_block.slot),
|
slot_cache: SlotCache::new(finalized_block.slot),
|
||||||
tx_subs: SubscriptionHandler::default(),
|
tx_subs: SubscriptionStore::default(),
|
||||||
txs: TxStore::default(),
|
txs: TxStore::default(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use crate::tpu_utils::tpu_connection_path::TpuConnectionPath;
|
||||||
use crate::tpu_utils::tpu_service::ConnectionManager::{DirectTpu, QuicProxy};
|
use crate::tpu_utils::tpu_service::ConnectionManager::{DirectTpu, QuicProxy};
|
||||||
use solana_lite_rpc_core::quic_connection_utils::QuicConnectionParameters;
|
use solana_lite_rpc_core::quic_connection_utils::QuicConnectionParameters;
|
||||||
use solana_lite_rpc_core::stores::data_cache::DataCache;
|
use solana_lite_rpc_core::stores::data_cache::DataCache;
|
||||||
use solana_lite_rpc_core::traits::leaders_fetcher_trait::LeaderFetcherInterface;
|
use solana_lite_rpc_core::traits::leaders_fetcher_interface::LeaderFetcherInterface;
|
||||||
use solana_lite_rpc_core::types::SlotStream;
|
use solana_lite_rpc_core::types::SlotStream;
|
||||||
use solana_lite_rpc_core::AnyhowJoinHandle;
|
use solana_lite_rpc_core::AnyhowJoinHandle;
|
||||||
use solana_sdk::{quic::QUIC_PORT_OFFSET, signature::Keypair, slot_history::Slot};
|
use solana_sdk::{quic::QUIC_PORT_OFFSET, signature::Keypair, slot_history::Slot};
|
||||||
|
|
Loading…
Reference in New Issue