ouroboros-consensus-0.25.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.ImmutableDB.Chunks

Synopsis

Documentation

data ChunkInfo Source #

Size of the chunks of the immutable DB

This is the key data structure that drives all layout functions.

TODO: Add support for non-uniform ChunkInfo https://github.com/IntersectMBO/ouroboros-network/issues/1754

Constructors

UniformChunkSize !ChunkSize

A single, uniform, chunk size

If EBBs are present, the chunk size must line up precisely with the epoch size (that is, the number of regular blocks in the chunk must equal the number of regular blocks in an epoch).

Instances

Instances details
Generic ChunkInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Associated Types

type Rep ChunkInfo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkInfo = D1 ('MetaData "ChunkInfo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "UniformChunkSize" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChunkSize)))

Methods

fromChunkInfoRep ChunkInfo x #

toRep ChunkInfo x → ChunkInfo #

Show ChunkInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

showsPrecIntChunkInfoShowS #

showChunkInfoString #

showList ∷ [ChunkInfo] → ShowS #

NoThunks ChunkInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkInfo = D1 ('MetaData "ChunkInfo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "UniformChunkSize" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChunkSize)))

data ChunkNo Source #

Chunk number

Instances

Instances details
Generic ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Associated Types

type Rep ChunkNo 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkNo = D1 ('MetaData "ChunkNo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'True) (C1 ('MetaCons "ChunkNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unChunkNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

Methods

fromChunkNoRep ChunkNo x #

toRep ChunkNo x → ChunkNo #

Show ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

showsPrecIntChunkNoShowS #

showChunkNoString #

showList ∷ [ChunkNo] → ShowS #

Eq ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

(==)ChunkNoChunkNoBool #

(/=)ChunkNoChunkNoBool #

Ord ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

compareChunkNoChunkNoOrdering #

(<)ChunkNoChunkNoBool #

(<=)ChunkNoChunkNoBool #

(>)ChunkNoChunkNoBool #

(>=)ChunkNoChunkNoBool #

maxChunkNoChunkNoChunkNo #

minChunkNoChunkNoChunkNo #

NoThunks ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkNo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkNo = D1 ('MetaData "ChunkNo" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'True) (C1 ('MetaCons "ChunkNo" 'PrefixI 'True) (S1 ('MetaSel ('Just "unChunkNo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data ChunkSize Source #

Size of a chunk

The total number of slots available in a chunk is equal to numRegularBlocks if not chunkCanContainEBB, and numRegularBlocks + 1 otherwise.

Constructors

ChunkSize 

Fields

Instances

Instances details
Generic ChunkSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Associated Types

type Rep ChunkSize 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkSize = D1 ('MetaData "ChunkSize" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "ChunkSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "chunkCanContainEBB") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "numRegularBlocks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))

Methods

fromChunkSizeRep ChunkSize x #

toRep ChunkSize x → ChunkSize #

Show ChunkSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

Methods

showsPrecIntChunkSizeShowS #

showChunkSizeString #

showList ∷ [ChunkSize] → ShowS #

NoThunks ChunkSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal

type Rep ChunkSize = D1 ('MetaData "ChunkSize" "Ouroboros.Consensus.Storage.ImmutableDB.Chunks.Internal" "ouroboros-consensus-0.25.0.0-inplace" 'False) (C1 ('MetaCons "ChunkSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "chunkCanContainEBB") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "numRegularBlocks") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)))

chunkInfoSupportsEBBsChunkInfoBool Source #

Can we store EBBs in the chunks described by this ChunkInfo?

This is only used for tests. This API will need to change (and the tests will become more complicated) once we support non-uniform ChunkInfo.

chunksBetweenChunkNoChunkNo → [ChunkNo] Source #

Enumerate all chunks

chunksBetween x              x  == [x]
chunksBetween x (nextChunkNo x) == [x, nextChunkNo x]

compareRelativeSlotHasCallStackRelativeSlotRelativeSlotOrdering Source #

RelativeSlot is partially ordered, not totally ordered

It makes no sense to compare RelativeSlots from different chunks. Doing so will result in an assertion failure.

countChunksChunkNoChunkNoWord64 Source #

Count number of chunks between two indices

countChunks x              x  == 0
countChunks x (nextChunkNo x) == 1

firstChunkNoChunkNo Source #

First chunk

simpleChunkInfoEpochSizeChunkInfo Source #

Simple chunk config with a single chunk size

This intentionally takes EpochSize (number of slots) rather than ChunkSize: the translation from EpochSize to ChunkSize (number of available entries in a chunk) should not be done by client code.