cardano-ledger-byron-1.0.2.0: The blockchain layer of Cardano during the Byron era
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Chain.Update.Validation.Interface

Description

Blockchain interface validation rules.

Synopsis

Environment

data Environment Source #

Constructors

Environment 

Fields

  • protocolMagic ∷ !(Annotated ProtocolMagicId ByteString)
     
  • k ∷ !BlockCount

    TODO: this is the chain security parameter, a.k.a. stableAfter, it is not part of our protocol parameters, so it seems that we need to pass it in the environment. However we need to double-check this with others.

  • currentSlot ∷ !SlotNumber
     
  • numGenKeys ∷ !Word8

    Number of genesis keys. This is used to calculate the proportion of genesis keys that need to endorse a new protocol version for it to be considered for adoption. See Cardano.Chain.Update.Validation.Endorsement.Environment.

  • delegationMap ∷ !Map
     

State

data State Source #

Update interface state.

Constructors

State 

Fields

Instances

Instances details
Generic State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Associated Types

type Rep StateTypeType Source #

Methods

fromStateRep State x Source #

toRep State x → State Source #

Show State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

FromCBOR State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

ToCBOR State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

toCBORStateEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy StateSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [State] → Size Source #

DecCBOR State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

EncCBOR State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

encCBORStateEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy StateSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [State] → Size Source #

NFData State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

rnfState → () Source #

Eq State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

(==)StateStateBool Source #

(/=)StateStateBool Source #

NoThunks State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

type Rep State Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

type Rep State = D1 ('MetaData "State" "Cardano.Chain.Update.Validation.Interface" "cardano-ledger-byron-1.0.2.0-inplace" 'False) (C1 ('MetaCons "State" 'PrefixI 'True) (((S1 ('MetaSel ('Just "currentEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNumber) :*: S1 ('MetaSel ('Just "adoptedProtocolVersion") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtocolVersion)) :*: (S1 ('MetaSel ('Just "adoptedProtocolParameters") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtocolParameters) :*: (S1 ('MetaSel ('Just "candidateProtocolUpdates") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [CandidateProtocolUpdate]) :*: S1 ('MetaSel ('Just "appVersions") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ApplicationVersions)))) :*: ((S1 ('MetaSel ('Just "registeredProtocolUpdateProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProtocolUpdateProposals) :*: (S1 ('MetaSel ('Just "registeredSoftwareUpdateProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SoftwareUpdateProposals) :*: S1 ('MetaSel ('Just "confirmedProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map UpId SlotNumber)))) :*: (S1 ('MetaSel ('Just "proposalVotes") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map UpId (Set KeyHash))) :*: (S1 ('MetaSel ('Just "registeredEndorsements") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set Endorsement)) :*: S1 ('MetaSel ('Just "proposalRegistrationSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map UpId SlotNumber)))))))

initialStateConfigState Source #

Initial update interface state

Signal

data Signal Source #

Signal combining signals from various rules

Error

data Error Source #

Instances

Instances details
Show Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

FromCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

ToCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

toCBORErrorEncoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ErrorSize Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Error] → Size Source #

DecCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

EncCBOR Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

encCBORErrorEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy ErrorSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [Error] → Size Source #

Eq Error Source # 
Instance details

Defined in Cardano.Chain.Update.Validation.Interface

Methods

(==)ErrorErrorBool Source #

(/=)ErrorErrorBool Source #

Interface functions

registerUpdateMonadError Error m ⇒ EnvironmentStateSignal → m State Source #

Group together the other registration rules in a single rule

This corresponds to the BUPI rule in the Byron chain specification.

registerProposalMonadError Error m ⇒ EnvironmentStateAProposal ByteString → m State Source #

Register an update proposal.

This corresponds to the UPIREG rule in the Byron ledger specification.

registerVoteMonadError Error m ⇒ EnvironmentStateAVote ByteString → m State Source #

Register a vote for the given proposal.

This corresponds to the UPIVOTE rule in the Byron ledger

registerEndorsementMonadError Error m ⇒ EnvironmentStateEndorsement → m State Source #

Register an endorsement.

An endorsement represents the fact that a genesis key is ready to start using the protocol version being endorsed. In the decentralized era only genesis key holders can endorse protocol versions.

This corresponds to the UPIEND rule in the Byron ledger specification.

registerEpoch Source #

Arguments

Environment 
State 
EpochNumber

Epoch seen on the block.

State 

Register an epoch. Whenever an epoch number is seen on a block this epoch number should be passed to this function so that on epoch change the protocol parameters can be updated, provided that there is an update candidate that was accepted and endorsed by a majority of the genesis keys.

This corresponds to the UPIEC rules in the Byron ledger specification.