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

query protocol-parameters does not show params introduced in Conway #729

Closed CarlosLopezDeLara closed 3 months ago

CarlosLopezDeLara commented 5 months ago

Description

We are missing the parameters introduced in conway in the output of query protocol-parameters

cardano-cli conway query protocol-parameters 
{
    "collateralPercentage": 150,
    "costModels": {
        "PlutusV1": [
        ],
        "PlutusV2": [
        ]
    },
    "decentralization": null,
    "executionUnitPrices": {
        "priceMemory": 5.77e-2,
        "priceSteps": 7.21e-5
    },
    "extraPraosEntropy": null,
    "maxBlockBodySize": 90112,
    "maxBlockExecutionUnits": {
        "memory": 62000000,
        "steps": 20000000000
    },
    "maxBlockHeaderSize": 1100,
    "maxCollateralInputs": 3,
    "maxTxExecutionUnits": {
        "memory": 14000000,
        "steps": 10000000000
    },
    "maxTxSize": 16384,
    "maxValueSize": 5000,
    "minPoolCost": 340000000,
    "minUTxOValue": null,
    "monetaryExpansion": 3.0e-3,
    "poolPledgeInfluence": 0.3,
    "poolRetireMaxEpoch": 18,
    "protocolVersion": {
        "major": 9,
        "minor": 0
    },
    "stakeAddressDeposit": 2000000,
    "stakePoolDeposit": 500000000,
    "stakePoolTargetNum": 500,
    "treasuryCut": 0.2,
    "txFeeFixed": 155381,
    "txFeePerByte": 44,
    "utxoCostPerByte": 4310

Desired behavior

query protocol parameters output should be similar to

cardano-cli conway query gov-state | jq .currentPParams
{
  "collateralPercentage": 150,
  "committeeMaxTermLength": 73,
  "committeeMinSize": 7,
  "costModels": {
    "PlutusV1": [
    ],
    "PlutusV2": [
    ]
  },
  "dRepActivity": 20,
  "dRepDeposit": 500000000,
  "dRepVotingThresholds": {
    "committeeNoConfidence": 0.6,
    "committeeNormal": 0.67,
    "hardForkInitiation": 0.6,
    "motionNoConfidence": 0.67,
    "ppEconomicGroup": 0.67,
    "ppGovGroup": 0.75,
    "ppNetworkGroup": 0.67,
    "ppTechnicalGroup": 0.67,
    "treasuryWithdrawal": 0.67,
    "updateToConstitution": 0.75
  },
  "executionUnitPrices": {
    "priceMemory": 0.0577,
    "priceSteps": 7.21e-05
  },
  "govActionDeposit": 50000000000,
  "govActionLifetime": 6,
  "maxBlockBodySize": 90112,
  "maxBlockExecutionUnits": {
    "memory": 62000000,
    "steps": 20000000000
  },
  "maxBlockHeaderSize": 1100,
  "maxCollateralInputs": 3,
  "maxTxExecutionUnits": {
    "memory": 14000000,
    "steps": 10000000000
  },
  "maxTxSize": 16384,
  "maxValueSize": 5000,
  "minFeeRefScriptCostPerByte": 44,
  "minPoolCost": 340000000,
  "monetaryExpansion": 0.003,
  "poolPledgeInfluence": 0.3,
  "poolRetireMaxEpoch": 18,
  "poolVotingThresholds": {
    "committeeNoConfidence": 0.51,
    "committeeNormal": 0.6,
    "hardForkInitiation": 0.51,
    "motionNoConfidence": 0.6,
    "ppSecurityGroup": 0.6
  },
  "protocolVersion": {
    "major": 9,
    "minor": 0
  },
  "stakeAddressDeposit": 2000000,
  "stakePoolDeposit": 500000000,
  "stakePoolTargetNum": 500,
  "treasuryCut": 0.2,
  "txFeeFixed": 155381,
  "txFeePerByte": 44,
  "utxoCostPerByte": 4310
}

Steps to Reproduce

  1. Connect to SanchoNet or a local cluster running Conway era
  2. query the protocol parameters with cardano-cli conway query protocol-parameters
  3. the output only includes pre-conway era prototol parameters

Additional Context

Possible Solution

We need to return all parameters.

smelc commented 4 months ago

This should probably be done like this, by adding the selected lines:

image

In this manner, we will:

which will make people involved in this discussion happy: https://github.com/IntersectMBO/cardano-cli/pull/569#issuecomment-1895636548

gitmachtl commented 4 months ago

Do you think this will make it into 8.23.0.0 release?

smelc commented 4 months ago

@gitmachtl> No it won't make it to 8.23.0.0, but we can probably prioritize it for the next one. Would that be useful to you?

gitmachtl commented 4 months ago

@smelc hi, yes please. because if every change we have to adjust all the external tooling. and at some point it would be good to come to a solution that will stay for a while. but have i read this correct, the outcome protocol parameters json will simply be like a merged output of the existing one and the extra parameters related to governance?

like:

{
  "collateralPercentage": 150,
  "costModels": {
    "PlutusV1": [
      205665,
      812,
      1,
      ...
    ],
    "PlutusV2": [
      205665,
      812,
      1,
      ...
    ],
    "PlutusV3": [
      205665,
      812,
      1,
      1,
      ...
    ]
  },
  "decentralization": null,
  "executionUnitPrices": {
    "priceMemory": 0.0577,
    "priceSteps": 7.21e-05
  },
  "extraPraosEntropy": null,
  "maxBlockBodySize": 90112,
  "maxBlockExecutionUnits": {
    "memory": 62000000,
    "steps": 20000000000
  },
  "maxBlockHeaderSize": 1100,
  "maxCollateralInputs": 3,
  "maxTxExecutionUnits": {
    "memory": 14000000,
    "steps": 10000000000
  },
  "maxTxSize": 16384,
  "maxValueSize": 5000,
  "minPoolCost": 340000000,
  "minUTxOValue": null,
  "monetaryExpansion": 0.003,
  "poolPledgeInfluence": 0.3,
  "poolRetireMaxEpoch": 18,
  "protocolVersion": {
    "major": 9,
    "minor": 0
  },
  "stakeAddressDeposit": 2000000,
  "stakePoolDeposit": 500000000,
  "stakePoolTargetNum": 500,
  "treasuryCut": 0.2,
  "txFeeFixed": 155381,
  "txFeePerByte": 44,
  "utxoCostPerByte": 4310,
  "committeeMaxTermLength": 73,
  "committeeMinSize": 7,
  "dRepActivity": 20,
  "dRepDeposit": 500000000,
  "dRepVotingThresholds": {
    "committeeNoConfidence": 0.6,
    "committeeNormal": 0.67,
    "hardForkInitiation": 0.6,
    "motionNoConfidence": 0.67,
    "ppEconomicGroup": 0.67,
    "ppGovGroup": 0.75,
    "ppNetworkGroup": 0.67,
    "ppTechnicalGroup": 0.67,
    "treasuryWithdrawal": 0.67,
    "updateToConstitution": 0.75
  },
  "govActionDeposit": 50000000000,
  "govActionLifetime": 6,
  "minFeeRefScriptCostPerByte": 44,
  "poolVotingThresholds": {
    "committeeNoConfidence": 0.51,
    "committeeNormal": 0.6,
    "hardForkInitiation": 0.51,
    "motionNoConfidence": 0.6,
    "ppSecurityGroup": 0.6
  }
}
smelc commented 4 months ago

the outcome protocol parameters json will simply be like a merged output of the existing one and the extra parameters related to governance?

Yes this is the plan :+1: but to be confirmed when I deep dive on it :laughing:

hi, yes please

Noted, will do this one soon :+1:

smelc commented 4 months ago

@gitmachtl> current state vs new state looking like this in my PoC (costModels removed for brevity):

image

I think this matches your expectations, right?

gitmachtl commented 4 months ago

yea, nice. 👍

smelc commented 4 months ago

@gitmachtl> final version trims some fields that were null (this is a result of using one source of truth for the JSON encoding, the one from the ledger)(showing here diff of old format to new format):

image

Is that fine?

gitmachtl commented 4 months ago

null is fine

smelc commented 4 months ago

@gitmachtl> to be explicit, the new version removes some null fields.

gitmachtl commented 4 months ago

@gitmachtl> to be explicit, the new version removes some null fields.

yea, all good. a jq query would also report back a null if absent.

gitmachtl commented 4 months ago

@smelc will the governance parameters still be there via the query gov-state command? or will that section in the output be removed?

smelc commented 4 months ago

@smelc will the governance parameters still be there via the query gov-state command? or will that section in the output be removed?

@gitmachtl> I only change query protocol-parameters, so query gov-state's behavior should remain the same (if not, that would be a bug of my PR).

gitmachtl commented 4 months ago

@smelc please notice https://github.com/IntersectMBO/cardano-cli/pull/758#discussion_r1599047067

gitmachtl commented 4 months ago

@smelc , posted you some test lines https://github.com/IntersectMBO/cardano-cli/pull/758#discussion_r1600089124