Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Protocol
Contents
Description
Transitional Praos.
Transitional praos allows for the overlaying of Praos with an overlay schedule determining slots to be produced by BFT
Synopsis
- data TPraos c
- data TPraosState c = TPraosState {}
- data TPraosChainSelectView c = TPraosChainSelectView {
- csvChainLength :: BlockNo
- csvSlotNo :: SlotNo
- csvSelfIssued :: SelfIssued
- csvIssuer :: VKey 'BlockIssuer c
- csvIssueNo :: Word64
- csvLeaderVRF :: OutputVRF (VRF c)
- data SelfIssued
- data TPraosFields c toSign = TPraosFields {
- tpraosSignature :: SignedKES c toSign
- tpraosToSign :: toSign
- forgeTPraosFields :: (PraosCrypto c, KESignable c toSign, Monad m) => HotKey c m -> CanBeLeader (TPraos c) -> IsLeader (TPraos c) -> (TPraosToSign c -> toSign) -> m (TPraosFields c toSign)
- data TPraosToSign c = TPraosToSign {}
- type TPraosValidateView c = BHeader c
- data TPraosParams = TPraosParams {}
- mkTPraosParams :: MaxMajorProtVer -> Nonce -> ShelleyGenesis era -> TPraosParams
- data TPraosCanBeLeader c = TPraosCanBeLeader {
- tpraosCanBeLeaderOpCert :: !(OCert c)
- tpraosCanBeLeaderColdVerKey :: !(VKey 'BlockIssuer c)
- tpraosCanBeLeaderSignKeyVRF :: !(SignKeyVRF c)
- data TPraosIsLeader c = TPraosIsLeader {}
- mkShelleyGlobals :: EpochInfo Identity -> TPraosParams -> Globals
- newtype MaxMajorProtVer = MaxMajorProtVer {}
- class (Crypto c, DSignable c (OCertSignable c), DSignable c (Hash c EraIndependentTxBody), KESignable c (BHBody c), VRFSignable c Seed) => PraosCrypto c
- data StandardCrypto
- data TPraosCannotForge c
- = TPraosCannotForgeKeyNotUsableYet !KESPeriod !KESPeriod
- | TPraosCannotForgeWrongVRF !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c))
- tpraosCheckCanForge :: ConsensusConfig (TPraos c) -> Hash c (VerKeyVRF c) -> SlotNo -> IsLeader (TPraos c) -> KESInfo -> Either (TPraosCannotForge c) ()
- data family ConsensusConfig p
- data family Ticked st
Documentation
Instances
data TPraosState c Source #
Transitional Praos consensus state.
In addition to the ChainDepState
provided by the ledger, we track the slot
number of the last applied header.
Constructors
TPraosState | |
Fields
|
Instances
data TPraosChainSelectView c Source #
View of the ledger tip for chain selection.
We order between chains as follows:
- By chain length, with longer chains always preferred.
- If the tip of each chain has the same slot number, we prefer the one tip that we produced ourselves.
- If the tip of each chain was issued by the same agent, then we prefer the chain whose tip has the highest ocert issue number.
- By the leader value of the chain tip, with lower values preferred.
Constructors
TPraosChainSelectView | |
Fields
|
Instances
data SelfIssued Source #
Constructors
SelfIssued | A block we produced ourself |
NotSelfIssued | A block produced by another node |
Instances
Eq SelfIssued Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol | |
Ord SelfIssued Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol Methods compare :: SelfIssued -> SelfIssued -> Ordering # (<) :: SelfIssued -> SelfIssued -> Bool # (<=) :: SelfIssued -> SelfIssued -> Bool # (>) :: SelfIssued -> SelfIssued -> Bool # (>=) :: SelfIssued -> SelfIssued -> Bool # max :: SelfIssued -> SelfIssued -> SelfIssued # min :: SelfIssued -> SelfIssued -> SelfIssued # | |
Show SelfIssued Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol Methods showsPrec :: Int -> SelfIssued -> ShowS # show :: SelfIssued -> String # showList :: [SelfIssued] -> ShowS # |
data TPraosFields c toSign Source #
Constructors
TPraosFields | |
Fields
|
Instances
forgeTPraosFields :: (PraosCrypto c, KESignable c toSign, Monad m) => HotKey c m -> CanBeLeader (TPraos c) -> IsLeader (TPraos c) -> (TPraosToSign c -> toSign) -> m (TPraosFields c toSign) Source #
data TPraosToSign c Source #
Fields arising from transitional praos execution which must be included in the block signature.
Constructors
TPraosToSign | |
Fields
|
Instances
type TPraosValidateView c = BHeader c Source #
Because we are using the executable spec, rather than implementing the protocol directly here, we have a fixed header type rather than an abstraction. So our validate view is fixed to this.
data TPraosParams Source #
TPraos parameters that are node independent
Constructors
TPraosParams | |
Fields
|
Instances
Arguments
:: MaxMajorProtVer | |
-> Nonce | Initial nonce |
-> ShelleyGenesis era | |
-> TPraosParams |
data TPraosCanBeLeader c Source #
Constructors
TPraosCanBeLeader | |
Fields
|
Instances
data TPraosIsLeader c Source #
Assembled proof that the issuer has the right to issue a block in the selected slot.
Constructors
TPraosIsLeader | |
Fields
|
Instances
mkShelleyGlobals :: EpochInfo Identity -> TPraosParams -> Globals Source #
newtype MaxMajorProtVer Source #
The maximum major protocol version.
Must be at least the current major protocol version. For Cardano mainnet, the Shelley era has major protocol verison 2.
Constructors
MaxMajorProtVer | |
Fields |
Instances
Crypto
class (Crypto c, DSignable c (OCertSignable c), DSignable c (Hash c EraIndependentTxBody), KESignable c (BHBody c), VRFSignable c Seed) => PraosCrypto c Source #
Instances
data StandardCrypto Source #
Instances
PraosCrypto StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto | |
Crypto StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto Associated Types type HASH StandardCrypto Source # type ADDRHASH StandardCrypto Source # type DSIGN StandardCrypto Source # type KES StandardCrypto Source # type VRF StandardCrypto Source # | |
type VRF StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto | |
type KES StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto | |
type DSIGN StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto | |
type ADDRHASH StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto | |
type HASH StandardCrypto Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol.Crypto |
CannotForge
data TPraosCannotForge c Source #
Expresses that, whilst we believe ourselves to be a leader for this slot, we are nonetheless unable to forge a block.
Constructors
TPraosCannotForgeKeyNotUsableYet | The KES key in our operational certificate can't be used because the current (wall clock) period is before the start period of the key. current KES period. Note: the opposite case, i.e., the wall clock period being after the
end period of the key, is caught when trying to update the key in
|
TPraosCannotForgeWrongVRF !(Hash c (VerKeyVRF c)) !(Hash c (VerKeyVRF c)) | We are a genesis delegate, but our VRF key (second argument) does not match the registered key for that delegate (first argument). |
Instances
Arguments
:: ConsensusConfig (TPraos c) | |
-> Hash c (VerKeyVRF c) | Precomputed hash of the VRF verification key |
-> SlotNo | |
-> IsLeader (TPraos c) | |
-> KESInfo | |
-> Either (TPraosCannotForge c) () |
Type instances
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
Generic (ConsensusConfig (TPraos c)) Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol Methods from :: ConsensusConfig (TPraos c) -> Rep (ConsensusConfig (TPraos c)) x # to :: Rep (ConsensusConfig (TPraos c)) x -> ConsensusConfig (TPraos c) # | |
PraosCrypto c => NoThunks (ConsensusConfig (TPraos c)) Source # | |
type Rep (ConsensusConfig (TPraos c)) Source # | |
Defined in Ouroboros.Consensus.Shelley.Protocol type Rep (ConsensusConfig (TPraos c)) = D1 ('MetaData "ConsensusConfig" "Ouroboros.Consensus.Shelley.Protocol" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "TPraosConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "tpraosParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TPraosParams) :*: S1 ('MetaSel ('Just "tpraosEpochInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochInfo Identity)))) | |
data ConsensusConfig (TPraos c) Source # | Static configuration |
Defined in Ouroboros.Consensus.Shelley.Protocol |
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.