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

Ouroboros.Consensus.Block.Forging

Contents

Synopsis

Documentation

type family CannotForge blk :: Type Source #

Information about why we cannot forge a block, although we are a leader

This should happen only rarely. An example might be that our hot key does not (yet/anymore) match the delegation state.

Instances

Instances details
type CannotForge (HardForkBlock xs) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Forging

type CannotForge (DualBlock m a) Source # 
Instance details

Defined in Ouroboros.Consensus.Ledger.Dual

type family ForgeStateInfo blk :: Type Source #

Returned when a call to updateForgeState succeeded and caused the forge state to change. This info is traced.

type family ForgeStateUpdateError blk :: Type Source #

Returned when a call updateForgeState failed, e.g., because the KES key is no longer valid. This info is traced.

data BlockForging m blk Source #

Stateful wrapper around block production

NOTE: do not refer to the consensus or ledger config in the closure of this record because they might contain an EpochInfo Identity, which will be incorrect when used as part of the hard fork combinator.

Constructors

BlockForging 

Fields

Instances

Instances details
Functor m => Isomorphic (BlockForging m) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

data ShouldForge blk Source #

Constructors

ForgeStateUpdateError (ForgeStateUpdateError blk)

Before check whether we are a leader in this slot, we tried to update our forge state (updateForgeState), but it failed. We will not check whether we are leader and will thus not forge a block either.

E.g., we could not evolve our KES key.

CannotForge (CannotForge blk)

We are a leader in this slot, but we cannot forge for a certain reason.

E.g., our KES key is not yet valid in this slot or we are not the current delegate of the genesis key we have a delegation certificate from.

NotLeader

We are not a leader in this slot

ShouldForge (IsLeader (BlockProtocol blk))

We are a leader in this slot and we should forge a block.

UpdateInfo

data UpdateInfo updated unchanged failed Source #

The result of updating something, e.g., the forge state.

Constructors

Updated updated 
Unchanged unchanged 
UpdateFailed failed 

Instances

Instances details
(Show updated, Show unchanged, Show failed) => Show (UpdateInfo updated unchanged failed) Source # 
Instance details

Defined in Ouroboros.Consensus.Block.Forging

Methods

showsPrec :: Int -> UpdateInfo updated unchanged failed -> ShowS #

show :: UpdateInfo updated unchanged failed -> String #

showList :: [UpdateInfo updated unchanged failed] -> ShowS #

castUpdateInfo :: (updated ~ updated', unchanged ~ unchanged', failed ~ failed') => UpdateInfo updated unchanged failed -> UpdateInfo updated' unchanged' failed' Source #