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

Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types

Synopsis

Misc types

data BlockOrEBB Source #

Constructors

Block !SlotNo 
EBB !EpochNo 

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

Associated Types

type Rep BlockOrEBBTypeType Source #

NoThunks BlockOrEBB Source # 
Instance details

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

Methods

noThunks ∷ Context → BlockOrEBBIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → BlockOrEBBIO (Maybe ThunkInfo) #

showTypeOfProxy BlockOrEBBString #

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.1.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
Functor WithBlockSize Source # 
Instance details

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

Methods

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

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

Foldable WithBlockSize Source # 
Instance details

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

Methods

foldMonoid m ⇒ WithBlockSize m → m Source #

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

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

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

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

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

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

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

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

toListWithBlockSize a → [a] Source #

nullWithBlockSize a → Bool Source #

lengthWithBlockSize a → Int Source #

elemEq a ⇒ a → WithBlockSize a → Bool Source #

maximumOrd a ⇒ WithBlockSize a → a Source #

minimumOrd a ⇒ WithBlockSize a → a Source #

sumNum a ⇒ WithBlockSize a → a Source #

productNum a ⇒ WithBlockSize a → a Source #

Traversable WithBlockSize Source # 
Instance details

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

Methods

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

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

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

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

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

Associated Types

type Rep (WithBlockSize a) ∷ TypeType Source #

NoThunks a ⇒ NoThunks (WithBlockSize a) Source # 
Instance details

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

Methods

noThunks ∷ Context → WithBlockSize a → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → WithBlockSize a → IO (Maybe ThunkInfo) #

showTypeOfProxy (WithBlockSize a) → String #

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.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
Eq ValidationPolicy Source # 
Instance details

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

Show ValidationPolicy Source # 
Instance details

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

Generic ValidationPolicy Source # 
Instance details

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

Associated Types

type Rep ValidationPolicyTypeType Source #

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.1.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 ⇒ Eq (ChunkFileError blk) Source # 
Instance details

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

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

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

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

Associated Types

type Rep TraceCacheEventTypeType Source #

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.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 Source #

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

(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 Source #

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

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

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

Methods

showsPrecIntTraceChunkValidation blk validateTo → ShowS Source #

showTraceChunkValidation blk validateTo → String Source #

showList ∷ [TraceChunkValidation blk validateTo] → ShowS Source #

Generic (TraceChunkValidation blk validateTo) Source # 
Instance details

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

Associated Types

type Rep (TraceChunkValidation blk validateTo) ∷ TypeType Source #

Methods

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

toRep (TraceChunkValidation blk validateTo) x → TraceChunkValidation blk validateTo 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.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
StandardHash blk ⇒ Eq (TraceEvent blk) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.ImmutableDB.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.ImmutableDB.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.ImmutableDB.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.ImmutableDB.Impl.Types

type Rep (TraceEvent blk) = D1 ('MetaData "TraceEvent" "Ouroboros.Consensus.Storage.ImmutableDB.Impl.Types" "ouroboros-consensus-0.1.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))))))