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 BlockOrEBB :: Type -> Type #

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.1.0.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "Block" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :+: C1 ('MetaCons "EBB" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe 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 #

(<$) :: a -> WithBlockSize b -> WithBlockSize a #

Foldable WithBlockSize Source # 
Instance details

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

Methods

fold :: Monoid m => WithBlockSize m -> m #

foldMap :: Monoid 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 #

toList :: WithBlockSize a -> [a] #

null :: WithBlockSize a -> Bool #

length :: WithBlockSize a -> Int #

elem :: Eq a => a -> WithBlockSize a -> Bool #

maximum :: Ord a => WithBlockSize a -> a #

minimum :: Ord a => WithBlockSize a -> a #

sum :: Num a => WithBlockSize a -> a #

product :: Num a => WithBlockSize a -> a #

Traversable WithBlockSize Source # 
Instance details

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

Methods

traverse :: Applicative f => (a -> f b) -> WithBlockSize a -> f (WithBlockSize b) #

sequenceA :: Applicative f => WithBlockSize (f a) -> f (WithBlockSize a) #

mapM :: Monad m => (a -> m b) -> WithBlockSize a -> m (WithBlockSize b) #

sequence :: Monad m => WithBlockSize (m a) -> m (WithBlockSize a) #

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) :: Type -> Type #

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.0-GfJNvFcM6lj2s5utKAUPEp" '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 ValidationPolicy :: Type -> Type #

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-GfJNvFcM6lj2s5utKAUPEp" 'False) (C1 ('MetaCons "ValidateMostRecentChunk" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ValidateAllChunks" 'PrefixI 'False) (U1 :: Type -> Type))

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 TraceEvent blk Source #

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 #

(/=) :: TraceEvent blk -> TraceEvent blk -> Bool #

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

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

Methods

showsPrec :: Int -> TraceEvent blk -> ShowS #

show :: TraceEvent blk -> String #

showList :: [TraceEvent blk] -> ShowS #

Generic (TraceEvent blk) Source # 
Instance details

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

Associated Types

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

Methods

from :: TraceEvent blk -> Rep (TraceEvent blk) x #

to :: Rep (TraceEvent blk) x -> TraceEvent blk #

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-GfJNvFcM6lj2s5utKAUPEp" '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 "ValidatingChunk" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ChunkNo)) :+: 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 "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 "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)))) :+: ((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)))))))

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 TraceCacheEvent :: Type -> Type #

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-GfJNvFcM6lj2s5utKAUPEp" '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)))))