ouroboros-consensus-0.18.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types

Synopsis

Misc types

data BlockOrEBB Source #

Constructors

Block !SlotNo 
EBB !EpochNo 

Instances

Instances details
Generic BlockOrEBB Source # 
Instance details

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

Associated Types

type Rep BlockOrEBBTypeType #

Show BlockOrEBB Source # 
Instance details

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

Eq BlockOrEBB Source # 
Instance details

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

Methods

(==)BlockOrEBBBlockOrEBBBool #

(/=)BlockOrEBBBlockOrEBBBool #

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

type Rep BlockOrEBB = D1 ('MetaData "BlockOrEBB" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.18.0.0-inplace" 'False) (C1 ('MetaCons "Block" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :+: C1 ('MetaCons "EBB" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo)))

data WithBlockSize a Source #

Constructors

WithBlockSize 

Fields

Instances

Instances details
Foldable WithBlockSize Source # 
Instance details

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

Methods

foldMonoid m ⇒ WithBlockSize m → m #

foldMapMonoid m ⇒ (a → m) → WithBlockSize a → m #

foldMap'Monoid m ⇒ (a → m) → WithBlockSize a → m #

foldr ∷ (a → b → b) → b → WithBlockSize a → b #

foldr' ∷ (a → b → b) → b → WithBlockSize a → b #

foldl ∷ (b → a → b) → b → WithBlockSize a → b #

foldl' ∷ (b → a → b) → b → WithBlockSize a → b #

foldr1 ∷ (a → a → a) → WithBlockSize a → a #

foldl1 ∷ (a → a → a) → WithBlockSize a → a #

toListWithBlockSize a → [a] #

nullWithBlockSize a → Bool #

lengthWithBlockSize a → Int #

elemEq a ⇒ a → WithBlockSize a → Bool #

maximumOrd a ⇒ WithBlockSize a → a #

minimumOrd a ⇒ WithBlockSize a → a #

sumNum a ⇒ WithBlockSize a → a #

productNum a ⇒ WithBlockSize a → a #

Traversable WithBlockSize Source # 
Instance details

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

Methods

traverseApplicative f ⇒ (a → f b) → WithBlockSize a → f (WithBlockSize b) #

sequenceAApplicative f ⇒ WithBlockSize (f a) → f (WithBlockSize a) #

mapMMonad m ⇒ (a → m b) → WithBlockSize a → m (WithBlockSize b) #

sequenceMonad m ⇒ WithBlockSize (m a) → m (WithBlockSize a) #

Functor WithBlockSize Source # 
Instance details

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

Methods

fmap ∷ (a → b) → WithBlockSize a → WithBlockSize b #

(<$) ∷ a → WithBlockSize b → WithBlockSize a #

Generic (WithBlockSize a) Source # 
Instance details

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

Associated Types

type Rep (WithBlockSize a) ∷ TypeType #

Methods

fromWithBlockSize a → Rep (WithBlockSize a) x #

toRep (WithBlockSize a) x → WithBlockSize a #

Show a ⇒ Show (WithBlockSize a) 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

Methods

(==)WithBlockSize a → WithBlockSize a → Bool #

(/=)WithBlockSize a → WithBlockSize a → Bool #

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

Instances

Instances details
Generic ValidationPolicy Source # 
Instance details

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

Associated Types

type Rep ValidationPolicyTypeType #

Show ValidationPolicy Source # 
Instance details

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

Eq ValidationPolicy Source # 
Instance details

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

type Rep ValidationPolicy Source # 
Instance details

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

type Rep ValidationPolicy = D1 ('MetaData "ValidationPolicy" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.18.0.0-inplace" 'False) (C1 ('MetaCons "ValidateMostRecentChunk" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ValidateAllChunks" 'PrefixI 'False) (U1TypeType))

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.

Instances

Instances details
StandardHash blk ⇒ Show (ChunkFileError blk) Source # 
Instance details

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

Methods

showsPrecIntChunkFileError blk → ShowS #

showChunkFileError blk → String #

showList ∷ [ChunkFileError blk] → ShowS #

StandardHash blk ⇒ Eq (ChunkFileError blk) Source # 
Instance details

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

Methods

(==)ChunkFileError blk → ChunkFileError blk → Bool #

(/=)ChunkFileError blk → ChunkFileError blk → Bool #

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
Generic TraceCacheEvent Source # 
Instance details

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

Associated Types

type Rep TraceCacheEventTypeType #

Show TraceCacheEvent Source # 
Instance details

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

Eq 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.18.0.0-inplace" 'False) ((C1 ('MetaCons "TraceCurrentChunkHit" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: C1 ('MetaCons "TracePastChunkHit" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) :+: (C1 ('MetaCons "TracePastChunkMiss" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: (C1 ('MetaCons "TracePastChunkEvict" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32)) :+: C1 ('MetaCons "TracePastChunksExpired" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ChunkNo]) :*: S1 ('MetaSel ('NothingMaybe 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

Methods

fmap ∷ (a → b) → TraceChunkValidation blk a → TraceChunkValidation blk b #

(<$) ∷ a → TraceChunkValidation blk b → TraceChunkValidation blk a #

Generic (TraceChunkValidation blk validateTo) Source # 
Instance details

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

Associated Types

type Rep (TraceChunkValidation blk validateTo) ∷ TypeType #

Methods

fromTraceChunkValidation blk validateTo → Rep (TraceChunkValidation blk validateTo) x #

toRep (TraceChunkValidation blk validateTo) x → TraceChunkValidation blk validateTo #

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

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

Methods

showsPrecIntTraceChunkValidation blk validateTo → ShowS #

showTraceChunkValidation blk validateTo → String #

showList ∷ [TraceChunkValidation blk validateTo] → ShowS #

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

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

Methods

(==)TraceChunkValidation blk validateTo → TraceChunkValidation blk validateTo → Bool #

(/=)TraceChunkValidation blk validateTo → TraceChunkValidation blk validateTo → Bool #

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.18.0.0-inplace" 'False) (((C1 ('MetaCons "StartedValidatingChunk" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 validateTo)) :+: C1 ('MetaCons "ValidatedChunk" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 validateTo))) :+: (C1 ('MetaCons "MissingChunkFile" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: (C1 ('MetaCons "InvalidChunkFile" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChunkFileError blk))) :+: C1 ('MetaCons "MissingPrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo))))) :+: ((C1 ('MetaCons "MissingSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: C1 ('MetaCons "InvalidPrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo))) :+: (C1 ('MetaCons "InvalidSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: (C1 ('MetaCons "RewritePrimaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: C1 ('MetaCons "RewriteSecondaryIndex" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe 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
Generic (TraceEvent blk) Source # 
Instance details

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

Associated Types

type Rep (TraceEvent blk) ∷ TypeType #

Methods

fromTraceEvent blk → Rep (TraceEvent blk) x #

toRep (TraceEvent blk) x → TraceEvent blk #

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

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

Methods

showsPrecIntTraceEvent blk → ShowS #

showTraceEvent blk → String #

showList ∷ [TraceEvent blk] → ShowS #

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

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

Methods

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

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

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.18.0.0-inplace" 'False) (((C1 ('MetaCons "NoValidLastLocation" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ValidatedLastLocation" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tip blk)))) :+: (C1 ('MetaCons "ChunkValidationEvent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TraceChunkValidation blk ChunkNo))) :+: C1 ('MetaCons "ChunkFileDoesntFit" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChainHash blk)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChainHash blk))))) :+: ((C1 ('MetaCons "Migrating" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "DeletingAfter" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithOrigin (Tip blk))))) :+: (C1 ('MetaCons "DBAlreadyClosed" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "DBClosed" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "TraceCacheEvent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TraceCacheEvent))))))