changes after groovies review

This commit is contained in:
Godmode Galactus 2023-09-14 12:05:13 +02:00
parent aff1c78d12
commit 73242ce9a6
No known key found for this signature in database
GPG Key ID: A04142C71ABB0DEA
11 changed files with 20 additions and 18 deletions

View File

@ -3,7 +3,7 @@ use async_trait::async_trait;
use itertools::Itertools;
use solana_client::nonblocking::rpc_client::RpcClient;
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 tokio::sync::RwLock;

View File

@ -5,8 +5,8 @@ use solana_sdk::slot_history::Slot;
use crate::{
stores::{
block_information_store::BlockInformationStore, cluster_info::ClusterInfo,
subscription_handler::SubscriptionHandler, tx_store::TxStore,
block_information_store::BlockInformationStore, cluster_info_store::ClusterInfo,
subscription_store::SubscriptionStore, tx_store::TxStore,
},
structures::{
identity_stakes::IdentityStakes,
@ -26,7 +26,7 @@ pub struct SlotCache {
pub struct DataCache {
pub block_store: BlockInformationStore,
pub txs: TxStore,
pub tx_subs: SubscriptionHandler,
pub tx_subs: SubscriptionStore,
pub slot_cache: SlotCache,
pub identity_stakes: IdentityStakes,
pub cluster_info: ClusterInfo,

View File

@ -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 cluster_info;
pub mod cluster_info_store;
pub mod data_cache;
pub mod subscription_handler;
pub mod subscription_store;
pub mod tx_store;

View File

@ -1,21 +1,19 @@
use std::{sync::Arc, time::Duration};
use crate::{structures::processed_block::TransactionInfo, types::SubscptionHanderSink};
use dashmap::DashMap;
use solana_sdk::{
commitment_config::{CommitmentConfig, CommitmentLevel},
slot_history::Slot,
};
use std::{sync::Arc, time::Duration};
use tokio::time::Instant;
use crate::{structures::processed_block::TransactionInfo, types::SubscptionHanderSink};
#[derive(Clone, Default)]
pub struct SubscriptionHandler {
pub struct SubscriptionStore {
pub signature_subscribers:
Arc<DashMap<(String, CommitmentConfig), (SubscptionHanderSink, Instant)>>,
}
impl SubscriptionHandler {
impl SubscriptionStore {
#[allow(deprecated)]
pub fn get_supported_commitment_config(
commitment_config: CommitmentConfig,

View File

@ -1,3 +1,5 @@
// this mod will contain all the core structures that are defined for lite-rpc
pub mod identity_stakes;
pub mod leader_data;
pub mod notifications;

View File

@ -1,3 +1,3 @@
pub mod block_storage;
pub mod leaders_fetcher_trait;
pub mod block_storage_interface;
pub mod leaders_fetcher_interface;
pub mod subscription_sink;

View File

@ -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::stores::{
block_information_store::{BlockInformation, BlockInformationStore},
cluster_info::ClusterInfo,
cluster_info_store::ClusterInfo,
data_cache::{DataCache, SlotCache},
subscription_handler::SubscriptionHandler,
subscription_store::SubscriptionStore,
tx_store::TxStore,
};
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(),
identity_stakes: IdentityStakes::new(validator_identity.pubkey()),
slot_cache: SlotCache::new(finalized_block.slot),
tx_subs: SubscriptionHandler::default(),
tx_subs: SubscriptionStore::default(),
txs: TxStore::default(),
};

View File

@ -7,7 +7,7 @@ use crate::tpu_utils::tpu_connection_path::TpuConnectionPath;
use crate::tpu_utils::tpu_service::ConnectionManager::{DirectTpu, QuicProxy};
use solana_lite_rpc_core::quic_connection_utils::QuicConnectionParameters;
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::AnyhowJoinHandle;
use solana_sdk::{quic::QUIC_PORT_OFFSET, signature::Keypair, slot_history::Slot};