@@ -70,7 +70,6 @@ use std::{
7070};
7171
7272use futures::{channel::oneshot, future::BoxFuture, select, Future, FutureExt, StreamExt};
73- use schnellru::LruMap;
7473
7574use client::{BlockImportNotification, BlockchainEvents, FinalityNotification};
7675use polkadot_primitives::{Block, BlockNumber, Hash};
@@ -88,8 +87,8 @@ use polkadot_node_subsystem_types::messages::{
8887
8988pub use polkadot_node_subsystem_types::{
9089 errors::{SubsystemError, SubsystemResult},
91- jaeger, ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, OverseerSignal ,
92- RuntimeApiSubsystemClient, UnpinHandle,
90+ jaeger, ActivatedLeaf, ActiveLeavesUpdate, OverseerSignal, RuntimeApiSubsystemClient ,
91+ UnpinHandle,
9392};
9493
9594pub mod metrics;
@@ -112,10 +111,6 @@ pub use orchestra::{
112111 SubsystemSender, TimeoutExt, ToOrchestra, TrySendError,
113112};
114113
115- /// Store 2 days worth of blocks, not accounting for forks,
116- /// in the LRU cache. Assumes a 6-second block time.
117- pub const KNOWN_LEAVES_CACHE_SIZE: u32 = 2 * 24 * 3600 / 6;
118-
119114#[cfg(any(target_os = "linux", feature = "jemalloc-allocator"))]
120115mod memory_stats;
121116#[cfg(test)]
@@ -283,6 +278,11 @@ impl From<FinalityNotification<Block>> for BlockInfo {
283278/// as the substrate framework or user interaction.
284279pub enum Event {
285280 /// A new block was imported.
281+ ///
282+ /// This event is not sent if the block was already known
283+ /// and we reorged to it e.g. due to a reversion.
284+ ///
285+ /// Also, these events are not sent during a major sync.
286286 BlockImported(BlockInfo),
287287 /// A block was finalized with i.e. babe or another consensus algorithm.
288288 BlockFinalized(BlockInfo),
@@ -641,9 +641,6 @@ pub struct Overseer<SupportsParachains> {
641641 /// An implementation for checking whether a header supports parachain consensus.
642642 pub supports_parachains: SupportsParachains,
643643
644- /// An LRU cache for keeping track of relay-chain heads that have already been seen.
645- pub known_leaves: LruMap<Hash, ()>,
646-
647644 /// Various Prometheus metrics.
648645 pub metrics: OverseerMetrics,
649646}
@@ -802,10 +799,9 @@ where
802799 };
803800
804801 let mut update = match self.on_head_activated(&block.hash, Some(block.parent_hash)).await {
805- Some(( span, status) ) => ActiveLeavesUpdate::start_work(ActivatedLeaf {
802+ Some(span) => ActiveLeavesUpdate::start_work(ActivatedLeaf {
806803 hash: block.hash,
807804 number: block.number,
808- status,
809805 unpin_handle: block.unpin_handle,
810806 span,
811807 }),
@@ -864,7 +860,7 @@ where
864860 &mut self,
865861 hash: &Hash,
866862 parent_hash: Option<Hash>,
867- ) -> Option<( Arc<jaeger::Span>, LeafStatus) > {
863+ ) -> Option<Arc<jaeger::Span>> {
868864 if !self.supports_parachains.head_supports_parachains(hash).await {
869865 return None
870866 }
@@ -891,14 +887,7 @@ where
891887 let span = Arc::new(span);
892888 self.span_per_active_leaf.insert(*hash, span.clone());
893889
894- let status = if self.known_leaves.get(hash).is_some() {
895- LeafStatus::Stale
896- } else {
897- self.known_leaves.insert(*hash, ());
898- LeafStatus::Fresh
899- };
900-
901- Some((span, status))
890+ Some(span)
902891 }
903892
904893 fn on_head_deactivated(&mut self, hash: &Hash) {
0 commit comments