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

Ouroboros.Consensus.Storage.ChainDB.API.Types.InvalidBlockPunishment

Description

How to punish the sender of a invalid block

Synopsis

opaque

data InvalidBlockPunishment m Source #

How to handle a discovered Invalidity

This type is opaque because the soundness of the punishment is subtle because of where it is invoked during the chain selection. As a result, arbitrary monadic actions would be foot guns. Instead, this module defines a small DSL for punishment that we judge to be sound.

combinators

data Invalidity Source #

Is the added block itself invalid, or is its prefix invalid?

Constructors

BlockItself 
BlockPrefix 

mkForDiffusionPipelining ∷ ∀ m blk. (IOLike m, BlockSupportsDiffusionPipelining blk) ⇒ STM m (BlockConfig blk → Header blk → InvalidBlockPunishment m → InvalidBlockPunishment m) Source #

Allocate a stateful punishment that performs the given punishment if the given header does not satisfy the diffusion pipelining criterion.

mkPunishThisThreadIOLike m ⇒ m (InvalidBlockPunishment m) Source #

Create a punishment that kills this thread