ouroboros-consensus-0.1.0.1: Consensus layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Storage.ImmutableDB.Impl.Iterator

Synopsis

Documentation

data CurrentChunkInfo Source #

Auxiliary data type that combines the currentChunk and currentChunkOffset fields from OpenState . This is used to avoid passing the whole state around, and moreover, it avoids issues with existential h type parameter.

getSlotInfo Source #

Arguments

:: forall m blk h. ( HasCallStack , IOLike m, HasHeader blk)
=> ChunkInfo
-> Index m blk h
-> WithOrigin ( Tip blk)

Current tip

-> RealPoint blk
-> ExceptT ( MissingBlock blk) m ( ChunkSlot , ( Entry blk, BlockSize ), SecondaryOffset )

Get information about the block or EBB at the given slot with the given hash. If no such block exists, because the slot is empty, it contains a block and/or EBB with a different hash, or it is newer than the current tip, return a MissingBlock .

Return the ChunkSlot corresponding to the block or EBB, the corresponding entry (and BlockSize ) from the secondary index file, and the SecondaryOffset of that entry.

The primary index is read to find out whether the slot is filled and what the SecondaryOffset is for the slot. The secondary index is read to check the hash and to return the Entry .