diff --git a/rs/artifact_pool/src/consensus_pool.rs b/rs/artifact_pool/src/consensus_pool.rs index f29821da9df..b7a5a87e665 100644 --- a/rs/artifact_pool/src/consensus_pool.rs +++ b/rs/artifact_pool/src/consensus_pool.rs @@ -272,15 +272,12 @@ impl UncachedConsensusPoolImpl { crate::lmdb_pool::PersistentHeightIndexedPool::new_consensus_pool( lmdb_config, config.persistent_pool_read_only, - log.clone(), + log, ), ) as Box<_>, #[cfg(feature = "rocksdb_backend")] PersistentPoolBackend::RocksDB(config) => Box::new( - crate::rocksdb_pool::PersistentHeightIndexedPool::new_consensus_pool( - config, - log.clone(), - ), + crate::rocksdb_pool::PersistentHeightIndexedPool::new_consensus_pool(config, log), ) as Box<_>, #[allow(unreachable_patterns)] cfg => { @@ -290,7 +287,7 @@ impl UncachedConsensusPoolImpl { UncachedConsensusPoolImpl { validated, - unvalidated: Box::new(InMemoryPoolSection::new(log)), + unvalidated: Box::new(InMemoryPoolSection::new()), } } } diff --git a/rs/artifact_pool/src/inmemory_pool.rs b/rs/artifact_pool/src/inmemory_pool.rs index ee6f3564860..11015c117b6 100644 --- a/rs/artifact_pool/src/inmemory_pool.rs +++ b/rs/artifact_pool/src/inmemory_pool.rs @@ -6,7 +6,6 @@ use crate::{ use ic_interfaces::consensus_pool::{ HeightIndexedPool, HeightRange, OnlyError, PoolSection, PurgeableArtifactType, }; -use ic_logger::{warn, ReplicaLogger}; use ic_types::{ artifact::ConsensusMessageId, consensus::*, @@ -18,15 +17,13 @@ use std::collections::BTreeMap; pub struct InMemoryPoolSection> { indexes: Indexes, artifacts: BTreeMap, - log: ReplicaLogger, } impl + HasTimestamp + Clone> InMemoryPoolSection { - pub fn new(log: ReplicaLogger) -> InMemoryPoolSection { + pub fn new() -> InMemoryPoolSection { InMemoryPoolSection { artifacts: BTreeMap::new(), indexes: Indexes::new(), - log, } } @@ -279,9 +276,7 @@ impl + HasTimestamp + Clone> MutablePoolSection self.insert(artifact), PoolSectionOp::Remove(msg_id) => { - if self.remove(&msg_id).is_none() { - warn!(self.log, "Error removing artifact {:?}", &msg_id) - } else { + if self.remove(&msg_id).is_some() { purged.push(msg_id) } } @@ -334,7 +329,7 @@ pub mod test { assert!(ic_test_utilities_time::with_timeout( std::time::Duration::new(12, 0), || { - let mut pool = InMemoryPoolSection::new(ic_logger::replica_logger::no_op_logger()); + let mut pool = InMemoryPoolSection::new(); let min = Height::from(1); let max = Height::from(std::u64::MAX); pool.insert(make_artifact(fake_random_beacon(min))); @@ -358,7 +353,7 @@ pub mod test { .collect::>(); let ids = beacons.iter().map(|b| b.get_id()).collect::>(); - let mut pool = InMemoryPoolSection::new(ic_logger::replica_logger::no_op_logger()); + let mut pool = InMemoryPoolSection::new(); beacons .into_iter() .for_each(|b| pool.insert(make_artifact(b)));