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

Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Synopsis

Blocks per file

mkBlocksPerFileWord32BlocksPerFile Source #

Create a BlocksPerFile.

PRECONDITION: the given number must be greater than 0, if not, this function will throw an error.

opaque

data BlocksPerFile Source #

The maximum number of blocks to store per file.

Instances

Instances details
Show BlocksPerFile Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Generic BlocksPerFile Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Associated Types

type Rep BlocksPerFileTypeType Source #

type Rep BlocksPerFile Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

type Rep BlocksPerFile = D1 ('MetaData "BlocksPerFile" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Types" "ouroboros-consensus-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BlocksPerFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlocksPerFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

Block validation policy

data BlockValidationPolicy Source #

When block validation is enabled, the parser checks for each block a number of properties and stops parsing if it finds any invalid blocks.

Constructors

NoValidation 
ValidateAll 

Parse error

data ParseError blk Source #

Note that we recover from the error, and thus never throw it as an Exception.

Defined here instead of in the Parser module because TraceEvent depends on it.

Constructors

BlockReadErr ReadIncrementalErr

A block could not be parsed.

BlockCorruptedErr (HeaderHash blk)

A block was corrupted, e.g., checking its signature and/or hash failed.

DuplicatedBlock (HeaderHash blk) FsPath FsPath

A block with the same hash occurred twice in the VolatileDB files.

We include the file in which it occurred first and the file in which it occured the second time. The two files can be the same.

Instances

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

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

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

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

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

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

showsPrecIntParseError blk → ShowS Source #

showParseError blk → String Source #

showList ∷ [ParseError blk] → ShowS Source #

Tracing

data TraceEvent blk Source #

Instances

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

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

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

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

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

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

showsPrecIntTraceEvent blk → ShowS Source #

showTraceEvent blk → String Source #

showList ∷ [TraceEvent blk] → ShowS Source #

Generic (TraceEvent blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Associated Types

type Rep (TraceEvent blk) ∷ TypeType Source #

Methods

fromTraceEvent blk → Rep (TraceEvent blk) x Source #

toRep (TraceEvent blk) x → TraceEvent blk Source #

type Rep (TraceEvent blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

type Rep (TraceEvent blk) = D1 ('MetaData "TraceEvent" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Types" "ouroboros-consensus-0.1.0.0-inplace" 'False) ((C1 ('MetaCons "DBAlreadyClosed" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "BlockAlreadyHere" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HeaderHash blk)))) :+: (C1 ('MetaCons "Truncate" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ParseError blk)) :*: (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FsPath) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BlockOffset))) :+: C1 ('MetaCons "InvalidFileNames" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FsPath]))))

Internal indices

newtype BlockOffset Source #

The offset at which a block is stored in a file.

Constructors

BlockOffset 

Fields

Instances

Instances details
Eq BlockOffset Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Show BlockOffset Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Generic BlockOffset Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Associated Types

type Rep BlockOffsetTypeType Source #

NoThunks BlockOffset Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

noThunks ∷ Context → BlockOffsetIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → BlockOffsetIO (Maybe ThunkInfo) #

showTypeOfProxy BlockOffsetString #

type Rep BlockOffset Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

type Rep BlockOffset = D1 ('MetaData "BlockOffset" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Types" "ouroboros-consensus-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BlockOffset" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

newtype BlockSize Source #

Constructors

BlockSize 

Fields

Instances

Instances details
Eq BlockSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Show BlockSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Generic BlockSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Associated Types

type Rep BlockSizeTypeType Source #

NoThunks BlockSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

noThunks ∷ Context → BlockSizeIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → BlockSizeIO (Maybe ThunkInfo) #

showTypeOfProxy BlockSizeString #

type Rep BlockSize Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

type Rep BlockSize = D1 ('MetaData "BlockSize" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Types" "ouroboros-consensus-0.1.0.0-inplace" 'True) (C1 ('MetaCons "BlockSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)))

type FileId = Int Source #

The FileId is the unique identifier of each file found in the db. For example, the file blocks-42.dat has FileId 42.

data InternalBlockInfo blk Source #

The internal information the db keeps for each block.

Instances

Instances details
Generic (InternalBlockInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Associated Types

type Rep (InternalBlockInfo blk) ∷ TypeType Source #

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

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

Methods

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

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

showTypeOfProxy (InternalBlockInfo blk) → String #

type Rep (InternalBlockInfo blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types

type Rep (InternalBlockInfo blk) = D1 ('MetaData "InternalBlockInfo" "Ouroboros.Consensus.Storage.VolatileDB.Impl.Types" "ouroboros-consensus-0.1.0.0-inplace" 'False) (C1 ('MetaCons "InternalBlockInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ibiFile") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FsPath) :*: S1 ('MetaSel ('Just "ibiBlockOffset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockOffset)) :*: (S1 ('MetaSel ('Just "ibiBlockSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BlockSize) :*: (S1 ('MetaSel ('Just "ibiBlockInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BlockInfo blk)) :*: S1 ('MetaSel ('Just "ibiNestedCtxt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SomeSecond (NestedCtxt Header) blk))))))

type ReverseIndex blk = Map (HeaderHash blk) (InternalBlockInfo blk) Source #

We map the header hash of each block to the InternalBlockInfo.

type SuccessorsIndex blk = Map (ChainHash blk) (Set (HeaderHash blk)) Source #

For each block, we store the set of all blocks which have this block as a predecessor (set of successors).