Safe Haskell | None |
---|---|
Language | Haskell2010 |
The various Bcc protocol parameters, including:
- the current values of updateable protocol parameters:
ProtocolParameters
- updates to protocol parameters:
ProtocolParametersUpdate
- update proposals that can be embedded in transactions:
UpdateProposal
- parameters fixed in the genesis file:
GenesisParameters
Synopsis
- data ProtocolParameters = ProtocolParameters {
- protocolParamProtocolVersion ∷ (Natural, Natural)
- protocolParamDecentralization ∷ Rational
- protocolParamExtraOptimumEntropy ∷ Maybe OptimumNonce
- protocolParamMaxBlockHeaderSize ∷ Natural
- protocolParamMaxBlockBodySize ∷ Natural
- protocolParamMaxTxSize ∷ Natural
- protocolParamTxFeeFixed ∷ Natural
- protocolParamTxFeePerByte ∷ Natural
- protocolParamMinUTxOValue ∷ Maybe Entropic
- protocolParamStakeAddressDeposit ∷ Entropic
- protocolParamStakePoolDeposit ∷ Entropic
- protocolParamMinPoolCost ∷ Entropic
- protocolParamPoolRetireMaxEpoch ∷ EpochNo
- protocolParamStakePoolTargetNum ∷ Natural
- protocolParamPoolPledgeInfluence ∷ Rational
- protocolParamMonetaryExpansion ∷ Rational
- protocolParamTreasuryCut ∷ Rational
- protocolParamUTxOCostPerWord ∷ Maybe Entropic
- protocolParamCostModels ∷ Map AnyZerepochScriptVersion CostModel
- protocolParamPrices ∷ Maybe ExecutionUnitPrices
- protocolParamMaxTxExUnits ∷ Maybe ExecutionUnits
- protocolParamMaxBlockExUnits ∷ Maybe ExecutionUnits
- protocolParamMaxValueSize ∷ Maybe Natural
- protocolParamCollateralPercent ∷ Maybe Natural
- protocolParamMaxCollateralInputs ∷ Maybe Natural
- checkProtocolParameters ∷ ∀ era. IsBccEra era ⇒ SophieBasedEra era → ProtocolParameters → Either ProtocolParametersError ()
- data ProtocolParametersError
- data EpochNo
- data ProtocolParametersUpdate = ProtocolParametersUpdate {
- protocolUpdateProtocolVersion ∷ Maybe (Natural, Natural)
- protocolUpdateDecentralization ∷ Maybe Rational
- protocolUpdateExtraOptimumEntropy ∷ Maybe (Maybe OptimumNonce)
- protocolUpdateMaxBlockHeaderSize ∷ Maybe Natural
- protocolUpdateMaxBlockBodySize ∷ Maybe Natural
- protocolUpdateMaxTxSize ∷ Maybe Natural
- protocolUpdateTxFeeFixed ∷ Maybe Natural
- protocolUpdateTxFeePerByte ∷ Maybe Natural
- protocolUpdateMinUTxOValue ∷ Maybe Entropic
- protocolUpdateStakeAddressDeposit ∷ Maybe Entropic
- protocolUpdateStakePoolDeposit ∷ Maybe Entropic
- protocolUpdateMinPoolCost ∷ Maybe Entropic
- protocolUpdatePoolRetireMaxEpoch ∷ Maybe EpochNo
- protocolUpdateStakePoolTargetNum ∷ Maybe Natural
- protocolUpdatePoolPledgeInfluence ∷ Maybe Rational
- protocolUpdateMonetaryExpansion ∷ Maybe Rational
- protocolUpdateTreasuryCut ∷ Maybe Rational
- protocolUpdateUTxOCostPerWord ∷ Maybe Entropic
- protocolUpdateCostModels ∷ Map AnyZerepochScriptVersion CostModel
- protocolUpdatePrices ∷ Maybe ExecutionUnitPrices
- protocolUpdateMaxTxExUnits ∷ Maybe ExecutionUnits
- protocolUpdateMaxBlockExUnits ∷ Maybe ExecutionUnits
- protocolUpdateMaxValueSize ∷ Maybe Natural
- protocolUpdateCollateralPercent ∷ Maybe Natural
- protocolUpdateMaxCollateralInputs ∷ Maybe Natural
- data OptimumNonce
- makeOptimumNonce ∷ ByteString → OptimumNonce
- data ExecutionUnits = ExecutionUnits {}
- data ExecutionUnitPrices = ExecutionUnitPrices {}
- newtype CostModel = CostModel (Map Text Integer)
- validateCostModel ∷ ZerepochScriptVersion lang → CostModel → Either InvalidCostModel ()
- data UpdateProposal = UpdateProposal !(Map (Hash GenesisKey) ProtocolParametersUpdate) !EpochNo
- makeSophieUpdateProposal ∷ ProtocolParametersUpdate → [Hash GenesisKey] → EpochNo → UpdateProposal
- toLedgerUpdate ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UpdateProposal → Update ledgerera
- fromLedgerUpdate ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → Update ledgerera → UpdateProposal
- toLedgerProposedPPUpdates ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → Map (Hash GenesisKey) ProtocolParametersUpdate → ProposedPPUpdates ledgerera
- fromLedgerProposedPPUpdates ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → ProposedPPUpdates ledgerera → Map (Hash GenesisKey) ProtocolParametersUpdate
- toLedgerPParams ∷ SophieBasedEra era → ProtocolParameters → PParams (SophieLedgerEra era)
- fromLedgerPParams ∷ SophieBasedEra era → PParams (SophieLedgerEra era) → ProtocolParameters
- fromSophiePParams ∷ PParams ledgerera → ProtocolParameters
- toAurumPrices ∷ ExecutionUnitPrices → Maybe Prices
- fromAurumPrices ∷ Prices → ExecutionUnitPrices
- toAurumScriptLanguage ∷ AnyZerepochScriptVersion → Language
- fromAurumScriptLanguage ∷ Language → AnyZerepochScriptVersion
- toAurumCostModel ∷ CostModel → CostModel
- fromAurumCostModel ∷ CostModel → CostModel
- data family AsType t
The updateable protocol paramaters
data ProtocolParameters Source #
The values of the set of updateable protocol paramaters. At any particular point on the chain there is a current set of paramaters in use.
These paramaters can be updated (at epoch boundaries) via an
UpdateProposal
, which contains a ProtocolParametersUpdate
.
The ProtocolParametersUpdate
is essentially a diff for the
ProtocolParameters
.
There are also paramaters fixed in the Genesis file. See GenesisParameters
.
ProtocolParameters | |
|
Instances
checkProtocolParameters ∷ ∀ era. IsBccEra era ⇒ SophieBasedEra era → ProtocolParameters → Either ProtocolParametersError () Source #
data ProtocolParametersError Source #
Instances
Show ProtocolParametersError Source # | |
Defined in Bcc.Api.ProtocolParameters | |
Error ProtocolParametersError Source # | |
Defined in Bcc.Api.ProtocolParameters |
Instances
Updates to the protocol paramaters
data ProtocolParametersUpdate Source #
The representation of a change in the ProtocolParameters
.
ProtocolParametersUpdate | |
|
Instances
Eq ProtocolParametersUpdate Source # | |
Show ProtocolParametersUpdate Source # | |
Defined in Bcc.Api.ProtocolParameters | |
Semigroup ProtocolParametersUpdate Source # | |
Monoid ProtocolParametersUpdate Source # | |
FromCBOR ProtocolParametersUpdate Source # | |
Defined in Bcc.Api.ProtocolParameters fromCBOR ∷ Decoder s ProtocolParametersUpdate # | |
ToCBOR ProtocolParametersUpdate Source # | |
Defined in Bcc.Api.ProtocolParameters toCBOR ∷ ProtocolParametersUpdate → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ProtocolParametersUpdate → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ProtocolParametersUpdate] → Size # |
OptimumNonce
data OptimumNonce Source #
Instances
Execution units, prices and cost models,
data ExecutionUnits Source #
The units for how long a script executes for and how much memory it uses. This is used to declare the resources used by a particular use of a script.
This type is also used to describe the limits for the maximum overall execution units per transaction or per block.
ExecutionUnits | |
|
Instances
Eq ExecutionUnits Source # | |
Defined in Bcc.Api.Script (==) ∷ ExecutionUnits → ExecutionUnits → Bool Source # (/=) ∷ ExecutionUnits → ExecutionUnits → Bool Source # | |
Show ExecutionUnits Source # | |
Defined in Bcc.Api.Script | |
FromJSON ExecutionUnits Source # | |
Defined in Bcc.Api.Script parseJSON ∷ Value → Parser ExecutionUnits # parseJSONList ∷ Value → Parser [ExecutionUnits] # | |
ToJSON ExecutionUnits Source # | |
Defined in Bcc.Api.Script toJSON ∷ ExecutionUnits → Value # toEncoding ∷ ExecutionUnits → Encoding # toJSONList ∷ [ExecutionUnits] → Value # toEncodingList ∷ [ExecutionUnits] → Encoding # | |
FromCBOR ExecutionUnits Source # | |
Defined in Bcc.Api.Script fromCBOR ∷ Decoder s ExecutionUnits # label ∷ Proxy ExecutionUnits → Text # | |
ToCBOR ExecutionUnits Source # | |
Defined in Bcc.Api.Script toCBOR ∷ ExecutionUnits → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ExecutionUnits → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ExecutionUnits] → Size # |
data ExecutionUnitPrices Source #
The prices for ExecutionUnits
as a fraction of a Entropic
.
These are used to determine the fee for the use of a script within a
transaction, based on the ExecutionUnits
needed by the use of the script.
Instances
Eq ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters | |
Show ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters | |
FromJSON ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters parseJSON ∷ Value → Parser ExecutionUnitPrices # parseJSONList ∷ Value → Parser [ExecutionUnitPrices] # | |
ToJSON ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters toJSON ∷ ExecutionUnitPrices → Value # toEncoding ∷ ExecutionUnitPrices → Encoding # toJSONList ∷ [ExecutionUnitPrices] → Value # toEncodingList ∷ [ExecutionUnitPrices] → Encoding # | |
FromCBOR ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters fromCBOR ∷ Decoder s ExecutionUnitPrices # | |
ToCBOR ExecutionUnitPrices Source # | |
Defined in Bcc.Api.ProtocolParameters toCBOR ∷ ExecutionUnitPrices → Encoding # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy ExecutionUnitPrices → Size # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [ExecutionUnitPrices] → Size # |
Instances
Eq CostModel Source # | |
Show CostModel Source # | |
FromJSON CostModel Source # | |
Defined in Bcc.Api.ProtocolParameters | |
ToJSON CostModel Source # | |
Defined in Bcc.Api.ProtocolParameters toEncoding ∷ CostModel → Encoding # toJSONList ∷ [CostModel] → Value # toEncodingList ∷ [CostModel] → Encoding # | |
FromCBOR CostModel Source # | |
ToCBOR CostModel Source # | |
validateCostModel ∷ ZerepochScriptVersion lang → CostModel → Either InvalidCostModel () Source #
Update proposals to change the protocol paramaters
data UpdateProposal Source #
Instances
makeSophieUpdateProposal ∷ ProtocolParametersUpdate → [Hash GenesisKey] → EpochNo → UpdateProposal Source #
Internal conversion functions
toLedgerUpdate ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → UpdateProposal → Update ledgerera Source #
fromLedgerUpdate ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → Update ledgerera → UpdateProposal Source #
toLedgerProposedPPUpdates ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → Map (Hash GenesisKey) ProtocolParametersUpdate → ProposedPPUpdates ledgerera Source #
fromLedgerProposedPPUpdates ∷ ∀ era ledgerera. SophieLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ SophieBasedEra era → ProposedPPUpdates ledgerera → Map (Hash GenesisKey) ProtocolParametersUpdate Source #
toLedgerPParams ∷ SophieBasedEra era → ProtocolParameters → PParams (SophieLedgerEra era) Source #
fromLedgerPParams ∷ SophieBasedEra era → PParams (SophieLedgerEra era) → ProtocolParameters Source #
fromSophiePParams ∷ PParams ledgerera → ProtocolParameters Source #
toAurumPrices ∷ ExecutionUnitPrices → Maybe Prices Source #
fromAurumPrices ∷ Prices → ExecutionUnitPrices Source #
toAurumScriptLanguage ∷ AnyZerepochScriptVersion → Language Source #
fromAurumScriptLanguage ∷ Language → AnyZerepochScriptVersion Source #
toAurumCostModel ∷ CostModel → CostModel Source #
fromAurumCostModel ∷ CostModel → CostModel Source #
Data family instances
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.