| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.ImmutableDB.Impl.Validation
Contents
Synopsis
- data ValidateEnv (m ∷ Type → Type) blk h = ValidateEnv {
- hasFS ∷ !(HasFS m h)
- chunkInfo ∷ !ChunkInfo
- tracer ∷ !(Tracer m (TraceEvent blk))
- cacheConfig ∷ !CacheConfig
- codecConfig ∷ !(CodecConfig blk)
- checkIntegrity ∷ !(blk → Bool)
- validateAndReopen ∷ ∀ (m ∷ Type → Type) blk h. (IOLike m, GetPrevHash blk, HasBinaryBlockInfo blk, DecodeDisk blk (ByteString → blk), ConvertRawHash blk, Eq h, HasCallStack) ⇒ ValidateEnv m blk h → ResourceRegistry m → ValidationPolicy → WithTempRegistry (OpenState m blk h) m (OpenState m blk h)
- data ShouldBeFinalised
- reconstructPrimaryIndex ∷ (ConvertRawHash blk, HasCallStack) ⇒ Proxy blk → ChunkInfo → ShouldBeFinalised → ChunkNo → [BlockOrEBB] → PrimaryIndex
Documentation
data ValidateEnv (m ∷ Type → Type) blk h Source #
Bundle of arguments used most validation functions.
Note that we don't use Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index because we are reading and manipulating index files in different ways, e.g., truncating them.
Constructors
| ValidateEnv | |
Fields
| |
validateAndReopen ∷ ∀ (m ∷ Type → Type) blk h. (IOLike m, GetPrevHash blk, HasBinaryBlockInfo blk, DecodeDisk blk (ByteString → blk), ConvertRawHash blk, Eq h, HasCallStack) ⇒ ValidateEnv m blk h → ResourceRegistry m → ValidationPolicy → WithTempRegistry (OpenState m blk h) m (OpenState m blk h) Source #
Perform validation as per the ValidationPolicy using validate and
create an OpenState corresponding to its outcome using mkOpenState.
Exported for testing purposes
data ShouldBeFinalised Source #
Iff the chunk is the most recent chunk, it should not be finalised.
With finalising, we mean: if there are one or more empty slots at the end
of the chunk, the primary index should be padded with offsets to indicate
that these slots are empty. See backfill.
Constructors
| ShouldBeFinalised | |
| ShouldNotBeFinalised |
Instances
| Show ShouldBeFinalised Source # | |
Defined in Ouroboros.Consensus.Storage.ImmutableDB.Impl.Validation Methods showsPrec ∷ Int → ShouldBeFinalised → ShowS # show ∷ ShouldBeFinalised → String # showList ∷ [ShouldBeFinalised] → ShowS # | |
reconstructPrimaryIndex ∷ (ConvertRawHash blk, HasCallStack) ⇒ Proxy blk → ChunkInfo → ShouldBeFinalised → ChunkNo → [BlockOrEBB] → PrimaryIndex Source #
Reconstruct a PrimaryIndex based on a list of Entrys.