ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Leios.AnnounceState

Description

The announcements the node has accepted, from whichever peer.

Each LeiosNotify client already holds its own upstream peer to at most two announcements per election. But the node relays what it accepts from all its peers, and a downstream peer holds the node to the same: no repeat, and no third announcement of an election. So the node decides once, here, whether an announcement is new, and only then relays it.

Synopsis

Documentation

data AnnounceState (m ∷ Type → Type) blk Source #

The node's announcements, per election, and the log it relays them in.

hasAnnouncement ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, ConvertRawHash blk, GetHeader blk) ⇒ AnnounceState m blk → SlotNo → RankingBlockHash → STM m Bool Source #

Whether the node accepted the announcement of this announcing block, in an election of the given slot, so that it can relay votes for it.

It accepts but does not relay one too old to relay, but then the votes for it are past their deadline too, so the node relays none of them either.

newAnnounceState ∷ (IOLike m, NoThunks (Header blk)) ⇒ NotifyLog m blk → m (AnnounceState m blk) Source #

onValidAnnouncement ∷ ∀ (m ∷ Type → Type) blk. (IOLike m, HasHeader (Header blk)) ⇒ AnnounceState m blk → ValidAnnouncement blk → STM m () Source #

Accept a valid announcement, and relay it if it is new and fresh enough, until maxAnnouncementAgeSend after its election slot began.

An announcement signed by a revoked operational certificate is neither, and one of an election already pruned, while it was validated, is not new.

pruneAnnounceState ∷ ∀ (m ∷ Type → Type) blk. IOLike m ⇒ AnnounceState m blk → SlotNo → STM m () Source #

Forget every election before the given slot, which is the immutable tip's.