Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MaxMajorProtVer = MaxMajorProtVer { }
-
data
ProtocolParamsAllegra
c =
ProtocolParamsAllegra
{
- allegraProtVer :: ProtVer
- allegraMaxTxCapacityOverrides :: Overrides ( ShelleyBlock ( TPraos c) ( AllegraEra c))
-
data
ProtocolParamsAlonzo
c =
ProtocolParamsAlonzo
{
- alonzoProtVer :: ProtVer
- alonzoMaxTxCapacityOverrides :: Overrides ( ShelleyBlock ( TPraos c) ( AlonzoEra c))
-
data
ProtocolParamsMary
c =
ProtocolParamsMary
{
- maryProtVer :: ProtVer
- maryMaxTxCapacityOverrides :: Overrides ( ShelleyBlock ( TPraos c) ( MaryEra c))
-
data
ProtocolParamsShelley
c =
ProtocolParamsShelley
{
- shelleyProtVer :: ProtVer
- shelleyMaxTxCapacityOverrides :: Overrides ( ShelleyBlock ( TPraos c) ( ShelleyEra c))
- data ProtocolParamsShelleyBased era = ProtocolParamsShelleyBased { }
-
data
Nonce
- = Nonce !( Hash Blake2b_256 Nonce )
- | NeutralNonce
- data ProtVer = ProtVer { }
-
data
ShelleyGenesis
era =
ShelleyGenesis
{
- sgSystemStart :: ! UTCTime
- sgNetworkMagic :: ! Word32
- sgNetworkId :: ! Network
- sgActiveSlotsCoeff :: ! PositiveUnitInterval
- sgSecurityParam :: ! Word64
- sgEpochLength :: ! EpochSize
- sgSlotsPerKESPeriod :: ! Word64
- sgMaxKESEvolutions :: ! Word64
- sgSlotLength :: ! NominalDiffTime
- sgUpdateQuorum :: ! Word64
- sgMaxLovelaceSupply :: ! Word64
- sgProtocolParams :: !( PParams era)
- sgGenDelegs :: !( Map ( KeyHash ' Genesis ( Crypto era)) ( GenDelegPair ( Crypto era)))
- sgInitialFunds :: !( Map ( Addr ( Crypto era)) Coin )
- sgStaking :: !( ShelleyGenesisStaking ( Crypto era))
- data ShelleyGenesisStaking crypto = ShelleyGenesisStaking { }
- emptyGenesisStaking :: ShelleyGenesisStaking crypto
- data ShelleyLeaderCredentials c = ShelleyLeaderCredentials { }
- protocolInfoShelley :: forall m c. ( IOLike m, PraosCrypto c, ShelleyCompatible ( TPraos c) ( ShelleyEra c), TxLimits ( ShelleyBlock ( TPraos c) ( ShelleyEra c))) => ProtocolParamsShelleyBased ( ShelleyEra c) -> ProtocolParamsShelley c -> ProtocolInfo m ( ShelleyBlock ( TPraos c) ( ShelleyEra c))
- protocolInfoTPraosShelleyBased :: forall m era c. ( IOLike m, PraosCrypto c, ShelleyCompatible ( TPraos c) era, TxLimits ( ShelleyBlock ( TPraos c) era), c ~ EraCrypto era) => ProtocolParamsShelleyBased era -> TranslationContext era -> ProtVer -> Overrides ( ShelleyBlock ( TPraos c) era) -> ProtocolInfo m ( ShelleyBlock ( TPraos c) era)
- registerGenesisStaking :: forall era. ShelleyBasedEra era => ShelleyGenesisStaking ( EraCrypto era) -> NewEpochState era -> NewEpochState era
- registerInitialFunds :: forall era. ( ShelleyBasedEra era, HasCallStack ) => Map ( Addr ( EraCrypto era)) Coin -> NewEpochState era -> NewEpochState era
- shelleyBlockForging :: forall m era c. ( ShelleyCompatible ( TPraos c) era, PraosCrypto c, c ~ EraCrypto era, TxLimits ( ShelleyBlock ( TPraos c) era), IOLike m) => TPraosParams -> Overrides ( ShelleyBlock ( TPraos c) era) -> ShelleyLeaderCredentials ( EraCrypto era) -> m ( BlockForging m ( ShelleyBlock ( TPraos c) era))
- shelleySharedBlockForging :: forall m c era. ( PraosCrypto c, ShelleyEraWithCrypto c ( TPraos c) era, IOLike m) => HotKey c m -> ( SlotNo -> KESPeriod ) -> ShelleyLeaderCredentials c -> Overrides ( ShelleyBlock ( TPraos c) era) -> BlockForging m ( ShelleyBlock ( TPraos c) era)
- validateGenesis :: ShelleyBasedEra era => ShelleyGenesis era -> Either String ()
Documentation
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 .
Instances
Eq MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common (==) :: MaxMajorProtVer -> MaxMajorProtVer -> Bool Source # (/=) :: MaxMajorProtVer -> MaxMajorProtVer -> Bool Source # |
|
Show MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common |
|
Generic MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common from :: MaxMajorProtVer -> Rep MaxMajorProtVer x Source # to :: Rep MaxMajorProtVer x -> MaxMajorProtVer Source # |
|
NoThunks MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common |
|
type Rep MaxMajorProtVer | |
Defined in Ouroboros.Consensus.Protocol.Praos.Common
type
Rep
MaxMajorProtVer
=
D1
('
MetaData
"MaxMajorProtVer" "Ouroboros.Consensus.Protocol.Praos.Common" "ouroboros-consensus-protocol-0.1.0.1-zKRBoYOfUlKsvZd6xB0lb" '
True
) (
C1
('
MetaCons
"MaxMajorProtVer" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"getMaxMajorProtVer") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedLazy
) (
Rec0
Natural
)))
|
data ProtocolParamsAllegra c Source #
Parameters needed to run Allegra
data ProtocolParamsAlonzo c Source #
Parameters needed to run Alonzo
ProtocolParamsAlonzo | |
|
data ProtocolParamsMary c Source #
Parameters needed to run Mary
ProtocolParamsMary | |
|
data ProtocolParamsShelley c Source #
Parameters needed to run Shelley
data ProtocolParamsShelleyBased era Source #
Parameters common to all Shelley-based ledgers.
When running a chain with multiple Shelley-based eras, in addition to the
per-era protocol parameters, one value of
ProtocolParamsShelleyBased
will
be needed, which is shared among all Shelley-based eras.
The
era
parameter determines from which era the genesis config will be
used.
ProtocolParamsShelleyBased | |
|
Evolving nonce type.
Nonce !( Hash Blake2b_256 Nonce ) | |
NeutralNonce |
Identity element |
Instances
Eq Nonce | |
Ord Nonce | |
Defined in Cardano.Ledger.BaseTypes |
|
Show Nonce | |
Generic Nonce | |
NFData Nonce | |
Defined in Cardano.Ledger.BaseTypes |
|
ToJSON Nonce | |
FromJSON Nonce | |
ToCBOR Nonce | |
FromCBOR Nonce | |
NoThunks Nonce | |
type Rep Nonce | |
Defined in Cardano.Ledger.BaseTypes
type
Rep
Nonce
=
D1
('
MetaData
"Nonce" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-0.1.0.0-3EJt5rxsPizAWHDEqGPh9V" '
False
) (
C1
('
MetaCons
"Nonce" '
PrefixI
'
False
) (
S1
('
MetaSel
('
Nothing
::
Maybe
Symbol
) '
NoSourceUnpackedness
'
SourceStrict
'
DecidedStrict
) (
Rec0
(
Hash
Blake2b_256
Nonce
)))
:+:
C1
('
MetaCons
"NeutralNonce" '
PrefixI
'
False
) (
U1
::
Type
->
Type
))
|
Instances
data ShelleyGenesis era Source #
Shelley genesis information
Note that this is needed only for a pure Shelley network, hence it being defined here rather than in its own module. In mainnet, Shelley will transition naturally from Byron, and thus will never have its own genesis information.
ShelleyGenesis | |
|
Instances
data ShelleyGenesisStaking crypto Source #
Genesis Shelley staking configuration.
This allows us to configure some initial stake pools and delegation to them, in order to test Praos in a static configuration, without requiring on-chain registration and delegation.
For simplicity, pools defined in the genesis staking do not pay deposits for their registration.
ShelleyGenesisStaking | |
|
Instances
emptyGenesisStaking :: ShelleyGenesisStaking crypto Source #
Empty genesis staking
data ShelleyLeaderCredentials c Source #
ShelleyLeaderCredentials | |
|
protocolInfoShelley :: forall m c. ( IOLike m, PraosCrypto c, ShelleyCompatible ( TPraos c) ( ShelleyEra c), TxLimits ( ShelleyBlock ( TPraos c) ( ShelleyEra c))) => ProtocolParamsShelleyBased ( ShelleyEra c) -> ProtocolParamsShelley c -> ProtocolInfo m ( ShelleyBlock ( TPraos c) ( ShelleyEra c)) Source #
protocolInfoTPraosShelleyBased :: forall m era c. ( IOLike m, PraosCrypto c, ShelleyCompatible ( TPraos c) era, TxLimits ( ShelleyBlock ( TPraos c) era), c ~ EraCrypto era) => ProtocolParamsShelleyBased era -> TranslationContext era -> ProtVer -> Overrides ( ShelleyBlock ( TPraos c) era) -> ProtocolInfo m ( ShelleyBlock ( TPraos c) era) Source #
registerGenesisStaking :: forall era. ShelleyBasedEra era => ShelleyGenesisStaking ( EraCrypto era) -> NewEpochState era -> NewEpochState era Source #
Register the initial staking information in the
NewEpochState
.
HERE BE DRAGONS! This function is intended to help in testing.
In production, the genesis should not contain any initial staking.
Any existing staking information is overridden, but the UTxO is left untouched.
TODO adapt and reuse
registerGenesisStaking
from
cardano-ledger-specs
.
registerInitialFunds :: forall era. ( ShelleyBasedEra era, HasCallStack ) => Map ( Addr ( EraCrypto era)) Coin -> NewEpochState era -> NewEpochState era Source #
Register the initial funds in the
NewEpochState
.
HERE BE DRAGONS! This function is intended to help in testing.
In production, the genesis should not contain any initial funds.
The given funds are added to the existing UTxO.
PRECONDITION: the given funds must not be part of the existing UTxO. > forall (addr, _) in initialFunds. > Map.notElem (SL.initialFundsPseudoTxIn addr) existingUTxO
PROPERTY: > genesisUTxO genesis > == genesisUTxO' (sgInitialFunds genesis) > == extractUTxO (registerInitialFunds (sgInitialFunds genesis) > NewEpochState )
TODO move to
cardano-ledger-specs
.
shelleyBlockForging :: forall m era c. ( ShelleyCompatible ( TPraos c) era, PraosCrypto c, c ~ EraCrypto era, TxLimits ( ShelleyBlock ( TPraos c) era), IOLike m) => TPraosParams -> Overrides ( ShelleyBlock ( TPraos c) era) -> ShelleyLeaderCredentials ( EraCrypto era) -> m ( BlockForging m ( ShelleyBlock ( TPraos c) era)) Source #
Create a
BlockForging
record for a single era.
In case the same credentials should be shared across multiple Shelley-based
eras, use
shelleySharedBlockForging
.
shelleySharedBlockForging :: forall m c era. ( PraosCrypto c, ShelleyEraWithCrypto c ( TPraos c) era, IOLike m) => HotKey c m -> ( SlotNo -> KESPeriod ) -> ShelleyLeaderCredentials c -> Overrides ( ShelleyBlock ( TPraos c) era) -> BlockForging m ( ShelleyBlock ( TPraos c) era) Source #
Create a
BlockForging
record safely using a given
Hotkey
.
The name of the era (separated by a
_
) will be appended to each
forgeLabel
.
validateGenesis :: ShelleyBasedEra era => ShelleyGenesis era -> Either String () Source #
Check the validity of the genesis config. To be used in conjunction with
assertWithMsg
.