ouroboros-consensus-shelley-0.1.0.1: Shelley ledger integration in the Ouroboros consensus layer
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Shelley.Protocol.Abstract

Description

Commonality between multiple protocols.

Everything in this module is indexed on the protocol (or the crypto), rather than on the block type. This allows it to be imported in Ouroboros.Consensus.Shelley.Ledger.Block .

Synopsis

Documentation

class ( Eq ( EnvelopeCheckError proto), NoThunks ( EnvelopeCheckError proto), Show ( EnvelopeCheckError proto)) => ProtocolHeaderSupportsEnvelope proto where Source #

Indicates that the header (determined by the protocol) supports " Envelope " functionality. Envelope functionality refers to the minimal functionality required to construct a chain.

Associated Types

type EnvelopeCheckError proto :: Type Source #

Instances

Instances details
PraosCrypto c => ProtocolHeaderSupportsEnvelope ( Praos c) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Praos

PraosCrypto c => ProtocolHeaderSupportsEnvelope ( TPraos c) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.TPraos

class ProtocolHeaderSupportsKES proto where Source #

ProtocolHeaderSupportsKES describes functionality common to protocols using key evolving signature schemes. This includes verifying the header integrity (e.g. validating the KES signature), as well as constructing the header (made specific to KES-using protocols through the need to handle the hot key).

Methods

configSlotsPerKESPeriod :: ConsensusConfig proto -> Word64 Source #

Extract the "slots per KES period" value from the protocol config.

Note that we do not require ConsensusConfig in verifyHeaderIntegrity since that function is also invoked with StorageConfig .

verifyHeaderIntegrity Source #

Arguments

:: Word64

Slots per KES period

-> ShelleyProtocolHeader proto
-> Bool

Verify that the signature on a header is correct and valid.

mkHeader Source #

Arguments

:: forall crypto m. ( Crypto crypto, Monad m, crypto ~ ProtoCrypto proto)
=> HotKey crypto m
-> CanBeLeader proto
-> IsLeader proto
-> SlotNo

Slot no

-> BlockNo

Block no

-> PrevHash crypto

Hash of the previous block

-> Hash crypto EraIndependentBlockBody

Hash of the block body to include in the header

-> Int

Size of the block body

-> ProtVer

Protocol version

-> m ( ShelleyProtocolHeader proto)

class ProtocolHeaderSupportsLedger proto where Source #

Indicates that the protocol header supports the Shelley ledger. We may need to generalise this if, in the future, the ledger requires different things from the protocol.

class ProtocolHeaderSupportsProtocol proto where Source #

ProtocolHeaderSupportsProtocol` provides support for the concrete block header to support the ConsensusProtocol itself.

Associated Types

type CannotForgeError proto :: Type Source #

newtype ShelleyHash crypto Source #

Instances

Instances details
Eq ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Ord ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Show ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Generic ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Associated Types

type Rep ( ShelleyHash crypto) :: Type -> Type Source #

Crypto crypto => ToCBOR ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Crypto crypto => FromCBOR ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

NoThunks ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Crypto crypto => Serialise ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

Condense ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

type Rep ( ShelleyHash crypto) Source #
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.Abstract

type Rep ( ShelleyHash crypto) = D1 (' MetaData "ShelleyHash" "Ouroboros.Consensus.Shelley.Protocol.Abstract" "ouroboros-consensus-shelley-0.1.0.1-Kwox0dapAHUG8fY5XKE0pO" ' True ) ( C1 (' MetaCons "ShelleyHash" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unShelleyHash") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Hash crypto EraIndependentBlockHeader ))))

type family ShelleyProtocolHeader proto = (sh :: Type ) | sh -> proto Source #

Shelley header, determined by the associated protocol.