Skip to content

Commit

Permalink
Merge pull request #2776 from IntersectMBO/update_pparams_conway
Browse files Browse the repository at this point in the history
feat(protocol): update protocol param keys for Conway
  • Loading branch information
mkoura authored Nov 20, 2024
2 parents 3ee9fbc + 78b2e47 commit b0a916f
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions cardano_node_tests/tests/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
import allure
import pytest
from cardano_clusterlib import clusterlib
from packaging import version

from cardano_node_tests.tests import common
from cardano_node_tests.tests import issues
from cardano_node_tests.utils import clusterlib_utils
from cardano_node_tests.utils import helpers
from cardano_node_tests.utils.versions import VERSIONS

LOGGER = logging.getLogger(__name__)

Expand All @@ -32,54 +29,39 @@
PROTOCOL_PARAM_KEYS = frozenset(
(
"collateralPercentage",
"committeeMaxTermLength",
"committeeMinSize",
"costModels",
"decentralization",
"dRepActivity",
"dRepDeposit",
"dRepVotingThresholds",
"executionUnitPrices",
"extraPraosEntropy",
"govActionDeposit",
"govActionLifetime",
"maxBlockBodySize",
"maxBlockExecutionUnits",
"maxBlockHeaderSize",
"maxCollateralInputs",
"maxTxExecutionUnits",
"maxTxSize",
"maxValueSize",
"minFeeRefScriptCostPerByte",
"minPoolCost",
"minUTxOValue",
"monetaryExpansion",
"poolPledgeInfluence",
"poolRetireMaxEpoch",
"poolVotingThresholds",
"protocolVersion",
"stakeAddressDeposit",
"stakePoolDeposit",
"stakePoolTargetNum",
"treasuryCut",
"txFeeFixed",
"txFeePerByte",
"utxoCostPerWord",
)
)
PROTOCOL_PARAM_KEYS_1_35_2 = frozenset(("utxoCostPerByte",))

PROTOCOL_PARAM_KEYS_CONWAY = frozenset(
(
"govActionLifetime",
"govActionDeposit",
"committeeMaxTermLength",
"dRepDeposit",
"poolVotingThresholds",
"dRepVotingThresholds",
"committeeMinSize",
"minFeeRefScriptCostPerByte",
"dRepActivity",
"utxoCostPerByte",
)
)

PROTOCOL_PARAM_KEYS_MISSING_8_6_0 = frozenset(("utxoCostPerWord",))

PROTOCOL_PARAM_KEYS_MISSING_8_12_0 = frozenset(
("minUTxOValue", "decentralization", "extraPraosEntropy")
)


@common.SKIPIF_WRONG_ERA
class TestProtocol:
Expand Down Expand Up @@ -130,18 +112,8 @@ def test_protocol_params(self, cluster: clusterlib.ClusterLib):
common.get_test_id(cluster)
protocol_params = cluster.g_query.get_protocol_params()

# The sets were updated for Conway, so there's nothing to add or remove at the moment.
union_with: tp.FrozenSet[str] = frozenset()
if clusterlib_utils.cli_has(
"legacy governance create-update-proposal --utxo-cost-per-byte"
):
union_with = union_with.union(PROTOCOL_PARAM_KEYS_1_35_2)
if VERSIONS.cluster_era >= VERSIONS.CONWAY:
union_with = union_with.union(PROTOCOL_PARAM_KEYS_CONWAY)

rem: tp.FrozenSet[str] = frozenset()
if clusterlib_utils.cli_has("conway"):
rem = rem.union(PROTOCOL_PARAM_KEYS_MISSING_8_6_0)
if VERSIONS.node >= version.parse("8.12.0"):
rem = rem.union(PROTOCOL_PARAM_KEYS_MISSING_8_12_0)

assert set(protocol_params) == PROTOCOL_PARAM_KEYS.union(union_with).difference(rem)

0 comments on commit b0a916f

Please sign in to comment.