| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.VolatileDB.Impl.Types
Synopsis
- data BlocksPerFile
- unBlocksPerFile :: BlocksPerFile -> Word32
- mkBlocksPerFile :: Word32 -> BlocksPerFile
- data BlockValidationPolicy
- data ParseError blk
- data TraceEvent blk
- type FileId = Int
- type ReverseIndex blk = Map (HeaderHash blk) (InternalBlockInfo blk)
- type SuccessorsIndex blk = Map (ChainHash blk) (Set (HeaderHash blk))
- newtype BlockSize = BlockSize {}
- newtype BlockOffset = BlockOffset {}
- data InternalBlockInfo blk = InternalBlockInfo {
- ibiFile :: !FsPath
- ibiBlockOffset :: !BlockOffset
- ibiBlockSize :: !BlockSize
- ibiBlockInfo :: !(BlockInfo blk)
- ibiNestedCtxt :: !(SomeSecond (NestedCtxt Header) blk)
Blocks per file
data BlocksPerFile Source #
The maximum number of blocks to store per file.
Instances
| Show BlocksPerFile Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Methods showsPrec :: Int -> BlocksPerFile -> ShowS # show :: BlocksPerFile -> String # showList :: [BlocksPerFile] -> ShowS # | |
| Generic BlocksPerFile Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Associated Types type Rep BlocksPerFile :: Type -> Type # | |
| type Rep BlocksPerFile Source # | |
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-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "BlocksPerFile" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlocksPerFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) | |
mkBlocksPerFile :: Word32 -> BlocksPerFile Source #
Create a BlocksPerFile.
PRECONDITION: the given number must be greater than 0, if not, this
function will throw an error.
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 |
Instances
| Eq BlockValidationPolicy Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Methods (==) :: BlockValidationPolicy -> BlockValidationPolicy -> Bool # (/=) :: BlockValidationPolicy -> BlockValidationPolicy -> Bool # | |
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
| StandardHash blk => Eq (ParseError blk) Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Methods (==) :: ParseError blk -> ParseError blk -> Bool # (/=) :: ParseError blk -> ParseError blk -> Bool # | |
| StandardHash blk => Show (ParseError blk) Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Methods showsPrec :: Int -> ParseError blk -> ShowS # show :: ParseError blk -> String # showList :: [ParseError blk] -> ShowS # | |
Tracing
data TraceEvent blk Source #
Constructors
| DBAlreadyClosed | |
| DBAlreadyOpen | |
| BlockAlreadyHere (HeaderHash blk) | |
| TruncateCurrentFile FsPath | |
| Truncate (ParseError blk) FsPath BlockOffset | |
| InvalidFileNames [FsPath] |
Instances
Internal indices
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).
Constructors
| BlockSize | |
Fields | |
Instances
| Eq BlockSize Source # | |
| Show BlockSize Source # | |
| Generic BlockSize Source # | |
| NoThunks BlockSize Source # | |
| type Rep BlockSize Source # | |
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-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "BlockSize" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word32))) | |
newtype BlockOffset Source #
The offset at which a block is stored in a file.
Constructors
| BlockOffset | |
Fields | |
Instances
| Eq BlockOffset Source # | |
| Show BlockOffset Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Methods showsPrec :: Int -> BlockOffset -> ShowS # show :: BlockOffset -> String # showList :: [BlockOffset] -> ShowS # | |
| Generic BlockOffset Source # | |
Defined in Ouroboros.Consensus.Storage.VolatileDB.Impl.Types Associated Types type Rep BlockOffset :: Type -> Type # | |
| NoThunks BlockOffset Source # | |
| type Rep BlockOffset Source # | |
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-GfJNvFcM6lj2s5utKAUPEp" 'True) (C1 ('MetaCons "BlockOffset" 'PrefixI 'True) (S1 ('MetaSel ('Just "unBlockOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))) | |
data InternalBlockInfo blk Source #
The internal information the db keeps for each block.
Constructors
| InternalBlockInfo | |
Fields
| |