IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

remove options from create-protocol-parameters-update #388

Closed CarlosLopezDeLara closed 10 months ago

CarlosLopezDeLara commented 11 months ago

Currently, cardano-cli conway governance action create-protocol-parameters-update gives the option of creating a proposal to change:

--protocol-major-version  
--protocol-minor-version  

protocol-major is used to trigger a hardfork See CDDL This kind of protocol parameter change is reserved to different type of governance action (Hardfork initiation), thus it makes no sense to have the option available under create-protocol-parameters-update

Reference from CIP1694

`

Separation of Hard Fork Initiation from Standard Protocol Parameter Changes In contrast to other protocol parameter updates, hard forks (or, more correctly, changes to the protocol's major version number) require much more attention. Indeed, while other protocol parameter changes can be performed without significant software changes, a hard fork assumes that a super-majority of the network has upgraded the Cardano node to support the new set of features that are introduced by the upgrade. This means that the timing of a hard fork event must be communicated well ahead of time to all Cardano users, and requires coordination between stake pool operators, wallet providers, DApp developers, and the node release team.

Hence, this proposal, unlike the Shelley scheme, promotes hard fork initiations as a standalone governance action, distinct from protocol parameter updates.

smelc commented 11 months ago

For the record, as of 4def5e68f02b6f74f95c82bdb2a04a35ad352a7e, the cli for conway governance action create-protocol-parameters-update is:

cabal run cardano-cli -- conway governance action create-protocol-parameters-update
Usage: cardano-cli conway governance action create-protocol-parameters-update --epoch NATURAL
                                                                                [--min-fee-constant LOVELACE]
                                                                                [--min-fee-linear LOVELACE]
                                                                                [--max-block-body-size NATURAL]
                                                                                [--max-tx-size NATURAL]
                                                                                [--max-block-header-size NATURAL]
                                                                                [--key-reg-deposit-amt NATURAL]
                                                                                [--pool-reg-deposit NATURAL]
                                                                                [--pool-retirement-epoch-boundary EPOCH_BOUNDARY]
                                                                                [--number-of-pools NATURAL]
                                                                                [--pool-influence RATIONAL]
                                                                                [--treasury-expansion RATIONAL]
                                                                                [--monetary-expansion RATIONAL]
                                                                                [--protocol-major-version NATURAL
                                                                                  --protocol-minor-version NATURAL]
                                                                                [--min-pool-cost NATURAL]
                                                                                [--price-execution-steps RATIONAL
                                                                                  --price-execution-memory RATIONAL]
                                                                                [--max-tx-execution-units (INT, INT)]
                                                                                [--max-block-execution-units (INT, INT)]
                                                                                [--max-value-size INT]
                                                                                [--collateral-percent INT]
                                                                                [--max-collateral-inputs INT]
                                                                                [--utxo-cost-per-byte LOVELACE]
                                                                                [--pool-voting-threshold-motion-no-confidence RATIONAL
                                                                                  --pool-voting-threshold-committee-normal RATIONAL
                                                                                  --pool-voting-threshold-committee-no-confidence RATIONAL
                                                                                  --pool-voting-threshold-hard-fork-initiation RATIONAL]
                                                                                [--drep-voting-threshold-motion-no-confidence RATIONAL
                                                                                  --drep-voting-threshold-committee-normal RATIONAL
                                                                                  --drep-voting-threshold-committee-no-confidence RATIONAL
                                                                                  --drep-voting-threshold-update-to-constitution RATIONAL
                                                                                  --drep-voting-threshold-hard-fork-initiation RATIONAL
                                                                                  --drep-voting-threshold-pp-network-group RATIONAL
                                                                                  --drep-voting-threshold-pp-economic-group RATIONAL
                                                                                  --drep-voting-threshold-pp-technical-group RATIONAL
                                                                                  --drep-voting-threshold-pp-governance-group RATIONAL
                                                                                  --drep-voting-threshold-treasury-withdrawal RATIONAL]
                                                                                [--min-committee-size INT]
                                                                                [--committee-term-length INT]
                                                                                [--governance-action-lifetime NATURAL]
                                                                                [--governance-action-deposit NATURAL]
                                                                                [--drep-deposit LOVELACE]
                                                                                [--drep-activity NATURAL]
                                                                                --out-file FILE

  Create a protocol parameters update.

Available options:
  --epoch NATURAL          The epoch number in which the update proposal is
                           valid.
  --min-fee-constant LOVELACE
                           The constant factor for the minimum fee calculation.
  --min-fee-linear LOVELACE
                           The linear factor per byte for the minimum fee
                           calculation.
  --max-block-body-size NATURAL
                           Maximal block body size.
  --max-tx-size NATURAL    Maximum transaction size.
  --max-block-header-size NATURAL
                           Maximum block header size.
  --key-reg-deposit-amt NATURAL
                           Key registration deposit amount.
  --pool-reg-deposit NATURAL
                           The amount of a pool registration deposit.
  --pool-retirement-epoch-boundary EPOCH_BOUNDARY
                           Epoch bound on pool retirement.
  --number-of-pools NATURAL
                           Desired number of pools.
  --pool-influence RATIONAL
                           Pool influence.
  --treasury-expansion RATIONAL
                           Treasury expansion.
  --monetary-expansion RATIONAL
                           Monetary expansion.
  --protocol-major-version NATURAL
                           Major protocol version. An increase indicates a hard
                           fork.
  --protocol-minor-version NATURAL
                           Minor protocol version. An increase indicates a soft
                           fork (old software canvalidate but not produce new
                           blocks).
  --min-pool-cost NATURAL  The minimum allowed cost parameter for stake pools.
  --price-execution-steps RATIONAL
                           Step price of execution units for script languages
                           that use them (from Alonzo era). (Examples: '1.1',
                           '11/10')
  --price-execution-memory RATIONAL
                           Memory price of execution units for script languages
                           that use them (from Alonzo era). (Examples: '1.1',
                           '11/10')
  --max-tx-execution-units (INT, INT)
                           Max total script execution resources units allowed
                           per tx (from Alonzo era). They are denominated as
                           follows (steps, memory).
  --max-block-execution-units (INT, INT)
                           Max total script execution resources units allowed
                           per block (from Alonzo era). They are denominated as
                           follows (steps, memory).
  --max-value-size INT     Max size of a multi-asset value in a tx output (from
                           Alonzo era).
  --collateral-percent INT The percentage of the script contribution to the
                           txfee that must be provided as collateral inputs when
                           including Plutus scripts (from Alonzo era).
  --max-collateral-inputs INT
                           The maximum number of collateral inputs allowed in a
                           transaction (from Alonzo era).
  --utxo-cost-per-byte LOVELACE
                           Cost in lovelace per unit of UTxO storage (from
                           Babbage era).
  --pool-voting-threshold-motion-no-confidence RATIONAL
                           TODO
  --pool-voting-threshold-committee-normal RATIONAL
                           TODO
  --pool-voting-threshold-committee-no-confidence RATIONAL
                           TODO
  --pool-voting-threshold-hard-fork-initiation RATIONAL
                           TODO
  --drep-voting-threshold-motion-no-confidence RATIONAL
                           TODO
  --drep-voting-threshold-committee-normal RATIONAL
                           TODO
  --drep-voting-threshold-committee-no-confidence RATIONAL
                           TODO
  --drep-voting-threshold-update-to-constitution RATIONAL
                           TODO
  --drep-voting-threshold-hard-fork-initiation RATIONAL
                           TODO
  --drep-voting-threshold-pp-network-group RATIONAL
                           TODO
  --drep-voting-threshold-pp-economic-group RATIONAL
                           TODO
  --drep-voting-threshold-pp-technical-group RATIONAL
                           TODO
  --drep-voting-threshold-pp-governance-group RATIONAL
                           TODO
  --drep-voting-threshold-treasury-withdrawal RATIONAL
                           TODO
  --min-committee-size INT TODO
  --committee-term-length INT
                           TODO
  --governance-action-lifetime NATURAL
                           TODO
  --governance-action-deposit NATURAL
                           Deposit required to submit a governance action.
  --drep-deposit LOVELACE  TODO
  --drep-activity NATURAL  TODO
  --out-file FILE          The output file.
  -h,--help                Show this help text
smelc commented 11 months ago

As I'm about to log off for one week, I'm dumping the info I gathered here. As we would say in French, this is a bit zucchini tartlet (i.e. you can do it, but it doesn't taste great :smile:).

The presence of [--protocol-major-version NATURAL | --protocol-minor-version NATURAL] in the parser comes from:

So at first sight, it would be a bit complicated to remove those two fields from the parser. Note that this difficulty is not conway specific, it would be the same for all eras, since the concerned parameters are shared for all eras.

smelc commented 11 months ago

On a second thought, there is a possible way that doesn't require changes nor in the ledger, nor in cardano-api:

  1. Introduce a copy of the type CommonProtocolParametersUpdate in cardano-cli, but make the type of field cppProtocolVersion a parameter of CommonProtocolParametersUpdate
  2. When the era is not conway, instantiate the new parameter by Maybe Ledger.ProtVer.
  3. When the era is conway, instantiate the new parameter by ()

@Jimbo4350, @newhoggy> any opinion on this?

smelc commented 10 months ago

If I understand correctly @teodanciu's PR https://github.com/input-output-hk/cardano-api/pull/321, I believe it's anyway impossible to change the protocol's minor and major version in the ledger. But it's our parser that is off, as my previous message shows. Need to confirm on a more recent HEAD, in case I tested before Teodora's change.

smelc commented 10 months ago

Confirming that the parser is still off after the integration of @teodanciu's PR, i.e. --protocol-major-version and --protocol-minor-version still show up in the help on d32fce056c2a0dcfe827d051d7d0767d12e58fa1. So there is something to do on the cardano-cli side. I'm investigating it.

smelc commented 10 months ago

Following-up on my "On a second thought" message from above, I tried it and it doesn't work, because ultimately we want a single parser for CommonProtocolParametersUpdate (function pCommonProtocolParameters).

However, while doing this, I found EraBasedProtocolParametersUpdate which is exactly designed to deal with different eras having different parameters. So I could:

  1. Introduce a new DeprecatedAfterBabbage type, whose only field would be cppProtocolVersion :: StrictMaybe Ledger.ProtVer
  2. Add a DeprecatedAfterBababbge value to all eras before Conway
  3. From there, the typechecker should guide me for the rest of the adaptation.