cardano-sl-0.4.3: Cardano SL main implementation

Safe HaskellNone
LanguageHaskell2010

Pos.DB.GState

Contents

Description

GState DB stores whole global state, i. e. result of application of all blocks up to tip.

Synopsis

Documentation

resolveForwardLink :: (HasHeaderHash a, MonadDB m) => a -> m (Maybe HeaderHash) Source #

Tries to retrieve next block using current one (given a block/header).

isBlockInMainChain :: (HasHeaderHash a, MonadDB m) => a -> m Bool Source #

Check if given hash representing block is in main chain.

data BlockExtraOp Source #

Constructors

AddForwardLink HeaderHash HeaderHash

Adds or overwrites forward link

RemoveForwardLink HeaderHash

Removes forward link

SetInMainChain Bool HeaderHash

Enables or disables "in main chain" status of the block

loadHeadersUpWhile :: (SscHelpersClass ssc, MonadDB m, HasHeaderHash a) => a -> (BlockHeader ssc -> Int -> Bool) -> m (OldestFirst [] (BlockHeader ssc)) Source #

Returns headers loaded up.

loadBlocksUpWhile :: (SscHelpersClass ssc, MonadDB m, HasHeaderHash a) => a -> (Block ssc -> Int -> Bool) -> m (OldestFirst [] (Block ssc)) Source #

Returns blocks loaded up.

prepareGStateDB :: forall ssc m. (WithNodeContext ssc m, MonadDB m) => HeaderHash -> m () Source #

Put missing initial data into GState DB.

sanityCheckGStateDB :: forall m. (MonadDB m, MonadMask m, WithLogger m) => m () Source #

Check that GState DB is consistent.

usingGStateSnapshot :: (MonadDB m, MonadMask m) => m a -> m a Source #

getPSKByIssuerAddressHash :: MonadDB m => StakeholderId -> m (Maybe ProxySKHeavy) Source #

Retrieves certificate by issuer address (hash of public key) if present.

getPSKByIssuer :: MonadDB m => PublicKey -> m (Maybe ProxySKHeavy) Source #

Retrieves certificate by issuer public key if present.

data DelegationOp Source #

Constructors

AddPSK !ProxySKHeavy

Adds PSK. Overwrites if present.

DelPSK !PublicKey

Removes PSK by issuer PK.

runPskIterator :: forall m a. MonadDB m => DBnIterator PskIter a -> m a Source #

runPskMapIterator :: forall v m a. MonadDB m => DBnMapIterator PskIter v a -> (IterType PskIter -> v) -> m a Source #

Operations

Getters

Initialization

prepareGStateBalances :: forall m. MonadDB m => Utxo -> m () Source #

Iteration

runBalanceIterator :: forall m a. MonadDB m => (forall iter. (MonadIterator (IterType BalanceIter) iter, MonadDB iter) => iter a) -> m a Source #

Run iterator over effective balances.

runBalanceMapIterator :: forall v m a. MonadDB m => (forall iter. (MonadIterator v iter, MonadDB iter) => iter a) -> (IterType BalanceIter -> v) -> m a Source #

Run map iterator over effective balances.

Sanity checks

Getters

Operations

Initialization

Iteration

runUtxoIterator :: forall i m a. (MonadDB m, DBIteratorClass i, IterKey i ~ TxIn, IterValue i ~ TxOutAux) => DBnIterator i a -> m a Source #

runUtxoMapIterator :: forall i v m a. (MonadDB m, DBIteratorClass i, IterKey i ~ TxIn, IterValue i ~ TxOutAux) => DBnMapIterator i v a -> (IterType i -> v) -> m a Source #

Get utxo

getAllPotentiallyHugeUtxo :: MonadDB m => m Utxo Source #

Get full utxo. Use with care – the utxo can be very big (hundreds of megabytes).

Sanity checks