Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review feedback
Signed-off-by: Andrei Sandu <[email protected]>
  • Loading branch information
sandreim committed Sep 27, 2022
commit eb0695940a654c3587c1184342499b58bf773453
14 changes: 9 additions & 5 deletions node/subsystem-util/src/rolling_session_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! care about the state of particular blocks.

pub use polkadot_node_primitives::{new_session_window_size, SessionWindowSize};
use polkadot_primitives::v2::{Hash, SessionIndex, SessionInfo};
use polkadot_primitives::v2::{BlockNumber, Hash, SessionIndex, SessionInfo};

use futures::channel::oneshot;
use polkadot_node_subsystem::{
Expand Down Expand Up @@ -51,7 +51,7 @@ pub enum SessionsUnavailableReason {
MissingLastFinalizedBlock,
/// Missing last finalized block hash.
#[error("Missing last finalized block hash")]
MissingLastFinalizedBlockHash,
MissingLastFinalizedBlockHash(BlockNumber),
}

/// Information about the sessions being fetched.
Expand Down Expand Up @@ -196,7 +196,7 @@ impl RollingSessionWindow {
};

let (tx, rx) = oneshot::channel();
// We want to get the parent of the last finalized block.
// We want to get the session index for the child of the last finalized block.
sender
.send_message(ChainApiMessage::FinalizedBlockHash(last_finalized_height, tx))
.await;
Expand All @@ -210,7 +210,9 @@ impl RollingSessionWindow {
Err(err) => {
gum::warn!(target: LOG_TARGET, ?err, "Failed fetching last finalized block hash");
return Err(SessionsUnavailable {
kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash,
kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash(
last_finalized_height,
),
info: None,
})
},
Expand All @@ -235,7 +237,9 @@ impl RollingSessionWindow {
Ok(session)
} else {
return Err(SessionsUnavailable {
kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash,
kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash(
last_finalized_height,
),
info: None,
})
}
Expand Down