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

Ouroboros.Consensus.Storage.Common

Synopsis

Indexing

PrefixLen

newtype PrefixLen Source #

Number of bytes from the start of a block needed to reconstruct the nested context.

See reconstructPrefixLen .

Instances

Instances details
Eq PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Ord PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Show PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Generic PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

NoThunks PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep PrefixLen Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep PrefixLen = D1 (' MetaData "PrefixLen" "Ouroboros.Consensus.Storage.Common" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "PrefixLen" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getPrefixLen") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word8 )))

BinaryBlockInfo

data BinaryBlockInfo Source #

Information about the serialised block.

Constructors

BinaryBlockInfo

Fields

  • headerOffset :: ! Word16

    The offset within the serialised block at which the header starts.

  • headerSize :: ! Word16

    How many bytes the header is long. Extracting the headerSize bytes from serialised block starting from headerOffset should yield the header. Before passing the extracted bytes to the decoder for headers, an envelope can be around using nodeAddHeaderEnvelope .

Iterator bounds

data StreamFrom blk Source #

The lower bound for an iterator

Hint: use StreamFromExclusive genesisPoint to start streaming from Genesis.

Instances

Instances details
StandardHash blk => Eq ( StreamFrom blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

StandardHash blk => Show ( StreamFrom blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Generic ( StreamFrom blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Associated Types

type Rep ( StreamFrom blk) :: Type -> Type Source #

( StandardHash blk, Typeable blk) => NoThunks ( StreamFrom blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep ( StreamFrom blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep ( StreamFrom blk) = D1 (' MetaData "StreamFrom" "Ouroboros.Consensus.Storage.Common" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) ( C1 (' MetaCons "StreamFromInclusive" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( RealPoint blk))) :+: C1 (' MetaCons "StreamFromExclusive" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Point blk))))

newtype StreamTo blk Source #

Instances

Instances details
StandardHash blk => Eq ( StreamTo blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

StandardHash blk => Show ( StreamTo blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Generic ( StreamTo blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Associated Types

type Rep ( StreamTo blk) :: Type -> Type Source #

( StandardHash blk, Typeable blk) => NoThunks ( StreamTo blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep ( StreamTo blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep ( StreamTo blk) = D1 (' MetaData "StreamTo" "Ouroboros.Consensus.Storage.Common" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' True ) ( C1 (' MetaCons "StreamToInclusive" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( RealPoint blk))))

validBounds :: StandardHash blk => StreamFrom blk -> StreamTo blk -> Bool Source #

Check whether the bounds make sense

An example of bounds that don't make sense:

StreamFromExclusive (BlockPoint 3 ..)
StreamToInclusive   (RealPoint  3 ..)

This function does not check whether the bounds correspond to existing blocks.

BlockComponent

data BlockComponent blk a where Source #

Which component of the block to read from a database: the whole block, its header, its hash, the block size, ..., or combinations thereof.

NOTE: when requesting multiple components, we will not optimise/cache them.

Re-exports