Move BankCommitmentCache to solana_runtime (#10816)

* Remove Blockstore member variable from BlockCommitmentCache

* Hoist is_confirmed_rooted() to its only caller

BlockCommitmentCache no longer depends on Blockstore

* Move BlockCommitmentCache to solana_runtime
This commit is contained in:
Greg Fitzgerald
2020-06-25 22:06:58 -06:00
committed by GitHub
parent 7430978d1a
commit 50b3fa83a0
16 changed files with 165 additions and 340 deletions

View File

@ -4,7 +4,6 @@ use crate::{
broadcast_stage::BroadcastStageType,
cluster_info::{ClusterInfo, Node},
cluster_info_vote_listener::VoteTracker,
commitment::BlockCommitmentCache,
contact_info::ContactInfo,
gossip_service::{discover_cluster, GossipService},
poh_recorder::{PohRecorder, GRACE_TICKS_FACTOR, MAX_GRACE_SLOTS},
@ -35,6 +34,7 @@ use solana_metrics::datapoint_info;
use solana_runtime::{
bank::Bank,
bank_forks::{BankForks, SnapshotConfig},
commitment::BlockCommitmentCache,
hardened_unpack::{open_genesis_config, MAX_GENESIS_ARCHIVE_UNPACKED_SIZE},
};
use solana_sdk::{
@ -242,9 +242,7 @@ impl Validator {
let cluster_info = Arc::new(ClusterInfo::new(node.info.clone(), keypair.clone()));
let blockstore = Arc::new(blockstore);
let block_commitment_cache = Arc::new(RwLock::new(
BlockCommitmentCache::default_with_blockstore(blockstore.clone()),
));
let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::default()));
let subscriptions = Arc::new(RpcSubscriptions::new(
&exit,