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

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.

Constructors

PrefixLen 

Fields

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

Associated Types

type Rep PrefixLenTypeType Source #

NoThunks PrefixLen Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

noThunks ∷ Context → PrefixLenIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PrefixLenIO (Maybe ThunkInfo) #

showTypeOfProxy PrefixLenString #

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.0-inplace" '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.

Instances

Instances details
Eq BinaryBlockInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Show BinaryBlockInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Generic BinaryBlockInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Associated Types

type Rep BinaryBlockInfoTypeType Source #

type Rep BinaryBlockInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

type Rep BinaryBlockInfo = D1 ('MetaData "BinaryBlockInfo" "Ouroboros.Consensus.Storage.Common" "ouroboros-consensus-0.1.0.0-inplace" 'False) (C1 ('MetaCons "BinaryBlockInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "headerOffset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16) :*: S1 ('MetaSel ('Just "headerSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16)))

extractHeaderBinaryBlockInfoByteStringByteString Source #

Extract the header from the given ByteString using the BinaryBlockInfo.

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

Methods

(==)StreamFrom blk → StreamFrom blk → Bool Source #

(/=)StreamFrom blk → StreamFrom blk → Bool Source #

StandardHash blk ⇒ Show (StreamFrom blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

showsPrecIntStreamFrom blk → ShowS Source #

showStreamFrom blk → String Source #

showList ∷ [StreamFrom blk] → ShowS Source #

Generic (StreamFrom blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Associated Types

type Rep (StreamFrom blk) ∷ TypeType Source #

Methods

fromStreamFrom blk → Rep (StreamFrom blk) x Source #

toRep (StreamFrom blk) x → StreamFrom blk Source #

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

Defined in Ouroboros.Consensus.Storage.Common

Methods

noThunks ∷ Context → StreamFrom blk → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → StreamFrom blk → IO (Maybe ThunkInfo) #

showTypeOfProxy (StreamFrom blk) → String #

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.0-inplace" 'False) (C1 ('MetaCons "StreamFromInclusive" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (RealPoint blk))) :+: C1 ('MetaCons "StreamFromExclusive" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Point blk))))

newtype StreamTo blk Source #

Constructors

StreamToInclusive (RealPoint blk) 

Instances

Instances details
StandardHash blk ⇒ Eq (StreamTo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

(==)StreamTo blk → StreamTo blk → Bool Source #

(/=)StreamTo blk → StreamTo blk → Bool Source #

StandardHash blk ⇒ Show (StreamTo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

showsPrecIntStreamTo blk → ShowS Source #

showStreamTo blk → String Source #

showList ∷ [StreamTo blk] → ShowS Source #

Generic (StreamTo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Associated Types

type Rep (StreamTo blk) ∷ TypeType Source #

Methods

fromStreamTo blk → Rep (StreamTo blk) x Source #

toRep (StreamTo blk) x → StreamTo blk Source #

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

Defined in Ouroboros.Consensus.Storage.Common

Methods

noThunks ∷ Context → StreamTo blk → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → StreamTo blk → IO (Maybe ThunkInfo) #

showTypeOfProxy (StreamTo blk) → String #

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.0-inplace" 'True) (C1 ('MetaCons "StreamToInclusive" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RealPoint blk))))

validBoundsStandardHash 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.

Constructors

GetVerifiedBlockBlockComponent blk blk

Verify the integrity of the block by checking its signature and/or hashes. The interpreter should throw an exception when the block does not pass the check.

GetBlockBlockComponent blk blk 
GetRawBlockBlockComponent blk ByteString 
GetHeaderBlockComponent blk (Header blk) 
GetRawHeaderBlockComponent blk ByteString 
GetHashBlockComponent blk (HeaderHash blk) 
GetSlotBlockComponent blk SlotNo 
GetIsEBBBlockComponent blk IsEBB 
GetBlockSizeBlockComponent blk Word32 
GetHeaderSizeBlockComponent blk Word16 
GetNestedCtxtBlockComponent blk (SomeSecond (NestedCtxt Header) blk) 
GetPure ∷ a → BlockComponent blk a 
GetApplyBlockComponent blk (a → b) → BlockComponent blk a → BlockComponent blk b 

Instances

Instances details
Functor (BlockComponent blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

fmap ∷ (a → b) → BlockComponent blk a → BlockComponent blk b Source #

(<$) ∷ a → BlockComponent blk b → BlockComponent blk a Source #

Applicative (BlockComponent blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.Common

Methods

pure ∷ a → BlockComponent blk a Source #

(<*>)BlockComponent blk (a → b) → BlockComponent blk a → BlockComponent blk b Source #

liftA2 ∷ (a → b → c) → BlockComponent blk a → BlockComponent blk b → BlockComponent blk c Source #

(*>)BlockComponent blk a → BlockComponent blk b → BlockComponent blk b Source #

(<*)BlockComponent blk a → BlockComponent blk b → BlockComponent blk a Source #

Re-exports