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

Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types

Synopsis

Misc types

data BlockOrEBB Source #

Instances

Instances details
Eq BlockOrEBB Source #
Instance details

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

Show BlockOrEBB Source #
Instance details

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

Generic BlockOrEBB Source #
Instance details

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

NoThunks BlockOrEBB Source #
Instance details

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

type Rep BlockOrEBB Source #
Instance details

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

data WithBlockSize a Source #

Instances

Instances details
Functor WithBlockSize Source #
Instance details

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

Foldable WithBlockSize Source #
Instance details

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

Traversable WithBlockSize Source #
Instance details

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

Eq a => Eq ( WithBlockSize a) Source #
Instance details

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

Show a => Show ( WithBlockSize a) Source #
Instance details

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

Generic ( WithBlockSize a) Source #
Instance details

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

NoThunks a => NoThunks ( WithBlockSize a) Source #
Instance details

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

type Rep ( WithBlockSize a) Source #
Instance details

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

type Rep ( WithBlockSize a) = D1 (' MetaData "WithBlockSize" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) ( C1 (' MetaCons "WithBlockSize" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "blockSize") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 Word32 ) :*: S1 (' MetaSel (' Just "withoutBlockSize") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 a)))

Validation policy

data ValidationPolicy Source #

The validation policy used when opening an ImmutableDB .

The validation policy is used by openDB : the initial opening of the database, either an empty database or a database that was previously closed.

The recovery policy dictates which on-disk files should be validated.

Constructors

ValidateMostRecentChunk

The chunk and index files of the most recent chunk stored on disk will be validated.

Prior chunk and index files are ignored, even their presence will not be checked.

A MissingFileError or an InvalidFileError will be thrown in case of a missing or invalid chunk file, or an invalid index file.

Because not all files are validated, subsequent operations on the database after opening may result in unexpected errors.

ValidateAllChunks

The chunk and index files of all chunks starting from the first one up to the last chunk stored on disk will be validated.

A MissingFileError or an InvalidFileError will be thrown in case of a missing or invalid chunk file, or an invalid index file.

Chunk file error

data ChunkFileError blk Source #

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

Constructors

ChunkErrRead ReadIncrementalErr

A block could not be decoded

ChunkErrHashMismatch

The previous hash of a block did not match the hash of the previous block.

Fields

ChunkErrCorrupt ( Point blk)

The integrity verification of the block with the given point returned False , indicating that the block got corrupted.

Tracing

data TraceCacheEvent Source #

The argument with type Word32 is the number of past chunk currently in the cache.

Constructors

TraceCurrentChunkHit ChunkNo Word32
TracePastChunkHit ChunkNo Word32
TracePastChunkMiss ChunkNo Word32
TracePastChunkEvict ChunkNo Word32

The least recently used past chunk was evicted because the cache was full.

TracePastChunksExpired [ ChunkNo ] Word32

Past chunks were expired from the cache because they haven't been used for a while.

Instances

Instances details
Eq TraceCacheEvent Source #
Instance details

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

Show TraceCacheEvent Source #
Instance details

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

Generic TraceCacheEvent Source #
Instance details

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

type Rep TraceCacheEvent Source #
Instance details

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

type Rep TraceCacheEvent = D1 (' MetaData "TraceCacheEvent" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) (( C1 (' MetaCons "TraceCurrentChunkHit" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word32 )) :+: C1 (' MetaCons "TracePastChunkHit" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word32 ))) :+: ( C1 (' MetaCons "TracePastChunkMiss" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word32 )) :+: ( C1 (' MetaCons "TracePastChunkEvict" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word32 )) :+: C1 (' MetaCons "TracePastChunksExpired" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 [ ChunkNo ]) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Word32 )))))

data TraceChunkValidation blk validateTo Source #

Instances

Instances details
Functor ( TraceChunkValidation blk) Source #
Instance details

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

( StandardHash blk, Eq validateTo) => Eq ( TraceChunkValidation blk validateTo) Source #
Instance details

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

( StandardHash blk, Show validateTo) => Show ( TraceChunkValidation blk validateTo) Source #
Instance details

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

Generic ( TraceChunkValidation blk validateTo) Source #
Instance details

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

Associated Types

type Rep ( TraceChunkValidation blk validateTo) :: Type -> Type Source #

type Rep ( TraceChunkValidation blk validateTo) Source #
Instance details

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

type Rep ( TraceChunkValidation blk validateTo) = D1 (' MetaData "TraceChunkValidation" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) ((( C1 (' MetaCons "StartedValidatingChunk" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 validateTo)) :+: C1 (' MetaCons "ValidatedChunk" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 validateTo))) :+: ( C1 (' MetaCons "MissingChunkFile" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo )) :+: ( C1 (' MetaCons "InvalidChunkFile" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( ChunkFileError blk))) :+: C1 (' MetaCons "MissingPrimaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ))))) :+: (( C1 (' MetaCons "MissingSecondaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo )) :+: C1 (' MetaCons "InvalidPrimaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ))) :+: ( C1 (' MetaCons "InvalidSecondaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo )) :+: ( C1 (' MetaCons "RewritePrimaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo )) :+: C1 (' MetaCons "RewriteSecondaryIndex" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ))))))

data TraceEvent blk Source #

Constructors

NoValidLastLocation
ValidatedLastLocation ChunkNo ( Tip blk)
ChunkValidationEvent ( TraceChunkValidation blk ChunkNo )
ChunkFileDoesntFit ( ChainHash blk) ( ChainHash blk)

The hash of the last block in the previous epoch doesn't match the previous hash of the first block in the current epoch

Migrating Text

Performing a migration of the on-disk files

DeletingAfter ( WithOrigin ( Tip blk))
DBAlreadyClosed
DBClosed
TraceCacheEvent ! TraceCacheEvent

Instances

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

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

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

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

Generic ( TraceEvent blk) Source #
Instance details

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

Associated Types

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

type Rep ( TraceEvent blk) Source #
Instance details

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

type Rep ( TraceEvent blk) = D1 (' MetaData "TraceEvent" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) ((( C1 (' MetaCons "NoValidLastLocation" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ValidatedLastLocation" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ChunkNo ) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Tip blk)))) :+: ( C1 (' MetaCons "ChunkValidationEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceChunkValidation blk ChunkNo ))) :+: C1 (' MetaCons "ChunkFileDoesntFit" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( ChainHash blk)) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( ChainHash blk))))) :+: (( C1 (' MetaCons "Migrating" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Text )) :+: C1 (' MetaCons "DeletingAfter" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( WithOrigin ( Tip blk))))) :+: ( C1 (' MetaCons "DBAlreadyClosed" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "DBClosed" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "TraceCacheEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 TraceCacheEvent ))))))