ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.PerasCertDB.API

Synopsis

Documentation

data PerasCertDB (m ∷ TypeType) blk Source #

Constructors

PerasCertDB 

Fields

  • addCertWithArrivalTime (ValidatedPerasCert blk) → m AddPerasCertResult

    Add a Peras certificate to the database. The result indicates whether the certificate was actually added, or if it was already present.

  • getWeightSnapshotSTM m (WithFingerprint (PerasWeightSnapshot blk))

    Return the Peras weights in order compare the current selection against potential candidate chains, namely the weights for blocks not older than the current immutable tip. It might contain weights for even older blocks if they have not yet been garbage-collected.

    The Fingerprint is updated every time a new certificate is added, but it stays the same when certificates are garbage-collected.

  • getCertSnapshotSTM m (PerasCertSnapshot blk)
     
  • getLatestCertSeenSTM m (Maybe (WithArrivalTime (ValidatedPerasCert blk)))

    Get the certificate with the highest round number that has been added to the db since it has been opened. This certificate is not affected by garbage collection, but it's forgotten when the db is closed.

    FIXME(peras): having seen a certificate is a precondition to start voting in every round except for the first one (at origin). As a consequence, only caught-up nodes can actively participate in the Peras protocol for now.

  • garbageCollectSlotNo → m ()

    Garbage-collect state older than the given slot number.

  • closeDB ∷ m ()
     

Instances

Instances details
NoThunks (PerasCertDB m blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API

PerasCertSnapshot

data PerasCertSnapshot blk Source #

Constructors

PerasCertSnapshot 

Fields

data PerasCertTicketNo Source #

A sequence number, incremented every time we receive a new certificate.

Note that we will usually receive certificates monotonically by round number, so round numbers could almost fulfill the role of ticket numbers. However, in certain edge cases (while catching up, or during cooldowns), this might not be true, such as during syncing or during cooldown periods. Therefore, for robustness, we choose to maintain dedicated ticket numbers separately.

Instances

Instances details
Enum PerasCertTicketNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API

Show PerasCertTicketNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API

Eq PerasCertTicketNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API

Ord PerasCertTicketNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API

NoThunks PerasCertTicketNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.PerasCertDB.API