ouroboros-consensus-mock-0.1.0.0: Mock ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Mock.Protocol.Praos

Description

Proof of concept implementation of Praos

Synopsis

Documentation

data HotKey c Source #

The key used for the given period or a stub Poisoned value.

A key will be poisoned if it failed to evolve by updateKES, and will remain poisoned forever after that.

Constructors

HotKey 

Fields

  • !Period

    Absolute period of the KES key

  • !(SignKeyKES (PraosKES c))
     
HotKeyPoisoned 

Instances

Instances details
PraosCrypto c ⇒ Show (HotKey c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

showsPrecIntHotKey c → ShowS Source #

showHotKey c → String Source #

showList ∷ [HotKey c] → ShowS Source #

Generic (HotKey c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (HotKey c) ∷ TypeType Source #

Methods

fromHotKey c → Rep (HotKey c) x Source #

toRep (HotKey c) x → HotKey c Source #

PraosCrypto c ⇒ NoThunks (HotKey c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → HotKey c → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → HotKey c → IO (Maybe ThunkInfo) #

showTypeOfProxy (HotKey c) → String #

type Rep (HotKey c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep (HotKey c) = D1 ('MetaData "HotKey" "Ouroboros.Consensus.Mock.Protocol.Praos" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "HotKey" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Period) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyKES (PraosKES c)))) :+: C1 ('MetaCons "HotKeyPoisoned" 'PrefixI 'False) (U1TypeType))

newtype HotKeyEvolutionError Source #

The HotKey could not be evolved to the given Period.

Constructors

HotKeyEvolutionError Period 

data Praos c Source #

An uninhabited type representing the Praos protocol.

Instances

Instances details
Generic (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (ConsensusConfig (Praos c)) ∷ TypeType Source #

PraosCrypto c ⇒ ConsensusProtocol (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

PraosCrypto c ⇒ NoThunks (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → ConsensusConfig (Praos c) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ConsensusConfig (Praos c) → IO (Maybe ThunkInfo) #

showTypeOfProxy (ConsensusConfig (Praos c)) → String #

type Rep (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep (ConsensusConfig (Praos c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Mock.Protocol.Praos" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PraosConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "praosParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PraosParams) :*: (S1 ('MetaSel ('Just "praosInitialEta") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "praosInitialStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StakeDist))) :*: (S1 ('MetaSel ('Just "praosEvolvingStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PraosEvolvingStake) :*: (S1 ('MetaSel ('Just "praosSignKeyVRF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyVRF (PraosVRF c))) :*: S1 ('MetaSel ('Just "praosVerKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map CoreNodeId (VerKeyKES (PraosKES c), VerKeyVRF (PraosVRF c))))))))
data ConsensusConfig (Praos c) Source #

The configuration that will be provided to every node when running the MockPraos protocol.

Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type ValidateView (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type ValidationErr (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type LedgerView (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type LedgerView (Praos c) = ()
type SelectView (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type CanBeLeader (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type IsLeader (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type IsLeader (Praos c)
type ChainDepState (Praos c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

newtype PraosChainDepState c Source #

The chain dependent state, in this case as it is a mock, we just will store a list of BlockInfos that allow us to look into the past.

Constructors

PraosChainDepState 

Fields

Instances

Instances details
PraosCrypto c ⇒ Eq (PraosChainDepState c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

PraosCrypto c ⇒ Show (PraosChainDepState c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

PraosCrypto c ⇒ Serialise (PraosChainDepState c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

encodePraosChainDepState c → Encoding #

decode ∷ Decoder s (PraosChainDepState c) #

encodeList ∷ [PraosChainDepState c] → Encoding #

decodeList ∷ Decoder s [PraosChainDepState c] #

PraosCrypto c ⇒ NoThunks (PraosChainDepState c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → PraosChainDepState c → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PraosChainDepState c → IO (Maybe ThunkInfo) #

showTypeOfProxy (PraosChainDepState c) → String #

PraosCrypto c' ⇒ EncodeDisk (SimplePraosBlock c c') (PraosChainDepState c') Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block.Praos

Methods

encodeDiskCodecConfig (SimplePraosBlock c c') → PraosChainDepState c' → Encoding Source #

PraosCrypto c' ⇒ DecodeDisk (SimplePraosBlock c c') (PraosChainDepState c') Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block.Praos

Methods

decodeDiskCodecConfig (SimplePraosBlock c c') → ∀ s. Decoder s (PraosChainDepState c') Source #

data Ticked (PraosChainDepState c) Source #

Ticking the Praos chain dep state has no effect

For the real Praos implementation, ticking is crucial, as it determines the point where the "nonce under construction" is swapped out for the "active" nonce. However, for the mock implementation, we keep the full history, and choose the right nonce from that; this means that ticking has no effect.

We do however need access to the ticked stake distribution.

Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

newtype PraosEvolvingStake Source #

An association from epoch to stake distributions.

Should be used when checking if someone is the leader of a particular slot. This is sufficiently good for a mock protocol as far as consensus is concerned. It is not strictly necessary that the stake distribution is computed from previous epochs, as we just need to consider that:

1) an attacker cannot influence it. 2) all the nodes agree on the same value for each Slot.

Each pair stores the stake distribution established by the end of the epoch in the first item of the pair. See latestEvolvedStakeDistAsOfEpoch for the intended interface.

If no value is returned, that means we are checking the stake before any changes have happened so we should consult instead the praosInitialStake.

data PraosExtraFields c Source #

Fields that should be included in the signature

Constructors

PraosExtraFields 

Fields

Instances

Instances details
PraosCrypto c ⇒ Eq (PraosExtraFields c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

PraosCrypto c ⇒ Show (PraosExtraFields c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Generic (PraosExtraFields c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (PraosExtraFields c) ∷ TypeType Source #

PraosCrypto c ⇒ NoThunks (PraosExtraFields c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → PraosExtraFields c → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PraosExtraFields c → IO (Maybe ThunkInfo) #

showTypeOfProxy (PraosExtraFields c) → String #

type Rep (PraosExtraFields c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

data PraosFields crypto typeBeingSigned Source #

The fields that Praos required in the header

Constructors

PraosFields 

Fields

Instances

Instances details
PraosCrypto c ⇒ Eq (PraosFields c toSign) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

(==)PraosFields c toSign → PraosFields c toSign → Bool Source #

(/=)PraosFields c toSign → PraosFields c toSign → Bool Source #

PraosCrypto c ⇒ Show (PraosFields c toSign) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

showsPrecIntPraosFields c toSign → ShowS Source #

showPraosFields c toSign → String Source #

showList ∷ [PraosFields c toSign] → ShowS Source #

Generic (PraosFields crypto typeBeingSigned) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (PraosFields crypto typeBeingSigned) ∷ TypeType Source #

Methods

fromPraosFields crypto typeBeingSigned → Rep (PraosFields crypto typeBeingSigned) x Source #

toRep (PraosFields crypto typeBeingSigned) x → PraosFields crypto typeBeingSigned Source #

PraosCrypto c ⇒ Condense (PraosFields c toSign) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

condensePraosFields c toSign → String Source #

(PraosCrypto c, Typeable toSign) ⇒ NoThunks (PraosFields c toSign) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → PraosFields c toSign → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PraosFields c toSign → IO (Maybe ThunkInfo) #

showTypeOfProxy (PraosFields c toSign) → String #

type Rep (PraosFields crypto typeBeingSigned) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep (PraosFields crypto typeBeingSigned) = D1 ('MetaData "PraosFields" "Ouroboros.Consensus.Mock.Protocol.Praos" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PraosFields" 'PrefixI 'True) (S1 ('MetaSel ('Just "praosSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SignedKES (PraosKES crypto) typeBeingSigned)) :*: S1 ('MetaSel ('Just "praosExtraFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PraosExtraFields crypto))))

data PraosParams Source #

Praos parameters that are node independent

Constructors

PraosParams 

Fields

Instances

Instances details
Generic PraosParams Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep PraosParamsTypeType Source #

NoThunks PraosParams Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → PraosParamsIO (Maybe ThunkInfo) #

wNoThunks ∷ Context → PraosParamsIO (Maybe ThunkInfo) #

showTypeOfProxy PraosParamsString #

type Rep PraosParams Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep PraosParams = D1 ('MetaData "PraosParams" "Ouroboros.Consensus.Mock.Protocol.Praos" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PraosParams" 'PrefixI 'True) (S1 ('MetaSel ('Just "praosLeaderF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "praosSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecurityParam) :*: S1 ('MetaSel ('Just "praosSlotsPerEpoch") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64))))

evolveKeyPraosCrypto c ⇒ SlotNoHotKey c → (HotKey c, UpdateInfo (HotKey c) HotKeyEvolutionError) Source #

To be used in conjunction with, e.g., updateMVar.

NOTE: when the key's period is after the target period, we shouldn't use it, but we currently do. In real TPraos we check this in tpraosCheckCanForge.

forgePraosFields ∷ (PraosCrypto c, Signable (PraosKES c) toSign, HasCallStack) ⇒ PraosProof c → HotKey c → (PraosExtraFields c → toSign) → PraosFields c toSign Source #

Create a PraosFields using a proof, a key and the data to be signed.

It is done by signing whatever is extracted from the extra fields by mkToSign and storing the signature and the extra fields on a PraosFields.

Tags

class (KESAlgorithm (PraosKES c), VRFAlgorithm (PraosVRF c), HashAlgorithm (PraosHash c), Typeable c, Typeable (PraosVRF c), Condense (SigKES (PraosKES c)), Signable (PraosVRF c) (Natural, SlotNo, VRFType), ContextKES (PraosKES c) ~ (), ContextVRF (PraosVRF c) ~ ()) ⇒ PraosCrypto (c ∷ Type) Source #

Associated Types

type PraosKES c ∷ Type Source #

type PraosVRF c ∷ Type Source #

type PraosHash c ∷ Type Source #

data PraosValidateView c Source #

A validate view is an association from the (signed) value to the PraosFields that contains the signature that sign it.

In this mock implementation, this could have been simplified to use SignedSimplePraos but from the consensus point of view, it is not relevant which actual value is being signed, that's why we use the existential.

Constructors

∀ signed.Signable (PraosKES c) signed ⇒ PraosValidateView (PraosFields c signed) signed 

data PraosValidationError c Source #

An error that can arise during validation

praosValidateView ∷ (SignedHeader hdr, Signable (PraosKES c) (Signed hdr)) ⇒ (hdr → PraosFields c (Signed hdr)) → hdr → PraosValidateView c Source #

Convenience constructor for PraosValidateView

Type instances

data BlockInfo c Source #

Constructors

BlockInfo 

Fields

Instances

Instances details
PraosCrypto c ⇒ Eq (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

(==)BlockInfo c → BlockInfo c → Bool Source #

(/=)BlockInfo c → BlockInfo c → Bool Source #

PraosCrypto c ⇒ Show (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Generic (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (BlockInfo c) ∷ TypeType Source #

Methods

fromBlockInfo c → Rep (BlockInfo c) x Source #

toRep (BlockInfo c) x → BlockInfo c Source #

PraosCrypto c ⇒ Serialise (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

encodeBlockInfo c → Encoding #

decode ∷ Decoder s (BlockInfo c) #

encodeList ∷ [BlockInfo c] → Encoding #

decodeList ∷ Decoder s [BlockInfo c] #

PraosCrypto c ⇒ NoThunks (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → BlockInfo c → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → BlockInfo c → IO (Maybe ThunkInfo) #

showTypeOfProxy (BlockInfo c) → String #

type Rep (BlockInfo c) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep (BlockInfo c)

data family ConsensusConfig p Source #

Static configuration required to run the consensus protocol

Every method in the ConsensusProtocol class takes the consensus configuration as a parameter, so having this as a data family rather than a type family resolves most ambiguity.

Defined out of the class so that protocols can define this type without having to define the entire protocol at the same time (or indeed in the same module).

Instances

Instances details
Generic (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

Associated Types

type Rep (ConsensusConfig (PBft c)) ∷ TypeType Source #

Generic (ConsensusConfig (Bft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

Associated Types

type Rep (ConsensusConfig (Bft c)) ∷ TypeType Source #

Generic (ConsensusConfig (WithLeaderSchedule p)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.LeaderSchedule

Associated Types

type Rep (ConsensusConfig (WithLeaderSchedule p)) ∷ TypeType Source #

Generic (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Associated Types

type Rep (ConsensusConfig (Praos c)) ∷ TypeType Source #

NoThunks (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

Methods

noThunks ∷ Context → ConsensusConfig (PBft c) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ConsensusConfig (PBft c) → IO (Maybe ThunkInfo) #

showTypeOfProxy (ConsensusConfig (PBft c)) → String #

BftCrypto c ⇒ NoThunks (ConsensusConfig (Bft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

Methods

noThunks ∷ Context → ConsensusConfig (Bft c) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ConsensusConfig (Bft c) → IO (Maybe ThunkInfo) #

showTypeOfProxy (ConsensusConfig (Bft c)) → String #

ConsensusProtocol p ⇒ NoThunks (ConsensusConfig (WithLeaderSchedule p)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.LeaderSchedule

Methods

noThunks ∷ Context → ConsensusConfig (WithLeaderSchedule p) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ConsensusConfig (WithLeaderSchedule p) → IO (Maybe ThunkInfo) #

showTypeOfProxy (ConsensusConfig (WithLeaderSchedule p)) → String #

PraosCrypto c ⇒ NoThunks (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

Methods

noThunks ∷ Context → ConsensusConfig (Praos c) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → ConsensusConfig (Praos c) → IO (Maybe ThunkInfo) #

showTypeOfProxy (ConsensusConfig (Praos c)) → String #

type Rep (ConsensusConfig (PBft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

type Rep (ConsensusConfig (PBft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.PBFT" "ouroboros-consensus-0.1.0.0-inplace" 'True) (C1 ('MetaCons "PBftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "pbftParams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PBftParams)))
type Rep (ConsensusConfig (Bft c)) 
Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

type Rep (ConsensusConfig (Bft c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Protocol.BFT" "ouroboros-consensus-0.1.0.0-inplace" 'False) (C1 ('MetaCons "BftConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "bftParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BftParams) :*: (S1 ('MetaSel ('Just "bftSignKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyDSIGN (BftDSIGN c))) :*: S1 ('MetaSel ('Just "bftVerKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map NodeId (VerKeyDSIGN (BftDSIGN c)))))))
type Rep (ConsensusConfig (WithLeaderSchedule p)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.LeaderSchedule

type Rep (ConsensusConfig (WithLeaderSchedule p)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Mock.Protocol.LeaderSchedule" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "WLSConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "wlsConfigSchedule") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 LeaderSchedule) :*: (S1 ('MetaSel ('Just "wlsConfigP") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ConsensusConfig p)) :*: S1 ('MetaSel ('Just "wlsConfigNodeId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CoreNodeId))))
type Rep (ConsensusConfig (Praos c)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type Rep (ConsensusConfig (Praos c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Mock.Protocol.Praos" "ouroboros-consensus-mock-0.1.0.0-inplace" 'False) (C1 ('MetaCons "PraosConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "praosParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PraosParams) :*: (S1 ('MetaSel ('Just "praosInitialEta") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "praosInitialStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StakeDist))) :*: (S1 ('MetaSel ('Just "praosEvolvingStake") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PraosEvolvingStake) :*: (S1 ('MetaSel ('Just "praosSignKeyVRF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SignKeyVRF (PraosVRF c))) :*: S1 ('MetaSel ('Just "praosVerKeys") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map CoreNodeId (VerKeyKES (PraosKES c), VerKeyVRF (PraosVRF c))))))))
newtype ConsensusConfig (PBft c)

(Static) node configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data ConsensusConfig (Bft c)

(Static) node configuration

Instance details

Defined in Ouroboros.Consensus.Protocol.BFT

data ConsensusConfig (Bft c) = BftConfig {}
data ConsensusConfig (WithLeaderSchedule p) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.LeaderSchedule

data ConsensusConfig (Praos c) Source #

The configuration that will be provided to every node when running the MockPraos protocol.

Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

data family Ticked st Source #

" Ticked " piece of state (LedgerState, LedgerView, ChainIndepState)

Ticking refers to the passage of time (the ticking of the clock). When a piece of state is marked as ticked, it means that time-related changes have been applied to the state (or forecast).

Some examples of time related changes:

  • Scheduled delegations might have been applied in Byron
  • New leader schedule computed for Shelley
  • Transition from Byron to Shelley activated in the hard fork combinator.
  • Nonces switched out at the start of a new epoch.

Instances

Instances details
(SimpleCrypto c, Typeable ext) ⇒ Eq (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Show (Ticked ()) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecIntTicked () → ShowS Source #

showTicked () → String Source #

showList ∷ [Ticked ()] → ShowS Source #

(SimpleCrypto c, Typeable ext) ⇒ Show (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Show (Ticked a) ⇒ Show (Ticked (K a x)) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecIntTicked (K a x) → ShowS Source #

showTicked (K a x) → String Source #

showList ∷ [Ticked (K a x)] → ShowS Source #

Generic (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Associated Types

type Rep (Ticked (LedgerState (SimpleBlock c ext))) ∷ TypeType Source #

IsLedger l ⇒ GetTip (Ticked (LedgerDB l)) 
Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

Methods

getTipTicked (LedgerDB l) → Point (Ticked (LedgerDB l)) Source #

IsLedger (LedgerState blk) ⇒ GetTip (Ticked (ExtLedgerState blk)) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

GetTip (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

(SimpleCrypto c, Typeable ext) ⇒ NoThunks (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

Methods

noThunks ∷ Context → Ticked (LedgerState (SimpleBlock c ext)) → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → Ticked (LedgerState (SimpleBlock c ext)) → IO (Maybe ThunkInfo) #

showTypeOfProxy (Ticked (LedgerState (SimpleBlock c ext))) → String #

Show (Ticked (f a)) ⇒ Show ((Ticked :.: f) a) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

showsPrecInt → (Ticked :.: f) a → ShowS Source #

show ∷ (Ticked :.: f) a → String Source #

showList ∷ [(Ticked :.: f) a] → ShowS Source #

NoThunks (Ticked (f a)) ⇒ NoThunks ((Ticked :.: f) a) 
Instance details

Defined in Ouroboros.Consensus.Ticked

Methods

noThunks ∷ Context → (Ticked :.: f) a → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → (Ticked :.: f) a → IO (Maybe ThunkInfo) #

showTypeOfProxy ((Ticked :.: f) a) → String #

data Ticked () 
Instance details

Defined in Ouroboros.Consensus.Ticked

type Rep (Ticked (LedgerState (SimpleBlock c ext))) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

type Rep (Ticked (LedgerState (SimpleBlock c ext))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Mock.Ledger.Block" "ouroboros-consensus-mock-0.1.0.0-inplace" 'True) (C1 ('MetaCons "TickedSimpleLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "getTickedSimpleLedgerState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (LedgerState (SimpleBlock c ext)))))
newtype Ticked (PBftLedgerView c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data Ticked (PBftState c) 
Instance details

Defined in Ouroboros.Consensus.Protocol.PBFT

data Ticked (LedgerDB l)

Ticking the ledger DB just ticks the current state

We don't push the new state into the DB until we apply a block.

Instance details

Defined in Ouroboros.Consensus.Storage.LedgerDB.InMemory

data Ticked (ExtLedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Extended

newtype Ticked (WrapChainDepState blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

newtype Ticked (WrapLedgerView blk) 
Instance details

Defined in Ouroboros.Consensus.TypeFamilyWrappers

data Ticked (HeaderState blk) 
Instance details

Defined in Ouroboros.Consensus.HeaderValidation

newtype Ticked (LedgerState (SimpleBlock c ext)) Source # 
Instance details

Defined in Ouroboros.Consensus.Mock.Ledger.Block

data Ticked (PraosChainDepState c) Source #

Ticking the Praos chain dep state has no effect

For the real Praos implementation, ticking is crucial, as it determines the point where the "nonce under construction" is swapped out for the "active" nonce. However, for the mock implementation, we keep the full history, and choose the right nonce from that; this means that ticking has no effect.

We do however need access to the ticked stake distribution.

Instance details

Defined in Ouroboros.Consensus.Mock.Protocol.Praos

type HeaderHash (Ticked l) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

newtype Ticked (K a x) 
Instance details

Defined in Ouroboros.Consensus.Ticked

newtype Ticked (K a x) = TickedK {}