Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/20261105_dijkstra_new_protocol_parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project: cardano-cli
pr: 1497
kind:
- feature
description: Bump cardano-api to 11.12.0 and add Dijkstra protocol parameter options to governance action create-protocol-parameters-update for the minimum pool margin, maximum pledge leverage, Peras parameters, and reference-input costs. --no-max-pledge-leverage and --no-peras-bootstrap-round propose setting those optional parameters to no value.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2026-09-29T11:48:37Z
, cardano-haskell-packages 2026-10-26T14:00:38Z
, cardano-haskell-packages 2026-11-05T14:52:50Z

packages:
cardano-cli
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ library
binary,
bytestring,
canonical-json,
cardano-api ^>=11.11,
cardano-api ^>=11.12,
cardano-binary,
cardano-config ^>=2.2.2,
cardano-crypto,
Expand Down
126 changes: 126 additions & 0 deletions cardano-cli/src/Cardano/CLI/EraBased/Governance/Actions/Option.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Cardano.CLI.EraBased.Common.Option
import Cardano.CLI.EraBased.Governance.Actions.Command qualified as Cmd
import Cardano.CLI.Option.Flag (setDefault)
import Cardano.CLI.Parser
import Cardano.CLI.Read (readerFromParsecParser)
import Cardano.CLI.Type.Common
import Cardano.Ledger.BaseTypes (Milliseconds32 (..), NonZero, PositiveInterval, nonZero)
import Cardano.Ledger.Plutus.ExUnits (OrdExUnits (..))
Expand Down Expand Up @@ -313,6 +314,8 @@ pIntroducedInDijkstraPParams =
<*> convertToLedger id (optional pMaxRefScriptSizePerTx)
<*> convertToLedger id (optional pRefScriptCostStride)
<*> convertToLedger id (optional pRefScriptCostMultiplier)
<*> convertToLedger toUnitIntervalOrErr (optional pMinPoolMargin)
<*> convertToLedger L.MaxPledgeLeverage (optional pMaxPledgeLeverage)
<*> convertToLedger id (optional pLeiosAnnouncementPeriodLength)
<*> convertToLedger id (optional pLeiosVotePeriodLength)
<*> convertToLedger id (optional pLeiosDiffusionPeriodLength)
Expand All @@ -322,6 +325,14 @@ pIntroducedInDijkstraPParams =
<*> convertToLedger id (optional pMaxEndorserBlockTxsSize)
<*> convertToLedger (OrdExUnits . toAlonzoExUnits) (optional pMaxEndorserBlockExecutionUnits)
<*> convertToLedger id (optional pMaxRefScriptSizePerEndorserBlock)
<*> convertToLedger id (optional pPerasMinCandidateBlockAge)
<*> convertToLedger id (optional pPerasHealingFactor)
<*> convertToLedger id (optional pPerasCertBoost)
<*> convertToLedger id (optional pPerasTargetCommitteeSize)
<*> convertToLedger id (optional pPerasBootstrapRound)
<*> convertToLedger toUnitIntervalOrErr (optional pPerasQuorumThresholdSafetyMargin)
<*> convertToLedger id (optional pRefInputsCostPerMultiAssetPolicy)
<*> convertToLedger id (optional pRefInputsCostPerDatumByte)

pLeiosAnnouncementPeriodLength :: Parser Milliseconds32
pLeiosAnnouncementPeriodLength =
Expand Down Expand Up @@ -466,6 +477,121 @@ toPositiveInterval r =
pure
$ L.boundRational r

pMinPoolMargin :: Parser Rational
pMinPoolMargin =
Opt.option readRationalUnitInterval $
mconcat
[ Opt.long "min-pool-margin"
, Opt.metavar "RATIONAL"
, Opt.help "Minimum stake pool profit margin."
]

-- | Either a leverage bound, or an explicit request to remove the bound.
pMaxPledgeLeverage :: Parser (L.StrictMaybe L.NonNegativeInterval)
pMaxPledgeLeverage =
asum
[ L.SJust . toNonNegativeIntervalOrErr
<$> Opt.option
readRational
( mconcat
[ Opt.long "max-pledge-leverage"
, Opt.metavar "RATIONAL"
, Opt.help "Maximum pledge leverage used when calculating stake pool rewards."
]
)
, Opt.flag' L.SNothing $
mconcat
[ Opt.long "no-max-pledge-leverage"
, Opt.help "Remove the maximum pledge leverage bound."
]
]

pPerasMinCandidateBlockAge :: Parser L.SlotInterval
pPerasMinCandidateBlockAge =
L.SlotInterval
<$> Opt.option
integralReader
( mconcat
[ Opt.long "peras-min-candidate-block-age"
, Opt.metavar "SLOTS"
, Opt.help "Minimum age of a Peras candidate block, in slots."
]
)

pPerasHealingFactor :: Parser PositiveInterval
pPerasHealingFactor =
Opt.option (readRational >>= toPositiveInterval) $
mconcat
[ Opt.long "peras-healing-factor"
, Opt.metavar "RATIONAL"
, Opt.help "Peras healing factor."
]

pPerasCertBoost :: Parser Word16
pPerasCertBoost =
Opt.option integralReader $
mconcat
[ Opt.long "peras-cert-boost"
, Opt.metavar "WORD16"
, Opt.help "Chain weight boost given by a Peras certificate."
]

pPerasTargetCommitteeSize :: Parser Word16
pPerasTargetCommitteeSize =
Opt.option integralReader $
mconcat
[ Opt.long "peras-target-committee-size"
, Opt.metavar "WORD16"
, Opt.help "Target size of the Peras committee."
]

-- | Either a bootstrap round, or an explicit request to unset it.
pPerasBootstrapRound :: Parser (L.StrictMaybe Word32)
pPerasBootstrapRound =
asum
[ L.SJust
<$> Opt.option
integralReader
( mconcat
[ Opt.long "peras-bootstrap-round"
, Opt.metavar "WORD32"
, Opt.help "Peras bootstrap round."
]
)
, Opt.flag' L.SNothing $
mconcat
[ Opt.long "no-peras-bootstrap-round"
, Opt.help "Unset the Peras bootstrap round."
]
]

pPerasQuorumThresholdSafetyMargin :: Parser Rational
pPerasQuorumThresholdSafetyMargin =
Opt.option readRationalUnitInterval $
mconcat
[ Opt.long "peras-quorum-threshold-safety-margin"
, Opt.metavar "RATIONAL"
, Opt.help "Safety margin for the Peras quorum threshold."
]

pRefInputsCostPerMultiAssetPolicy :: Parser L.Coin
pRefInputsCostPerMultiAssetPolicy =
Opt.option (readerFromParsecParser parseLovelace) $
mconcat
[ Opt.long "ref-inputs-cost-per-multi-asset-policy"
, Opt.metavar "LOVELACE"
, Opt.help "Reference-input cost per multi-asset policy."
]

pRefInputsCostPerDatumByte :: Parser L.CoinPerByte
pRefInputsCostPerDatumByte =
Opt.option (readerFromParsecParser parseCoinPerByte) $
mconcat
[ Opt.long "ref-inputs-cost-per-datum-byte"
, Opt.metavar "LOVELACE"
, Opt.help "Reference-input cost per datum byte."
]

-- Not necessary in Conway era onwards
pProtocolParametersUpdateGenesisKeys :: Parser [VerificationKeyFile In]
pProtocolParametersUpdateGenesisKeys = some pGenesisVerificationKeyFile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ hprop_golden_dijkstra_governance_action_create_protocol_parameters_update =
, "1000003"
, "--ref-script-cost-multiplier"
, "11/10"
, "--min-pool-margin"
, "1/50"
, "--max-pledge-leverage"
, "7/2"
, -- Leios
"--leios-announcement-period-length"
, "1000"
Expand All @@ -620,6 +624,24 @@ hprop_golden_dijkstra_governance_action_create_protocol_parameters_update =
, "(1000006, 1000007)"
, "--max-ref-script-size-per-endorser-block"
, "1000008"
, -- Peras
"--peras-min-candidate-block-age"
, "91"
, "--peras-healing-factor"
, "1/3"
, "--peras-cert-boost"
, "16"
, "--peras-target-committee-size"
, "801"
, "--peras-bootstrap-round"
, "1000009"
, "--peras-quorum-threshold-safety-margin"
, "1/20"
, -- Reference-input costs
"--ref-inputs-cost-per-multi-asset-policy"
, "1000010"
, "--ref-inputs-cost-per-datum-byte"
, "1000011"
, "--out-file"
, actionFile
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "Governance proposal",
"description": "Update protocol parameters proposal",
"cborHex": "84193039581de18f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058400f6ad18221a000f424118231a000f424218241a000f42431825d81e820b0a18281903e818291907d0182a190bb8182b1901f4182cd81e820304182d1a000f4244182e1a000f4245182f821a000f42471a000f424618301a000f4248f6826b6578616d706c652e636f6d5820c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745"
"cborHex": "84193039581de18f4a3466a404c11eb410313015b88e447d81b60089e25f611600e6058400f6b718221a000f424118231a000f424218241a000f42431825d81e820b0a1826d81e8207021827d81e8201183218281903e818291907d0182a190bb8182b1901f4182cd81e820304182d1a000f4244182e1a000f4245182f821a000f42471a000f424618301a000f42481831185b1832d81e820103183310183419032118351a000f42491836d81e82011418371a000f424a18381a000f424bf6826b6578616d706c652e636f6d5820c7ddb5b493faa4d3d2d679847740bdce0c5d358d56f9b1470ca67f5652a02745"
}
14 changes: 14 additions & 0 deletions cardano-cli/test/cardano-cli-golden/files/golden/help.cli
Original file line number Diff line number Diff line change
Expand Up @@ -3984,6 +3984,10 @@ Usage: cardano-cli dijkstra governance action create-protocol-parameters-update
[--max-ref-script-size-per-tx WORD32]
[--ref-script-cost-stride WORD32]
[--ref-script-cost-multiplier RATIONAL]
[--min-pool-margin RATIONAL]
[ --max-pledge-leverage RATIONAL
| --no-max-pledge-leverage
]
[--leios-announcement-period-length MILLISECONDS]
[--leios-vote-period-length MILLISECONDS]
[--leios-diffusion-period-length MILLISECONDS]
Expand All @@ -3993,6 +3997,16 @@ Usage: cardano-cli dijkstra governance action create-protocol-parameters-update
[--max-endorser-block-txs-size WORD32]
[--max-endorser-block-execution-units (INT, INT)]
[--max-ref-script-size-per-endorser-block WORD32]
[--peras-min-candidate-block-age SLOTS]
[--peras-healing-factor RATIONAL]
[--peras-cert-boost WORD16]
[--peras-target-committee-size WORD16]
[ --peras-bootstrap-round WORD32
| --no-peras-bootstrap-round
]
[--peras-quorum-threshold-safety-margin RATIONAL]
[--ref-inputs-cost-per-multi-asset-policy LOVELACE]
[--ref-inputs-cost-per-datum-byte LOVELACE]
[--cost-model-file FILE]
--out-file FILEPATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Usage: cardano-cli dijkstra governance action create-protocol-parameters-update
[--max-ref-script-size-per-tx WORD32]
[--ref-script-cost-stride WORD32]
[--ref-script-cost-multiplier RATIONAL]
[--min-pool-margin RATIONAL]
[ --max-pledge-leverage RATIONAL
| --no-max-pledge-leverage
]
[--leios-announcement-period-length MILLISECONDS]
[--leios-vote-period-length MILLISECONDS]
[--leios-diffusion-period-length MILLISECONDS]
Expand All @@ -71,6 +75,16 @@ Usage: cardano-cli dijkstra governance action create-protocol-parameters-update
[--max-endorser-block-txs-size WORD32]
[--max-endorser-block-execution-units (INT, INT)]
[--max-ref-script-size-per-endorser-block WORD32]
[--peras-min-candidate-block-age SLOTS]
[--peras-healing-factor RATIONAL]
[--peras-cert-boost WORD16]
[--peras-target-committee-size WORD16]
[ --peras-bootstrap-round WORD32
| --no-peras-bootstrap-round
]
[--peras-quorum-threshold-safety-margin RATIONAL]
[--ref-inputs-cost-per-multi-asset-policy LOVELACE]
[--ref-inputs-cost-per-datum-byte LOVELACE]
[--cost-model-file FILE]
--out-file FILEPATH

Expand Down Expand Up @@ -228,6 +242,12 @@ Available options:
calculation.
--ref-script-cost-multiplier RATIONAL
Reference script cost multiplier for fee calculation.
--min-pool-margin RATIONAL
Minimum stake pool profit margin.
--max-pledge-leverage RATIONAL
Maximum pledge leverage used when calculating stake
pool rewards.
--no-max-pledge-leverage Remove the maximum pledge leverage bound.
--leios-announcement-period-length MILLISECONDS
Length of the Leios announcement period, in
milliseconds.
Expand All @@ -254,6 +274,24 @@ Available options:
--max-ref-script-size-per-endorser-block WORD32
Maximum total size of reference scripts per endorser
block.
--peras-min-candidate-block-age SLOTS
Minimum age of a Peras candidate block, in slots.
--peras-healing-factor RATIONAL
Peras healing factor.
--peras-cert-boost WORD16
Chain weight boost given by a Peras certificate.
--peras-target-committee-size WORD16
Target size of the Peras committee.
--peras-bootstrap-round WORD32
Peras bootstrap round.
--no-peras-bootstrap-round
Unset the Peras bootstrap round.
--peras-quorum-threshold-safety-margin RATIONAL
Safety margin for the Peras quorum threshold.
--ref-inputs-cost-per-multi-asset-policy LOVELACE
Reference-input cost per multi-asset policy.
--ref-inputs-cost-per-datum-byte LOVELACE
Reference-input cost per datum byte.
--cost-model-file FILE Filepath of the JSON formatted cost model
--out-file FILEPATH The output file.
-h,--help Show this help text
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading