cardano-sl-0.4.3: Cardano SL main implementation

Safe HaskellNone
LanguageHaskell2010

Pos.Lrc

Contents

Synopsis

Documentation

newtype InvalidRichmenStake thd Source #

Wrapper over RichmenStake. Its Arbitrary instance enforces that the stake distribution inside must be invalid, i.e. one of the stakeholders does not have sufficient coins to participate.

Constructors

Invalid 

newtype ValidRichmenStake thd Source #

Wrapper over RichmenStake. Its Arbitrary instance enforces that the stake distribution inside must be valid with respect to the threshold thd, i.e. all of the coins are non-zero and every stakeholder has sufficient coins (above 'coinPortionToDouble thd' %) to participate. Using reflection, the thd phantom type is used to get the threshold desired in each case.

Constructors

Valid 

Getters

Operations

Initialization

prepareLrcDB :: (WithNodeContext ssc m, MonadDB m) => m () Source #

Put missing initial data into LRC DB.

Initialization

Concrete instances

Ssc

US

Delegation

findRichmenStake #

Arguments

:: MonadIterator (StakeholderId, Coin) m 
=> Coin

Eligibility threshold

-> m RichmenStake 

Find nodes which have at least 'eligibility threshold' coins.

findRichmenPure :: [(StakeholderId, Coin)] -> (Coin -> Coin) -> RichmenType -> FullRichmenData Source #

Pure version of findRichmen which uses in-memory Utxo.

findAllRichmenMaybe Source #

Arguments

:: (MonadDB m, MonadIterator (StakeholderId, Coin) m) 
=> Maybe Coin

Eligibility threshold (optional)

-> Maybe Coin

Delegation threshold (optional)

-> m (RichmenStake, RichmenStake) 

Function considers all variants of computation and compute using one pass by stake DB and one pass by delegation DB.

lrcSingleShot :: (SscWorkersClass ssc, WorkMode ssc m, MonadDBCore m) => m (Set NodeId) -> EpochIndex -> m () Source #

Run leaders and richmen computation for given epoch. If stable block for this epoch is not known, LrcError will be thrown.

lrcSingleShotNoLock :: (SscWorkersClass ssc, WorkMode ssc m, MonadDBCore m) => m (Set NodeId) -> EpochIndex -> m () Source #

Same, but doesn't take lock on the semaphore.