Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
impl review suggestions
  • Loading branch information
acatangiu committed Nov 25, 2022
commit 084f90b028ff151030e62703e1d2a5d3859bb802
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ impl<B: Block> OnDemandJustificationsEngine<B> {

fn request_from_peer(&mut self, peer: PeerId, req_info: RequestInfo<B>) {
debug!(
target: "beefy::sync",
target: "beefy::sync",
"🥩 requesting justif #{:?} from peer {:?}",
req_info.block,
req_info.block,
peer,
);

Expand Down
9 changes: 6 additions & 3 deletions client/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl<B: Block> VoterOracle<B> {
Ok(())
}

/// Return current pending mandatory block, if any.
/// Return current pending mandatory block, if any, plus its active validator set.
pub fn mandatory_pending(&self) -> Option<(NumberFor<B>, ValidatorSet<AuthorityId>)> {
self.sessions.front().and_then(|round| {
if round.mandatory_done() {
Expand Down Expand Up @@ -548,8 +548,11 @@ where
// New state is persisted after finalization.
self.finalize(finality_proof)?;
} else {
let mandatory_round =
self.voting_oracle().mandatory_pending().map(|p| p.0 == round.1).unwrap_or(false);
let mandatory_round = self
.voting_oracle()
.mandatory_pending()
.map(|p| p.0 == round.1)
.unwrap_or(false);
// Persist state after handling self vote to avoid double voting in case
// of voter restarts.
// Also persist state after handling mandatory block vote.
Expand Down