From 9df4f760eefe5906cad93b2d06a1a17f28611b7b Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 8 May 2024 17:05:25 +0200 Subject: [PATCH 01/47] Update clusterlib to v0.6.0a18 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- requirements_freeze.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index aac39f372..072d6779d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -105,13 +105,13 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "cardano-clusterlib" -version = "0.6.0a17" +version = "0.6.0a18" description = "Python wrapper for cardano-cli for working with cardano cluster" optional = false python-versions = ">=3.8" files = [ - {file = "cardano-clusterlib-0.6.0a17.tar.gz", hash = "sha256:6028786183c1ea6519d2e117c722c9bdcc96d4a9d59eaab2e02d5bdb3c75f291"}, - {file = "cardano_clusterlib-0.6.0a17-py3-none-any.whl", hash = "sha256:ba1cf338f8da0e8dd3474bf6749a690e79e975e1f34f4f5b8500ef0c68af3e37"}, + {file = "cardano_clusterlib-0.6.0a18-py3-none-any.whl", hash = "sha256:3cc32d8635a2b30263a39347e0753dd46fbb5a87bd0bc66a99f9f74f5e5be042"}, + {file = "cardano_clusterlib-0.6.0a18.tar.gz", hash = "sha256:4a976df9065922daca6ec327bf5c975b84fe03ec89c7a539216b452d20e7b0c1"}, ] [package.dependencies] @@ -1935,4 +1935,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "4987a3b6645b84a59939df863cea769792ceb31772ff10514cba97e39c2c34e0" +content-hash = "1163c65a22d8e1911c27e12a208c6a7d16fd74cb350497ae36c9188e0b8b8b20" diff --git a/pyproject.toml b/pyproject.toml index 645b07e01..ae0c18c4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ packages = [{include = "cardano_node_tests"}] [tool.poetry.dependencies] python = ">=3.9,<4.0" allure-pytest = "^2.13.2" -cardano-clusterlib = "^0.6.0a17" +cardano-clusterlib = "^0.6.0a18" cbor2 = "^5.4.6" filelock = "^3.12.2" hypothesis = "^6.82.6" diff --git a/requirements_freeze.txt b/requirements_freeze.txt index 4a61274dd..cc5963e6c 100644 --- a/requirements_freeze.txt +++ b/requirements_freeze.txt @@ -4,7 +4,7 @@ allure-pytest==2.13.5 ; python_version >= "3.9" and python_version < "4.0" allure-python-commons==2.13.5 ; python_version >= "3.9" and python_version < "4.0" annotated-types==0.6.0 ; python_version >= "3.9" and python_version < "4.0" attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0" -cardano-clusterlib==0.6.0a17 ; python_version >= "3.9" and python_version < "4.0" +cardano-clusterlib==0.6.0a18 ; python_version >= "3.9" and python_version < "4.0" cbor2==5.6.3 ; python_version >= "3.9" and python_version < "4.0" certifi==2024.2.2 ; python_version >= "3.9" and python_version < "4.0" cffi==1.16.0 ; python_version >= "3.9" and python_version < "4.0" From 15927e9681619a201cd3715b2f74a840dcc82b20 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 8 May 2024 17:06:25 +0200 Subject: [PATCH 02/47] Add hardfork governance test --- cardano_node_tests/tests/reqs_conway.py | 3 + .../tests/tests_conway/test_hardfork.py | 281 ++++++++++++++++++ cardano_node_tests/utils/governance_utils.py | 15 +- src_docs/requirements_mapping.json | 6 +- 4 files changed, 303 insertions(+), 2 deletions(-) create mode 100644 cardano_node_tests/tests/tests_conway/test_hardfork.py diff --git a/cardano_node_tests/tests/reqs_conway.py b/cardano_node_tests/tests/reqs_conway.py index 0a0ab8b89..62cd4178d 100644 --- a/cardano_node_tests/tests/reqs_conway.py +++ b/cardano_node_tests/tests/reqs_conway.py @@ -47,6 +47,7 @@ def __r(id: str) -> requirements.Req: cip031b = __r("CIP031b") cip031c_01 = __r("intCIP031c-01") # anchor cip031c_02 = __r("intCIP031c-02") # script hash +cip031d = __r("CIP031d") cip031e = __r("CIP031e") cip031f = __r("CIP031f") cip032en = __r("intCIP032en") # enacted @@ -66,6 +67,7 @@ def __r(id: str) -> requirements.Req: cip040 = __r("CIP040") cip041 = __r("CIP041") cip042 = __r("CIP042") +cip043_01 = __r("intCIP043-01") cip044 = __r("CIP044") cip045 = __r("CIP045") cip046 = __r("CIP046") @@ -136,6 +138,7 @@ def __r(id: str) -> requirements.Req: cli016 = __r("CLI016") cli017 = __r("CLI017") cli018 = __r("CLI018") +cli019 = __r("CLI019") cli020 = __r("CLI020") cli021 = __r("CLI021") cli022 = __r("CLI022") diff --git a/cardano_node_tests/tests/tests_conway/test_hardfork.py b/cardano_node_tests/tests/tests_conway/test_hardfork.py new file mode 100644 index 000000000..3fcdc324b --- /dev/null +++ b/cardano_node_tests/tests/tests_conway/test_hardfork.py @@ -0,0 +1,281 @@ +"""Tests for Conway hard-fork.""" + +import logging + +import allure +import pytest +from cardano_clusterlib import clusterlib + +from cardano_node_tests.cluster_management import cluster_management +from cardano_node_tests.tests import common +from cardano_node_tests.tests import reqs_conway as reqc +from cardano_node_tests.tests.tests_conway import conway_common +from cardano_node_tests.utils import clusterlib_utils +from cardano_node_tests.utils import governance_setup +from cardano_node_tests.utils import governance_utils +from cardano_node_tests.utils import helpers +from cardano_node_tests.utils.versions import VERSIONS + +LOGGER = logging.getLogger(__name__) + +pytestmark = pytest.mark.skipif( + VERSIONS.transaction_era < VERSIONS.CONWAY, + reason="runs only with Tx era >= Conway", +) + + +@pytest.fixture +def pool_user_lg( + cluster_manager: cluster_management.ClusterManager, + cluster_lock_governance: governance_setup.GovClusterT, +) -> clusterlib.PoolUser: + """Create a pool user for "lock governance".""" + cluster, __ = cluster_lock_governance + key = helpers.get_current_line_str() + return conway_common.get_pool_user( + cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + ) + + +class TestHardfork: + """Tests for hard-fork.""" + + @pytest.fixture(scope="class") + def skip_hf_command(self): + if not clusterlib_utils.cli_has("action create-hardfork"): + pytest.skip("The `cardano-cli action create-hardfork` command is not available.") + + @pytest.fixture + def skip_hf_version( + self, + cluster_lock_governance: governance_setup.GovClusterT, + ): + cluster, __ = cluster_lock_governance + pv = cluster.g_conway_governance.query.gov_state()["currentPParams"]["protocolVersion"][ + "major" + ] + if pv != 9: + pytest.skip("The major protocol version needs to be 9.") + + @allure.link(helpers.get_vcs_link()) + @pytest.mark.long + def test_hardfork( + self, + skip_hf_command: None, # noqa: ARG002 + skip_hf_version: None, # noqa: ARG002 + cluster_manager: cluster_management.ClusterManager, + cluster_lock_governance: governance_setup.GovClusterT, + pool_user_lg: clusterlib.PoolUser, + ): + """Test hardfork action. + + * create a "hardfork" action + * check that DReps cannot vote during the bootstrap period + * vote to disapprove the action + * vote to approve the action + * check that the action is ratified + * try to disapprove the ratified action, this shouldn't have any effect + * check that the action is enacted + * check that it's not possible to vote on enacted action + """ + cluster, governance_data = cluster_lock_governance + temp_template = common.get_test_id(cluster) + + init_return_account_balance = cluster.g_query.get_stake_addr_info( + pool_user_lg.stake.address + ).reward_account_balance + + # Create an action + deposit_amt = cluster.conway_genesis["govActionDeposit"] + anchor_url = "http://www.hardfork.com" + anchor_data_hash = "5d372dca1a4cc90d7d16d966c48270e33e3aa0abcb0e78f0d5ca7ff330d2245d" + prev_action_rec = governance_utils.get_prev_action( + action_type=governance_utils.PrevGovActionIds.HARDFORK, + gov_state=cluster.g_conway_governance.query.gov_state(), + ) + + _url = helpers.get_vcs_link() + [ + r.start(url=_url) + for r in (reqc.cli019, reqc.cip031a_07, reqc.cip031d, reqc.cip038_07, reqc.cip054_07) + ] + + hardfork_action = cluster.g_conway_governance.action.create_hardfork( + action_name=temp_template, + deposit_amt=deposit_amt, + anchor_url=anchor_url, + anchor_data_hash=anchor_data_hash, + protocol_major_version=10, + protocol_minor_version=0, + prev_action_txid=prev_action_rec.txid, + prev_action_ix=prev_action_rec.ix, + deposit_return_stake_vkey_file=pool_user_lg.stake.vkey_file, + ) + [r.success() for r in (reqc.cip031a_07, reqc.cip031d, reqc.cip054_07)] + + tx_files_action = clusterlib.TxFiles( + proposal_files=[hardfork_action.action_file], + signing_key_files=[ + pool_user_lg.payment.skey_file, + ], + ) + + # Make sure we have enough time to submit the proposal and the votes in one epoch + clusterlib_utils.wait_for_epoch_interval( + cluster_obj=cluster, start=1, stop=common.EPOCH_STOP_SEC_BUFFER - 20 + ) + + tx_output_action = clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=f"{temp_template}_action", + src_address=pool_user_lg.payment.address, + use_build_cmd=True, + tx_files=tx_files_action, + ) + + out_utxos_action = cluster.g_query.get_utxo(tx_raw_output=tx_output_action) + assert ( + clusterlib.filter_utxos(utxos=out_utxos_action, address=pool_user_lg.payment.address)[ + 0 + ].amount + == clusterlib.calculate_utxos_balance(tx_output_action.txins) + - tx_output_action.fee + - deposit_amt + ), f"Incorrect balance for source address `{pool_user_lg.payment.address}`" + + action_txid = cluster.g_transaction.get_txid(tx_body_file=tx_output_action.out_file) + action_gov_state = cluster.g_conway_governance.query.gov_state() + _cur_epoch = cluster.g_query.get_epoch() + conway_common.save_gov_state( + gov_state=action_gov_state, name_template=f"{temp_template}_action_{_cur_epoch}" + ) + prop_action = governance_utils.lookup_proposal( + gov_state=action_gov_state, action_txid=action_txid + ) + assert prop_action, "Hardfork action not found" + assert ( + prop_action["proposalProcedure"]["govAction"]["tag"] + == governance_utils.ActionTags.HARDFORK_INIT.value + ), "Incorrect action tag" + + action_ix = prop_action["actionId"]["govActionIx"] + + # Check that DReps cannot vote + with pytest.raises(clusterlib.CLIError) as excinfo: + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_no", + payment_addr=pool_user_lg.payment, + action_txid=action_txid, + action_ix=action_ix, + approve_cc=False, + approve_drep=False, + approve_spo=False, + ) + err_str = str(excinfo.value) + assert "(DisallowedVotesDuringBootstrap ((DRepVoter" in err_str, err_str + + # Vote & disapprove the action + reqc.cip043_01.start(url=helpers.get_vcs_link()) + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_no", + payment_addr=pool_user_lg.payment, + action_txid=action_txid, + action_ix=action_ix, + approve_cc=False, + approve_spo=False, + ) + reqc.cli019.success() + + # Vote & approve the action + voted_votes = conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_yes", + payment_addr=pool_user_lg.payment, + action_txid=action_txid, + action_ix=action_ix, + approve_cc=True, + approve_spo=True, + ) + + # Testnet will be using an unexpected protocol version, respin is needed + cluster_manager.set_needs_respin() + + # Check ratification + _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) + rat_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=rat_gov_state, name_template=f"{temp_template}_rat_{_cur_epoch}" + ) + rat_action = governance_utils.lookup_ratified_actions( + gov_state=rat_gov_state, action_txid=action_txid + ) + assert rat_action, "Action not found in ratified actions" + reqc.cip043_01.success() + + # Disapprove ratified action, the voting shouldn't have any effect + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_after_ratification", + payment_addr=pool_user_lg.payment, + action_txid=action_txid, + action_ix=action_ix, + approve_cc=False, + approve_spo=False, + ) + + assert rat_gov_state["nextRatifyState"]["ratificationDelayed"], "Ratification not delayed" + reqc.cip038_07.success() + + # Check enactment + _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) + enact_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=enact_gov_state, name_template=f"{temp_template}_enact_{_cur_epoch}" + ) + assert ( + enact_gov_state["currentPParams"]["protocolVersion"]["major"] == 10 + ), "Incorrect major version" + + enact_prev_action_rec = governance_utils.get_prev_action( + action_type=governance_utils.PrevGovActionIds.HARDFORK, + gov_state=enact_gov_state, + ) + assert enact_prev_action_rec.txid == action_txid, "Incorrect previous action Txid" + assert enact_prev_action_rec.ix == action_ix, "Incorrect previous action index" + + enact_deposit_returned = cluster.g_query.get_stake_addr_info( + pool_user_lg.stake.address + ).reward_account_balance + + assert ( + enact_deposit_returned == init_return_account_balance + deposit_amt + ), "Incorrect return account balance" + + # Try to vote on enacted action + with pytest.raises(clusterlib.CLIError) as excinfo: + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_enacted", + payment_addr=pool_user_lg.payment, + action_txid=action_txid, + action_ix=action_ix, + approve_drep=False, + approve_spo=False, + ) + err_str = str(excinfo.value) + assert "(GovActionsDoNotExist" in err_str, err_str + + # Check action view + governance_utils.check_action_view(cluster_obj=cluster, action_data=hardfork_action) + + # Check vote view + if voted_votes.cc: + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.cc[0]) + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=voted_votes.spo[0]) diff --git a/cardano_node_tests/utils/governance_utils.py b/cardano_node_tests/utils/governance_utils.py index 126d8b4c6..6e5517292 100644 --- a/cardano_node_tests/utils/governance_utils.py +++ b/cardano_node_tests/utils/governance_utils.py @@ -15,11 +15,12 @@ ActionsAllT = tp.Union[ # pylint: disable=invalid-name clusterlib.ActionConstitution, + clusterlib.ActionHardfork, clusterlib.ActionInfo, clusterlib.ActionNoConfidence, clusterlib.ActionPParamsUpdate, - clusterlib.ActionUpdateCommittee, clusterlib.ActionTreasuryWithdrawal, + clusterlib.ActionUpdateCommittee, ] VotesAllT = tp.Union[ # pylint: disable=invalid-name @@ -76,6 +77,7 @@ class ActionTags(enum.Enum): TREASURY_WITHDRAWALS = "TreasuryWithdrawals" INFO_ACTION = "InfoAction" NO_CONFIDENCE = "NoConfidence" + HARDFORK_INIT = "HardForkInitiation" def get_drep_cred_name(drep_id: str) -> str: @@ -376,6 +378,17 @@ def _get_cvkey_hash(member: clusterlib.CCMember) -> str: else None, "tag": ActionTags.NO_CONFIDENCE.value, } + elif isinstance(action_data, clusterlib.ActionHardfork): + gov_action = { + "contents": [ + None, # TODO 8.11: what is this? + { + "major": action_data.protocol_major_version, + "minor": action_data.protocol_minor_version, + }, + ], + "tag": ActionTags.HARDFORK_INIT.value, + } else: msg = f"Not implemented for action `{action_data}`" raise NotImplementedError(msg) diff --git a/src_docs/requirements_mapping.json b/src_docs/requirements_mapping.json index abdc6743a..360a350bd 100644 --- a/src_docs/requirements_mapping.json +++ b/src_docs/requirements_mapping.json @@ -1,7 +1,7 @@ { "chang_us": { "CIP020": ["intCIP020-01", "intCIP020-02", "intCIP020-03"], - "CIP028": ["CLI018", "CIP031b", "CIP031c", "CIP031d", "CIP031e", "CIP031f", "CLI031"], + "CIP028": ["CLI013", "CLI014", "CLI015", "CLI016", "CLI017", "CLI018", "CLI019"], "CIP030": ["intCIP030en", "intCIP030ex"], "CIP031a": [ "intCIP031a-01", @@ -24,6 +24,10 @@ "intCIP038-06", "intCIP038-07" ], + "CIP043": [ + "intCIP043-01", + "intCIP043-02" + ], "CIP054": [ "intCIP054-01", "intCIP054-02", From b2eacadcc2be455b80cc04d456a00df37e102437 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 8 May 2024 17:22:24 +0200 Subject: [PATCH 03/47] Pass deposit value --- cardano_node_tests/tests/issues.py | 2 +- cardano_node_tests/utils/clusterlib_utils.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index 8581b98e3..a40abd389 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -10,7 +10,7 @@ issue=484, repo="IntersectMBO/cardano-api", fixed_in="8.11.0", # Unknown yet, will be fixed/changed sometime in the future - message="repeated certificates stripped from Conway transaction.", + message="Repeated certificates stripped from Conway transaction.", ) cli_49 = blockers.GH(issue=49, repo="IntersectMBO/cardano-cli", message="Not sending pings.") diff --git a/cardano_node_tests/utils/clusterlib_utils.py b/cardano_node_tests/utils/clusterlib_utils.py index 5d12cc93a..ebfed568a 100644 --- a/cardano_node_tests/utils/clusterlib_utils.py +++ b/cardano_node_tests/utils/clusterlib_utils.py @@ -149,6 +149,7 @@ def build_and_submit_tx( required_signer_hashes=required_signer_hashes, withdrawals=withdrawals, script_withdrawals=script_withdrawals, + deposit=deposit, invalid_hereafter=invalid_hereafter, invalid_before=invalid_before, witness_count_add=witness_count_add, From 22e11c170d7e3f57f7d67827d3623667b7e3d997 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 15 May 2024 18:07:21 +0200 Subject: [PATCH 04/47] Use dev_workdir for dev cluster --- .gitignore | 1 + README.md | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 09c61dbfb..808f18294 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Workdir for running tests run_workdir/ +dev_workdir/ # Status files of cluster instances /state-cluster*/ diff --git a/README.md b/README.md index 7c4537e82..0056d575b 100644 --- a/README.md +++ b/README.md @@ -182,19 +182,21 @@ When running tests, the testing framework starts and stops cluster instances as 1. prepare cluster scripts for starting local cluster directly in Babbage era ```sh - prepare-cluster-scripts -d /babbage_fast -s cardano_node_tests/cluster_scripts/babbage_fast/ + mkdir -p dev_workdir + prepare-cluster-scripts -c -d dev_workdir/babbage_fast -s cardano_node_tests/cluster_scripts/babbage_fast/ ``` 1. set env variables ```sh - export CARDANO_NODE_SOCKET_PATH=/state-cluster0/bft1.socket DEV_CLUSTER_RUNNING=1 + export CARDANO_NODE_SOCKET_PATH="$PWD/dev_workdir/state-cluster0/bft1.socket" DEV_CLUSTER_RUNNING=1 + mkdir -p "${CARDANO_NODE_SOCKET_PATH%/*}" ``` 1. start the cluster instance in development mode ```sh - /babbage_fast/start-cluster + ./dev_workdir/babbage_fast/start-cluster ``` After the cluster starts, keys and configuration files are available in the `/state-cluster0` directory. The pool-related files and keys are located in the `nodes` subdirectory, genesis keys in the `shelley` and `byron` subdirectories, and payment address with initial funds and related keys in the `byron` subdirectory. The local faucet address and related key files are stored in the `addrs_data` subdirectory. From bb5d739ccff1fb53fb2aec8737e063a87bca4a26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 08:26:12 +0000 Subject: [PATCH 05/47] Bump cachix/install-nix-action from 26 to 27 Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 26 to 27. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v26...V27) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/nix_smoke.yaml | 2 +- .github/workflows/regression_reusable.yaml | 2 +- .github/workflows/upgrade_reusable.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nix_smoke.yaml b/.github/workflows/nix_smoke.yaml index 2aa6b550e..e7e7a1d00 100644 --- a/.github/workflows/nix_smoke.yaml +++ b/.github/workflows/nix_smoke.yaml @@ -17,7 +17,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@V27 with: extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/regression_reusable.yaml b/.github/workflows/regression_reusable.yaml index 85830322a..07470802a 100644 --- a/.github/workflows/regression_reusable.yaml +++ b/.github/workflows/regression_reusable.yaml @@ -71,7 +71,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@V27 with: extra_nix_config: | access-tokens = github.com=${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/upgrade_reusable.yaml b/.github/workflows/upgrade_reusable.yaml index a311e63e7..c5d1fad36 100644 --- a/.github/workflows/upgrade_reusable.yaml +++ b/.github/workflows/upgrade_reusable.yaml @@ -26,7 +26,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@V27 with: extra_nix_config: | access-tokens = github.com=${{ secrets.GH_TOKEN }} From b9354fd5e9d1a9b20b376ccae7916dea62179f00 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 15 May 2024 14:21:48 +0200 Subject: [PATCH 06/47] Changes needed for testing node 8.11.0 --- .github/regression.sh | 19 ++++++--- .github/workflows/regression.yaml | 3 +- .../babbage/genesis.conway.spec.json | 2 +- .../release_8_9-genesis.conway.spec.json | 40 +++++++++++++++++++ .../cluster_scripts/babbage/start-cluster | 9 +++++ .../babbage_fast/genesis.conway.spec.json | 2 +- .../release_8_9-genesis.conway.spec.json | 40 +++++++++++++++++++ .../babbage_fast/start-cluster | 9 +++++ .../conway/genesis.alonzo.spec.json | 4 ++ .../conway/genesis.conway.spec.json | 1 + .../conway_fast/genesis.alonzo.spec.json | 4 ++ .../conway_fast/genesis.conway.spec.json | 1 + .../mainnet_fast/genesis.conway.spec.json | 2 +- .../release_8_9-genesis.conway.spec.json | 40 +++++++++++++++++++ .../mainnet_fast/start-cluster | 9 +++++ .../tests/tests_conway/test_hardfork.py | 7 +++- cardano_node_tests/utils/configuration.py | 3 ++ 17 files changed, 184 insertions(+), 11 deletions(-) create mode 100644 cardano_node_tests/cluster_scripts/babbage/release_8_9-genesis.conway.spec.json create mode 100644 cardano_node_tests/cluster_scripts/babbage_fast/release_8_9-genesis.conway.spec.json create mode 100644 cardano_node_tests/cluster_scripts/mainnet_fast/release_8_9-genesis.conway.spec.json diff --git a/.github/regression.sh b/.github/regression.sh index 3a8d17fd8..5e1af4c8d 100755 --- a/.github/regression.sh +++ b/.github/regression.sh @@ -78,9 +78,9 @@ export SCHEDULING_LOG=scheduling.log true > "$SCHEDULING_LOG" MARKEXPR="${MARKEXPR:-""}" -if [ "${MARKEXPR:-""}" = "all" ]; then +if [ "$MARKEXPR" = "all" ]; then unset MARKEXPR -elif [ "${MARKEXPR:-""}" = "conway only" ]; then +elif [ "$MARKEXPR" = "conway only" ]; then unset MARKEXPR export TESTS_DIR="cardano_node_tests/tests/tests_conway" fi @@ -89,11 +89,20 @@ if [ -n "${CLUSTERS_COUNT:-""}" ]; then export CLUSTERS_COUNT fi -export CLUSTER_ERA="${CLUSTER_ERA:-"$DEFAULT_CLUSTER_ERA"}" +CLUSTER_ERA="${CLUSTER_ERA:-"$DEFAULT_CLUSTER_ERA"}" +if [ "$CLUSTER_ERA" = "conway 9" ]; then + unset PV10 + CLUSTER_ERA="conway" +elif [ "$CLUSTER_ERA" = "conway 10" ]; then + export PV10=1 + CLUSTER_ERA="conway" +fi +export CLUSTER_ERA -if [ "${TX_ERA:-""}" = "default" ]; then +TX_ERA="${TX_ERA:-""}" +if [ "$TX_ERA" = "default" ]; then export TX_ERA="" -elif [ "${TX_ERA:-""}" = "conway" ]; then +elif [ "$TX_ERA" = "conway" ]; then unset TX_ERA export COMMAND_ERA="conway" fi diff --git a/.github/workflows/regression.yaml b/.github/workflows/regression.yaml index 101d1af6b..b1934b10f 100644 --- a/.github/workflows/regression.yaml +++ b/.github/workflows/regression.yaml @@ -11,7 +11,8 @@ on: description: "Cluster era" options: - babbage - - conway + - conway 9 + - conway 10 default: babbage tx_era: type: choice diff --git a/cardano_node_tests/cluster_scripts/babbage/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/babbage/genesis.conway.spec.json index 12d461512..441178802 100644 --- a/cardano_node_tests/cluster_scripts/babbage/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/babbage/genesis.conway.spec.json @@ -25,6 +25,7 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "constitution": { "anchor": { "url": "", @@ -34,7 +35,6 @@ "committee": { "members": { }, - "quorum": 0.0, "threshold": 0.0 } } diff --git a/cardano_node_tests/cluster_scripts/babbage/release_8_9-genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/babbage/release_8_9-genesis.conway.spec.json new file mode 100644 index 000000000..12d461512 --- /dev/null +++ b/cardano_node_tests/cluster_scripts/babbage/release_8_9-genesis.conway.spec.json @@ -0,0 +1,40 @@ +{ + "poolVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "ppSecurityGroup": 0.51 + }, + "dRepVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 + }, + "committeeMinSize": 0, + "committeeMaxTermLength": 11000, + "govActionLifetime": 2, + "govActionDeposit": 100000000, + "dRepDeposit": 2000000, + "dRepActivity": 100, + "minFeeRefScriptCostPerByte": 0, + "constitution": { + "anchor": { + "url": "", + "dataHash": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "committee": { + "members": { + }, + "quorum": 0.0, + "threshold": 0.0 + } +} diff --git a/cardano_node_tests/cluster_scripts/babbage/start-cluster b/cardano_node_tests/cluster_scripts/babbage/start-cluster index 3aabc029a..730a974e4 100644 --- a/cardano_node_tests/cluster_scripts/babbage/start-cluster +++ b/cardano_node_tests/cluster_scripts/babbage/start-cluster @@ -242,6 +242,15 @@ if [ "$genesis_created" -eq 0 ] ; then echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" mv "$STATE_CLUSTER/shelley/genesis.conway.spec.json" \ "$STATE_CLUSTER/shelley/master-genesis.conway.spec.json" + mv "$STATE_CLUSTER/shelley/release_8_9-genesis.conway.spec.json" \ + "$STATE_CLUSTER/shelley/genesis.conway.spec.json" + gen_genesis && genesis_created=1 || genesis_created=0 +fi + +if [ "$genesis_created" -eq 0 ] ; then + echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" + mv "$STATE_CLUSTER/shelley/genesis.conway.spec.json" \ + "$STATE_CLUSTER/shelley/release_8_9-genesis.conway.spec.json" mv "$STATE_CLUSTER/shelley/release-genesis.conway.spec.json" \ "$STATE_CLUSTER/shelley/genesis.conway.spec.json" gen_genesis && genesis_created=1 || genesis_created=0 diff --git a/cardano_node_tests/cluster_scripts/babbage_fast/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/babbage_fast/genesis.conway.spec.json index 12d461512..441178802 100644 --- a/cardano_node_tests/cluster_scripts/babbage_fast/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/babbage_fast/genesis.conway.spec.json @@ -25,6 +25,7 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "constitution": { "anchor": { "url": "", @@ -34,7 +35,6 @@ "committee": { "members": { }, - "quorum": 0.0, "threshold": 0.0 } } diff --git a/cardano_node_tests/cluster_scripts/babbage_fast/release_8_9-genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/babbage_fast/release_8_9-genesis.conway.spec.json new file mode 100644 index 000000000..12d461512 --- /dev/null +++ b/cardano_node_tests/cluster_scripts/babbage_fast/release_8_9-genesis.conway.spec.json @@ -0,0 +1,40 @@ +{ + "poolVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "ppSecurityGroup": 0.51 + }, + "dRepVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 + }, + "committeeMinSize": 0, + "committeeMaxTermLength": 11000, + "govActionLifetime": 2, + "govActionDeposit": 100000000, + "dRepDeposit": 2000000, + "dRepActivity": 100, + "minFeeRefScriptCostPerByte": 0, + "constitution": { + "anchor": { + "url": "", + "dataHash": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "committee": { + "members": { + }, + "quorum": 0.0, + "threshold": 0.0 + } +} diff --git a/cardano_node_tests/cluster_scripts/babbage_fast/start-cluster b/cardano_node_tests/cluster_scripts/babbage_fast/start-cluster index 9e7d7cb72..3ca718301 100644 --- a/cardano_node_tests/cluster_scripts/babbage_fast/start-cluster +++ b/cardano_node_tests/cluster_scripts/babbage_fast/start-cluster @@ -208,6 +208,15 @@ if [ "$genesis_created" -eq 0 ] ; then echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" mv "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" \ "$STATE_CLUSTER/create_staked/master-genesis.conway.spec.json" + mv "$STATE_CLUSTER/create_staked/release_8_9-genesis.conway.spec.json" \ + "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" + gen_genesis && genesis_created=1 || genesis_created=0 +fi + +if [ "$genesis_created" -eq 0 ] ; then + echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" + mv "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" \ + "$STATE_CLUSTER/create_staked/release_8_9-genesis.conway.spec.json" mv "$STATE_CLUSTER/create_staked/release-genesis.conway.spec.json" \ "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" gen_genesis && genesis_created=1 || genesis_created=0 diff --git a/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json b/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json index e3f7b71bf..7df7b1e59 100644 --- a/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json +++ b/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json @@ -454,6 +454,8 @@ "equalsByteString-cpu-arguments-constant": 245000, "equalsByteString-cpu-arguments-intercept": 216773, "equalsByteString-cpu-arguments-slope": 62, + "equalsByteString-cpu-arguments-model-arguments-intercept": 150000, + "equalsByteString-cpu-arguments-model-arguments-slope": 247, "equalsByteString-memory-arguments": 1, "equalsData-cpu-arguments-intercept": 1060367, "equalsData-cpu-arguments-slope": 12586, @@ -464,6 +466,8 @@ "equalsString-cpu-arguments-constant": 187000, "equalsString-cpu-arguments-intercept": 1000, "equalsString-cpu-arguments-slope": 52998, + "equalsString-cpu-arguments-model-arguments-intercept": 150000, + "equalsString-cpu-arguments-model-arguments-slope": 1000, "equalsString-memory-arguments": 1, "fstPair-cpu-arguments": 80436, "fstPair-memory-arguments": 32, diff --git a/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json index e32c23f79..441178802 100644 --- a/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json @@ -25,6 +25,7 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "constitution": { "anchor": { "url": "", diff --git a/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json b/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json index e3f7b71bf..7df7b1e59 100644 --- a/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json +++ b/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json @@ -454,6 +454,8 @@ "equalsByteString-cpu-arguments-constant": 245000, "equalsByteString-cpu-arguments-intercept": 216773, "equalsByteString-cpu-arguments-slope": 62, + "equalsByteString-cpu-arguments-model-arguments-intercept": 150000, + "equalsByteString-cpu-arguments-model-arguments-slope": 247, "equalsByteString-memory-arguments": 1, "equalsData-cpu-arguments-intercept": 1060367, "equalsData-cpu-arguments-slope": 12586, @@ -464,6 +466,8 @@ "equalsString-cpu-arguments-constant": 187000, "equalsString-cpu-arguments-intercept": 1000, "equalsString-cpu-arguments-slope": 52998, + "equalsString-cpu-arguments-model-arguments-intercept": 150000, + "equalsString-cpu-arguments-model-arguments-slope": 1000, "equalsString-memory-arguments": 1, "fstPair-cpu-arguments": 80436, "fstPair-memory-arguments": 32, diff --git a/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json index e32c23f79..441178802 100644 --- a/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json @@ -25,6 +25,7 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "constitution": { "anchor": { "url": "", diff --git a/cardano_node_tests/cluster_scripts/mainnet_fast/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/mainnet_fast/genesis.conway.spec.json index 12d461512..441178802 100644 --- a/cardano_node_tests/cluster_scripts/mainnet_fast/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/mainnet_fast/genesis.conway.spec.json @@ -25,6 +25,7 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "constitution": { "anchor": { "url": "", @@ -34,7 +35,6 @@ "committee": { "members": { }, - "quorum": 0.0, "threshold": 0.0 } } diff --git a/cardano_node_tests/cluster_scripts/mainnet_fast/release_8_9-genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/mainnet_fast/release_8_9-genesis.conway.spec.json new file mode 100644 index 000000000..d97a1622d --- /dev/null +++ b/cardano_node_tests/cluster_scripts/mainnet_fast/release_8_9-genesis.conway.spec.json @@ -0,0 +1,40 @@ +{ + "poolVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "ppSecurityGroup": 0.51 + }, + "dRepVotingThresholds": { + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.0, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 + }, + "committeeMinSize": 0, + "committeeMaxTermLength": 11000, + "govActionLifetime": 2, + "govActionDeposit": 100000000, + "dRepDeposit": 2000000, + "dRepActivity": 100, + "minFeeRefScriptCostPerByte": 0, + "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], + "constitution": { + "anchor": { + "url": "", + "dataHash": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "committee": { + "members": { + }, + "threshold": 0.0 + } +} diff --git a/cardano_node_tests/cluster_scripts/mainnet_fast/start-cluster b/cardano_node_tests/cluster_scripts/mainnet_fast/start-cluster index 76a4dbe48..8babb690f 100644 --- a/cardano_node_tests/cluster_scripts/mainnet_fast/start-cluster +++ b/cardano_node_tests/cluster_scripts/mainnet_fast/start-cluster @@ -202,6 +202,15 @@ if [ "$genesis_created" -eq 0 ] ; then echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" mv "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" \ "$STATE_CLUSTER/create_staked/master-genesis.conway.spec.json" + mv "$STATE_CLUSTER/create_staked/release_8_9-genesis.conway.spec.json" \ + "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" + gen_genesis && genesis_created=1 || genesis_created=0 +fi + +if [ "$genesis_created" -eq 0 ] ; then + echo "Failed to generate genesis files, retrying with a different genesis.conway.spec.json" + mv "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" \ + "$STATE_CLUSTER/create_staked/release_8_9-genesis.conway.spec.json" mv "$STATE_CLUSTER/create_staked/release-genesis.conway.spec.json" \ "$STATE_CLUSTER/create_staked/genesis.conway.spec.json" gen_genesis && genesis_created=1 || genesis_created=0 diff --git a/cardano_node_tests/tests/tests_conway/test_hardfork.py b/cardano_node_tests/tests/tests_conway/test_hardfork.py index 3fcdc324b..77efe32ff 100644 --- a/cardano_node_tests/tests/tests_conway/test_hardfork.py +++ b/cardano_node_tests/tests/tests_conway/test_hardfork.py @@ -42,8 +42,11 @@ class TestHardfork: @pytest.fixture(scope="class") def skip_hf_command(self): - if not clusterlib_utils.cli_has("action create-hardfork"): - pytest.skip("The `cardano-cli action create-hardfork` command is not available.") + if not clusterlib_utils.cli_has("conway governance action create-hardfork"): + pytest.skip( + "The `cardano-cli conway governance action create-hardfork` command " + "is not available." + ) @pytest.fixture def skip_hf_version( diff --git a/cardano_node_tests/utils/configuration.py b/cardano_node_tests/utils/configuration.py index 7f4505c85..d9264c9f3 100644 --- a/cardano_node_tests/utils/configuration.py +++ b/cardano_node_tests/utils/configuration.py @@ -39,6 +39,9 @@ def _check_cardano_node_socket_path() -> None: # used also in startup scripts as `if [ -n "$VAR" ]...` HAS_CC = (os.environ.get("NO_CC") or "") == "" +# used also in startup scripts as `if [ -n "$VAR" ]...` +PV10 = (os.environ.get("PV10") or "") == "" + # used also in startup scripts DB_BACKEND = os.environ.get("DB_BACKEND") or "" if DB_BACKEND not in ("", "mem", "lmdb"): From fd5392fdbad14d9c5fa74a64a6de47fbbc4e6f5b Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 16 May 2024 13:02:09 +0200 Subject: [PATCH 07/47] Wait for at least the middle of epoch We want the original node to have time to forge blocks. --- cardano_node_tests/tests/test_blocks.py | 30 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/cardano_node_tests/tests/test_blocks.py b/cardano_node_tests/tests/test_blocks.py index ee2640dbc..45f0b22f2 100644 --- a/cardano_node_tests/tests/test_blocks.py +++ b/cardano_node_tests/tests/test_blocks.py @@ -442,6 +442,16 @@ def test_dynamic_block_production( ) ) + def _save_state(curr_epoch: int) -> tp.Dict[str, int]: + ledger_state = clusterlib_utils.get_ledger_state(cluster_obj=cluster) + clusterlib_utils.save_ledger_state( + cluster_obj=cluster, + state_name=f"{temp_template}_epoch{curr_epoch}", + ledger_state=ledger_state, + ) + blocks_before: tp.Dict[str, int] = ledger_state["blocksBefore"] + return blocks_before + # Blocks are produced by BFT node in Byron epoch and first Shelley epoch on local cluster # that starts in Byron era. curr_epoch = cluster.g_query.get_epoch() @@ -456,6 +466,16 @@ def test_dynamic_block_production( if curr_epoch < 1: curr_epoch = cluster.wait_for_new_epoch(new_epochs=1) + # Wait for the epoch to be at least half way through and not too close to the end. + # We want the original pool to have time to forge blocks in this epoch, before it becomes + # backup node. + # And we want to have enough time to replace the node's configuration before the epoch ends. + clusterlib_utils.wait_for_epoch_interval( + cluster_obj=cluster, + start=(cluster.epoch_length_sec // 2), + stop=-50, + ) + # The cluster needs respin after this point cluster_manager.set_needs_respin() @@ -463,16 +483,6 @@ def test_dynamic_block_production( self.reconf_for_dynamic() cluster_nodes.restart_all_nodes() - def _save_state(curr_epoch: int) -> tp.Dict[str, int]: - ledger_state = clusterlib_utils.get_ledger_state(cluster_obj=cluster) - clusterlib_utils.save_ledger_state( - cluster_obj=cluster, - state_name=f"{temp_template}_epoch{curr_epoch}", - ledger_state=ledger_state, - ) - blocks_before: tp.Dict[str, int] = ledger_state["blocksBefore"] - return blocks_before - tip = cluster.g_query.get_tip() epoch_end = cluster.time_to_epoch_end(tip) curr_epoch = int(tip["epoch"]) From 47cbf1e0087100351830bb0e056c23603436d10e Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 16 May 2024 13:20:58 +0200 Subject: [PATCH 08/47] Use protocol version 10 in Conway nightly --- .github/env_nightly_conway_cc | 1 + .github/env_nightly_conway_nocc | 1 + src_docs/source/test_results/nightly_system_tests.rst | 2 ++ 3 files changed, 4 insertions(+) diff --git a/.github/env_nightly_conway_cc b/.github/env_nightly_conway_cc index 68ace95ae..287455cba 100644 --- a/.github/env_nightly_conway_cc +++ b/.github/env_nightly_conway_cc @@ -1,3 +1,4 @@ CLUSTER_ERA=conway COMMAND_ERA=conway +PV10=true ENABLE_P2P=true diff --git a/.github/env_nightly_conway_nocc b/.github/env_nightly_conway_nocc index 4e6248bff..6e1be0a5a 100644 --- a/.github/env_nightly_conway_nocc +++ b/.github/env_nightly_conway_nocc @@ -1,4 +1,5 @@ CLUSTER_ERA=conway COMMAND_ERA=conway NO_CC=true +PV10=true ENABLE_P2P=true diff --git a/src_docs/source/test_results/nightly_system_tests.rst b/src_docs/source/test_results/nightly_system_tests.rst index 7fec26bf7..9d827a4b1 100644 --- a/src_docs/source/test_results/nightly_system_tests.rst +++ b/src_docs/source/test_results/nightly_system_tests.rst @@ -46,11 +46,13 @@ Nightly results * cluster starts directly in Babbage era * `nightly-conway-cc `__: |nightly-conway-cc-badge| * network in Conway era + * protocol version 10 * P2P network topology * Constitutional Commitee has 3 members * cluster starts directly in Conway era * `nightly-conway-no-cc `__: |nightly-conway-nocc-badge| * network in Conway era + * protocol version 10 * P2P network topology * Constitutional Commitee has 0 members * cluster starts directly in Conway era From ca3dea1bcbaaa80f078061cdcf8dce7d28494568 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 16 May 2024 18:03:23 +0200 Subject: [PATCH 09/47] Fix PlutusV3 cost models --- .../conway/genesis.conway.spec.json | 236 +++++++++++++++++- .../conway_fast/genesis.conway.spec.json | 236 +++++++++++++++++- 2 files changed, 470 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json index 441178802..32989e92a 100644 --- a/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/conway/genesis.conway.spec.json @@ -25,7 +25,241 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, - "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], + "plutusV3CostModel": [ + 205665, + 812, + 1, + 1, + 1000, + 571, + 0, + 1, + 1000, + 24177, + 4, + 1, + 1000, + 32, + 117366, + 10475, + 4, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 100, + 100, + 23000, + 100, + 19537, + 32, + 175354, + 32, + 46417, + 4, + 221973, + 511, + 0, + 1, + 89141, + 32, + 497525, + 14068, + 4, + 2, + 196500, + 453240, + 220, + 0, + 1, + 1, + 1000, + 28662, + 4, + 2, + 245000, + 216773, + 62, + 1, + 1060367, + 12586, + 1, + 208512, + 421, + 1, + 187000, + 1000, + 52998, + 1, + 80436, + 32, + 43249, + 32, + 1000, + 32, + 80556, + 1, + 57667, + 4, + 1000, + 10, + 197145, + 156, + 1, + 197145, + 156, + 1, + 204924, + 473, + 1, + 208896, + 511, + 1, + 52467, + 32, + 64832, + 32, + 65493, + 32, + 22558, + 32, + 16563, + 32, + 76511, + 32, + 196500, + 453240, + 220, + 0, + 1, + 1, + 69522, + 11687, + 0, + 1, + 60091, + 32, + 196500, + 453240, + 220, + 0, + 1, + 1, + 196500, + 453240, + 220, + 0, + 1, + 1, + 1159724, + 392670, + 0, + 2, + 806990, + 30482, + 4, + 1927926, + 82523, + 4, + 265318, + 0, + 4, + 0, + 85931, + 32, + 205665, + 812, + 1, + 1, + 41182, + 32, + 212342, + 32, + 31220, + 32, + 32696, + 32, + 43357, + 32, + 32247, + 32, + 38314, + 32, + 35190005, + 10, + 57996947, + 18975, + 10, + 39121781, + 32260, + 10, + 23000, + 100, + 23000, + 100, + 832808, + 18, + 3209094, + 6, + 331451, + 1, + 65990684, + 23097, + 18, + 114242, + 18, + 94393407, + 87060, + 18, + 16420089, + 18, + 2145798, + 36, + 3795345, + 12, + 889023, + 1, + 204237282, + 23271, + 36, + 129165, + 36, + 189977790, + 85902, + 36, + 33012864, + 36, + 388443360, + 1, + 401885761, + 72, + 2331379, + 72, + 1927926, + 82523, + 4, + 117366, + 10475, + 4, + 1292075, + 24469, + 74, + 0, + 1, + 936157, + 49601, + 237, + 0, + 1 + ], "constitution": { "anchor": { "url": "", diff --git a/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json b/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json index 441178802..32989e92a 100644 --- a/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json +++ b/cardano_node_tests/cluster_scripts/conway_fast/genesis.conway.spec.json @@ -25,7 +25,241 @@ "dRepDeposit": 2000000, "dRepActivity": 100, "minFeeRefScriptCostPerByte": 0, - "plutusV3CostModel": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], + "plutusV3CostModel": [ + 205665, + 812, + 1, + 1, + 1000, + 571, + 0, + 1, + 1000, + 24177, + 4, + 1, + 1000, + 32, + 117366, + 10475, + 4, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 23000, + 100, + 100, + 100, + 23000, + 100, + 19537, + 32, + 175354, + 32, + 46417, + 4, + 221973, + 511, + 0, + 1, + 89141, + 32, + 497525, + 14068, + 4, + 2, + 196500, + 453240, + 220, + 0, + 1, + 1, + 1000, + 28662, + 4, + 2, + 245000, + 216773, + 62, + 1, + 1060367, + 12586, + 1, + 208512, + 421, + 1, + 187000, + 1000, + 52998, + 1, + 80436, + 32, + 43249, + 32, + 1000, + 32, + 80556, + 1, + 57667, + 4, + 1000, + 10, + 197145, + 156, + 1, + 197145, + 156, + 1, + 204924, + 473, + 1, + 208896, + 511, + 1, + 52467, + 32, + 64832, + 32, + 65493, + 32, + 22558, + 32, + 16563, + 32, + 76511, + 32, + 196500, + 453240, + 220, + 0, + 1, + 1, + 69522, + 11687, + 0, + 1, + 60091, + 32, + 196500, + 453240, + 220, + 0, + 1, + 1, + 196500, + 453240, + 220, + 0, + 1, + 1, + 1159724, + 392670, + 0, + 2, + 806990, + 30482, + 4, + 1927926, + 82523, + 4, + 265318, + 0, + 4, + 0, + 85931, + 32, + 205665, + 812, + 1, + 1, + 41182, + 32, + 212342, + 32, + 31220, + 32, + 32696, + 32, + 43357, + 32, + 32247, + 32, + 38314, + 32, + 35190005, + 10, + 57996947, + 18975, + 10, + 39121781, + 32260, + 10, + 23000, + 100, + 23000, + 100, + 832808, + 18, + 3209094, + 6, + 331451, + 1, + 65990684, + 23097, + 18, + 114242, + 18, + 94393407, + 87060, + 18, + 16420089, + 18, + 2145798, + 36, + 3795345, + 12, + 889023, + 1, + 204237282, + 23271, + 36, + 129165, + 36, + 189977790, + 85902, + 36, + 33012864, + 36, + 388443360, + 1, + 401885761, + 72, + 2331379, + 72, + 1927926, + 82523, + 4, + 117366, + 10475, + 4, + 1292075, + 24469, + 74, + 0, + 1, + 936157, + 49601, + 237, + 0, + 1 + ], "constitution": { "anchor": { "url": "", From 549ef4d0e007df6852f6705d5186158537b93404 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 16 May 2024 18:21:57 +0200 Subject: [PATCH 10/47] XFAIL on cli issue (PR) 768 --- cardano_node_tests/tests/issues.py | 6 ++++++ cardano_node_tests/tests/test_tx_negative.py | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index a40abd389..1f5869570 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -39,6 +39,12 @@ fixed_in="8.22.0.1", # Fixed in a release after 8.22.0.0 message="Option `--reference-script-size` required.", ) +cli_768 = blockers.GH( + issue=768, + repo="IntersectMBO/cardano-cli", + fixed_in="8.23.1.1", # Fixed in a release after 8.23.1.0 + message="Option `--fee` not required.", +) consensus_973 = blockers.GH( issue=973, diff --git a/cardano_node_tests/tests/test_tx_negative.py b/cardano_node_tests/tests/test_tx_negative.py index 5c6772ab7..2365bce31 100644 --- a/cardano_node_tests/tests/test_tx_negative.py +++ b/cardano_node_tests/tests/test_tx_negative.py @@ -1319,7 +1319,8 @@ def test_missing_fee( txins=tx_raw_output.txins, txouts=tx_raw_output.txouts ) - with pytest.raises(clusterlib.CLIError) as excinfo: + err_str = "" + try: cluster.cli( [ "transaction", @@ -1332,7 +1333,10 @@ def test_missing_fee( *helpers.prepend_flag("--tx-out", txouts), ] ) - err_str = str(excinfo.value) + except clusterlib.CLIError as exc: + err_str = str(exc) + else: + issues.cli_768.finish_test() if "Transaction _ fee not supported in" in err_str: issues.node_4591.finish_test() From e258cd2b5dd4c6c28be7de3e97acb8c00a3423e8 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 9 May 2024 17:50:43 +0200 Subject: [PATCH 11/47] Test DRep inactivity --- cardano_node_tests/tests/issues.py | 6 + .../tests/tests_conway/conway_common.py | 37 +- .../tests/tests_conway/test_committee.py | 16 +- .../tests/tests_conway/test_constitution.py | 8 +- .../tests/tests_conway/test_drep.py | 485 +++++++++++++++++- .../tests/tests_conway/test_hardfork.py | 8 +- .../tests/tests_conway/test_info.py | 8 +- .../tests/tests_conway/test_no_confidence.py | 8 +- .../tests/tests_conway/test_pparam_update.py | 4 +- .../tests_conway/test_treasury_withdrawals.py | 8 +- cardano_node_tests/utils/governance_utils.py | 14 + 11 files changed, 555 insertions(+), 47 deletions(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index 1f5869570..f400069ad 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -98,6 +98,12 @@ fixed_in="8.11.0", message="Resigned CC members can approve actions.", ) +ledger_4346 = blockers.GH( + issue=4346, + repo="IntersectMBO/cardano-ledger", + fixed_in="8.12.0", # Unknown yet, will be fixed/changed sometime in the future + message="Inactive DRep expiry gets incremented.", +) node_3788 = blockers.GH( issue=3788, diff --git a/cardano_node_tests/tests/tests_conway/conway_common.py b/cardano_node_tests/tests/tests_conway/conway_common.py index 526abaaaf..9b1dc79b8 100644 --- a/cardano_node_tests/tests/tests_conway/conway_common.py +++ b/cardano_node_tests/tests/tests_conway/conway_common.py @@ -102,24 +102,39 @@ def save_committee_state(committee_state: tp.Dict[str, tp.Any], name_template: s json.dump(committee_state, out_fp, indent=2) -def get_pool_user( +def save_drep_state(drep_state: governance_utils.DRepStateT, name_template: str) -> None: + """Save DRep state to a file.""" + with open(f"{name_template}_drep_state.json", "w", encoding="utf-8") as out_fp: + json.dump(drep_state, out_fp, indent=2) + + +# TODO: move this and reuse in other tests that need a registered stake address. +def get_registered_pool_user( cluster_manager: cluster_management.ClusterManager, + name_template: str, cluster_obj: clusterlib.ClusterLib, - caching_key: str, + caching_key: str = "", fund_amount: int = 1000_000_000, ) -> clusterlib.PoolUser: - """Create a pool user.""" - with cluster_manager.cache_fixture(key=caching_key) as fixture_cache: - if fixture_cache.value: - return fixture_cache.value # type: ignore + """Create a registered pool user.""" - test_id = common.get_test_id(cluster_obj) + def _create_user() -> clusterlib.PoolUser: pool_user = clusterlib_utils.create_pool_users( cluster_obj=cluster_obj, - name_template=f"{test_id}_pool_user", + name_template=f"{name_template}_pool_user", no_of_addr=1, )[0] - fixture_cache.value = pool_user + return pool_user + + if caching_key: + with cluster_manager.cache_fixture(key=caching_key) as fixture_cache: + if fixture_cache.value: + return fixture_cache.value # type: ignore + + pool_user = _create_user() + fixture_cache.value = pool_user + else: + pool_user = _create_user() # Fund the payment address with some ADA clusterlib_utils.fund_from_faucet( @@ -132,7 +147,7 @@ def get_pool_user( # Register the stake address stake_deposit_amt = cluster_obj.g_query.get_address_deposit() stake_addr_reg_cert = cluster_obj.g_stake_address.gen_stake_addr_registration_cert( - addr_name=f"{test_id}_pool_user", + addr_name=f"{name_template}_pool_user", deposit_amt=stake_deposit_amt, stake_vkey_file=pool_user.stake.vkey_file, ) @@ -143,7 +158,7 @@ def get_pool_user( clusterlib_utils.build_and_submit_tx( cluster_obj=cluster_obj, - name_template=f"{test_id}_pool_user", + name_template=f"{name_template}_pool_user", src_address=pool_user.payment.address, use_build_cmd=True, tx_files=tx_files_action, diff --git a/cardano_node_tests/tests/tests_conway/test_committee.py b/cardano_node_tests/tests/tests_conway/test_committee.py index 4585c238a..58024326e 100644 --- a/cardano_node_tests/tests/tests_conway/test_committee.py +++ b/cardano_node_tests/tests/tests_conway/test_committee.py @@ -68,8 +68,12 @@ def pool_user( ) -> clusterlib.PoolUser: """Create a pool user.""" key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) @@ -81,8 +85,12 @@ def pool_user_lg( """Create a pool user for "lock governance".""" cluster, __ = cluster_lock_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/tests/tests_conway/test_constitution.py b/cardano_node_tests/tests/tests_conway/test_constitution.py index c0270e0b7..630b59311 100644 --- a/cardano_node_tests/tests/tests_conway/test_constitution.py +++ b/cardano_node_tests/tests/tests_conway/test_constitution.py @@ -33,8 +33,12 @@ def pool_user_lg( """Create a pool user for "lock governance".""" cluster, __ = cluster_lock_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/tests/tests_conway/test_drep.py b/cardano_node_tests/tests/tests_conway/test_drep.py index 9d0975ef3..9dd184854 100644 --- a/cardano_node_tests/tests/tests_conway/test_drep.py +++ b/cardano_node_tests/tests/tests_conway/test_drep.py @@ -1,8 +1,9 @@ """Tests for Conway governance DRep functionality.""" -# pylint: disable=expression-not-assigned +import dataclasses import logging import pathlib as pl +import pickle import typing as tp import allure @@ -15,9 +16,12 @@ from cardano_node_tests.tests import delegation from cardano_node_tests.tests import issues from cardano_node_tests.tests import reqs_conway as reqc +from cardano_node_tests.tests.tests_conway import conway_common +from cardano_node_tests.utils import blockers from cardano_node_tests.utils import cluster_nodes from cardano_node_tests.utils import clusterlib_utils from cardano_node_tests.utils import dbsync_utils +from cardano_node_tests.utils import governance_setup from cardano_node_tests.utils import governance_utils from cardano_node_tests.utils import helpers from cardano_node_tests.utils import submit_utils @@ -31,6 +35,13 @@ ) +@dataclasses.dataclass(frozen=True, order=True) +class DRepStateRecord: + epoch_no: int + id: str + drep_state: governance_utils.DRepStateT + + def get_payment_addr( name_template: str, cluster_manager: cluster_management.ClusterManager, @@ -86,6 +97,35 @@ def get_pool_user( return pool_user +def create_drep( + name_template: str, + cluster_obj: clusterlib.ClusterLib, + payment_addr: clusterlib.AddressRecord, +) -> governance_utils.DRepRegistration: + """Create a DRep.""" + reg_drep = governance_utils.get_drep_reg_record( + cluster_obj=cluster_obj, + name_template=name_template, + ) + + tx_files_reg = clusterlib.TxFiles( + certificate_files=[reg_drep.registration_cert], + signing_key_files=[payment_addr.skey_file, reg_drep.key_pair.skey_file], + ) + + clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster_obj, + name_template=f"{name_template}_drep_reg", + src_address=payment_addr.address, + submit_method=submit_utils.SubmitMethods.CLI, + use_build_cmd=True, + tx_files=tx_files_reg, + deposit=reg_drep.deposit, + ) + + return reg_drep + + def get_custom_drep( name_template: str, cluster_manager: cluster_management.ClusterManager, @@ -93,7 +133,7 @@ def get_custom_drep( payment_addr: clusterlib.AddressRecord, caching_key: str, ) -> governance_utils.DRepRegistration: - """Create a custom DRep.""" + """Create a custom DRep and cache it.""" if cluster_nodes.get_cluster_type().type != cluster_nodes.ClusterType.LOCAL: pytest.skip("runs only on local cluster") @@ -101,24 +141,10 @@ def get_custom_drep( if fixture_cache.value: return fixture_cache.value # type: ignore - reg_drep = governance_utils.get_drep_reg_record( + reg_drep = create_drep( + name_template=name_template, cluster_obj=cluster_obj, - name_template=f"drep_custom_{name_template}", - ) - - tx_files_reg = clusterlib.TxFiles( - certificate_files=[reg_drep.registration_cert], - signing_key_files=[payment_addr.skey_file, reg_drep.key_pair.skey_file], - ) - - clusterlib_utils.build_and_submit_tx( - cluster_obj=cluster_obj, - name_template=f"drep_custom_reg{name_template}", - src_address=payment_addr.address, - submit_method=submit_utils.SubmitMethods.CLI, - use_build_cmd=True, - tx_files=tx_files_reg, - deposit=reg_drep.deposit, + payment_addr=payment_addr, ) fixture_cache.value = reg_drep @@ -165,7 +191,7 @@ def custom_drep( test_id = common.get_test_id(cluster) key = helpers.get_current_line_str() return get_custom_drep( - name_template=test_id, + name_template=f"custom_drep_{test_id}", cluster_manager=cluster_manager, cluster_obj=cluster, payment_addr=payment_addr, @@ -209,7 +235,7 @@ def custom_drep_wp( test_id = common.get_test_id(cluster) key = helpers.get_current_line_str() return get_custom_drep( - name_template=test_id, + name_template=f"custom_drep_{test_id}", cluster_manager=cluster_manager, cluster_obj=cluster, payment_addr=payment_addr_wp, @@ -848,3 +874,420 @@ def _deregister(): governance_utils.check_drep_delegation( deleg_state=deleg_state, drep_id=drep_id, stake_addr_hash=stake_addr_hash ) + + +class TestDRepActivity: + """Tests for DReps activity.""" + + @pytest.fixture + def pool_user_lg( + self, + cluster_manager: cluster_management.ClusterManager, + cluster_lock_governance: governance_setup.GovClusterT, + ) -> clusterlib.PoolUser: + """Create a pool user for "lock governance". + + This fixture is NOT cached, as it is used only in one test. + """ + cluster, __ = cluster_lock_governance + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + ) + + @allure.link(helpers.get_vcs_link()) + @pytest.mark.long + def test_drep_inactivity( # noqa: C901 + self, + cluster_manager: cluster_management.ClusterManager, + cluster_lock_governance: governance_setup.GovClusterT, + pool_user_lg: clusterlib.PoolUser, + testfile_temp_dir: pl.Path, + request: FixtureRequest, + ): + """Test DRep inactivity. + + * Create the first DRep and delegate to it + * Update the `dRepActivity` parameter to `1` + * Create the second DRep and delegate to it + * Update DRep activity again so there is a proposal to vote for. The newly created DReps + will not vote. + * Again, update DRep activity so there is a proposal to vote for. Again, the newly + created DReps will not vote. + * Once again, update DRep activity so there is a proposal to vote for. Again, the newly + created DReps will not vote. + * Update DRep activity again so there is a proposal to vote for. The newly created DRep1 + will vote. + * Update DRep activity again so there is a proposal to vote for. The newly created DRep2 + will vote. + * Check DRep activity records using saved DRep status data. + """ + cluster, governance_data = cluster_lock_governance + temp_template = common.get_test_id(cluster) + deposit_amt = cluster.g_query.get_address_deposit() + + # Deregister stake address so it doesn't affect stake distribution + def _deregister_addr(name_template: str, pool_user: clusterlib.PoolUser) -> None: + with helpers.change_cwd(testfile_temp_dir): + stake_addr_info = cluster.g_query.get_stake_addr_info(pool_user.stake.address) + if not stake_addr_info: + return + + # Deregister stake address + stake_addr_dereg_cert = cluster.g_stake_address.gen_stake_addr_deregistration_cert( + addr_name=name_template, + deposit_amt=deposit_amt, + stake_vkey_file=pool_user.stake.vkey_file, + ) + tx_files_dereg = clusterlib.TxFiles( + certificate_files=[stake_addr_dereg_cert], + signing_key_files=[ + pool_user.payment.skey_file, + pool_user.stake.skey_file, + ], + ) + withdrawals = ( + [ + clusterlib.TxOut( + address=pool_user.stake.address, + amount=stake_addr_info.reward_account_balance, + ) + ] + if stake_addr_info.reward_account_balance + else [] + ) + clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=name_template, + src_address=pool_user.payment.address, + use_build_cmd=True, + tx_files=tx_files_dereg, + withdrawals=withdrawals, + deposit=-deposit_amt, + ) + + # Register and delegate stake address + def _delegate_addr( + name_template: str, + drep_reg: governance_utils.DRepRegistration, + pool_user: clusterlib.PoolUser, + ) -> None: + # Create stake address registration cert + reg_cert = cluster.g_stake_address.gen_stake_addr_registration_cert( + addr_name=name_template, + deposit_amt=deposit_amt, + stake_vkey_file=pool_user.stake.vkey_file, + ) + + # Create vote delegation cert + deleg_cert = cluster.g_stake_address.gen_vote_delegation_cert( + addr_name=name_template, + stake_vkey_file=pool_user.stake.vkey_file, + drep_key_hash=drep_reg.drep_id, + ) + + tx_files = clusterlib.TxFiles( + certificate_files=[reg_cert, deleg_cert], + signing_key_files=[pool_user.payment.skey_file, pool_user.stake.skey_file], + ) + + # Make sure we have enough time to finish the registration/delegation in one epoch + clusterlib_utils.wait_for_epoch_interval( + cluster_obj=cluster, start=1, stop=common.EPOCH_STOP_SEC_LEDGER_STATE + ) + + tx_output = clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=name_template, + src_address=pool_user.payment.address, + use_build_cmd=True, + tx_files=tx_files, + deposit=deposit_amt, + ) + + request.addfinalizer( + lambda: _deregister_addr( + name_template=f"{name_template}_dereg", pool_user=pool_user + ) + ) + + stake_addr_info = cluster.g_query.get_stake_addr_info(pool_user.stake.address) + assert ( + stake_addr_info.address + ), f"Stake address is NOT registered: {pool_user.stake.address}" + assert stake_addr_info.vote_delegation == governance_utils.get_drep_cred_name( + drep_id=drep_reg.drep_id + ), "Votes are NOT delegated to the correct DRep" + + out_utxos = cluster.g_query.get_utxo(tx_raw_output=tx_output) + assert ( + clusterlib.filter_utxos(utxos=out_utxos, address=pool_user.payment.address)[ + 0 + ].amount + == clusterlib.calculate_utxos_balance(tx_output.txins) - tx_output.fee - deposit_amt + ), f"Incorrect balance for source address `{pool_user.payment.address}`" + + # Check that stake address is delegated to the correct DRep. + cluster.wait_for_new_epoch(padding_seconds=5) + deleg_state = clusterlib_utils.get_delegation_state(cluster_obj=cluster) + stake_addr_hash = cluster.g_stake_address.get_stake_vkey_hash( + stake_vkey_file=pool_user.stake.vkey_file + ) + governance_utils.check_drep_delegation( + deleg_state=deleg_state, + drep_id=drep_reg.drep_id, + stake_addr_hash=stake_addr_hash, + ) + + def _update_drep_activity(governance_data: governance_setup.DefaultGovernance) -> None: + rand_str = clusterlib.get_rand_str(4) + anchor_url = f"http://www.drep-activity-{rand_str}.com" + anchor_data_hash = cluster.g_conway_governance.get_anchor_data_hash(text=anchor_url) + prev_action_rec = governance_utils.get_prev_action( + action_type=governance_utils.PrevGovActionIds.PPARAM_UPDATE, + gov_state=cluster.g_conway_governance.query.gov_state(), + ) + + proposals = [ + clusterlib_utils.UpdateProposal( + arg="--drep-activity", + value=1, + name="dRepActivity", + ), + ] + + prop_rec = conway_common.propose_pparams_update( + cluster_obj=cluster, + name_template=f"{temp_template}_{rand_str}_drep_activity", + anchor_url=anchor_url, + anchor_data_hash=anchor_data_hash, + pool_user=pool_user_lg, + proposals=proposals, + prev_action_rec=prev_action_rec, + ) + + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_{rand_str}_drep_activity", + payment_addr=pool_user_lg.payment, + action_txid=prop_rec.action_txid, + action_ix=prop_rec.action_ix, + approve_cc=True, + approve_drep=True, + ) + + # Check ratification + _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) + rat_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=rat_gov_state, + name_template=f"{temp_template}_{rand_str}_drep_activity_rat_{_cur_epoch}", + ) + + rat_action = governance_utils.lookup_ratified_actions( + gov_state=rat_gov_state, action_txid=prop_rec.action_txid + ) + assert rat_action, "Action not found in ratified actions" + + # Check enactment + _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) + enact_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=enact_gov_state, + name_template=f"{temp_template}_{rand_str}_drep_activity_enact_{_cur_epoch}", + ) + pparams = ( + enact_gov_state.get("curPParams") or enact_gov_state.get("currentPParams") or {} + ) + clusterlib_utils.check_updated_params( + update_proposals=proposals, protocol_params=pparams + ) + + # Save DRep states + drep1_state = [] + drep2_state = [] + + def _save_drep_states( + id: str, + drep1: tp.Optional[governance_utils.DRepRegistration], + drep2: tp.Optional[governance_utils.DRepRegistration], + ) -> None: + _cur_epoch = cluster.g_query.get_epoch() + if drep1 is not None: + _drep_state = cluster.g_conway_governance.query.drep_state( + drep_vkey_file=drep1.key_pair.vkey_file + ) + drep1_state.append( + DRepStateRecord( + epoch_no=_cur_epoch, + id=id, + drep_state=_drep_state, + ) + ) + conway_common.save_drep_state( + drep_state=_drep_state, + name_template=f"{temp_template}_drep1_{id}_{_cur_epoch}", + ) + if drep2 is not None: + _drep_state = cluster.g_conway_governance.query.drep_state( + drep_vkey_file=drep2.key_pair.vkey_file + ) + drep2_state.append( + DRepStateRecord( + epoch_no=_cur_epoch, + id=id, + drep_state=_drep_state, + ) + ) + conway_common.save_drep_state( + drep_state=_drep_state, + name_template=f"{temp_template}_drep2_{id}_{_cur_epoch}", + ) + + def _save_drep_records() -> None: + """Save debugging data in case of test failure.""" + with open(f"{temp_template}_drep_records.pickle", "wb") as out_data: + _state = {"drep1": drep1_state, "drep2": drep2_state} + pickle.dump(_state, out_data) + + def _check_drep_records() -> tp.List[blockers.GH]: + found_issues = [] + + assert drep1_state, "No DRep1 states" + assert drep2_state, "No DRep2 states" + + drep1_init_expiry = drep1_state[0].drep_state[0][1]["expiry"] + assert drep1_init_expiry > drep1_state[0].epoch_no + 5, "Unexpected DRep1 init expiry" + assert ( + drep1_state[1].drep_state[0][1]["expiry"] > drep1_init_expiry + ), "DRep1 expiry was not updated" + + assert governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep1_state[-2].drep_state, + epoch=drep1_state[-2].epoch_no, + ), "DRep1 is not active" + assert not governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep1_state[-1].drep_state, + epoch=drep1_state[-1].epoch_no, + ), "DRep1 is still active" + + drep2_init_expiry = drep2_state[0].drep_state[0][1]["expiry"] + assert drep2_init_expiry < drep2_state[0].epoch_no + 3, "Unexpected DRep2 init expiry" + assert ( + drep2_state[1].drep_state[0][1]["expiry"] > drep2_init_expiry + ), "DRep2 expiry was not updated" + assert not governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep2_state[-3].drep_state, + epoch=drep2_state[-3].epoch_no, + ), "DRep2 is still active" + assert not governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep2_state[-2].drep_state, + epoch=drep2_state[-2].epoch_no, + ), "DRep2 is still active" + assert governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep2_state[-1].drep_state, + epoch=drep2_state[-1].epoch_no, + ), "DRep2 is not active" + if ( + drep2_state[-2].drep_state[0][1]["expiry"] + > drep2_state[-3].drep_state[0][1]["expiry"] + ): + found_issues.append(issues.ledger_4346) + + return found_issues + + # Create stake addresses for votes delegation and fund them + created_users = clusterlib_utils.create_pool_users( + cluster_obj=cluster, + name_template=f"{temp_template}_pool_user", + no_of_addr=2, + ) + clusterlib_utils.fund_from_faucet( + *created_users, + cluster_obj=cluster, + faucet_data=cluster_manager.cache.addrs_data["user1"], + ) + + # Create the first DRep + custom_drep1 = create_drep( + name_template=f"{temp_template}_drep1", + cluster_obj=cluster, + payment_addr=pool_user_lg.payment, + ) + _save_drep_states(drep1=custom_drep1, drep2=None, id="created_drep1") + _delegate_addr( + name_template=f"{temp_template}_pool_user1_deleg", + drep_reg=custom_drep1, + pool_user=created_users[0], + ) + _save_drep_states(drep1=custom_drep1, drep2=None, id="delegated_drep1") + + # Update DRep activity + _update_drep_activity(governance_data=governance_data) + _save_drep_states(drep1=custom_drep1, drep2=None, id="updated_activity") + + # Create the second DRep + custom_drep2 = create_drep( + name_template=f"{temp_template}_drep2", + cluster_obj=cluster, + payment_addr=pool_user_lg.payment, + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="created_drep2") + _delegate_addr( + name_template=f"{temp_template}_pool_user2_deleg", + drep_reg=custom_drep2, + pool_user=created_users[1], + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="delegated_drep2") + + # Add the DReps to the governance data + governance_data_drep1 = dataclasses.replace( + governance_data, dreps_reg=[*governance_data.dreps_reg, custom_drep1] + ) + governance_data_drep2 = dataclasses.replace( + governance_data, dreps_reg=[*governance_data.dreps_reg, custom_drep2] + ) + + # Update DRep activity again so there is a proposal to vote for. The newly created DReps + # will not vote. + _update_drep_activity(governance_data=governance_data) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig1") + + # Update DRep activity again so there is a proposal to vote for. The newly created DReps + # will still not vote. + _update_drep_activity(governance_data=governance_data) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig2") + + # Update DRep activity again so there is a proposal to vote for. The newly created DReps + # will still not vote. + _update_drep_activity(governance_data=governance_data) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig3") + + # Update DRep activity again so there is a proposal to vote for. The newly created DRep1 + # will vote. + _update_drep_activity(governance_data=governance_data_drep1) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep1") + + # Update DRep activity again so there is a proposal to vote for. The newly created DRep2 + # will vote. + _update_drep_activity(governance_data=governance_data_drep2) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep2") + + # Check DRep activity records + found_issues = [] + try: + found_issues = _check_drep_records() + except Exception: + _save_drep_records() + raise + + if found_issues: + blockers.finish_test(issues=found_issues) diff --git a/cardano_node_tests/tests/tests_conway/test_hardfork.py b/cardano_node_tests/tests/tests_conway/test_hardfork.py index 77efe32ff..6a97bc400 100644 --- a/cardano_node_tests/tests/tests_conway/test_hardfork.py +++ b/cardano_node_tests/tests/tests_conway/test_hardfork.py @@ -32,8 +32,12 @@ def pool_user_lg( """Create a pool user for "lock governance".""" cluster, __ = cluster_lock_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/tests/tests_conway/test_info.py b/cardano_node_tests/tests/tests_conway/test_info.py index 24f5aaca1..07ba08458 100644 --- a/cardano_node_tests/tests/tests_conway/test_info.py +++ b/cardano_node_tests/tests/tests_conway/test_info.py @@ -35,8 +35,12 @@ def pool_user_ug( """Create a pool user for "use governance".""" cluster, __ = cluster_use_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/tests/tests_conway/test_no_confidence.py b/cardano_node_tests/tests/tests_conway/test_no_confidence.py index 06551e04f..0d13f55f8 100644 --- a/cardano_node_tests/tests/tests_conway/test_no_confidence.py +++ b/cardano_node_tests/tests/tests_conway/test_no_confidence.py @@ -35,8 +35,12 @@ def pool_user_lg( """Create a pool user for "lock governance".""" cluster, __ = cluster_lock_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/tests/tests_conway/test_pparam_update.py b/cardano_node_tests/tests/tests_conway/test_pparam_update.py index e3eced768..32b5112c8 100644 --- a/cardano_node_tests/tests/tests_conway/test_pparam_update.py +++ b/cardano_node_tests/tests/tests_conway/test_pparam_update.py @@ -114,8 +114,10 @@ def pool_user_lg( """Create a pool user for "lock governance".""" cluster, __ = cluster_lock_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( cluster_manager=cluster_manager, + name_template=name_template, cluster_obj=cluster, caching_key=key, fund_amount=2000_000_000, diff --git a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py index 732f8171a..002af41ef 100644 --- a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py +++ b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py @@ -37,8 +37,12 @@ def pool_user_ug( """Create a pool user for "use governance".""" cluster, __ = cluster_use_governance key = helpers.get_current_line_str() - return conway_common.get_pool_user( - cluster_manager=cluster_manager, cluster_obj=cluster, caching_key=key + name_template = common.get_test_id(cluster) + return conway_common.get_registered_pool_user( + cluster_manager=cluster_manager, + name_template=name_template, + cluster_obj=cluster, + caching_key=key, ) diff --git a/cardano_node_tests/utils/governance_utils.py b/cardano_node_tests/utils/governance_utils.py index 6e5517292..5cffbc085 100644 --- a/cardano_node_tests/utils/governance_utils.py +++ b/cardano_node_tests/utils/governance_utils.py @@ -29,6 +29,8 @@ clusterlib.VoteSPO, ] +DRepStateT = tp.List[tp.List[tp.Dict[str, tp.Any]]] + @dataclasses.dataclass(frozen=True, order=True) class DRepRegistration: @@ -527,3 +529,15 @@ def get_delegated_stake(cluster_obj: clusterlib.ClusterLib) -> StakeDelegation: return StakeDelegation( spo=total_spo_stake, drep=total_drep_stake, total_lovelace=total_lovelace ) + + +def is_drep_active( + cluster_obj: clusterlib.ClusterLib, + drep_state: DRepStateT, + epoch: int = -1, +) -> bool: + """Check if DRep is active.""" + if epoch == -1: + epoch = cluster_obj.g_query.get_epoch() + + return bool(drep_state[0][1].get("expiry", 0) >= epoch) From 2a886e70079843970c87be2b251fccd7c0d3e0a2 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 22 May 2024 17:02:10 +0200 Subject: [PATCH 12/47] Add `test_cli_drep_status_consistency` --- cardano_node_tests/tests/issues.py | 6 ++++ .../tests/tests_conway/conftest.py | 16 +++++++++ .../tests/tests_conway/test_drep.py | 36 +++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index f400069ad..f9ad20085 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -104,6 +104,12 @@ fixed_in="8.12.0", # Unknown yet, will be fixed/changed sometime in the future message="Inactive DRep expiry gets incremented.", ) +ledger_4349 = blockers.GH( + issue=4349, + repo="IntersectMBO/cardano-ledger", + fixed_in="8.12.0", # Unknown yet, will be fixed/changed sometime in the future + message="Inconsistent listing of DRep expiry.", +) node_3788 = blockers.GH( issue=3788, diff --git a/cardano_node_tests/tests/tests_conway/conftest.py b/cardano_node_tests/tests/tests_conway/conftest.py index 1918d02eb..016062f5d 100644 --- a/cardano_node_tests/tests/tests_conway/conftest.py +++ b/cardano_node_tests/tests/tests_conway/conftest.py @@ -25,6 +25,22 @@ def cluster_use_committee( return cluster_obj, governance_data +@pytest.fixture +def cluster_use_dreps( + cluster_manager: cluster_management.ClusterManager, +) -> governance_setup.GovClusterT: + """Mark governance DReps as "in use" and return instance of `clusterlib.ClusterLib`.""" + cluster_obj = cluster_manager.get( + use_resources=[ + cluster_management.Resources.DREPS, + ] + ) + governance_data = governance_setup.get_default_governance( + cluster_manager=cluster_manager, cluster_obj=cluster_obj + ) + return cluster_obj, governance_data + + @pytest.fixture def cluster_use_governance( cluster_manager: cluster_management.ClusterManager, diff --git a/cardano_node_tests/tests/tests_conway/test_drep.py b/cardano_node_tests/tests/tests_conway/test_drep.py index 9dd184854..5e8f139b6 100644 --- a/cardano_node_tests/tests/tests_conway/test_drep.py +++ b/cardano_node_tests/tests/tests_conway/test_drep.py @@ -875,6 +875,42 @@ def _deregister(): deleg_state=deleg_state, drep_id=drep_id, stake_addr_hash=stake_addr_hash ) + @allure.link(helpers.get_vcs_link()) + @pytest.mark.smoke + def test_cli_drep_status_consistency( + self, + cluster_use_dreps: governance_setup.GovClusterT, + ): + """Test consistency of `cardano-cli conway query drep-state` output. + + * List status of all DReps + * List status of selected DReps + * Compare the output to check that it is consistent + """ + cluster, governance_data = cluster_use_dreps + common.get_test_id(cluster) + + def _get_drep_rec( + drep_state: governance_utils.DRepStateT, + ) -> tp.Dict[str, tp.Dict[str, tp.Any]]: + return {drep[0]["keyHash"]: drep[1] for drep in drep_state} + + drep_states_all = _get_drep_rec(drep_state=cluster.g_conway_governance.query.drep_state()) + drep_states_gov_data = _get_drep_rec( + drep_state=[ + cluster.g_conway_governance.query.drep_state(drep_key_hash=drep.drep_id)[0] + for drep in governance_data.dreps_reg + ] + ) + + first_key = next(iter(drep_states_gov_data)) + if drep_states_all[first_key]["expiry"] != drep_states_gov_data[first_key]["expiry"]: + issues.ledger_4349.finish_test() + + for key, rec in drep_states_gov_data.items(): + assert key in drep_states_all, f"DRep '{key}' not found in DRep state" + assert rec == drep_states_all[key], f"DRep '{key}' state mismatch" + class TestDRepActivity: """Tests for DReps activity.""" From c1749072c28d8ff618acbe5a60211e10d33ec669 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 22 May 2024 19:22:44 +0200 Subject: [PATCH 13/47] Respin needed in `test_drep_inactivity` (#2426) * Respin needed in `test_drep_inactivity` * remove whitespace --- cardano_node_tests/tests/tests_conway/test_drep.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cardano_node_tests/tests/tests_conway/test_drep.py b/cardano_node_tests/tests/tests_conway/test_drep.py index 5e8f139b6..e5b6c40f1 100644 --- a/cardano_node_tests/tests/tests_conway/test_drep.py +++ b/cardano_node_tests/tests/tests_conway/test_drep.py @@ -1252,6 +1252,9 @@ def _check_drep_records() -> tp.List[blockers.GH]: faucet_data=cluster_manager.cache.addrs_data["user1"], ) + # Testnet respin is needed after this point + cluster_manager.set_needs_respin() + # Create the first DRep custom_drep1 = create_drep( name_template=f"{temp_template}_drep1", From 60e3dcb36c1e4fcaef350976086f7d46cd7e24d1 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 24 May 2024 17:00:50 +0200 Subject: [PATCH 14/47] Add more checks for inactive DReps stake (#2427) Check that delegated stake does not count towards the active voting stake for inactive DReps. --- cardano_node_tests/tests/reqs_conway.py | 1 + .../tests/tests_conway/test_drep.py | 356 ++++++++++-------- cardano_node_tests/utils/governance_utils.py | 2 +- 3 files changed, 211 insertions(+), 148 deletions(-) diff --git a/cardano_node_tests/tests/reqs_conway.py b/cardano_node_tests/tests/reqs_conway.py index 62cd4178d..126f93fce 100644 --- a/cardano_node_tests/tests/reqs_conway.py +++ b/cardano_node_tests/tests/reqs_conway.py @@ -26,6 +26,7 @@ def __r(id: str) -> requirements.Req: cip016 = __r("CIP016") cip017 = __r("CIP017") cip018 = __r("CIP018") +cip019 = __r("CIP019") cip020_01 = __r("intCIP020-01") # verification key cip020_02 = __r("intCIP020-02") # Native script cip020_03 = __r("intCIP020-03") # Plutus script diff --git a/cardano_node_tests/tests/tests_conway/test_drep.py b/cardano_node_tests/tests/tests_conway/test_drep.py index e5b6c40f1..e987660e1 100644 --- a/cardano_node_tests/tests/tests_conway/test_drep.py +++ b/cardano_node_tests/tests/tests_conway/test_drep.py @@ -42,6 +42,12 @@ class DRepStateRecord: drep_state: governance_utils.DRepStateT +@dataclasses.dataclass(frozen=True, order=True) +class DRepRatRecord: + id: str + ratified: bool + + def get_payment_addr( name_template: str, cluster_manager: cluster_management.ClusterManager, @@ -934,75 +940,43 @@ def pool_user_lg( ) @allure.link(helpers.get_vcs_link()) + @pytest.mark.order(5) @pytest.mark.long def test_drep_inactivity( # noqa: C901 self, cluster_manager: cluster_management.ClusterManager, cluster_lock_governance: governance_setup.GovClusterT, pool_user_lg: clusterlib.PoolUser, - testfile_temp_dir: pl.Path, - request: FixtureRequest, ): """Test DRep inactivity. - * Create the first DRep and delegate to it - * Update the `dRepActivity` parameter to `1` - * Create the second DRep and delegate to it + * Create the first DRep and delegate to it. + * Update the `dRepActivity` parameter to `1`. + * Create the second DRep and delegate to it. * Update DRep activity again so there is a proposal to vote for. The newly created DReps - will not vote. - * Again, update DRep activity so there is a proposal to vote for. Again, the newly - created DReps will not vote. - * Once again, update DRep activity so there is a proposal to vote for. Again, the newly - created DReps will not vote. + will not vote. The action will not be ratified, because the newly created DReps didn't + vote and their delegated stake is > 51% (threshold). * Update DRep activity again so there is a proposal to vote for. The newly created DRep1 - will vote. + will vote. The action will be ratified, because the newly created DRep1 voted and + together with the original DReps their delegated stake is > 51% (threshold). + * Update DRep activity again so there is a proposal to vote for. The newly created DReps + will not vote. The action will be ratified, because the newly created DReps are + inactive and so their delegated stake does not count towards the active voting stake. + * Wait for another epoch without submitting any proposal, to see if "expire" counters + are incremented. * Update DRep activity again so there is a proposal to vote for. The newly created DRep2 - will vote. + will vote. The action will be ratified, because the newly created DRep2 voted and + together with the original DReps their delegated stake is > 51% (threshold). * Check DRep activity records using saved DRep status data. """ cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) deposit_amt = cluster.g_query.get_address_deposit() - # Deregister stake address so it doesn't affect stake distribution - def _deregister_addr(name_template: str, pool_user: clusterlib.PoolUser) -> None: - with helpers.change_cwd(testfile_temp_dir): - stake_addr_info = cluster.g_query.get_stake_addr_info(pool_user.stake.address) - if not stake_addr_info: - return - - # Deregister stake address - stake_addr_dereg_cert = cluster.g_stake_address.gen_stake_addr_deregistration_cert( - addr_name=name_template, - deposit_amt=deposit_amt, - stake_vkey_file=pool_user.stake.vkey_file, - ) - tx_files_dereg = clusterlib.TxFiles( - certificate_files=[stake_addr_dereg_cert], - signing_key_files=[ - pool_user.payment.skey_file, - pool_user.stake.skey_file, - ], - ) - withdrawals = ( - [ - clusterlib.TxOut( - address=pool_user.stake.address, - amount=stake_addr_info.reward_account_balance, - ) - ] - if stake_addr_info.reward_account_balance - else [] - ) - clusterlib_utils.build_and_submit_tx( - cluster_obj=cluster, - name_template=name_template, - src_address=pool_user.payment.address, - use_build_cmd=True, - tx_files=tx_files_dereg, - withdrawals=withdrawals, - deposit=-deposit_amt, - ) + # Saved DRep records + drep1_state: tp.Dict[str, DRepStateRecord] = {} + drep2_state: tp.Dict[str, DRepStateRecord] = {} + rat_records: tp.Dict[str, DRepRatRecord] = {} # Register and delegate stake address def _delegate_addr( @@ -1043,12 +1017,6 @@ def _delegate_addr( deposit=deposit_amt, ) - request.addfinalizer( - lambda: _deregister_addr( - name_template=f"{name_template}_dereg", pool_user=pool_user - ) - ) - stake_addr_info = cluster.g_query.get_stake_addr_info(pool_user.stake.address) assert ( stake_addr_info.address @@ -1077,9 +1045,11 @@ def _delegate_addr( stake_addr_hash=stake_addr_hash, ) - def _update_drep_activity(governance_data: governance_setup.DefaultGovernance) -> None: - rand_str = clusterlib.get_rand_str(4) - anchor_url = f"http://www.drep-activity-{rand_str}.com" + def _update_drep_activity( + governance_data: governance_setup.DefaultGovernance, + action_id: str, + ) -> str: + anchor_url = f"http://www.drep-activity-{action_id}.com" anchor_data_hash = cluster.g_conway_governance.get_anchor_data_hash(text=anchor_url) prev_action_rec = governance_utils.get_prev_action( action_type=governance_utils.PrevGovActionIds.PPARAM_UPDATE, @@ -1096,7 +1066,7 @@ def _update_drep_activity(governance_data: governance_setup.DefaultGovernance) - prop_rec = conway_common.propose_pparams_update( cluster_obj=cluster, - name_template=f"{temp_template}_{rand_str}_drep_activity", + name_template=f"{temp_template}_{action_id}_drep_activity", anchor_url=anchor_url, anchor_data_hash=anchor_data_hash, pool_user=pool_user_lg, @@ -1104,47 +1074,77 @@ def _update_drep_activity(governance_data: governance_setup.DefaultGovernance) - prev_action_rec=prev_action_rec, ) - conway_common.cast_vote( + votes_cc = [ + cluster.g_conway_governance.vote.create_committee( + vote_name=f"{temp_template}_{action_id}_drep_activity_cc{i}", + action_txid=prop_rec.action_txid, + action_ix=prop_rec.action_ix, + vote=clusterlib.Votes.YES, + cc_hot_vkey_file=m.hot_vkey_file, + ) + for i, m in enumerate(governance_data.cc_members, start=1) + ] + votes_drep = [ + cluster.g_conway_governance.vote.create_drep( + vote_name=f"{temp_template}_{action_id}_drep_activity_drep{i}", + action_txid=prop_rec.action_txid, + action_ix=prop_rec.action_ix, + vote=clusterlib.Votes.YES, + drep_vkey_file=d.key_pair.vkey_file, + ) + for i, d in enumerate(governance_data.dreps_reg, start=1) + ] + + votes: tp.List[governance_utils.VotesAllT] = [*votes_cc, *votes_drep] + vote_keys = [ + *[r.hot_skey_file for r in governance_data.cc_members], + *[r.key_pair.skey_file for r in governance_data.dreps_reg], + ] + + conway_common.submit_vote( cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_{rand_str}_drep_activity", + name_template=f"{temp_template}_{action_id}_drep_activity", payment_addr=pool_user_lg.payment, - action_txid=prop_rec.action_txid, - action_ix=prop_rec.action_ix, - approve_cc=True, - approve_drep=True, + votes=votes, + keys=vote_keys, + use_build_cmd=True, ) - # Check ratification + return prop_rec.action_txid + + def _check_ratification( + action_txid: str, + action_id: str, + ): _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) rat_gov_state = cluster.g_conway_governance.query.gov_state() conway_common.save_gov_state( gov_state=rat_gov_state, - name_template=f"{temp_template}_{rand_str}_drep_activity_rat_{_cur_epoch}", + name_template=f"{temp_template}_{action_id}_drep_activity_rat_{_cur_epoch}", ) - rat_action = governance_utils.lookup_ratified_actions( - gov_state=rat_gov_state, action_txid=prop_rec.action_txid + gov_state=rat_gov_state, action_txid=action_txid ) - assert rat_action, "Action not found in ratified actions" - # Check enactment + rat_records[action_id] = DRepRatRecord(id=action_id, ratified=bool(rat_action)) + + def _check_enactment( + action_txid: str, + action_id: str, + ): _cur_epoch = cluster.wait_for_new_epoch(padding_seconds=5) enact_gov_state = cluster.g_conway_governance.query.gov_state() conway_common.save_gov_state( gov_state=enact_gov_state, - name_template=f"{temp_template}_{rand_str}_drep_activity_enact_{_cur_epoch}", - ) - pparams = ( - enact_gov_state.get("curPParams") or enact_gov_state.get("currentPParams") or {} + name_template=f"{temp_template}_{action_id}_drep_activity_enact_{_cur_epoch}", ) - clusterlib_utils.check_updated_params( - update_proposals=proposals, protocol_params=pparams + prev_action_rec = governance_utils.get_prev_action( + action_type=governance_utils.PrevGovActionIds.PPARAM_UPDATE, + gov_state=cluster.g_conway_governance.query.gov_state(), ) - - # Save DRep states - drep1_state = [] - drep2_state = [] + assert ( + action_txid == prev_action_rec.txid + ), f"Unexpected action txid: {prev_action_rec.txid}" def _save_drep_states( id: str, @@ -1156,12 +1156,11 @@ def _save_drep_states( _drep_state = cluster.g_conway_governance.query.drep_state( drep_vkey_file=drep1.key_pair.vkey_file ) - drep1_state.append( - DRepStateRecord( - epoch_no=_cur_epoch, - id=id, - drep_state=_drep_state, - ) + assert id not in drep1_state + drep1_state[id] = DRepStateRecord( + epoch_no=_cur_epoch, + id=id, + drep_state=_drep_state, ) conway_common.save_drep_state( drep_state=_drep_state, @@ -1171,85 +1170,107 @@ def _save_drep_states( _drep_state = cluster.g_conway_governance.query.drep_state( drep_vkey_file=drep2.key_pair.vkey_file ) - drep2_state.append( - DRepStateRecord( - epoch_no=_cur_epoch, - id=id, - drep_state=_drep_state, - ) + assert id not in drep2_state + drep2_state[id] = DRepStateRecord( + epoch_no=_cur_epoch, + id=id, + drep_state=_drep_state, ) conway_common.save_drep_state( drep_state=_drep_state, name_template=f"{temp_template}_drep2_{id}_{_cur_epoch}", ) - def _save_drep_records() -> None: + def _dump_records() -> None: """Save debugging data in case of test failure.""" with open(f"{temp_template}_drep_records.pickle", "wb") as out_data: - _state = {"drep1": drep1_state, "drep2": drep2_state} + _state = {"drep1": drep1_state, "drep2": drep2_state, "rat_records": rat_records} pickle.dump(_state, out_data) - def _check_drep_records() -> tp.List[blockers.GH]: + def _check_records() -> tp.List[blockers.GH]: found_issues = [] assert drep1_state, "No DRep1 states" assert drep2_state, "No DRep2 states" - drep1_init_expiry = drep1_state[0].drep_state[0][1]["expiry"] - assert drep1_init_expiry > drep1_state[0].epoch_no + 5, "Unexpected DRep1 init expiry" + drep1_init_expiry = drep1_state["created_drep1"].drep_state[0][1]["expiry"] assert ( - drep1_state[1].drep_state[0][1]["expiry"] > drep1_init_expiry + drep1_init_expiry > drep1_state["created_drep1"].epoch_no + 5 + ), "Unexpected DRep1 init expiry" + assert ( + drep1_state["delegated_drep1"].drep_state[0][1]["expiry"] > drep1_init_expiry ), "DRep1 expiry was not updated" assert governance_utils.is_drep_active( cluster_obj=cluster, - drep_state=drep1_state[-2].drep_state, - epoch=drep1_state[-2].epoch_no, + drep_state=drep1_state["voted_drep1_voted"].drep_state, + epoch=drep1_state["voted_drep1_voted"].epoch_no, ), "DRep1 is not active" assert not governance_utils.is_drep_active( cluster_obj=cluster, - drep_state=drep1_state[-1].drep_state, - epoch=drep1_state[-1].epoch_no, + drep_state=drep1_state["voted_orig2_voted"].drep_state, + epoch=drep1_state["voted_orig2_voted"].epoch_no, + ), "DRep1 is still active" + assert not governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep1_state["voted_orig2_ratified"].drep_state, + epoch=drep1_state["voted_orig2_ratified"].epoch_no, + ), "DRep1 is still active" + assert not governance_utils.is_drep_active( + cluster_obj=cluster, + drep_state=drep1_state["voted_drep2_voted"].drep_state, + epoch=drep1_state["voted_drep2_voted"].epoch_no, ), "DRep1 is still active" - drep2_init_expiry = drep2_state[0].drep_state[0][1]["expiry"] - assert drep2_init_expiry < drep2_state[0].epoch_no + 3, "Unexpected DRep2 init expiry" + drep2_init_expiry = drep2_state["created_drep2"].drep_state[0][1]["expiry"] + assert ( + drep2_init_expiry < drep2_state["created_drep2"].epoch_no + 3 + ), "Unexpected DRep2 init expiry" assert ( - drep2_state[1].drep_state[0][1]["expiry"] > drep2_init_expiry + drep2_state["delegated_drep2"].drep_state[0][1]["expiry"] > drep2_init_expiry ), "DRep2 expiry was not updated" + assert not governance_utils.is_drep_active( cluster_obj=cluster, - drep_state=drep2_state[-3].drep_state, - epoch=drep2_state[-3].epoch_no, + drep_state=drep2_state["voted_orig2_voted"].drep_state, + epoch=drep2_state["voted_orig2_voted"].epoch_no, ), "DRep2 is still active" assert not governance_utils.is_drep_active( cluster_obj=cluster, - drep_state=drep2_state[-2].drep_state, - epoch=drep2_state[-2].epoch_no, + drep_state=drep2_state["no_proposal"].drep_state, + epoch=drep2_state["no_proposal"].epoch_no, ), "DRep2 is still active" assert governance_utils.is_drep_active( cluster_obj=cluster, - drep_state=drep2_state[-1].drep_state, - epoch=drep2_state[-1].epoch_no, + drep_state=drep2_state["voted_drep2_voted"].drep_state, + epoch=drep2_state["voted_drep2_voted"].epoch_no, ), "DRep2 is not active" + + assert not rat_records["voted_orig1_ratification"].ratified, "Action was not ratified" + assert rat_records["voted_drep1_ratification"].ratified, "Action was not ratified" + assert rat_records["voted_orig2_ratification"].ratified, "Action was not ratified" + assert rat_records["voted_drep2_ratification"].ratified, "Action was not ratified" + if ( - drep2_state[-2].drep_state[0][1]["expiry"] - > drep2_state[-3].drep_state[0][1]["expiry"] + drep1_state["voted_orig2_ratified"].drep_state[0][1]["expiry"] + > drep1_state["voted_orig2_voted"].drep_state[0][1]["expiry"] ): found_issues.append(issues.ledger_4346) return found_issues # Create stake addresses for votes delegation and fund them - created_users = clusterlib_utils.create_pool_users( + drep_users = clusterlib_utils.create_pool_users( cluster_obj=cluster, name_template=f"{temp_template}_pool_user", no_of_addr=2, ) clusterlib_utils.fund_from_faucet( - *created_users, + *drep_users, cluster_obj=cluster, faucet_data=cluster_manager.cache.addrs_data["user1"], + # Add a lot of funds so no action can be ratified without the new DReps + amount=10_000_000_000_000, ) # Testnet respin is needed after this point @@ -1265,13 +1286,24 @@ def _check_drep_records() -> tp.List[blockers.GH]: _delegate_addr( name_template=f"{temp_template}_pool_user1_deleg", drep_reg=custom_drep1, - pool_user=created_users[0], + pool_user=drep_users[0], ) _save_drep_states(drep1=custom_drep1, drep2=None, id="delegated_drep1") + # Add the first DRep to the governance data + governance_data_drep1 = dataclasses.replace( + governance_data, dreps_reg=[*governance_data.dreps_reg, custom_drep1] + ) + # Update DRep activity - _update_drep_activity(governance_data=governance_data) - _save_drep_states(drep1=custom_drep1, drep2=None, id="updated_activity") + _action_txid = _update_drep_activity( + governance_data=governance_data_drep1, action_id="update_activity_vote" + ) + _save_drep_states(drep1=custom_drep1, drep2=None, id="updated_activity_voted") + _check_ratification(action_txid=_action_txid, action_id="updated_activity_ratification") + _save_drep_states(drep1=custom_drep1, drep2=None, id="updated_activity_ratified") + _check_enactment(action_txid=_action_txid, action_id="updated_activity_enacted") + _save_drep_states(drep1=custom_drep1, drep2=None, id="updated_activity_enacted") # Create the second DRep custom_drep2 = create_drep( @@ -1283,50 +1315,80 @@ def _check_drep_records() -> tp.List[blockers.GH]: _delegate_addr( name_template=f"{temp_template}_pool_user2_deleg", drep_reg=custom_drep2, - pool_user=created_users[1], + pool_user=drep_users[1], ) _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="delegated_drep2") - # Add the DReps to the governance data - governance_data_drep1 = dataclasses.replace( - governance_data, dreps_reg=[*governance_data.dreps_reg, custom_drep1] - ) + # Add the second DRep to the governance data governance_data_drep2 = dataclasses.replace( governance_data, dreps_reg=[*governance_data.dreps_reg, custom_drep2] ) # Update DRep activity again so there is a proposal to vote for. The newly created DReps - # will not vote. - _update_drep_activity(governance_data=governance_data) - _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig1") + # will not vote. The action will not be ratified, because the newly created DReps didn't + # vote and their delegated stake is > 51%. + _action_txid = _update_drep_activity( + governance_data=governance_data, action_id="vote_orig1_vote" + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig1_voted") + _check_ratification(action_txid=_action_txid, action_id="voted_orig1_ratification") + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig1_ratified") - # Update DRep activity again so there is a proposal to vote for. The newly created DReps - # will still not vote. - _update_drep_activity(governance_data=governance_data) - _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig2") + # Update DRep activity again so there is a proposal to vote for. The newly created DRep1 + # will vote. The action will be ratified, because the newly created DRep1 voted and + # together with the original DReps their delegated stake is > 51%. + _action_txid = _update_drep_activity( + governance_data=governance_data_drep1, + action_id="vote_drep1_vote", + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep1_voted") + _check_ratification( + action_txid=_action_txid, + action_id="voted_drep1_ratification", + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep1_ratified") + _check_enactment(action_txid=_action_txid, action_id="voted_drep1_enacted") + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep1_enacted") # Update DRep activity again so there is a proposal to vote for. The newly created DReps - # will still not vote. - _update_drep_activity(governance_data=governance_data) - _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig3") + # will not vote. The action will be ratified, because the newly created DReps are + # inactive and so their delegated stake does not count towards the active voting stake. + _action_txid = _update_drep_activity( + governance_data=governance_data, action_id="vote_orig2_vote" + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig2_voted") + _check_ratification(action_txid=_action_txid, action_id="voted_orig2_ratification") + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_orig2_ratified") - # Update DRep activity again so there is a proposal to vote for. The newly created DRep1 - # will vote. - _update_drep_activity(governance_data=governance_data_drep1) - _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep1") + # Wait for another epoch without submitting any proposal, to see if "expire" counters + # are incremented. + cluster.wait_for_new_epoch(padding_seconds=5) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="no_proposal") # Update DRep activity again so there is a proposal to vote for. The newly created DRep2 - # will vote. - _update_drep_activity(governance_data=governance_data_drep2) - _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep2") + # will vote. The action will be ratified, because the newly created DRep2 voted and + # together with the original DReps their delegated stake is > 51%. + _action_txid = _update_drep_activity( + governance_data=governance_data_drep2, + action_id="vote_drep2_vote", + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep2_voted") + _check_ratification( + action_txid=_action_txid, + action_id="voted_drep2_ratification", + ) + _save_drep_states(drep1=custom_drep1, drep2=custom_drep2, id="voted_drep2_ratified") + # We'll not check the enactment here, as we don't want to wait for another epoch - # Check DRep activity records + # Check DRep records + reqc.cip019.start(url=helpers.get_vcs_link()) found_issues = [] try: - found_issues = _check_drep_records() + found_issues = _check_records() except Exception: - _save_drep_records() + _dump_records() raise + reqc.cip019.success() if found_issues: blockers.finish_test(issues=found_issues) diff --git a/cardano_node_tests/utils/governance_utils.py b/cardano_node_tests/utils/governance_utils.py index 5cffbc085..7e842c9f1 100644 --- a/cardano_node_tests/utils/governance_utils.py +++ b/cardano_node_tests/utils/governance_utils.py @@ -540,4 +540,4 @@ def is_drep_active( if epoch == -1: epoch = cluster_obj.g_query.get_epoch() - return bool(drep_state[0][1].get("expiry", 0) >= epoch) + return bool(drep_state[0][1].get("expiry", 0) > epoch) From 3abaeb47f88abb97d84355e869099982e04ef20c Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 24 May 2024 17:35:59 +0200 Subject: [PATCH 15/47] Remove unused nightly jobs We no longer test old Tx eras Shelley and Alonzo. Use mixed topology for main nightly. --- .github/env_nightly | 4 +++- .github/env_nightly_p2p | 1 - .github/workflows/nightly_alonzo_tx.yaml | 19 ------------------ .github/workflows/nightly_mixed.yaml | 20 ------------------- .github/workflows/nightly_shelley_tx.yaml | 19 ------------------ .../test_results/nightly_system_tests.rst | 20 ++----------------- 6 files changed, 5 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/nightly_alonzo_tx.yaml delete mode 100644 .github/workflows/nightly_mixed.yaml delete mode 100644 .github/workflows/nightly_shelley_tx.yaml diff --git a/.github/env_nightly b/.github/env_nightly index c4a5d5756..5d4512abf 100644 --- a/.github/env_nightly +++ b/.github/env_nightly @@ -1,2 +1,4 @@ CLUSTER_ERA=babbage -TX_ERA=babbage +MIXED_P2P=true +NUM_POOLS=4 +CI_BYRON_CLUSTER=true diff --git a/.github/env_nightly_p2p b/.github/env_nightly_p2p index af4493210..dc044bb2c 100644 --- a/.github/env_nightly_p2p +++ b/.github/env_nightly_p2p @@ -1,4 +1,3 @@ CLUSTER_ERA=babbage TX_ERA=babbage ENABLE_P2P=true -CI_BYRON_CLUSTER=true diff --git a/.github/workflows/nightly_alonzo_tx.yaml b/.github/workflows/nightly_alonzo_tx.yaml deleted file mode 100644 index 6e08dbfde..000000000 --- a/.github/workflows/nightly_alonzo_tx.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Nightly tests Alonzo Tx - -on: - schedule: - - cron: '15 01 * * *' - workflow_dispatch: - -jobs: - nightly_job: - if: github.repository_owner == 'IntersectMBO' || github.event_name != 'schedule' - # reusable workflow from local repo and same branch as this config - uses: ./.github/workflows/regression_reusable.yaml - with: - env-path: .github/env_nightly_alonzo_tx - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_FAIL_MAILS: ${{ secrets.NIGHTLY_FAIL_MAILS }} - GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }} - GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }} diff --git a/.github/workflows/nightly_mixed.yaml b/.github/workflows/nightly_mixed.yaml deleted file mode 100644 index 74ca5eed6..000000000 --- a/.github/workflows/nightly_mixed.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# mix of P2P and legacy topologies -name: Nightly tests mixed - -on: - schedule: - - cron: '15 05 * * *' - workflow_dispatch: - -jobs: - nightly_job: - if: github.repository_owner == 'IntersectMBO' || github.event_name != 'schedule' - # reusable workflow from local repo and same branch as this config - uses: ./.github/workflows/regression_reusable.yaml - with: - env-path: .github/env_nightly_mixed - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_FAIL_MAILS: ${{ secrets.NIGHTLY_FAIL_MAILS }} - GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }} - GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }} diff --git a/.github/workflows/nightly_shelley_tx.yaml b/.github/workflows/nightly_shelley_tx.yaml deleted file mode 100644 index 34217224b..000000000 --- a/.github/workflows/nightly_shelley_tx.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Nightly tests Shelley Tx - -on: - schedule: - - cron: '15 04 * * *' - workflow_dispatch: - -jobs: - nightly_job: - if: github.repository_owner == 'IntersectMBO' || github.event_name != 'schedule' - # reusable workflow from local repo and same branch as this config - uses: ./.github/workflows/regression_reusable.yaml - with: - env-path: .github/env_nightly_shelley_tx - secrets: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CI_FAIL_MAILS: ${{ secrets.NIGHTLY_FAIL_MAILS }} - GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }} - GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }} diff --git a/src_docs/source/test_results/nightly_system_tests.rst b/src_docs/source/test_results/nightly_system_tests.rst index 9d827a4b1..f5a723da0 100644 --- a/src_docs/source/test_results/nightly_system_tests.rst +++ b/src_docs/source/test_results/nightly_system_tests.rst @@ -22,9 +22,8 @@ Nightly results * `nightly `__: |nightly-badge| * network in Babbage era - * Babbage transaction era - * default (legacy) network topology - * cluster starts directly in Babbage era + * default transaction era + * mixed network topology (two stake pools P2P, two stake pools default topology) * `nightly-dbsync `__: |nightly-dbsync-badge| * network in Babbage era * Babbage transaction era @@ -34,15 +33,6 @@ Nightly results * network in Babbage era * Babbage transaction era * P2P network topology -* `nightly-mixed `__: |nightly-mixed-badge| - * network in Babbage era - * default transaction era - * mixed network topology (two stake pools P2P, two stake pools default topology) -* `nightly-alonzo-tx `__: |nightly-alonzo-tx-badge| - * network in Babbage era - * Alonzo transaction era - * default (legacy) network topology - * skip long-running tests * cluster starts directly in Babbage era * `nightly-conway-cc `__: |nightly-conway-cc-badge| * network in Conway era @@ -88,12 +78,6 @@ Nightly upgrade testing .. |nightly-p2p-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-p2p%2Fbadge.json :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-p2p/ -.. |nightly-mixed-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-mixed%2Fbadge.json - :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-mixed/ - -.. |nightly-alonzo-tx-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-alonzo-tx%2Fbadge.json - :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-alonzo-tx/ - .. |nightly-upgrade-step1-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-upgrade%2Fstep1%2Fbadge.json :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-upgrade/step1/ From 9f48e3439c3e67e9e17d6039979be3f34840c377 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 27 May 2024 18:02:57 +0200 Subject: [PATCH 16/47] Add support for testing bootstrap period --- .../tests/tests_conway/conway_common.py | 10 + .../tests/tests_conway/test_committee.py | 31 ++- .../tests/tests_conway/test_constitution.py | 15 ++ .../tests/tests_conway/test_drep.py | 4 + .../tests/tests_conway/test_hardfork.py | 16 +- .../tests/tests_conway/test_no_confidence.py | 6 + .../tests/tests_conway/test_pparam_update.py | 245 ++++++++++-------- .../tests_conway/test_treasury_withdrawals.py | 34 ++- cardano_node_tests/utils/requirements.py | 5 +- 9 files changed, 237 insertions(+), 129 deletions(-) diff --git a/cardano_node_tests/tests/tests_conway/conway_common.py b/cardano_node_tests/tests/tests_conway/conway_common.py index 9b1dc79b8..8a02e9d6e 100644 --- a/cardano_node_tests/tests/tests_conway/conway_common.py +++ b/cardano_node_tests/tests/tests_conway/conway_common.py @@ -32,6 +32,16 @@ class PParamPropRec: future_pparams: tp.Dict[str, tp.Any] +def is_in_bootstrap( + cluster_obj: clusterlib.ClusterLib, +) -> bool: + """Check if the cluster is in bootstrap period.""" + pv = cluster_obj.g_conway_governance.query.gov_state()["currentPParams"]["protocolVersion"][ + "major" + ] + return bool(pv == 9) + + def get_committee_val(data: tp.Dict[str, tp.Any]) -> tp.Dict[str, tp.Any]: """Get the committee value from the data. diff --git a/cardano_node_tests/tests/tests_conway/test_committee.py b/cardano_node_tests/tests/tests_conway/test_committee.py index 58024326e..82b5af752 100644 --- a/cardano_node_tests/tests/tests_conway/test_committee.py +++ b/cardano_node_tests/tests/tests_conway/test_committee.py @@ -23,6 +23,7 @@ from cardano_node_tests.utils import governance_setup from cardano_node_tests.utils import governance_utils from cardano_node_tests.utils import helpers +from cardano_node_tests.utils import submit_api from cardano_node_tests.utils import submit_utils from cardano_node_tests.utils.versions import VERSIONS @@ -266,8 +267,7 @@ def test_update_committee_action( gov_state=cluster.g_conway_governance.query.gov_state(), ) - _url = helpers.get_vcs_link() - [r.start(url=_url) for r in (reqc.cip007, reqc.cip031a_01)] + reqc.cip031a_01.start(url=helpers.get_vcs_link()) update_action = cluster.g_conway_governance.action.update_committee( action_name=temp_template, deposit_amt=deposit_amt, @@ -290,6 +290,23 @@ def test_update_committee_action( ], ) + if conway_common.is_in_bootstrap(cluster_obj=cluster): + with pytest.raises((clusterlib.CLIError, submit_api.SubmitApiError)) as excinfo: + clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=f"{temp_template}_bootstrap", + src_address=pool_user.payment.address, + submit_method=submit_method, + use_build_cmd=use_build_cmd, + tx_files=tx_files, + deposit=deposit_amt, + ) + err_str = str(excinfo.value) + assert "(DisallowedProposalDuringBootstrap" in err_str, err_str + return + + reqc.cip007.start(url=helpers.get_vcs_link()) + tx_output = clusterlib_utils.build_and_submit_tx( cluster_obj=cluster, name_template=temp_template, @@ -370,6 +387,10 @@ def test_add_rm_committee_members( # noqa: C901 # pylint: disable=too-many-locals,too-many-statements,too-many-branches cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("Cannot run during bootstrap period.") + deposit_amt = cluster.conway_genesis["govActionDeposit"] # Check if total delegated stake is below the threshold. This can be used to check that @@ -968,7 +989,7 @@ def _check_rem_state(gov_state: tp.Dict[str, tp.Any]): @allure.link(helpers.get_vcs_link()) @pytest.mark.skipif(not configuration.HAS_CC, reason="Runs only on setup with CC") @pytest.mark.long - def test_empty_committee( + def test_empty_committee( # noqa: C901 self, cluster_manager: cluster_management.ClusterManager, cluster_lock_governance: governance_setup.GovClusterT, @@ -999,6 +1020,10 @@ def test_empty_committee( __: tp.Any # mypy workaround cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("Cannot run during bootstrap period.") + deposit_amt = cluster.conway_genesis["govActionDeposit"] xfail_ledger_3979_msgs = set() diff --git a/cardano_node_tests/tests/tests_conway/test_constitution.py b/cardano_node_tests/tests/tests_conway/test_constitution.py index 630b59311..58b4a17ef 100644 --- a/cardano_node_tests/tests/tests_conway/test_constitution.py +++ b/cardano_node_tests/tests/tests_conway/test_constitution.py @@ -92,6 +92,21 @@ def test_change_constitution( ) reqc.cli002.success() + if conway_common.is_in_bootstrap(cluster_obj=cluster): + with pytest.raises(clusterlib.CLIError) as excinfo: + conway_common.propose_change_constitution( + cluster_obj=cluster, + name_template=f"{temp_template}_constitution_bootstrap", + anchor_url=anchor_url, + anchor_data_hash=anchor_data_hash, + constitution_url=constitution_url, + constitution_hash=constitution_hash, + pool_user=pool_user_lg, + ) + err_str = str(excinfo.value) + assert "(DisallowedProposalDuringBootstrap" in err_str, err_str + return + _url = helpers.get_vcs_link() [r.start(url=_url) for r in (reqc.cli013, reqc.cip031a_02, reqc.cip031c_01, reqc.cip054_03)] ( diff --git a/cardano_node_tests/tests/tests_conway/test_drep.py b/cardano_node_tests/tests/tests_conway/test_drep.py index e987660e1..f6d37d61c 100644 --- a/cardano_node_tests/tests/tests_conway/test_drep.py +++ b/cardano_node_tests/tests/tests_conway/test_drep.py @@ -971,6 +971,10 @@ def test_drep_inactivity( # noqa: C901 """ cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("Cannot run in bootstrap period.") + deposit_amt = cluster.g_query.get_address_deposit() # Saved DRep records diff --git a/cardano_node_tests/tests/tests_conway/test_hardfork.py b/cardano_node_tests/tests/tests_conway/test_hardfork.py index 6a97bc400..650735b95 100644 --- a/cardano_node_tests/tests/tests_conway/test_hardfork.py +++ b/cardano_node_tests/tests/tests_conway/test_hardfork.py @@ -52,24 +52,11 @@ def skip_hf_command(self): "is not available." ) - @pytest.fixture - def skip_hf_version( - self, - cluster_lock_governance: governance_setup.GovClusterT, - ): - cluster, __ = cluster_lock_governance - pv = cluster.g_conway_governance.query.gov_state()["currentPParams"]["protocolVersion"][ - "major" - ] - if pv != 9: - pytest.skip("The major protocol version needs to be 9.") - @allure.link(helpers.get_vcs_link()) @pytest.mark.long def test_hardfork( self, skip_hf_command: None, # noqa: ARG002 - skip_hf_version: None, # noqa: ARG002 cluster_manager: cluster_management.ClusterManager, cluster_lock_governance: governance_setup.GovClusterT, pool_user_lg: clusterlib.PoolUser, @@ -88,6 +75,9 @@ def test_hardfork( cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + if not conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("The major protocol version needs to be 9.") + init_return_account_balance = cluster.g_query.get_stake_addr_info( pool_user_lg.stake.address ).reward_account_balance diff --git a/cardano_node_tests/tests/tests_conway/test_no_confidence.py b/cardano_node_tests/tests/tests_conway/test_no_confidence.py index 0d13f55f8..9f9248246 100644 --- a/cardano_node_tests/tests/tests_conway/test_no_confidence.py +++ b/cardano_node_tests/tests/tests_conway/test_no_confidence.py @@ -71,6 +71,9 @@ def test_no_confidence_action( cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("We can't create a needed 'update committee' previous action in bootstrap.") + # Reinstate CC members first, if needed, so we have a previous action prev_action_rec = governance_utils.get_prev_action( action_type=governance_utils.PrevGovActionIds.COMMITTEE, @@ -349,6 +352,9 @@ def test_committee_min_size( cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("We can't have this many CC members resign during bootstrap.") + # Resign all CC Members but one reqc.cip014.start(url=helpers.get_vcs_link()) diff --git a/cardano_node_tests/tests/tests_conway/test_pparam_update.py b/cardano_node_tests/tests/tests_conway/test_pparam_update.py index 32b5112c8..8276ff3be 100644 --- a/cardano_node_tests/tests/tests_conway/test_pparam_update.py +++ b/cardano_node_tests/tests/tests_conway/test_pparam_update.py @@ -244,6 +244,10 @@ def test_pparam_update( # noqa: C901 cluster, governance_data = cluster_lock_governance temp_template = common.get_test_id(cluster) cost_proposal_file = DATA_DIR / "cost_models_list.json" + is_in_bootstrap = conway_common.is_in_bootstrap(cluster_obj=cluster) + + if is_in_bootstrap and not configuration.HAS_CC: + pytest.skip("The test doesn't work in bootstrap period without CC.") # Check if total delegated stake is below the threshold. This can be used to check that # undelegated stake is treated as Abstain. If undelegated stake was treated as Yes, than @@ -678,20 +682,40 @@ def _check_proposed_pparams( update_proposals=net_nodrep_prop_rec.proposals, protocol_params=net_nodrep_prop_rec.future_pparams, ) + reqc.cip061_04.start(url=_url) - conway_common.cast_vote( - cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_net_nodrep", - payment_addr=pool_user_lg.payment, - action_txid=net_nodrep_prop_rec.action_txid, - action_ix=net_nodrep_prop_rec.action_ix, - approve_cc=True, - approve_drep=False, - approve_spo=None - if net_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) - else True, - ) + + if is_in_bootstrap: + with pytest.raises(clusterlib.CLIError) as excinfo: + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_net_nodrep_bootstrap", + payment_addr=pool_user_lg.payment, + action_txid=net_nodrep_prop_rec.action_txid, + action_ix=net_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=False, + approve_spo=None + if net_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) + else True, + ) + err_str = str(excinfo.value) + assert "(DisallowedVotesDuringBootstrap" in err_str, err_str + else: + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_net_nodrep", + payment_addr=pool_user_lg.payment, + action_txid=net_nodrep_prop_rec.action_txid, + action_ix=net_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=False, + approve_spo=None + if net_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) + else True, + ) # Vote on update proposals from network group that will NOT get approved by CC if configuration.HAS_CC: @@ -707,34 +731,35 @@ def _check_proposed_pparams( action_txid=net_nocc_prop_rec.action_txid, action_ix=net_nocc_prop_rec.action_ix, approve_cc=False, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if net_nocc_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, ) # Vote on update proposals from economic group that will NOT get approved by DReps - eco_nodrep_update_proposals = list(helpers.flatten(economic_g_proposals)) - eco_nodrep_prop_rec = _propose_pparams_update( - name_template=f"{temp_template}_eco_nodrep", proposals=eco_nodrep_update_proposals - ) - _check_proposed_pparams( - update_proposals=eco_nodrep_prop_rec.proposals, - protocol_params=eco_nodrep_prop_rec.future_pparams, - ) - conway_common.cast_vote( - cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_eco_nodrep", - payment_addr=pool_user_lg.payment, - action_txid=eco_nodrep_prop_rec.action_txid, - action_ix=eco_nodrep_prop_rec.action_ix, - approve_cc=True, - approve_drep=False, - approve_spo=None - if eco_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) - else True, - ) + if not is_in_bootstrap: + eco_nodrep_update_proposals = list(helpers.flatten(economic_g_proposals)) + eco_nodrep_prop_rec = _propose_pparams_update( + name_template=f"{temp_template}_eco_nodrep", proposals=eco_nodrep_update_proposals + ) + _check_proposed_pparams( + update_proposals=eco_nodrep_prop_rec.proposals, + protocol_params=eco_nodrep_prop_rec.future_pparams, + ) + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_eco_nodrep", + payment_addr=pool_user_lg.payment, + action_txid=eco_nodrep_prop_rec.action_txid, + action_ix=eco_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=False, + approve_spo=None + if eco_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) + else True, + ) # Vote on update proposals from economic group that will NOT get approved by CC if configuration.HAS_CC: @@ -750,7 +775,7 @@ def _check_proposed_pparams( action_txid=eco_nocc_prop_rec.action_txid, action_ix=eco_nocc_prop_rec.action_ix, approve_cc=False, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if eco_nocc_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, @@ -780,7 +805,7 @@ def _check_proposed_pparams( action_txid=tech_nodrep_prop_rec.action_txid, action_ix=tech_nodrep_prop_rec.action_ix, approve_cc=False, - approve_drep=False, + approve_drep=None if is_in_bootstrap else False, approve_spo=True, ) err_str = str(excinfo.value) @@ -791,16 +816,17 @@ def _check_proposed_pparams( if is_drep_total_below_threshold: reqc.cip064_03.start(url=_url) - conway_common.cast_vote( - cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_tech_nodrep", - payment_addr=pool_user_lg.payment, - action_txid=tech_nodrep_prop_rec.action_txid, - action_ix=tech_nodrep_prop_rec.action_ix, - approve_cc=True, - approve_drep=None, - ) + if not is_in_bootstrap: + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_tech_nodrep", + payment_addr=pool_user_lg.payment, + action_txid=tech_nodrep_prop_rec.action_txid, + action_ix=tech_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=None, + ) # Vote on update proposals from technical group that will NOT get approved by CC if configuration.HAS_CC: @@ -815,7 +841,7 @@ def _check_proposed_pparams( action_txid=tech_nocc_prop_rec.action_txid, action_ix=tech_nocc_prop_rec.action_ix, approve_cc=None, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if tech_nocc_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, @@ -841,7 +867,7 @@ def _check_proposed_pparams( action_txid=sec_nonespo_prop_rec.action_txid, action_ix=sec_nonespo_prop_rec.action_ix, approve_cc=True, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None, ) @@ -858,32 +884,33 @@ def _check_proposed_pparams( action_txid=sec_nospo_prop_rec.action_txid, action_ix=sec_nospo_prop_rec.action_ix, approve_cc=True, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=False, ) # Vote on update proposals from governance group that will NOT get approved by DReps - gov_nodrep_update_proposals = list(helpers.flatten(governance_g_proposals)) - gov_nodrep_prop_rec = _propose_pparams_update( - name_template=f"{temp_template}_gov_nodrep", proposals=gov_nodrep_update_proposals - ) - _check_proposed_pparams( - update_proposals=gov_nodrep_prop_rec.proposals, - protocol_params=gov_nodrep_prop_rec.future_pparams, - ) - conway_common.cast_vote( - cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_gov_nodrep", - payment_addr=pool_user_lg.payment, - action_txid=gov_nodrep_prop_rec.action_txid, - action_ix=gov_nodrep_prop_rec.action_ix, - approve_cc=True, - approve_drep=False, - approve_spo=None - if gov_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) - else True, - ) + if not is_in_bootstrap: + gov_nodrep_update_proposals = list(helpers.flatten(governance_g_proposals)) + gov_nodrep_prop_rec = _propose_pparams_update( + name_template=f"{temp_template}_gov_nodrep", proposals=gov_nodrep_update_proposals + ) + _check_proposed_pparams( + update_proposals=gov_nodrep_prop_rec.proposals, + protocol_params=gov_nodrep_prop_rec.future_pparams, + ) + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_gov_nodrep", + payment_addr=pool_user_lg.payment, + action_txid=gov_nodrep_prop_rec.action_txid, + action_ix=gov_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=False, + approve_spo=None + if gov_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) + else True, + ) # Vote on update proposals from governance group that will NOT get approved by CC if configuration.HAS_CC: @@ -899,43 +926,44 @@ def _check_proposed_pparams( action_txid=gov_nocc_prop_rec.action_txid, action_ix=gov_nocc_prop_rec.action_ix, approve_cc=False, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if gov_nocc_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, ) # Vote on update proposals from mix of groups that will NOT get approved by DReps - mix_nodrep_update_proposals = list( - helpers.flatten( - [ - *random.sample(network_g_proposals, 2), - *random.sample(economic_g_proposals, 2), - *random.sample(technical_g_proposals, 2), - *random.sample(governance_g_proposals, 2), - ] + if not is_in_bootstrap: + mix_nodrep_update_proposals = list( + helpers.flatten( + [ + *random.sample(network_g_proposals, 2), + *random.sample(economic_g_proposals, 2), + *random.sample(technical_g_proposals, 2), + *random.sample(governance_g_proposals, 2), + ] + ) + ) + mix_nodrep_prop_rec = _propose_pparams_update( + name_template=f"{temp_template}_mix_nodrep", proposals=mix_nodrep_update_proposals + ) + _check_proposed_pparams( + update_proposals=mix_nodrep_prop_rec.proposals, + protocol_params=mix_nodrep_prop_rec.future_pparams, + ) + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_mix_nodrep", + payment_addr=pool_user_lg.payment, + action_txid=mix_nodrep_prop_rec.action_txid, + action_ix=mix_nodrep_prop_rec.action_ix, + approve_cc=True, + approve_drep=False, + approve_spo=None + if mix_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) + else True, ) - ) - mix_nodrep_prop_rec = _propose_pparams_update( - name_template=f"{temp_template}_mix_nodrep", proposals=mix_nodrep_update_proposals - ) - _check_proposed_pparams( - update_proposals=mix_nodrep_prop_rec.proposals, - protocol_params=mix_nodrep_prop_rec.future_pparams, - ) - conway_common.cast_vote( - cluster_obj=cluster, - governance_data=governance_data, - name_template=f"{temp_template}_mix_nodrep", - payment_addr=pool_user_lg.payment, - action_txid=mix_nodrep_prop_rec.action_txid, - action_ix=mix_nodrep_prop_rec.action_ix, - approve_cc=True, - approve_drep=False, - approve_spo=None - if mix_nodrep_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) - else True, - ) # Vote on update proposals from mix of groups that will NOT get approved by CC if configuration.HAS_CC: @@ -964,7 +992,7 @@ def _check_proposed_pparams( action_txid=mix_nocc_prop_rec.action_txid, action_ix=mix_nocc_prop_rec.action_ix, approve_cc=False, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if mix_nocc_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, @@ -989,7 +1017,7 @@ def _check_proposed_pparams( action_txid=fin_prop_rec.action_txid, action_ix=fin_prop_rec.action_ix, approve_cc=False, - approve_drep=False, + approve_drep=None if is_in_bootstrap else False, approve_spo=False, ) @@ -1004,7 +1032,7 @@ def _check_proposed_pparams( action_txid=fin_prop_rec.action_txid, action_ix=fin_prop_rec.action_ix, approve_cc=True, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=True, ) fin_approve_epoch = cluster.g_query.get_epoch() @@ -1036,7 +1064,7 @@ def _check_proposed_pparams( action_txid=mix_approved_prop_rec.action_txid, action_ix=mix_approved_prop_rec.action_ix, approve_cc=True, - approve_drep=True, + approve_drep=None if is_in_bootstrap else True, approve_spo=None if mix_approved_prop_rec.proposal_names.isdisjoint(SECURITY_PPARAMS) else True, @@ -1074,7 +1102,7 @@ def _check_state(state: dict): action_txid=fin_prop_rec.action_txid, action_ix=fin_prop_rec.action_ix, approve_cc=False, - approve_drep=False, + approve_drep=None if is_in_bootstrap else False, ) next_rat_state = rat_gov_state["nextRatifyState"] @@ -1137,7 +1165,7 @@ def _check_state(state: dict): action_txid=fin_prop_rec.action_txid, action_ix=fin_prop_rec.action_ix, approve_cc=False, - approve_drep=False, + approve_drep=None if is_in_bootstrap else False, ) err_str = str(excinfo.value) assert "(GovActionsDoNotExist" in err_str, err_str @@ -1145,7 +1173,8 @@ def _check_state(state: dict): # Check vote view if fin_voted_votes.cc: governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.cc[0]) - governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0]) + if fin_voted_votes.drep: + governance_utils.check_vote_view(cluster_obj=cluster, vote_data=fin_voted_votes.drep[0]) class TestPParamData: diff --git a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py index 002af41ef..9aaf31f28 100644 --- a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py +++ b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py @@ -116,6 +116,19 @@ def test_treasury_withdrawals( # noqa: C901 signing_key_files=[pool_user_ug.payment.skey_file, recv_stake_addr_rec.skey_file], ) + if conway_common.is_in_bootstrap(cluster_obj=cluster): + with pytest.raises(clusterlib.CLIError) as excinfo: + clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=f"{temp_template}_action_bootstrap", + src_address=pool_user_ug.payment.address, + use_build_cmd=True, + tx_files=tx_files_action, + ) + err_str = str(excinfo.value) + assert "(DisallowedProposalDuringBootstrap" in err_str, err_str + return + # Make sure we have enough time to submit the proposals in one epoch clusterlib_utils.wait_for_epoch_interval( cluster_obj=cluster, start=1, stop=common.EPOCH_STOP_SEC_BUFFER @@ -372,6 +385,7 @@ def test_expire_treasury_withdrawals( # pylint: disable=too-many-locals,too-many-statements cluster, governance_data = cluster_use_governance temp_template = common.get_test_id(cluster) + is_in_bootstrap = conway_common.is_in_bootstrap(cluster_obj=cluster) actions_num = 3 # Create stake address and registration certificate @@ -396,7 +410,8 @@ def test_expire_treasury_withdrawals( anchor_data_hash = "5d372dca1a4cc90d7d16d966c48270e33e3aa0abcb0e78f0d5ca7ff330d2245d" - reqc.cip030ex.start(url=helpers.get_vcs_link()) + if not is_in_bootstrap: + reqc.cip030ex.start(url=helpers.get_vcs_link()) withdrawal_actions = [ cluster.g_conway_governance.action.create_treasury_withdrawal( action_name=f"{temp_template}_{a}", @@ -416,14 +431,27 @@ def test_expire_treasury_withdrawals( signing_key_files=[pool_user_ug.payment.skey_file, recv_stake_addr_rec.skey_file], ) + actions_deposit_combined = action_deposit_amt * len(withdrawal_actions) + + if is_in_bootstrap: + with pytest.raises(clusterlib.CLIError) as excinfo: + clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=f"{temp_template}_action_bootstrap", + src_address=pool_user_ug.payment.address, + tx_files=tx_files_action, + deposit=actions_deposit_combined + stake_deposit_amt, + ) + err_str = str(excinfo.value) + assert "(DisallowedProposalDuringBootstrap" in err_str, err_str + return + # Make sure we have enough time to submit the proposals in one epoch clusterlib_utils.wait_for_epoch_interval( cluster_obj=cluster, start=1, stop=common.EPOCH_STOP_SEC_BUFFER ) action_prop_epoch = cluster.g_query.get_epoch() - actions_deposit_combined = action_deposit_amt * len(withdrawal_actions) - reqc.cli025.start(url=helpers.get_vcs_link()) tx_output_action = clusterlib_utils.build_and_submit_tx( cluster_obj=cluster, diff --git a/cardano_node_tests/utils/requirements.py b/cardano_node_tests/utils/requirements.py index 13cb05de4..3e1b6e214 100644 --- a/cardano_node_tests/utils/requirements.py +++ b/cardano_node_tests/utils/requirements.py @@ -61,10 +61,11 @@ def failure(self) -> bool: ) return False - def start(self, url: str = "") -> bool: + def start(self, url: str = "") -> "Req": if url: self.url = url - return self.failure() + self.failure() + return self def __repr__(self) -> str: return f"" From 5d3e8fde72ffedd937f851aa5bbd740fb46985da Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 27 May 2024 18:38:18 +0200 Subject: [PATCH 17/47] Add nightly workflow for testing bootstrap period --- .github/env_nightly_conway_bootstrap | 3 +++ .../workflows/nightly_conway_bootstrap.yaml | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/env_nightly_conway_bootstrap create mode 100644 .github/workflows/nightly_conway_bootstrap.yaml diff --git a/.github/env_nightly_conway_bootstrap b/.github/env_nightly_conway_bootstrap new file mode 100644 index 000000000..68ace95ae --- /dev/null +++ b/.github/env_nightly_conway_bootstrap @@ -0,0 +1,3 @@ +CLUSTER_ERA=conway +COMMAND_ERA=conway +ENABLE_P2P=true diff --git a/.github/workflows/nightly_conway_bootstrap.yaml b/.github/workflows/nightly_conway_bootstrap.yaml new file mode 100644 index 000000000..73f12cbdf --- /dev/null +++ b/.github/workflows/nightly_conway_bootstrap.yaml @@ -0,0 +1,19 @@ +name: Nightly tests Conway Bootstrap + +on: + schedule: + - cron: '15 01 * * *' + workflow_dispatch: + +jobs: + nightly_job: + if: github.repository_owner == 'IntersectMBO' || github.event_name != 'schedule' + # reusable workflow from local repo and same branch as this config + uses: ./.github/workflows/regression_reusable.yaml + with: + env-path: .github/env_nightly_conway_bootstrap + secrets: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CI_FAIL_MAILS: ${{ secrets.NIGHTLY_FAIL_MAILS }} + GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }} + GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }} From a7f146eb00ae2541989102a75e6124bd18aa45ec Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 27 May 2024 18:42:32 +0200 Subject: [PATCH 18/47] Optimize nighty workflows schedule --- .github/workflows/nightly_conway_nocc.yaml | 2 +- .github/workflows/nightly_upgrade.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly_conway_nocc.yaml b/.github/workflows/nightly_conway_nocc.yaml index 116b317cb..b50c1b789 100644 --- a/.github/workflows/nightly_conway_nocc.yaml +++ b/.github/workflows/nightly_conway_nocc.yaml @@ -2,7 +2,7 @@ name: Nightly tests Conway no CC on: schedule: - - cron: '15 07 * * *' + - cron: '15 04 * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/nightly_upgrade.yaml b/.github/workflows/nightly_upgrade.yaml index d87c7d2a7..2f6a66c21 100644 --- a/.github/workflows/nightly_upgrade.yaml +++ b/.github/workflows/nightly_upgrade.yaml @@ -2,7 +2,7 @@ name: Nightly tests upgrade on: schedule: - - cron: '15 06 * * *' + - cron: '15 05 * * *' workflow_dispatch: jobs: From 6a7c0e42e0e0fccf6297f40d80978754f4564c5f Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 27 May 2024 18:55:01 +0200 Subject: [PATCH 19/47] Update requests lib --- poetry.lock | 10 +++++----- requirements_freeze.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 072d6779d..ed65189da 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -1466,13 +1466,13 @@ files = [ [[package]] name = "requests" -version = "2.31.0" +version = "2.32.2" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, + {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, ] [package.dependencies] diff --git a/requirements_freeze.txt b/requirements_freeze.txt index cc5963e6c..56ead6055 100644 --- a/requirements_freeze.txt +++ b/requirements_freeze.txt @@ -35,7 +35,7 @@ pytest-select==0.1.2 ; python_version >= "3.9" and python_version < "4.0" pytest-xdist==3.3.1 ; python_version >= "3.9" and python_version < "4.0" pytest==7.4.4 ; python_version >= "3.9" and python_version < "4.0" pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0" -requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0" +requests==2.32.2 ; python_version >= "3.9" and python_version < "4.0" sortedcontainers==2.4.0 ; python_version >= "3.9" and python_version < "4.0" tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11" typing-extensions==4.11.0 ; python_version >= "3.9" and python_version < "4.0" From 0d349d482c26c43343d7eab175b56872622aed5f Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 28 May 2024 11:07:43 +0200 Subject: [PATCH 20/47] Add Conway bootstrap to the nightly results page --- src_docs/source/test_results/nightly_system_tests.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src_docs/source/test_results/nightly_system_tests.rst b/src_docs/source/test_results/nightly_system_tests.rst index f5a723da0..b3f4b4d06 100644 --- a/src_docs/source/test_results/nightly_system_tests.rst +++ b/src_docs/source/test_results/nightly_system_tests.rst @@ -40,6 +40,12 @@ Nightly results * P2P network topology * Constitutional Commitee has 3 members * cluster starts directly in Conway era +* `nightly-conway-bootstrap `__: |nightly-conway-bootstrap-badge| + * network in Conway era + * protocol version 9 (bootstrap phase) + * P2P network topology + * Constitutional Commitee has 3 members + * cluster starts directly in Conway era * `nightly-conway-no-cc `__: |nightly-conway-nocc-badge| * network in Conway era * protocol version 10 @@ -90,5 +96,8 @@ Nightly upgrade testing .. |nightly-conway-cc-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-conway-cc%2Fbadge.json :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-conway-cc/ +.. |nightly-conway-bootstrap-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-conway-bootstrap%2Fbadge.json + :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-conway-bootstrap/ + .. |nightly-conway-nocc-badge| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Fcardano-tests-reports-3-74-115-22.nip.io%2Fcardano-node-tests-nightly-conway-no-cc%2Fbadge.json :target: https://cardano-tests-reports-3-74-115-22.nip.io/cardano-node-tests-nightly-conway-no-cc/ From 8b70a4f1ece070c483b9f8ec5531e1ec8a41da16 Mon Sep 17 00:00:00 2001 From: saratomaz Date: Thu, 23 May 2024 11:31:36 +0100 Subject: [PATCH 21/47] Test voting_procedure dbsync table --- .../tests/tests_conway/conway_common.py | 11 ++------ .../tests/tests_conway/test_info.py | 11 +++++++- .../tests_conway/test_treasury_withdrawals.py | 4 +-- cardano_node_tests/utils/dbsync_queries.py | 26 +++++++++++++++++++ cardano_node_tests/utils/dbsync_utils.py | 25 ++++++++++++++++++ cardano_node_tests/utils/governance_utils.py | 7 +++++ 6 files changed, 72 insertions(+), 12 deletions(-) diff --git a/cardano_node_tests/tests/tests_conway/conway_common.py b/cardano_node_tests/tests/tests_conway/conway_common.py index 9b1dc79b8..73b277488 100644 --- a/cardano_node_tests/tests/tests_conway/conway_common.py +++ b/cardano_node_tests/tests/tests_conway/conway_common.py @@ -16,13 +16,6 @@ LOGGER = logging.getLogger(__name__) -@dataclasses.dataclass(frozen=True, order=True) -class VotedVotes: - cc: tp.List[clusterlib.VoteCC] # pylint: disable=invalid-name - drep: tp.List[clusterlib.VoteDrep] - spo: tp.List[clusterlib.VoteSPO] - - @dataclasses.dataclass(frozen=True) class PParamPropRec: proposals: tp.List[clusterlib_utils.UpdateProposal] @@ -220,7 +213,7 @@ def cast_vote( cc_skip_votes: bool = False, drep_skip_votes: bool = False, spo_skip_votes: bool = False, -) -> VotedVotes: +) -> governance_utils.VotedVotes: """Cast a vote.""" # pylint: disable=too-many-arguments votes_cc = [] @@ -309,7 +302,7 @@ def cast_vote( assert not votes_drep or prop_vote["dRepVotes"], "No DRep votes" assert not votes_spo or prop_vote["stakePoolVotes"], "No stake pool votes" - return VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo) + return governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo) def resign_ccs( diff --git a/cardano_node_tests/tests/tests_conway/test_info.py b/cardano_node_tests/tests/tests_conway/test_info.py index 07ba08458..3fc072c38 100644 --- a/cardano_node_tests/tests/tests_conway/test_info.py +++ b/cardano_node_tests/tests/tests_conway/test_info.py @@ -14,6 +14,7 @@ from cardano_node_tests.tests.tests_conway import conway_common from cardano_node_tests.utils import clusterlib_utils from cardano_node_tests.utils import configuration +from cardano_node_tests.utils import dbsync_utils from cardano_node_tests.utils import governance_setup from cardano_node_tests.utils import governance_utils from cardano_node_tests.utils import helpers @@ -179,7 +180,7 @@ def test_info( ) reqc.cli024.start(url=helpers.get_vcs_link()) - conway_common.submit_vote( + vote_tx_output = conway_common.submit_vote( cluster_obj=cluster, name_template=temp_template, payment_addr=pool_user_ug.payment, @@ -189,6 +190,8 @@ def test_info( ) reqc.cli024.success() + vote_txid = cluster.g_transaction.get_txid(tx_body_file=vote_tx_output.out_file) + vote_gov_state = cluster.g_conway_governance.query.gov_state() _cur_epoch = cluster.g_query.get_epoch() conway_common.save_gov_state( @@ -231,3 +234,9 @@ def test_info( governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_drep[0]) governance_utils.check_vote_view(cluster_obj=cluster, vote_data=votes_spo[0]) reqc.cli022.success() + + # Check dbsync + dbsync_utils.check_votes( + votes=governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo), + txhash=vote_txid, + ) diff --git a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py index 002af41ef..6cff089d5 100644 --- a/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py +++ b/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py @@ -168,7 +168,7 @@ def test_treasury_withdrawals( # noqa: C901 def _cast_vote( approve: bool, vote_id: str, add_spo_votes: bool = False - ) -> conway_common.VotedVotes: + ) -> governance_utils.VotedVotes: votes_cc = [] votes_drep = [] votes_spo = [] @@ -247,7 +247,7 @@ def _cast_vote( assert prop_vote["dRepVotes"], "No DRep votes" assert not votes_spo or prop_vote["stakePoolVotes"], "Unexpected stake pool votes" - return conway_common.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo) + return governance_utils.VotedVotes(cc=votes_cc, drep=votes_drep, spo=votes_spo) # Check that SPOs cannot vote on treasury withdrawal action with pytest.raises(clusterlib.CLIError) as excinfo: diff --git a/cardano_node_tests/utils/dbsync_queries.py b/cardano_node_tests/utils/dbsync_queries.py index 490dabf90..e4aba4218 100644 --- a/cardano_node_tests/utils/dbsync_queries.py +++ b/cardano_node_tests/utils/dbsync_queries.py @@ -424,6 +424,17 @@ class GovActionProposalDBRow: expired_epoch: int +@dataclasses.dataclass(frozen=True) +class VotingProcedureDBRow: + # pylint: disable-next=invalid-name + id: int + voter_role: str + committee_voter: int + drep_voter: int + pool_voter: int + vote: str + + @contextlib.contextmanager def execute(query: str, vars: tp.Sequence = ()) -> tp.Iterator[psycopg2.extensions.cursor]: # pylint: disable=redefined-builtin @@ -1125,3 +1136,18 @@ def query_gov_action_proposal( with execute(query=query, vars=(query_var,)) as cur: while (result := cur.fetchone()) is not None: yield GovActionProposalDBRow(*result) + + +def query_voting_procedure(txhash: str) -> tp.Generator[VotingProcedureDBRow, None, None]: + """Query voting_procedure table in db-sync.""" + query = ( + "SELECT" + " vp.id, vp.voter_role, vp.committee_voter, vp.drep_voter, vp.pool_voter, vp.vote " + "FROM voting_procedure as vp " + "INNER JOIN tx ON tx.id = vp.tx_id " + "WHERE tx.hash = %s;" + ) + + with execute(query=query, vars=(rf"\x{txhash}",)) as cur: + while (result := cur.fetchone()) is not None: + yield VotingProcedureDBRow(*result) diff --git a/cardano_node_tests/utils/dbsync_utils.py b/cardano_node_tests/utils/dbsync_utils.py index 6ff766a05..c4eb99aa8 100644 --- a/cardano_node_tests/utils/dbsync_utils.py +++ b/cardano_node_tests/utils/dbsync_utils.py @@ -985,3 +985,28 @@ def check_drep_deregistration( ), f"Wrong deposit value for deregistered DRep {drep.drep_id} in db-sync" return drep_data + + +def check_votes(votes: governance_utils.VotedVotes, txhash: str) -> None: + """Check votes in db-sync.""" + if not configuration.HAS_DBSYNC: + return + + expected_votes_by_role = { + "ConstitutionalCommittee": [v.vote.name for v in votes.cc], + "DRep": [v.vote.name for v in votes.drep], + "SPO": [v.vote.name for v in votes.spo], + } + + dbsync_votes = list(dbsync_queries.query_voting_procedure(txhash=txhash)) + + dbsync_votes_by_role: dict = { + "ConstitutionalCommittee": [], + "DRep": [], + "SPO": [], + } + + for d_vote in dbsync_votes: + dbsync_votes_by_role[d_vote.voter_role].append(d_vote.vote.upper()) + + assert expected_votes_by_role == dbsync_votes_by_role, "Votes didn't match in dbsync" diff --git a/cardano_node_tests/utils/governance_utils.py b/cardano_node_tests/utils/governance_utils.py index 5cffbc085..02ac914ca 100644 --- a/cardano_node_tests/utils/governance_utils.py +++ b/cardano_node_tests/utils/governance_utils.py @@ -65,6 +65,13 @@ class StakeDelegation: total_lovelace: int +@dataclasses.dataclass(frozen=True, order=True) +class VotedVotes: + cc: tp.List[clusterlib.VoteCC] # pylint: disable=invalid-name + drep: tp.List[clusterlib.VoteDrep] + spo: tp.List[clusterlib.VoteSPO] + + class PrevGovActionIds(enum.Enum): COMMITTEE = "Committee" CONSTITUTION = "Constitution" From 7fb137614936d4e6ade6ee50c0039da7001d30cd Mon Sep 17 00:00:00 2001 From: saratomaz Date: Tue, 23 Apr 2024 20:28:23 +0100 Subject: [PATCH 22/47] Test CC threshold set to zero --- .../tests/tests_conway/test_committee.py | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) diff --git a/cardano_node_tests/tests/tests_conway/test_committee.py b/cardano_node_tests/tests/tests_conway/test_committee.py index 82b5af752..ab5d5a88c 100644 --- a/cardano_node_tests/tests/tests_conway/test_committee.py +++ b/cardano_node_tests/tests/tests_conway/test_committee.py @@ -1354,3 +1354,178 @@ def test_update_committee_threshold_out_of_range( err_str = str(excinfo.value) assert "Please enter a value in the range [0,1]" in err_str, err_str + + @allure.link(helpers.get_vcs_link()) + @pytest.mark.skipif(not configuration.HAS_CC, reason="Runs only on setup with CC") + @pytest.mark.long + def test_committee_zero_threshold( + self, + cluster_lock_governance: governance_setup.GovClusterT, + pool_user_lg: clusterlib.PoolUser, + ): + """Test that actions that requires CC approval can be ratified when threshold == 0. + + Even if the CC disapprove the action. + + * set CC threshold to zero + * submit a "create constitution" action + * vote to disapprove the action by the CC and approve by the DReps + * check that the action is ratified + * check that the action is enacted + """ + cluster, governance_data = cluster_lock_governance + temp_template = common.get_test_id(cluster) + + if conway_common.is_in_bootstrap(cluster_obj=cluster): + pytest.skip("Cannot run during bootstrap period.") + + def _check_rat_enact_state( + action_txid: str, action_type: governance_utils.PrevGovActionIds + ) -> None: + # Check ratification + _cur_epoch_rat = cluster.wait_for_new_epoch(padding_seconds=5) + + rat_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=rat_gov_state, name_template=f"{temp_template}_rat_{_cur_epoch_rat}" + ) + + rat_action = governance_utils.lookup_ratified_actions( + gov_state=rat_gov_state, action_txid=action_txid + ) + assert rat_action, "Action not found in ratified actions" + + # Wait for enactment + _cur_epoch_enact = cluster.wait_for_new_epoch(padding_seconds=5) + + # Check enactment + assert _cur_epoch_enact == _cur_epoch_rat + 1, f"Unexpected epoch {_cur_epoch_enact}" + enact_gov_state = cluster.g_conway_governance.query.gov_state() + conway_common.save_gov_state( + gov_state=enact_gov_state, name_template=f"{temp_template}_enact_{_cur_epoch_enact}" + ) + + prev_action_rec = governance_utils.get_prev_action( + action_type=action_type, + gov_state=enact_gov_state, + ) + + assert prev_action_rec.txid == action_txid, "Action not enacted" + + deposit_amt = cluster.conway_genesis["govActionDeposit"] + anchor_url = "http://www.cc-update.com" + anchor_data_hash = "5d372dca1a4cc90d7d16d966c48270e33e3aa0abcb0e78f0d5ca7ff330d2245d" + prev_action_rec = governance_utils.get_prev_action( + action_type=governance_utils.PrevGovActionIds.COMMITTEE, + gov_state=cluster.g_conway_governance.query.gov_state(), + ) + + # Set CC threshold to zero + update_threshold_action = cluster.g_conway_governance.action.update_committee( + action_name=temp_template, + deposit_amt=deposit_amt, + anchor_url=anchor_url, + anchor_data_hash=anchor_data_hash, + threshold="0", + prev_action_txid=prev_action_rec.txid, + prev_action_ix=prev_action_rec.ix, + deposit_return_stake_vkey_file=pool_user_lg.stake.vkey_file, + ) + + tx_files = clusterlib.TxFiles( + proposal_files=[update_threshold_action.action_file], + signing_key_files=[ + pool_user_lg.payment.skey_file, + ], + ) + + tx_output_action = clusterlib_utils.build_and_submit_tx( + cluster_obj=cluster, + name_template=f"{temp_template}_update_threshold", + src_address=pool_user_lg.payment.address, + use_build_cmd=True, + tx_files=tx_files, + ) + + threshold_action_txid = cluster.g_transaction.get_txid( + tx_body_file=tx_output_action.out_file + ) + threshold_action_gov_state = cluster.g_conway_governance.query.gov_state() + _cur_epoch = cluster.g_query.get_epoch() + conway_common.save_gov_state( + gov_state=threshold_action_gov_state, + name_template=f"{temp_template}_action_{_cur_epoch}", + ) + prop_action = governance_utils.lookup_proposal( + gov_state=threshold_action_gov_state, action_txid=threshold_action_txid + ) + action_ix = prop_action["actionId"]["govActionIx"] + + # Make sure the votes don't happen close to epoch boundary + clusterlib_utils.wait_for_epoch_interval( + cluster_obj=cluster, start=10, stop=common.EPOCH_STOP_SEC_BUFFER + ) + + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_add_yes", + payment_addr=pool_user_lg.payment, + action_txid=threshold_action_txid, + action_ix=action_ix, + approve_drep=True, + approve_spo=True, + ) + + _check_rat_enact_state( + action_txid=threshold_action_txid, + action_type=governance_utils.PrevGovActionIds.COMMITTEE, + ) + + # Try to ratify a "create constitution" action that is expecting approval from the CC + anchor_url = "http://www.const-action.com" + constitution_url = "http://www.const-new.com" + ( + const_action, + const_action_txid, + const_action_ix, + ) = conway_common.propose_change_constitution( + cluster_obj=cluster, + name_template=f"{temp_template}_constitution", + anchor_url=anchor_url, + anchor_data_hash=cluster.g_conway_governance.get_anchor_data_hash(text=anchor_url), + constitution_url=constitution_url, + constitution_hash=cluster.g_conway_governance.get_anchor_data_hash( + text=constitution_url + ), + pool_user=pool_user_lg, + ) + + # Make sure the votes don't happen close to epoch boundary + clusterlib_utils.wait_for_epoch_interval( + cluster_obj=cluster, start=10, stop=common.EPOCH_STOP_SEC_BUFFER + ) + + conway_common.cast_vote( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_constitution", + payment_addr=pool_user_lg.payment, + action_txid=const_action_txid, + action_ix=const_action_ix, + approve_cc=False, + approve_drep=True, + ) + + _check_rat_enact_state( + action_txid=const_action_txid, + action_type=governance_utils.PrevGovActionIds.CONSTITUTION, + ) + + # Reinstate the original CC data + governance_setup.reinstate_committee( + cluster_obj=cluster, + governance_data=governance_data, + name_template=f"{temp_template}_reinstate", + pool_user=pool_user_lg, + ) From 708d473f216aeb894b7ad02628c01954c1caafdd Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 28 May 2024 19:01:51 +0200 Subject: [PATCH 23/47] Add ability to merge coverage reports --- cardano_node_tests/chang_us_coverage.py | 8 +-- .../dump_requirements_coverage.py | 40 +++++++++++--- cardano_node_tests/utils/requirements.py | 55 ++++++++++++++----- 3 files changed, 76 insertions(+), 27 deletions(-) diff --git a/cardano_node_tests/chang_us_coverage.py b/cardano_node_tests/chang_us_coverage.py index de41b9835..d08a48421 100755 --- a/cardano_node_tests/chang_us_coverage.py +++ b/cardano_node_tests/chang_us_coverage.py @@ -36,11 +36,11 @@ def get_args() -> argparse.Namespace: def _get_color(status: str) -> str: - if status == requirements.Statuses.SUCCESS: + if status == requirements.Statuses.success.name: return "green" - if status == requirements.Statuses.FAILURE: + if status == requirements.Statuses.failure.name: return "red" - if status == requirements.Statuses.PARTIAL_SUCCESS: + if status == requirements.Statuses.partial_success.name: return "yellow" return "grey" @@ -62,7 +62,7 @@ def main() -> None: for req_id, req_data in chang_group.items(): # Partial or uncovered requirements should be ignored - if req_id.startswith("int") or req_data["status"] == requirements.Statuses.UNCOVERED: + if req_id.startswith("int") or req_data["status"] == requirements.Statuses.uncovered.name: continue color = _get_color(req_data["status"]) diff --git a/cardano_node_tests/dump_requirements_coverage.py b/cardano_node_tests/dump_requirements_coverage.py index 329d1df33..8e109950b 100755 --- a/cardano_node_tests/dump_requirements_coverage.py +++ b/cardano_node_tests/dump_requirements_coverage.py @@ -2,6 +2,7 @@ """Generate coverage results for external requirements.""" import argparse +import json import logging from cardano_node_tests.utils import helpers @@ -13,13 +14,6 @@ def get_args() -> argparse.Namespace: """Get command line arguments.""" parser = argparse.ArgumentParser(description=__doc__.split("\n", maxsplit=1)[0]) - parser.add_argument( - "-a", - "--artifacts-base-dir", - required=True, - type=helpers.check_dir_arg, - help="Path to a directory with testing artifacts", - ) parser.add_argument( "-m", "--requirements-mapping", @@ -32,6 +26,19 @@ def get_args() -> argparse.Namespace: required=True, help="File where to save coverage results", ) + parser.add_argument( + "-a", + "--artifacts-base-dir", + type=helpers.check_dir_arg, + help="Path to a directory with testing artifacts", + ) + parser.add_argument( + "-i", + "--input-files", + nargs="+", + type=helpers.check_file_arg, + help="Path to coverage results to merge into a final result", + ) return parser.parse_args() @@ -42,9 +49,24 @@ def main() -> None: ) args = get_args() - executed_req = requirements.collect_executed_req(base_dir=args.artifacts_base_dir) + if not (args.artifacts_base_dir or args.input_files): + LOGGER.error("Either `--artifacts-base-dir` or `--input-files` must be provided") + return + + executed_req = {} + if args.artifacts_base_dir: + executed_req = requirements.collect_executed_req(base_dir=args.artifacts_base_dir) + + input_reqs = [] + if args.input_files: + for input_file in args.input_files: + with open(input_file, encoding="utf-8") as in_fp: + input_reqs.append(json.load(in_fp)) + + merged_reqs = requirements.merge_reqs(executed_req, *input_reqs) + report = requirements.get_mapped_req( - mapping=args.requirements_mapping, executed_req=executed_req + mapping=args.requirements_mapping, executed_req=merged_reqs ) helpers.write_json(out_file=args.output_file, content=report) diff --git a/cardano_node_tests/utils/requirements.py b/cardano_node_tests/utils/requirements.py index 3e1b6e214..b8d669660 100644 --- a/cardano_node_tests/utils/requirements.py +++ b/cardano_node_tests/utils/requirements.py @@ -1,5 +1,6 @@ """Functionality for tracking execution of external requirements.""" +import enum import json import logging import pathlib as pl @@ -14,11 +15,11 @@ class GroupsKnown: CHANG_US: tp.Final[str] = "chang_us" -class Statuses: - SUCCESS: tp.Final[str] = "success" - FAILURE: tp.Final[str] = "failure" - UNCOVERED: tp.Final[str] = "uncovered" - PARTIAL_SUCCESS: tp.Final[str] = "partial_success" +class Statuses(enum.Enum): + success = 1 + failure = 2 + partial_success = 3 + uncovered = 4 class Req: @@ -48,14 +49,24 @@ def _get_dest_dir(self) -> pl.Path: return dest_dir def success(self) -> bool: - content = {"id": self.id, "group": self.group, "url": self.url, "status": Statuses.SUCCESS} + content = { + "id": self.id, + "group": self.group, + "url": self.url, + "status": Statuses.success.name, + } helpers.write_json( out_file=self._get_dest_dir() / f"{self.basename}_success.json", content=content ) return True def failure(self) -> bool: - content = {"id": self.id, "group": self.group, "url": self.url, "status": Statuses.FAILURE} + content = { + "id": self.id, + "group": self.group, + "url": self.url, + "status": Statuses.failure.name, + } helpers.write_json( out_file=self._get_dest_dir() / f"{self.basename}_init.json", content=content ) @@ -86,7 +97,7 @@ def collect_executed_req(base_dir: pl.Path) -> dict: req_id = req_rec["id"] id_collected = group_collected.get(req_id) - if id_collected and id_collected["status"] == Statuses.SUCCESS: + if id_collected and id_collected["status"] == Statuses.success.name: continue if not id_collected: id_collected = {} @@ -97,6 +108,22 @@ def collect_executed_req(base_dir: pl.Path) -> dict: return collected +def merge_reqs(*reqs: tp.Dict[str, dict]) -> dict: + """Merge requirements.""" + merged: tp.Dict[str, dict] = {} + for report in reqs: + for gname, greqs in report.items(): + merged_group = merged.get(gname) or {} + for req_id, req_data in greqs.items(): + merged_rec = merged_group.get(req_id) or {} + merged_status_val = Statuses[merged_rec.get("status") or "uncovered"].value + req_status_val = Statuses[req_data["status"]].value + if not merged_rec or req_status_val < merged_status_val: + merged_group[req_id] = req_data + merged[gname] = merged_group + return merged + + def get_mapped_req(mapping: pl.Path, executed_req: dict) -> dict: """Get mapped requirements.""" with open(mapping, encoding="utf-8") as in_fp: @@ -116,22 +143,22 @@ def get_mapped_req(mapping: pl.Path, executed_req: dict) -> dict: if not url: url = executed_group.get(p_req, {}).get("url") - if p_status == Statuses.SUCCESS: + if p_status == Statuses.success.name: dependencies_success.append(p_req) - elif p_status == Statuses.FAILURE: + elif p_status == Statuses.failure.name: dependencies_failures.append(p_req) # If any partial requirement failed, the overall outcome would be failed if dependencies_failures: - status = Statuses.FAILURE + status = Statuses.failure.name # If none partial requirement is covered, the overall outcome would be uncovered elif not (dependencies_success or dependencies_failures): - status = Statuses.UNCOVERED + status = Statuses.uncovered.name # If all partial requirements are successful, the overall outcome would be success elif len(dependencies_success) == len(dependencies): - status = Statuses.SUCCESS + status = Statuses.success.name else: - status = Statuses.PARTIAL_SUCCESS + status = Statuses.partial_success.name executed_req[group][req_id] = {"status": status, "url": url} From 0bcc3867e80b171a7456a9340720aa8df9ba42c7 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 28 May 2024 19:10:28 +0200 Subject: [PATCH 24/47] Update Chang User Stories coverage report --- .../chang_user_stories_system_tests.rst | 242 +++++++++--------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/src_docs/source/test_results/requirements/chang_user_stories_system_tests.rst b/src_docs/source/test_results/requirements/chang_user_stories_system_tests.rst index fab4b6852..791136850 100644 --- a/src_docs/source/test_results/requirements/chang_user_stories_system_tests.rst +++ b/src_docs/source/test_results/requirements/chang_user_stories_system_tests.rst @@ -3,7 +3,7 @@ System Tests Coverage The page is updated every Tuesday and Friday until the coverage is complete. -Latest update: **2024-04-16**   +Latest update: **2024-05-28**   **Legend:** |Success Badge| |Failure Badge| |Partial Coverage Badge| |Uncovered Badge|   @@ -940,77 +940,77 @@ CIP1694 User Stories .. |Uncovered Badge| image:: https://img.shields.io/badge/uncovered-grey .. |image-CLI1| image:: https://img.shields.io/badge/CLI001-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L203 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L207 .. |image-CLI2| image:: https://img.shields.io/badge/CLI002-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L85 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L89 .. |image-CLI3| image:: https://img.shields.io/badge/CLI003-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L115 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L125 .. |image-CLI4| image:: https://img.shields.io/badge/CLI004-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L115 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L125 .. |image-CLI5| image:: https://img.shields.io/badge/CLI005-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L115 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L125 .. |image-CLI6| image:: https://img.shields.io/badge/CLI006-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L115 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L125 .. |image-CLI7| image:: https://img.shields.io/badge/CLI007-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L163 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L174 .. |image-CLI8| image:: https://img.shields.io/badge/CLI008-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L259 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L291 .. |image-CLI9| image:: https://img.shields.io/badge/CLI009-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L259 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L291 .. |image-CLI10| image:: https://img.shields.io/badge/CLI010-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L259 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L291 .. |image-CLI11| image:: https://img.shields.io/badge/CLI011-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L316 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L348 .. |image-CLI12| image:: https://img.shields.io/badge/CLI012-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L254 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L286 .. |image-CLI13| image:: https://img.shields.io/badge/CLI013-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L91 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L95 .. |image-CLI14| image:: https://img.shields.io/badge/CLI014-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L464 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L487 .. |image-CLI15| image:: https://img.shields.io/badge/CLI015-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L92 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L96 .. |image-CLI16| image:: https://img.shields.io/badge/CLI016-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L69 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L73 .. |image-CLI17| image:: https://img.shields.io/badge/CLI017-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L640 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L668 .. |image-CLI18| image:: https://img.shields.io/badge/CLI018-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L97 -.. |image-CLI19| image:: https://img.shields.io/badge/CLI019-grey - :target: https://github.com/CLI019-404 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L101 +.. |image-CLI19| image:: https://img.shields.io/badge/CLI019-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/66da2d77713141d8fcb54d02a4b674b1b19af5c7/cardano_node_tests/tests/tests_conway/test_hardfork.py#L94 .. |image-CLI20| image:: https://img.shields.io/badge/CLI020-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L250 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L254 .. |image-CLI21| image:: https://img.shields.io/badge/CLI021-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L131 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L135 .. |image-CLI22| image:: https://img.shields.io/badge/CLI022-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L224 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L228 .. |image-CLI23| image:: https://img.shields.io/badge/CLI023-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L90 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L94 .. |image-CLI24| image:: https://img.shields.io/badge/CLI024-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L177 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L181 .. |image-CLI25| image:: https://img.shields.io/badge/CLI025-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L426 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L427 .. |image-CLI26| image:: https://img.shields.io/badge/CLI026-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L515 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L516 .. |image-CLI27| image:: https://img.shields.io/badge/CLI027-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L555 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L582 .. |image-CLI28| image:: https://img.shields.io/badge/CLI028-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L603 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L630 .. |image-CLI29| image:: https://img.shields.io/badge/CLI029-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L564 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L591 .. |image-CLI30| image:: https://img.shields.io/badge/CLI030-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L750 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L777 .. |image-CLI31| image:: https://img.shields.io/badge/CLI031-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L111 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L115 .. |image-CLI32| image:: https://img.shields.io/badge/CLI032-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L149 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L160 .. |image-CLI33| image:: https://img.shields.io/badge/CLI033-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L292 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L324 .. |image-CLI34| image:: https://img.shields.io/badge/CLI034-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L676 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L703 .. |image-CLI35| image:: https://img.shields.io/badge/CLI035-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L643 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L670 .. |image-CLI36| image:: https://img.shields.io/badge/CLI036-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L230 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L234 .. |image-CLI37| image:: https://img.shields.io/badge/CLI037-grey :target: https://github.com/CLI037-404 .. |image-CLI38| image:: https://img.shields.io/badge/CLI038-grey @@ -1021,175 +1021,175 @@ CIP1694 User Stories :target: https://github.com/CLI038-404 .. |image-CIP1a| image:: https://img.shields.io/badge/CIP001a-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L203 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L207 .. |image-CIP1b| image:: https://img.shields.io/badge/CIP001b-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L203 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L207 .. |image-CIP2| image:: https://img.shields.io/badge/CIP002-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L149 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L160 .. |image-CIP3| image:: https://img.shields.io/badge/CIP003-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L115 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L125 .. |image-CIP4| image:: https://img.shields.io/badge/CIP004-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L149 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L160 .. |image-CIP5| image:: https://img.shields.io/badge/CIP005-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L533 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L556 .. |image-CIP6| image:: https://img.shields.io/badge/CIP006-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L640 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L668 .. |image-CIP7| image:: https://img.shields.io/badge/CIP007-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L251 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L269 .. |image-CIP8| image:: https://img.shields.io/badge/CIP008-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L1174 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L1129 .. |image-CIP9| image:: https://img.shields.io/badge/CIP009-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L830 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L853 .. |image-CIP10| image:: https://img.shields.io/badge/CIP010-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L830 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L853 .. |image-CIP11| image:: https://img.shields.io/badge/CIP011-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L783 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L806 .. |image-CIP12| image:: https://img.shields.io/badge/CIP012-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L163 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L174 .. |image-CIP13| image:: https://img.shields.io/badge/CIP013-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L97 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L101 .. |image-CIP14| image:: https://img.shields.io/badge/CIP014-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L353 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L354 .. |image-CIP15| image:: https://img.shields.io/badge/CIP015-grey :target: https://github.com/CIP015-404 .. |image-CIP16| image:: https://img.shields.io/badge/CIP016-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L552 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L579 .. |image-CIP17| image:: https://img.shields.io/badge/CIP017-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L552 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L579 .. |image-CIP18| image:: https://img.shields.io/badge/CIP018-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L552 -.. |image-CIP19| image:: https://img.shields.io/badge/CIP019-grey - :target: https://github.com/CIP019-404 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L579 +.. |image-CIP19| image:: https://img.shields.io/badge/CIP019-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L1384 .. |image-CIP20| image:: https://img.shields.io/badge/CIP020-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L670 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L697 .. |image-CIP21| image:: https://img.shields.io/badge/CIP021-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L259 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L291 .. |image-CIP22| image:: https://img.shields.io/badge/CIP022-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L564 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L591 .. |image-CIP23| image:: https://img.shields.io/badge/CIP023-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L316 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L348 .. |image-CIP24| image:: https://img.shields.io/badge/CIP024-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L340 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L372 .. |image-CIP25| image:: https://img.shields.io/badge/CIP025-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_drep.py#L676 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_drep.py#L703 .. |image-CIP26| image:: https://img.shields.io/badge/CIP026-grey :target: https://github.com/CIP026-404 .. |image-CIP27| image:: https://img.shields.io/badge/CIP027-grey :target: https://github.com/CIP027-404 -.. |image-CIP28| image:: https://img.shields.io/badge/CIP028-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L97 +.. |image-CIP28| image:: https://img.shields.io/badge/CIP028-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L95 .. |image-CIP29| image:: https://img.shields.io/badge/CIP029-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L97 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L101 .. |image-CIP30| image:: https://img.shields.io/badge/CIP030-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L97 -.. |image-CIP31a| image:: https://img.shields.io/badge/CIP031a-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L251 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L101 +.. |image-CIP31a| image:: https://img.shields.io/badge/CIP031a-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L269 .. |image-CIP31b| image:: https://img.shields.io/badge/CIP031b-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L464 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L487 .. |image-CIP31c| image:: https://img.shields.io/badge/CIP031c-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L91 -.. |image-CIP31d| image:: https://img.shields.io/badge/CIP031d-grey - :target: https://github.com/CIP031d-404 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L95 +.. |image-CIP31d| image:: https://img.shields.io/badge/CIP031d-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/66da2d77713141d8fcb54d02a4b674b1b19af5c7/cardano_node_tests/tests/tests_conway/test_hardfork.py#L94 .. |image-CIP31e| image:: https://img.shields.io/badge/CIP031e-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L640 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L668 .. |image-CIP31f| image:: https://img.shields.io/badge/CIP031f-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L92 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L96 .. |image-CIP32| image:: https://img.shields.io/badge/CIP032-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L258 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L262 .. |image-CIP33| image:: https://img.shields.io/badge/CIP033-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L310 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L314 .. |image-CIP34| image:: https://img.shields.io/badge/CIP034-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L278 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L282 .. |image-CIP35| image:: https://img.shields.io/badge/CIP035-grey :target: https://github.com/CIP035-404 .. |image-CIP36| image:: https://img.shields.io/badge/CIP036-grey :target: https://github.com/CIP036-404 .. |image-CIP37| image:: https://img.shields.io/badge/CIP037-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1019 -.. |image-CIP38| image:: https://img.shields.io/badge/CIP038-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L774 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L974 +.. |image-CIP38| image:: https://img.shields.io/badge/CIP038-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L797 .. |image-CIP39| image:: https://img.shields.io/badge/CIP039-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L184 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L188 .. |image-CIP40| image:: https://img.shields.io/badge/CIP040-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L688 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L711 .. |image-CIP41| image:: https://img.shields.io/badge/CIP041-green :target: https://github.com/CIP41-404 .. |image-CIP42| image:: https://img.shields.io/badge/CIP042-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L137 -.. |image-CIP43| image:: https://img.shields.io/badge/CIP043-grey - :target: https://github.com/CIP043-404 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L141 +.. |image-CIP43| image:: https://img.shields.io/badge/CIP043-yellow + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/66da2d77713141d8fcb54d02a4b674b1b19af5c7/cardano_node_tests/tests/tests_conway/test_hardfork.py#L177 .. |image-CIP44| image:: https://img.shields.io/badge/CIP044-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L736 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L661 .. |image-CIP45| image:: https://img.shields.io/badge/CIP045-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L736 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L661 .. |image-CIP46| image:: https://img.shields.io/badge/CIP046-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L736 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L661 .. |image-CIP47| image:: https://img.shields.io/badge/CIP047-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L736 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L661 .. |image-CIP48| image:: https://img.shields.io/badge/CIP048-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L258 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L262 .. |image-CIP49| image:: https://img.shields.io/badge/CIP049-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L273 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L264 .. |image-CIP50| image:: https://img.shields.io/badge/CIP050-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L273 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L264 .. |image-CIP51| image:: https://img.shields.io/badge/CIP051-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L273 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L264 .. |image-CIP52| image:: https://img.shields.io/badge/CIP052-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L273 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L264 .. |image-CIP53| image:: https://img.shields.io/badge/CIP053-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L131 -.. |image-CIP54| image:: https://img.shields.io/badge/CIP054-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L640 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L135 +.. |image-CIP54| image:: https://img.shields.io/badge/CIP054-green + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L668 .. |image-CIP55| image:: https://img.shields.io/badge/CIP055-grey :target: https://github.com/CIP055-404 .. |image-CIP56| image:: https://img.shields.io/badge/CIP056-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1058 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1015 .. |image-CIP57| image:: https://img.shields.io/badge/CIP057-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L258 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L262 .. |image-CIP58| image:: https://img.shields.io/badge/CIP058-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L464 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L487 .. |image-CIP59| image:: https://img.shields.io/badge/CIP059-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_info.py#L131 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_info.py#L135 .. |image-CIP60| image:: https://img.shields.io/badge/CIP060-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L736 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L661 .. |image-CIP61| image:: https://img.shields.io/badge/CIP061-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L688 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L711 .. |image-CIP62| image:: https://img.shields.io/badge/CIP062-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1041 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L998 .. |image-CIP63| image:: https://img.shields.io/badge/CIP063-grey :target: https://github.com/CIP063-404 .. |image-CIP64| image:: https://img.shields.io/badge/CIP064-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L688 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L711 .. |image-CIP65| image:: https://img.shields.io/badge/CIP065-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L848 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L789 .. |image-CIP66| image:: https://img.shields.io/badge/CIP066-grey :target: https://github.com/CIP066-404 .. |image-CIP67| image:: https://img.shields.io/badge/CIP067-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_committee.py#L671 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_committee.py#L694 .. |image-CIP68| image:: https://img.shields.io/badge/CIP068-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1093 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1052 .. |image-CIP69| image:: https://img.shields.io/badge/CIP069-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L169 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_no_confidence.py#L173 .. |image-CIP70| image:: https://img.shields.io/badge/CIP070-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L647 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L645 .. |image-CIP71| image:: https://img.shields.io/badge/CIP071-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_conway.py#L32 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_conway.py#L32 .. |image-CIP72| image:: https://img.shields.io/badge/CIP072-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L203 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L207 .. |image-CIP73| image:: https://img.shields.io/badge/CIP073-yellow - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_constitution.py#L203 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_constitution.py#L207 .. |image-CIP74| image:: https://img.shields.io/badge/CIP074-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L882 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L825 .. |image-CIP75| image:: https://img.shields.io/badge/CIP075-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1205 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1164 .. |image-CIP76| image:: https://img.shields.io/badge/CIP076-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1205 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1164 .. |image-CIP77| image:: https://img.shields.io/badge/CIP077-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1205 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1164 .. |image-CIP78| image:: https://img.shields.io/badge/CIP078-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1205 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_pparam_update.py#L1164 .. |image-CIP79| image:: https://img.shields.io/badge/CIP079-green - :target: https://github.com/IntersectMBO/cardano-node-tests/blob/fafba27f4ea8d79b23fc90ae8aed8307e623d543/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L326 + :target: https://github.com/IntersectMBO/cardano-node-tests/blob/162b85860698aef319cefe31fc258fd57271fdc0/cardano_node_tests/tests/tests_conway/test_treasury_withdrawals.py#L330 .. |image-CIP80| image:: https://img.shields.io/badge/CIP080-grey :target: https://github.com/CIP080-404 .. |image-CIP81| image:: https://img.shields.io/badge/CIP081-grey From 33e9d9355efaccf94bde1065bd40d2be54601570 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 29 May 2024 11:41:36 +0200 Subject: [PATCH 25/47] Add testing results for node tag 8.11.0(-pre) (#2429) * Add testing results for node tag 8.11.0(-pre) * Add bootstrap period testing results * Add sync testing and cabal build instructions results --- .../source/test_results/node/tag_8_11_0.rst | 83 +++++++++++++++++++ src_docs/source/test_results/tag_tests.rst | 1 + 2 files changed, 84 insertions(+) create mode 100644 src_docs/source/test_results/node/tag_8_11_0.rst diff --git a/src_docs/source/test_results/node/tag_8_11_0.rst b/src_docs/source/test_results/node/tag_8_11_0.rst new file mode 100644 index 000000000..3add60dfd --- /dev/null +++ b/src_docs/source/test_results/node/tag_8_11_0.rst @@ -0,0 +1,83 @@ +8.11.0-pre +========== + +* Release notes - +* Tag commits - + + +Regression testing on a local cluster +------------------------------------- + +.. list-table:: Regression Testsuite + :header-rows: 0 + + * - P2P ON - `Babbage with Babbage TX `__ + - |:heavy_check_mark:| + * - P2P OFF - `Babbage with default (Babbage) TX `__ + - |:heavy_check_mark:| + * - Mix P2P and Legacy - `Babbage with default (Babbage) TX `__ + - |:heavy_check_mark:| + * - P2P ON - `Conway PV9 `__ + - |:heavy_check_mark:| + * - P2P ON - `Conway PV10 `__ + - |:heavy_check_mark:| + +.. list-table:: Other Testing + :header-rows: 0 + + * - Upgrade testing (8.9.2 to 8.11.0) + - |:heavy_check_mark:| + * - Rollback testing + - |:heavy_check_mark:| + * - Reconnection testing + - |:heavy_check_mark:| + * - Block production testing on network with 10 pools, 5 of them P2P, 5 of them Legacy - `results (sqlite db) `__ + - |:heavy_check_mark:| + * - Sanity checks of the submit-api REST service + - |:heavy_check_mark:| + * - P2P Dynamic Block Production testing + - |:heavy_check_mark:| + + +Release testing checklist +------------------------- + +.. list-table:: + :header-rows: 0 + + * - `8.11.0` pushed to `shelley-qa` + - |:heavy_check_mark:| + * - `8.11.0` pushed to `preview` + - |:hourglass_flowing_sand:| + * - Grafana metrics OK + - |:hourglass_flowing_sand:| + * - Regression testing against `shelley-qa` + - |:heavy_check_mark:| + * - Regression testing against `preview` + - |:hourglass_flowing_sand:| + * - `Sync testing ran against shelley_qa & Preview & Preprod & Mainnet (Windows, Linux, macOS) `__ + - |:heavy_check_mark:| + * - DB re-validation testing (ledger snapshots compatibility) + - |:heavy_check_mark:| + * - Backward compatibility testing (Node with version N-1) + - |:heavy_check_mark:| + * - Check build instructions changes + - |:heavy_check_mark:| + + +New functionalities in this tag +------------------------------- + + +Known issues +------------ + +`Up-to-date list of existing issues `__ + + +New issues +---------- + + +Breaking changes +---------------- diff --git a/src_docs/source/test_results/tag_tests.rst b/src_docs/source/test_results/tag_tests.rst index 7e0718949..19385cd2d 100644 --- a/src_docs/source/test_results/tag_tests.rst +++ b/src_docs/source/test_results/tag_tests.rst @@ -4,6 +4,7 @@ Tag Testing .. toctree:: :maxdepth: 4 + node/tag_8_11_0.rst node/tag_8_9_1.rst node/tag_8_9_0.rst node/tag_8_8_0.rst From 2afc6d14c9f6c21fbeb73d54f851adc731036485 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 09:44:57 +0000 Subject: [PATCH 26/47] Bump jinja2 from 3.1.3 to 3.1.4 Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4) --- updated-dependencies: - dependency-name: jinja2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index ed65189da..8bbf61d3c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -683,13 +683,13 @@ testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "jinja2" -version = "3.1.3" +version = "3.1.4" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" files = [ - {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, - {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, ] [package.dependencies] From 56f2e6049e8d1efd3e0e14cbe47159532ca92418 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 29 May 2024 12:16:09 +0200 Subject: [PATCH 27/47] Add testing results for 8.9.3 release --- .../source/test_results/node/tag_8_9_3.rst | 83 +++++++++++++++++++ src_docs/source/test_results/tag_tests.rst | 1 + 2 files changed, 84 insertions(+) create mode 100644 src_docs/source/test_results/node/tag_8_9_3.rst diff --git a/src_docs/source/test_results/node/tag_8_9_3.rst b/src_docs/source/test_results/node/tag_8_9_3.rst new file mode 100644 index 000000000..640a4362a --- /dev/null +++ b/src_docs/source/test_results/node/tag_8_9_3.rst @@ -0,0 +1,83 @@ +8.9.3 +===== + +* Release notes - +* Tag commits - + + +Regression testing on a local cluster +------------------------------------- + +.. list-table:: Regression Testsuite + :header-rows: 0 + + * - P2P ON - `Babbage with Babbage TX `__ + - |:heavy_check_mark:| + * - P2P OFF - `Babbage with default (Babbage) TX `__ + - |:heavy_check_mark:| + * - Mix P2P and Legacy - `Babbage with default (Babbage) TX `__ + - |:heavy_check_mark:| + * - P2P OFF - `Babbage with Alonzo TX `__ + - |:heavy_check_mark:| + * - P2P ON - `Conway with Conway TX `__ + - |:heavy_check_mark:| + +.. list-table:: Other Testing + :header-rows: 0 + + * - Upgrade testing (8.9.2 to 8.9.3) + - |:heavy_check_mark:| + * - Rollback testing + - |:heavy_check_mark:| + * - Reconnection testing + - |:heavy_check_mark:| + * - Block production testing on network with 10 pools, 5 of them P2P, 5 of them Legacy - `results (sqlite db) `__ + - |:hourglass_flowing_sand:| + * - Sanity checks of the submit-api REST service + - |:heavy_check_mark:| + * - P2P Dynamic Block Production testing + - |:heavy_check_mark:| + + +Release testing checklist +------------------------- + +.. list-table:: + :header-rows: 0 + + * - `8.9.3` pushed to `shelley-qa` + - |:hourglass_flowing_sand:| + * - `8.9.3` pushed to `preview` + - |:hourglass_flowing_sand:| + * - Grafana metrics OK + - |:hourglass_flowing_sand:| + * - Regression testing against `shelley-qa` + - |:hourglass_flowing_sand:| + * - Regression testing against `preview` + - |:hourglass_flowing_sand:| + * - `Sync testing ran against shelley_qa & Preview & Preprod & Mainnet (Windows, Linux, macOS) `__ + - |:heavy_check_mark:| + * - DB re-validation testing (ledger snapshots compatibility) + - |:heavy_check_mark:| + * - Backward compatibility testing (Node with version N-1) + - |:heavy_check_mark:| + * - Check build instructions changes + - |:hourglass_flowing_sand:| + + +New functionalities in this tag +------------------------------- + + +Known issues +------------ + +`Up-to-date list of existing issues `__ + + +New issues +---------- + + +Breaking changes +---------------- diff --git a/src_docs/source/test_results/tag_tests.rst b/src_docs/source/test_results/tag_tests.rst index 19385cd2d..0416ae15c 100644 --- a/src_docs/source/test_results/tag_tests.rst +++ b/src_docs/source/test_results/tag_tests.rst @@ -5,6 +5,7 @@ Tag Testing :maxdepth: 4 node/tag_8_11_0.rst + node/tag_8_9_3.rst node/tag_8_9_1.rst node/tag_8_9_0.rst node/tag_8_8_0.rst From 50bc558acf5534bfc3afa5a6aed8358a0d5103a2 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 29 May 2024 12:57:55 +0200 Subject: [PATCH 28/47] Change tables dimensions for better readability --- src_docs/source/test_results/node/tag_1_35_3.rst | 4 ++++ src_docs/source/test_results/node/tag_1_35_4_rc1.rst | 4 ++++ src_docs/source/test_results/node/tag_1_35_5.rst | 4 ++++ src_docs/source/test_results/node/tag_1_35_6.rst | 4 ++++ src_docs/source/test_results/node/tag_1_35_7.rst | 4 ++++ src_docs/source/test_results/node/tag_8_0_0.rst | 3 +++ src_docs/source/test_results/node/tag_8_11_0.rst | 3 +++ src_docs/source/test_results/node/tag_8_1_1.rst | 3 +++ src_docs/source/test_results/node/tag_8_6_0_pre.rst | 3 +++ src_docs/source/test_results/node/tag_8_7_2.rst | 3 +++ src_docs/source/test_results/node/tag_8_7_3.rst | 3 +++ src_docs/source/test_results/node/tag_8_8_0.rst | 3 +++ src_docs/source/test_results/node/tag_8_9_0.rst | 3 +++ src_docs/source/test_results/node/tag_8_9_1.rst | 3 +++ src_docs/source/test_results/node/tag_8_9_3.rst | 3 +++ 15 files changed, 50 insertions(+) diff --git a/src_docs/source/test_results/node/tag_1_35_3.rst b/src_docs/source/test_results/node/tag_1_35_3.rst index 6595856a9..ef5878f17 100644 --- a/src_docs/source/test_results/node/tag_1_35_3.rst +++ b/src_docs/source/test_results/node/tag_1_35_3.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: only with costModelV1 + :widths: 64 7 :header-rows: 0 * - CDDL OFF, P2P OFF - `Babbage with Babbage TX `__ @@ -42,6 +43,7 @@ Regression testing on a local cluster .. list-table:: both with costModelV1 and costModelV2 + :widths: 64 7 :header-rows: 0 * - CDDL OFF, P2P OFF - `Babbage with Babbage TX `__ @@ -58,6 +60,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.34.1 to 1.35.3) @@ -70,6 +73,7 @@ Release testing checklist ---------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `1.35.3-rc1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_1_35_4_rc1.rst b/src_docs/source/test_results/node/tag_1_35_4_rc1.rst index 891c1ca54..ae087ea20 100644 --- a/src_docs/source/test_results/node/tag_1_35_4_rc1.rst +++ b/src_docs/source/test_results/node/tag_1_35_4_rc1.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: protocol version 7 + :widths: 64 7 :header-rows: 0 * - P2P OFF - `Babbage with Babbage TX `__ @@ -33,6 +34,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: protocol version 8 and SECP256K1 cost model + :widths: 64 7 :header-rows: 0 * - P2P OFF - `Babbage with Babbage TX `__ @@ -47,6 +49,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.35.3 to 1.35.4-rc1) (including the intra-era hard fork) @@ -59,6 +62,7 @@ Release testing checklist ---------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `1.35.4-rc1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_1_35_5.rst b/src_docs/source/test_results/node/tag_1_35_5.rst index 3d3993246..42267326e 100644 --- a/src_docs/source/test_results/node/tag_1_35_5.rst +++ b/src_docs/source/test_results/node/tag_1_35_5.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: protocol version 8 and SECP256K1 cost model + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -35,6 +36,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: protocol version 7 + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -43,6 +45,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.35.4 to 1.35.5-rc1) (including the intra-era hard fork) @@ -57,6 +60,7 @@ Release testing checklist ---------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `1.35.5-rc1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_1_35_6.rst b/src_docs/source/test_results/node/tag_1_35_6.rst index 4364d43db..f84aec26f 100644 --- a/src_docs/source/test_results/node/tag_1_35_6.rst +++ b/src_docs/source/test_results/node/tag_1_35_6.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: protocol version 8 and SECP256K1 cost model + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -35,6 +36,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.35.5 to 1.35.6-rc2) @@ -49,6 +51,7 @@ Release testing checklist ---------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `1.35.6-rc2` pushed to `shelley-qa` @@ -93,6 +96,7 @@ Component Level Test Tracking ------------------------------ .. list-table:: Test Definition and Status + :widths: 14 16 5 14 22 :header-rows: 1 * - Quality Control diff --git a/src_docs/source/test_results/node/tag_1_35_7.rst b/src_docs/source/test_results/node/tag_1_35_7.rst index 3f477b6ec..ca12548a5 100644 --- a/src_docs/source/test_results/node/tag_1_35_7.rst +++ b/src_docs/source/test_results/node/tag_1_35_7.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: protocol version 8 and SECP256K1 cost model + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -35,6 +36,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.35.6 to 1.35.7-rc1) @@ -49,6 +51,7 @@ Release testing checklist ---------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `1.35.7-rc1` pushed to `shelley-qa` @@ -99,6 +102,7 @@ Component Level Test Tracking ------------------------------ .. list-table:: Test Definition and Status + :widths: 14 16 5 14 22 :header-rows: 1 * - Quality Control diff --git a/src_docs/source/test_results/node/tag_8_0_0.rst b/src_docs/source/test_results/node/tag_8_0_0.rst index 3f2ebca03..1c1139509 100644 --- a/src_docs/source/test_results/node/tag_8_0_0.rst +++ b/src_docs/source/test_results/node/tag_8_0_0.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: protocol version 8 and SECP256K1 cost model + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -35,6 +36,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: other testing + :widths: 64 7 :header-rows: 0 * - upgrade job (1.35.7 to 8.0.0-rc1) @@ -49,6 +51,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.0.0-rc1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_11_0.rst b/src_docs/source/test_results/node/tag_8_11_0.rst index 3add60dfd..40fcac7f5 100644 --- a/src_docs/source/test_results/node/tag_8_11_0.rst +++ b/src_docs/source/test_results/node/tag_8_11_0.rst @@ -9,6 +9,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -23,6 +24,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.9.2 to 8.11.0) @@ -43,6 +45,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.11.0` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_1_1.rst b/src_docs/source/test_results/node/tag_8_1_1.rst index 9e6b8cbe1..0cf476ceb 100644 --- a/src_docs/source/test_results/node/tag_8_1_1.rst +++ b/src_docs/source/test_results/node/tag_8_1_1.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -37,6 +38,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.0.0 to 8.1.1) @@ -53,6 +55,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.1.1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_6_0_pre.rst b/src_docs/source/test_results/node/tag_8_6_0_pre.rst index 4ea8331d5..bbe68aa27 100644 --- a/src_docs/source/test_results/node/tag_8_6_0_pre.rst +++ b/src_docs/source/test_results/node/tag_8_6_0_pre.rst @@ -19,6 +19,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - Babbage with default (Babbage) TX @@ -31,6 +32,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.1.2 to 8.6.0-pre) @@ -47,6 +49,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.6.0-pre` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_7_2.rst b/src_docs/source/test_results/node/tag_8_7_2.rst index a1233ee81..7e41bd1cf 100644 --- a/src_docs/source/test_results/node/tag_8_7_2.rst +++ b/src_docs/source/test_results/node/tag_8_7_2.rst @@ -9,6 +9,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with default (Babbage) TX `__ @@ -23,6 +24,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.1.2 to 8.7.2) @@ -39,6 +41,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.7.2` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_7_3.rst b/src_docs/source/test_results/node/tag_8_7_3.rst index 6e5dc3b80..751df3b11 100644 --- a/src_docs/source/test_results/node/tag_8_7_3.rst +++ b/src_docs/source/test_results/node/tag_8_7_3.rst @@ -11,6 +11,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with default (Babbage) TX on 8.7.2 `__ @@ -25,6 +26,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.1.2 to 8.7.2) @@ -41,6 +43,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.7.3` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_8_0.rst b/src_docs/source/test_results/node/tag_8_8_0.rst index 8ecc68001..430549884 100644 --- a/src_docs/source/test_results/node/tag_8_8_0.rst +++ b/src_docs/source/test_results/node/tag_8_8_0.rst @@ -9,6 +9,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - Babbage with default (Babbage) TX @@ -23,6 +24,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.7.2 to 8.8.0) @@ -41,6 +43,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.8.0` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_9_0.rst b/src_docs/source/test_results/node/tag_8_9_0.rst index 0cf6d2a87..994aace30 100644 --- a/src_docs/source/test_results/node/tag_8_9_0.rst +++ b/src_docs/source/test_results/node/tag_8_9_0.rst @@ -9,6 +9,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -21,6 +22,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.7.3 to 8.9.0) @@ -43,6 +45,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.9.0` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_9_1.rst b/src_docs/source/test_results/node/tag_8_9_1.rst index 573f02e09..603e20236 100644 --- a/src_docs/source/test_results/node/tag_8_9_1.rst +++ b/src_docs/source/test_results/node/tag_8_9_1.rst @@ -11,6 +11,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -25,6 +26,7 @@ Regression testing on a local cluster - |:ok_hand:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.7.3 to 8.9.1) @@ -47,6 +49,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.9.1` pushed to `shelley-qa` diff --git a/src_docs/source/test_results/node/tag_8_9_3.rst b/src_docs/source/test_results/node/tag_8_9_3.rst index 640a4362a..1267f6a71 100644 --- a/src_docs/source/test_results/node/tag_8_9_3.rst +++ b/src_docs/source/test_results/node/tag_8_9_3.rst @@ -9,6 +9,7 @@ Regression testing on a local cluster ------------------------------------- .. list-table:: Regression Testsuite + :widths: 64 7 :header-rows: 0 * - P2P ON - `Babbage with Babbage TX `__ @@ -23,6 +24,7 @@ Regression testing on a local cluster - |:heavy_check_mark:| .. list-table:: Other Testing + :widths: 64 7 :header-rows: 0 * - Upgrade testing (8.9.2 to 8.9.3) @@ -43,6 +45,7 @@ Release testing checklist ------------------------- .. list-table:: + :widths: 64 7 :header-rows: 0 * - `8.9.3` pushed to `shelley-qa` From dc91a381e2aea61543b7a592c10ba964be9a0c94 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Mon, 3 Jun 2024 16:45:37 +0200 Subject: [PATCH 29/47] Delete plutus_src dir It was replaced with https://github.com/mkoura/plutus-scripts-e2e --- plutus_src/mint-tokenname.hs | 9 --------- plutus_src/time_range.hs | 8 -------- plutus_src/witness-redeemer.hs | 8 -------- 3 files changed, 25 deletions(-) delete mode 100644 plutus_src/mint-tokenname.hs delete mode 100644 plutus_src/time_range.hs delete mode 100644 plutus_src/witness-redeemer.hs diff --git a/plutus_src/mint-tokenname.hs b/plutus_src/mint-tokenname.hs deleted file mode 100644 index 694754198..000000000 --- a/plutus_src/mint-tokenname.hs +++ /dev/null @@ -1,9 +0,0 @@ -mintTokenName :: TokenName -> ScriptContext -> Bool -mintTokenName tn ctx = traceIfFalse "wrong token name" checkTokenName - - where - info :: TxInfo - info = scriptContextTxInfo ctx - - checkTokenName :: Bool - checkTokenName = valueOf (txInfoMint info) (ownCurrencySymbol ctx) tn > 0 diff --git a/plutus_src/time_range.hs b/plutus_src/time_range.hs deleted file mode 100644 index 57169d7b1..000000000 --- a/plutus_src/time_range.hs +++ /dev/null @@ -1,8 +0,0 @@ -mkPolicy :: POSIXTime -> ScriptContext -> Bool -mkPolicy dl ctx = (to dl) `contains` range - where - info :: TxInfo - info = scriptContextTxInfo ctx - - range :: POSIXTimeRange - range = txInfoValidRange info diff --git a/plutus_src/witness-redeemer.hs b/plutus_src/witness-redeemer.hs deleted file mode 100644 index e367d70d3..000000000 --- a/plutus_src/witness-redeemer.hs +++ /dev/null @@ -1,8 +0,0 @@ -mkPolicy :: PubKeyHash -> ScriptContext -> Bool -mkPolicy pkh ctx = traceIfFalse "not signed by redeemer pubkeyhash" checkWitness - where - info :: TxInfo - info = scriptContextTxInfo ctx - - checkWitness :: Bool - checkWitness = txSignedBy info pkh From bb9f592c340e673fd8a61e36adf4d070a65f75fd Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 12 Jun 2024 00:13:18 +0200 Subject: [PATCH 30/47] Use top level README.md for instructions on local cluster --- doc/running_local_cluster.md | 2 ++ src_docs/source/how-tos/300_running_local_cluster.rst | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 src_docs/source/how-tos/300_running_local_cluster.rst diff --git a/doc/running_local_cluster.md b/doc/running_local_cluster.md index 2bb81ed20..85e149df5 100644 --- a/doc/running_local_cluster.md +++ b/doc/running_local_cluster.md @@ -1,5 +1,7 @@ # How to start a local cluster +> :warning: **This document is outdated**. Please follow the top level README.md for the most up-to-date instructions. + ## What is a local cluster A **local cluster** is a local Cardano blockchain that consists of 3 stake pools and 1 BFT node. The chain is started in Byron era and it is moved to the desired era, similarly to Mainnet, using Update Proposals. The default `testnet-magic` value is 42. diff --git a/src_docs/source/how-tos/300_running_local_cluster.rst b/src_docs/source/how-tos/300_running_local_cluster.rst deleted file mode 100644 index a8801f4e9..000000000 --- a/src_docs/source/how-tos/300_running_local_cluster.rst +++ /dev/null @@ -1 +0,0 @@ -.. mdinclude:: ../../../doc/running_local_cluster.md From 0e5dfc98c9f37444676043b3d34d2665c1696910 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 14 Jun 2024 16:51:43 +0200 Subject: [PATCH 31/47] Swap order of steps needed for dev cluster The env variables need to be already set before running `prepare-cluster-scripts`. --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0056d575b..8d34a86f9 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ When running tests, the testing framework starts and stops cluster instances as 1. cd back to 'cardano-node-tests' repo ```sh - cd ../cardano-node-test + cd ../cardano-node-tests ``` 1. activate virtual env @@ -179,18 +179,18 @@ When running tests, the testing framework starts and stops cluster instances as export PYTHONPATH="$(echo $VIRTUAL_ENV/lib/python3*/site-packages)":$PYTHONPATH ``` -1. prepare cluster scripts for starting local cluster directly in Babbage era +1. set env variables ```sh - mkdir -p dev_workdir - prepare-cluster-scripts -c -d dev_workdir/babbage_fast -s cardano_node_tests/cluster_scripts/babbage_fast/ + export CARDANO_NODE_SOCKET_PATH="$PWD/dev_workdir/state-cluster0/bft1.socket" DEV_CLUSTER_RUNNING=1 + mkdir -p "${CARDANO_NODE_SOCKET_PATH%/*}" ``` -1. set env variables +1. prepare cluster scripts for starting local cluster directly in Babbage era ```sh - export CARDANO_NODE_SOCKET_PATH="$PWD/dev_workdir/state-cluster0/bft1.socket" DEV_CLUSTER_RUNNING=1 - mkdir -p "${CARDANO_NODE_SOCKET_PATH%/*}" + mkdir -p dev_workdir + prepare-cluster-scripts -c -d dev_workdir/babbage_fast -s cardano_node_tests/cluster_scripts/babbage_fast/ ``` 1. start the cluster instance in development mode From 18876fec7f43ad8965582e00b45ad591ec453543 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 18 Jun 2024 12:15:47 +0200 Subject: [PATCH 32/47] Update clusterlib to v0.6.0a19 --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- requirements_freeze.txt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8bbf61d3c..ab9477a7b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "alabaster" @@ -105,13 +105,13 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "cardano-clusterlib" -version = "0.6.0a18" +version = "0.6.0a19" description = "Python wrapper for cardano-cli for working with cardano cluster" optional = false python-versions = ">=3.8" files = [ - {file = "cardano_clusterlib-0.6.0a18-py3-none-any.whl", hash = "sha256:3cc32d8635a2b30263a39347e0753dd46fbb5a87bd0bc66a99f9f74f5e5be042"}, - {file = "cardano_clusterlib-0.6.0a18.tar.gz", hash = "sha256:4a976df9065922daca6ec327bf5c975b84fe03ec89c7a539216b452d20e7b0c1"}, + {file = "cardano_clusterlib-0.6.0a19-py3-none-any.whl", hash = "sha256:524555a13cce3eb5b4c5c408c99fa7c2c03c6e1c523976bea25bd8d67884f193"}, + {file = "cardano_clusterlib-0.6.0a19.tar.gz", hash = "sha256:ea28f4f96b6ac211eb1970e0b06700fd96ec04d7e7487deb18a78cbf3586335e"}, ] [package.dependencies] @@ -1935,4 +1935,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "1163c65a22d8e1911c27e12a208c6a7d16fd74cb350497ae36c9188e0b8b8b20" +content-hash = "38df40e4a8e09e50613b7b6019ab87774ed8a9b2501996c26ed99041b131b536" diff --git a/pyproject.toml b/pyproject.toml index ae0c18c4e..306425505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ packages = [{include = "cardano_node_tests"}] [tool.poetry.dependencies] python = ">=3.9,<4.0" allure-pytest = "^2.13.2" -cardano-clusterlib = "^0.6.0a18" +cardano-clusterlib = "^0.6.0a19" cbor2 = "^5.4.6" filelock = "^3.12.2" hypothesis = "^6.82.6" diff --git a/requirements_freeze.txt b/requirements_freeze.txt index 56ead6055..6ecc94d30 100644 --- a/requirements_freeze.txt +++ b/requirements_freeze.txt @@ -4,7 +4,7 @@ allure-pytest==2.13.5 ; python_version >= "3.9" and python_version < "4.0" allure-python-commons==2.13.5 ; python_version >= "3.9" and python_version < "4.0" annotated-types==0.6.0 ; python_version >= "3.9" and python_version < "4.0" attrs==23.2.0 ; python_version >= "3.9" and python_version < "4.0" -cardano-clusterlib==0.6.0a18 ; python_version >= "3.9" and python_version < "4.0" +cardano-clusterlib==0.6.0a19 ; python_version >= "3.9" and python_version < "4.0" cbor2==5.6.3 ; python_version >= "3.9" and python_version < "4.0" certifi==2024.2.2 ; python_version >= "3.9" and python_version < "4.0" cffi==1.16.0 ; python_version >= "3.9" and python_version < "4.0" From 8d1da05b50bf91d7c64622c8f3ea8cdb040b0219 Mon Sep 17 00:00:00 2001 From: saratomaz Date: Wed, 8 May 2024 15:47:23 +0100 Subject: [PATCH 33/47] Add V3 plutus scripts tests --- .../v3/alwaysFailsPolicyScriptV3.plutus | 5 ++ .../v3/alwaysSucceedSpendScriptV3.plutus | 5 ++ .../tests/data/plutus/v3/blsMint.plutus | 5 ++ .../tests/data/plutus/v3/blsSpend.plutus | 5 ++ .../v3/mintTokenNamePolicyScriptV3.plutus | 5 ++ .../plutus/v3/timeRangePolicyScriptV3.plutus | 5 ++ .../v3/verifyEcdsaPolicyScriptV3.plutus | 5 ++ .../v3/verifySchnorrPolicyScriptV3.plutus | 5 ++ .../v3/witnessRedeemerPolicyScriptV3.plutus | 5 ++ cardano_node_tests/tests/plutus_common.py | 56 +++++++++++++++++++ .../tests/tests_plutus/test_mint_build.py | 17 +++++- .../tests_plutus/test_mint_negative_build.py | 32 +++++++++-- .../tests_plutus/test_mint_negative_raw.py | 12 +++- .../tests/tests_plutus/test_spend_build.py | 24 +++++--- .../tests_plutus/test_spend_negative_build.py | 10 ++-- .../tests_plutus/test_spend_negative_raw.py | 12 ++-- .../tests/tests_plutus/test_spend_raw.py | 24 ++++---- .../test_mint_secp256k1_build.py | 12 ++-- .../test_mint_secp256k1_raw.py | 12 ++-- 19 files changed, 210 insertions(+), 46 deletions(-) create mode 100644 cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/blsMint.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus create mode 100644 cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus diff --git a/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus new file mode 100644 index 000000000..7e67d744e --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/alwaysFailsPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "4b4a010100225968c0022c01" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus new file mode 100644 index 000000000..a9b930f56 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/alwaysSucceedSpendScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "484701010022280001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus b/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus new file mode 100644 index 000000000..92c46c254 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/blsMint.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590a0c590a090101003232323232323232323232322259323232333573466ee4cddc00180099bb6001337709000000c0020046eed2213097f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb003232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302623232325333573466e1d20000021800980e9aba100198029aba1357440021303203135573c0046aae74004dd5000998130009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c094d5d0800ccc08c8c8c8c94ccd5cd19b8748000008600260526ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260740726aae78008d55ce8009baa001357426ae880042606c06a6aae78008d55ce8009baa357420073007357420053232325333573466e1d200000218000a999ab9a3370e90010010c014dd71aba10010a999ab9a3370e90020010c00cd5d080084c0d80d4d55cf0011aab9d00137546ae8400666040eb8d5d09aba20011aba200135744002260620606aae78008d55ce8009baa001375a6ae8403cc004d5d0807180118013ad330240183574201866602c036eb4d5d08059919192999ab9a3370e90000010c004c8c8c94ccd5cd19b874800000860026605ceb4d5d0800cc0b4d5d09aba2001098190189aab9e00235573a0026ea8d5d0800cc8c8c94ccd5cd19b874800000860026605ceb4d5d0800cc0b4d5d09aba2001098190189aab9e00235573a0026ea8d5d09aba2001098178171aab9e00235573a0026ea8d5d0805198123ae3574201266602c02804c6ae84020cc008098d5d080398151aba100633301601a3301602923232325333573466e1d200000218010a999ab9a3370e90010010c01054ccd5cd19b874801000860002606005e6aae78008d55ce8009baa0013574200a6604802a6ae84010c004d5d080198009aba1357440066030eb4c051d71aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200135744002260380366aae78008d55ce8009baa357420133001357426ae880244646464a666ae68cdc3a40000043003375c6ae840042a666ae68cdc3a4004004300930073574200215333573466e1d2004002180398059aba10010a999ab9a3370e90030010c004dd69aba100198041aba13574400215333573466e1d2008002180598051aba10010a999ab9a3370e90050010c014dd69aba100198029aba1357440021301c01b35573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298059aba10019919192999ab9a3370e90000010994024cc034074d5d08014d5d0800ccc035d71aba135744002357440022a666ae68cdc3a400400430013300c01c357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c088084d55cf0011aab9d00137546ae84d5d1000854ccd5cd19b8748010008601666601201ceb4d5d0800ccc031d71aba13574400215333573466e1d200600218039980600e1aba10010a999ab9a3370e9004001099194034cc038078d5d0801ccc064040d5d08014ccc02c041d69aba1001c9919192999ab9a3370e90000010c004dd69aba10019bad357426ae88004260480466aae78008d55ce8009baa357426ae8800644660320040021aba2001357440022a666ae68cdc3a401400430053300c01c357420033232325333573466e1d200000213300f75c6ae840044c088084d55cf0011aab9d00137546ae84d5d1000854ccd5cd19b874803000860042603e03c6aae78008d55ce8009baa357426ae880046ae880044c06c068d55cf0011aab9d00137540024464460046eac004c06488cccd55cf800940008ca007001300635573a003300535573c00298021aba20031aba100280011919192999ab9a3370e90000010c004c05cd5d0800cdd69aba1357440021301901835573c0046aae74004dd500091919192999ab9a3370e90000010c034c01cd5d0800ccc015d69aba13574400215333573466e1d2002002180998039aba100199802bad357426ae880042a64666ae68cdc3a400800630033008357420053001357426ae880082a666ae68cdc3a400c00626500b300935742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c020d5d08014dd69aba13574400415333573466e1d200a003180a98041aba10020a999ab9a3370e90060018c044c020d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098041aba100298041aba13574400415333573466e1d2014003180798041aba10020980c80c11919192999ab9a3370e90000010c004dd71aba10010a99199ab9a3370e90010018c014c004d5d0801054ccd5cd19b874801000c60066eb8d5d08014c004d5d09aba20020980e80e11919192999ab9a3370e90000010c004c03cd5d0800854ccd5cd19b874800800860042a666ae68cdc3a400800430041302001f35573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980c00b9aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000086002600a6ae840042a666ae68cdc3a4004004300330053574200215333573466e1d200400218029bae357420021301601535573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980a80a1aab9e00235573a0026ea80044c044040d55cf0011aab9d00137540046eb400a300089806a481035054350018059112999ab9a3370e00200c2c2a666ae68cdc400080309980199b810060023370200c002265001337080060033370800400233004002001300a2225333573466e1c00401440084cc00c004cdc3001000919118011bac001300a2233335573e0025000280198021aba100298019aba200240012000200123232325333573466e1d200000218010a999ab9a3370e90010010c0004c024020d55cf0011aab9d001375400244646464a666ae68cdc3a4000004300215333573466e1d2002002180098029aba10010a999ab9a3370e90020010c0104c024020d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300535742003375a6ae84d5d100084c01c018d55cf0011aab9d00137540024646464a666ae68cdc3a400000426eb8d5d0800898030029aab9e00235573a0026ea80052401035054310023263357380030002323001001223300330020020011" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus b/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus new file mode 100644 index 000000000..fefa382d4 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/blsSpend.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590a10590a0d0101003232323232323232323232322225932323232333573466ee4cddc00200099bb6001337700060030008011bbb48813097f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb003232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302823232325333573466e1d20000021800980e9aba100198029aba1357440021303403335573c0046aae74004dd5000998140009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c094d5d0800ccc08c8c8c8c94ccd5cd19b8748000008600260526ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260780766aae78008d55ce8009baa001357426ae880042607006e6aae78008d55ce8009baa357420073007357420053232325333573466e1d200000218000a999ab9a3370e90010010c014dd71aba10010a999ab9a3370e90020010c00cd5d080084c0e00dcd55cf0011aab9d00137546ae8400666040eb8d5d09aba20011aba200135744002260660646aae78008d55ce8009baa001375a6ae8403cc004d5d080718009800bad330260183574201866602c036eb4d5d08059919192999ab9a3370e90000010c004c8c8c94ccd5cd19b8748000008600266060eb4d5d0800cc0bcd5d09aba20010981a0199aab9e00235573a0026ea8d5d0800cc8c8c94ccd5cd19b8748000008600266060eb4d5d0800cc0bcd5d09aba20010981a0199aab9e00235573a0026ea8d5d09aba2001098188181aab9e00235573a0026ea8d5d0805198133ae3574201266602c0280506ae84020cc0040a0d5d080398161aba100633301601a3301602b23232325333573466e1d200000218010a999ab9a3370e90010010c01054ccd5cd19b87480100086000260640626aae78008d55ce8009baa0013574200a6604c02a6ae84010c008d5d080198011aba135744006602aeb8c05dd69aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440022603c03a6aae78008d55ce8009baa357420133001357426ae880244646464a666ae68cdc3a40000043003375c6ae840042a666ae68cdc3a4004004300930073574200215333573466e1d2004002180398059aba10010a999ab9a3370e90030010c004dd69aba100198041aba13574400215333573466e1d2008002180598051aba10010a999ab9a3370e90050010c014dd69aba100198029aba1357440021301e01d35573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298059aba10019919192999ab9a3370e90000010994024cc03407cd5d08014d5d0800ccc035d71aba135744002357440022a666ae68cdc3a400400430013300c01e357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c09008cd55cf0011aab9d00137546ae84d5d1000854ccd5cd19b8748010008601666601201ceb4d5d0800ccc031d71aba13574400215333573466e1d200600218039980600f1aba10010a999ab9a3370e9004001099194034cc038080d5d0801ccc06c040d5d08014ccc02c041d69aba1001c9919192999ab9a3370e90000010c004dd69aba10019bad357426ae880042604c04a6aae78008d55ce8009baa357426ae8800644660360040021aba2001357440022a666ae68cdc3a401400430053300c01e357420033232325333573466e1d200000213300f75c6ae840044c09008cd55cf0011aab9d00137546ae84d5d1000854ccd5cd19b87480300086004260420406aae78008d55ce8009baa357426ae880046ae880044c074070d55cf0011aab9d00137540024464460046eac004c06c88cccd55cf800940008ca007001300635573a003300535573c00298021aba20031aba100280011919192999ab9a3370e90000010c004c064d5d0800cdd69aba1357440021301b01a35573c0046aae74004dd500091919192999ab9a3370e90000010c034c01cd5d0800ccc015d69aba13574400215333573466e1d2002002180998039aba100199802bad357426ae880042a64666ae68cdc3a400800630033008357420053001357426ae880082a666ae68cdc3a400c00626500b300935742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c020d5d08014dd69aba13574400415333573466e1d200a003180a98041aba10020a999ab9a3370e90060018c044c020d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098041aba100298041aba13574400415333573466e1d2014003180798041aba10020980d80d11919192999ab9a3370e90000010c004dd71aba10010a99199ab9a3370e90010018c014c004d5d0801054ccd5cd19b874801000c60066eb8d5d08014c004d5d09aba20020980f80f11919192999ab9a3370e90000010c004c03cd5d0800854ccd5cd19b874800800860042a666ae68cdc3a400800430041302202135573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980d00c9aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000086002600a6ae840042a666ae68cdc3a4004004300330053574200215333573466e1d200400218029bae357420021301801735573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980b80b1aab9e00235573a0026ea80044c04c048d55cf0011aab9d00137540066eb400cdd6801c60011300e491035054350018059112999ab9a3370e00200c2c2a666ae68cdc400080309980199b810060023370200c002265001337080060033370800400233004002001300a2225333573466e1c00401440084cc00c004cdc3001000919118011bac001300a2233335573e0025000280198021aba100298019aba200240012000200123232325333573466e1d200000218010a999ab9a3370e90010010c0004c024020d55cf0011aab9d001375400244646464a666ae68cdc3a4000004300215333573466e1d2002002180098029aba10010a999ab9a3370e90020010c0104c024020d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300535742003375a6ae84d5d100084c01c018d55cf0011aab9d00137540024646464a666ae68cdc3a400000426eb8d5d0800898030029aab9e00235573a0026ea80052401035054310023263357380030002323001001223300330020020011" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus new file mode 100644 index 000000000..d94a24b31 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/mintTokenNamePolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "587f587d0101003223225333573466e24c8c8cc0188964006290004886400a44a666ae68cdc780100389805000898030018005200522900193480064d269348989001914801488888888888888880304800060043000300222590018a40012219002912999ab9a3371e00400e20022600c00611918008009119801980100100081" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus new file mode 100644 index 000000000..463dd0b67 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "590265590262010100323232232232532323232933300100900b0058c0022b266600201201600f180146401e45200f225323293330020119006912c800c400a2b20052180099806809000a200510021200922590018801456400a430013300d0120014400a200422a00318014540042b2666002021200522590018801456400a430013300b0110014400a20042401244b200310028ac801486002660160220028801440084600118014600022253232900490a801456400e430048c00230044540042b20052150028c00a2a00215900290ac801484ccc02c0140080062d180222d15900190c00a2d1800004452003229002912994801454c8ca401642a0051328012801c540042b2a0052150028c0022a00215900390aca80148564ccc02c02400800630028c002300245a300245a2b2a0032180045a300222b2007213259500390ac999806005001000c60051800460048c002300219806004800c4ca004a003159500190c00230008c0080c801c8964006200515900290c004cc0300280051002880100a40064444444400e29001911110020a40064444400a900191480148888888888888888024800c0060058003001800800b00020020032337020029001480064003323001001223225333573466e2400c00460060073300230050030010c000c008008466e01200200180091199ab9a3370e0040030008014894ccd5cd19b8700200118000a999ab9a3371200400230041801488ccd5cd19b88002001800400a44666ae68cdc4801000c00200522333573466e2400800600500091199ab9a337100040030028004894ccd5cd19b8900200110011002912999ab9a33712004002200420021" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus new file mode 100644 index 000000000..316c5edc9 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "58ba58b801010032229003911199ab9a3337680060040030008010ccccd448800888a002007002800884a400a0024881210392d7b94bc6a11c335a043ee1ff326b6eacee6230d3685861cd62bce350a172e00048812016e0bf1f85594a11e75030981c0b670370b3ad83a43f49ae58a2fd6f6513cde9004881405fb12954b28be6456feb080cfb8467b6f5677f62eb9ad231de7a575f4b6857512754fb5ef7e0e60e270832e7bb0e2f0dc271012fa9c46c02504aa0e798be62950001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus new file mode 100644 index 000000000..b291da005 --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "58d958d701010032229003911199ab9a33376a0060040030008010ccccd448800888a002007002800884a400a002488120599de3e582e2a3779208a210dfeae8f330b9af00a47a7fb22e9bb8ef596f301b0048814030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030004881405a56da88e6fd8419181dec4d3dd6997bab953d2fc71ab65e23cfc9e7e3d1a310613454a60f6703819a39fdac2a410a094442afd1fc083354443e8d8bb4461a9b0001" +} diff --git a/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus new file mode 100644 index 000000000..f734ec8db --- /dev/null +++ b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus @@ -0,0 +1,5 @@ +{ + "type": "PlutusScriptV3", + "description": "", + "cborHex": "583858360101002322900191480148888888888888888c0500203230010012232590028c00a442a666ae68cdc78030010c0004c00c0046004005" +} diff --git a/cardano_node_tests/tests/plutus_common.py b/cardano_node_tests/tests/plutus_common.py index 168eebf63..935031265 100644 --- a/cardano_node_tests/tests/plutus_common.py +++ b/cardano_node_tests/tests/plutus_common.py @@ -32,6 +32,9 @@ SECP256K1_LOOP_ECDSA_PLUTUS_V2 = SCRIPTS_V2_DIR / "ecdsa-secp256k1-loop.plutus" SECP256K1_LOOP_SCHNORR_PLUTUS_V2 = SCRIPTS_V2_DIR / "schnorr-secp256k1-loop.plutus" +ALWAYS_SUCCEEDS_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysSucceedSpendScriptV3.plutus" +ALWAYS_FAILS_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysFailsPolicyScriptV3.plutus" + MINTING_PLUTUS_V1 = SCRIPTS_V1_DIR / "anyone-can-mint.plutus" MINTING_TIME_RANGE_PLUTUS_V1 = SCRIPTS_V1_DIR / "time_range.plutus" MINTING_CONTEXT_EQUIVALENCE_PLUTUS_V1 = SCRIPTS_V1_DIR / "minting-context-equivalence-test.plutus" @@ -47,6 +50,10 @@ MINTING_SECP256K1_SCHNORR_PLUTUS_V2 = SCRIPTS_V2_DIR / "secp256k1-schnorr-policy.plutus" MINTING_PLUTUS_V3 = SCRIPTS_V3_DIR / "alwaysSucceedPolicyScriptV3.plutus" +MINTING_SECP256K1_ECDSA_PLUTUS_V3 = SCRIPTS_V3_DIR / "verifyEcdsaPolicyScriptV3.plutus" +MINTING_SECP256K1_SCHNORR_PLUTUS_V3 = SCRIPTS_V3_DIR / "verifySchnorrPolicyScriptV3.plutus" +MINTING_TIME_RANGE_PLUTUS_V3 = SCRIPTS_V3_DIR / "timeRangePolicyScriptV3.plutus" +MINTING_WITNESS_REDEEMER_PLUTUS_V3 = SCRIPTS_V3_DIR / "witnessRedeemerPolicyScriptV3.plutus" STAKE_GUESS_42_PLUTUS_V1 = SCRIPTS_V1_DIR / "guess-42-stake.plutus" @@ -100,6 +107,9 @@ class ExecutionCost: per_time=430_445_916, per_space=128_584, fixed_cost=38_455 ) +ALWAYS_FAILS_V3_COST = ExecutionCost(per_time=230_100, per_space=1_100, fixed_cost=81) +ALWAYS_SUCCEEDS_V3_COST = ExecutionCost(per_time=230_100, per_space=1_100, fixed_cost=81) + MINTING_COST = ExecutionCost(per_time=259_868_784, per_space=978_434, fixed_cost=74_960) MINTING_TIME_RANGE_COST = ExecutionCost( per_time=277_239_670, per_space=1_044_064, fixed_cost=80_232 @@ -150,6 +160,11 @@ class PlutusScriptData: script_type=clusterlib.ScriptTypes.PLUTUS_V2, execution_cost=ALWAYS_FAILS_V2_COST, ), + "v3": PlutusScriptData( + script_file=ALWAYS_FAILS_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=ALWAYS_FAILS_V3_COST, + ), } ALWAYS_SUCCEEDS = { @@ -163,6 +178,11 @@ class PlutusScriptData: script_type=clusterlib.ScriptTypes.PLUTUS_V2, execution_cost=ALWAYS_SUCCEEDS_V2_COST, ), + "v3": PlutusScriptData( + script_file=ALWAYS_SUCCEEDS_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=ALWAYS_SUCCEEDS_V3_COST, + ), } GUESSING_GAME = { @@ -209,6 +229,42 @@ class PlutusScriptData: ), } +MINTING_WITNESS_REDEEMER = { + "v1": PlutusScriptData( + script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_WITNESS_REDEEMER_COST, + ), + "v3": PlutusScriptData( + script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_WITNESS_REDEEMER_COST, + ), +} + +MINTING_TIME_RANGE = { + "v1": PlutusScriptData( + script_file=MINTING_TIME_RANGE_PLUTUS_V1, + script_type=clusterlib.ScriptTypes.PLUTUS_V1, + execution_cost=MINTING_TIME_RANGE_COST, + ), + "v3": PlutusScriptData( + script_file=MINTING_TIME_RANGE_PLUTUS_V3, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, + execution_cost=MINTING_TIME_RANGE_COST, + ), +} + +MINTING_SECP256K1_ECDSA = { + "v2": MINTING_SECP256K1_ECDSA_PLUTUS_V2, + "v3": MINTING_SECP256K1_ECDSA_PLUTUS_V3, +} + +MINTING_SECP256K1_SCHNORR = { + "v2": MINTING_SECP256K1_SCHNORR_PLUTUS_V2, + "v3": MINTING_SECP256K1_SCHNORR_PLUTUS_V3, +} + @dataclasses.dataclass(frozen=True, order=True) class PlutusOp: diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_build.py index 7f024a1f9..23feb5f86 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_build.py @@ -241,12 +241,21 @@ def test_minting_one_token( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.testnets @submit_utils.PARAM_SUBMIT_METHOD def test_time_range_minting( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, submit_method: str, ): """Test minting a token with a time constraints Plutus script. @@ -270,8 +279,10 @@ def test_time_range_minting( token_amount = 5 script_fund = 200_000_000 + plutus_script = plutus_common.MINTING_TIME_RANGE[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_TIME_RANGE_COST, + execution_cost=plutus_script.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -301,7 +312,7 @@ def test_time_range_minting( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + policyid = cluster.g_transaction.get_policyid(plutus_script.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -311,7 +322,7 @@ def test_time_range_minting( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=plutus_script.script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py index 337b09ca4..791b1fc54 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py @@ -89,11 +89,20 @@ def fund_issuer_long_asset_name( @allure.link(helpers.get_vcs_link()) @pytest.mark.testnets + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @submit_utils.PARAM_SUBMIT_METHOD def test_witness_redeemer_missing_signer( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, submit_method: str, ): """Test minting a token with a Plutus script with invalid signers. @@ -134,7 +143,7 @@ def test_witness_redeemer_missing_signer( # Step 2: mint the "qacoin" policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1 + plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file ) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" @@ -145,7 +154,7 @@ def test_witness_redeemer_missing_signer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_file=plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file, collaterals=collateral_utxos, redeemer_file=plutus_common.DATUM_WITNESS_GOLDEN_NORMAL, ) @@ -356,9 +365,20 @@ def test_asset_name_too_long( ), min_req_utxo_error @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.testnets def test_time_range_missing_tx_validity( - self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord] + self, + cluster: clusterlib.ClusterLib, + payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a time constraints Plutus script and no TX validity. @@ -407,7 +427,9 @@ def test_time_range_missing_tx_validity( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + script_file = plutus_common.MINTING_TIME_RANGE[plutus_version].script_file + + policyid = cluster.g_transaction.get_policyid(script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -417,7 +439,7 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py index 1cbc5247e..c9d96f451 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py @@ -497,11 +497,21 @@ def test_execution_units_above_limit( assert "ExUnitsTooBigUTxO" in err_str, err_str @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) + @pytest.mark.testnets @pytest.mark.testnets def test_time_range_missing_tx_validity( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a time constraints Plutus script and no TX validity. @@ -557,7 +567,7 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=plutus_common.MINTING_TIME_RANGE[plutus_version].script_file, collaterals=collateral_utxos, execution_units=( plutus_common.MINTING_TIME_RANGE_COST.per_time, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_build.py index 6375a75a8..26fd756cd 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_build.py @@ -83,7 +83,7 @@ class TestBuildLocking: @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_locking( self, cluster: clusterlib.ClusterLib, @@ -634,10 +634,12 @@ def test_two_scripts_spending( ) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_always_fails( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test locking a Tx output with a Plutus script and spending the locked UTxO. @@ -653,11 +655,13 @@ def test_always_fails( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) + plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_script.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_script.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( @@ -686,10 +690,12 @@ def test_always_fails( assert helpers.is_in_interval(tx_output_fund.fee, expected_fee_fund, frac=0.15) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_script_invalid( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test failing script together with the `--script-invalid` argument - collateral is taken. @@ -705,11 +711,13 @@ def test_script_invalid( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) + plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_script.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_script.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( @@ -759,7 +767,7 @@ def test_script_invalid( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_token_locking( self, cluster: clusterlib.ClusterLib, @@ -836,7 +844,7 @@ def test_txout_token_locking( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_partial_spending( self, cluster: clusterlib.ClusterLib, @@ -959,7 +967,7 @@ def test_partial_spending( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_is_txin( self, cluster: clusterlib.ClusterLib, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py index 4ba71d3b7..6b840e3d2 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_negative_build.py @@ -164,7 +164,7 @@ def test_no_script( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_w_tokens( self, cluster: clusterlib.ClusterLib, @@ -233,7 +233,7 @@ def test_collateral_w_tokens( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_same_collateral_txin( self, cluster: clusterlib.ClusterLib, @@ -373,7 +373,7 @@ def test_invalid_guessing_game( assert "The Plutus script evaluation failed" in err_str, err_str @allure.link(helpers.get_vcs_link()) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_two_scripts_spending_one_fail( self, cluster: clusterlib.ClusterLib, @@ -403,10 +403,10 @@ def test_two_scripts_spending_one_fail( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) plutus_op2 = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) # Step 1: fund the Plutus scripts diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py b/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py index b6686726a..e716f1934 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_negative_raw.py @@ -279,7 +279,7 @@ def test_no_script( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_w_tokens( self, cluster: clusterlib.ClusterLib, @@ -344,7 +344,7 @@ def test_collateral_w_tokens( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_same_collateral_txin( self, cluster: clusterlib.ClusterLib, @@ -396,7 +396,7 @@ def test_same_collateral_txin( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collateral_percent( self, cluster: clusterlib.ClusterLib, @@ -452,7 +452,7 @@ def test_collateral_percent( assert "InsufficientCollateral" in err_str, err_str @allure.link(helpers.get_vcs_link()) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_two_scripts_spending_one_fail( self, cluster: clusterlib.ClusterLib, @@ -480,10 +480,10 @@ def test_two_scripts_spending_one_fail( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) plutus_op2 = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) # Step 1: fund the Plutus scripts diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_raw.py b/cardano_node_tests/tests/tests_plutus/test_spend_raw.py index 1bb0364ce..24c613381 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_raw.py @@ -135,7 +135,7 @@ class TestLocking: @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_locking( self, cluster: clusterlib.ClusterLib, @@ -629,10 +629,12 @@ def test_two_scripts_spending( dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_output_redeem) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_always_fails( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test locking a Tx output with a Plutus script and spending the locked UTxO. @@ -649,10 +651,10 @@ def test_always_fails( amount = 2_000_000 plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, - redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) script_utxos, collateral_utxos, __ = spend_raw._fund_script( @@ -685,10 +687,12 @@ def test_always_fails( assert "PlutusFailure" in err, err @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS3_VERSION def test_script_invalid( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test failing script together with the `--script-invalid` argument - collateral is taken. @@ -703,10 +707,10 @@ def test_script_invalid( amount = 2_000_000 plutus_op = plutus_common.PlutusOp( - script_file=plutus_common.ALWAYS_FAILS_PLUTUS_V1, + script_file=plutus_common.ALWAYS_FAILS[plutus_version].script_file, datum_file=plutus_common.DATUM_42_TYPED, - redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_common.ALWAYS_FAILS_COST, + redeemer_cbor_file=plutus_common.REDEEMER_42_CBOR, + execution_cost=plutus_common.ALWAYS_FAILS[plutus_version].execution_cost, ) script_utxos, collateral_utxos, __ = spend_raw._fund_script( @@ -748,7 +752,7 @@ def test_script_invalid( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_txout_token_locking( self, cluster: clusterlib.ClusterLib, @@ -809,7 +813,7 @@ def test_txout_token_locking( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_partial_spending( self, cluster: clusterlib.ClusterLib, @@ -899,7 +903,7 @@ def test_partial_spending( @allure.link(helpers.get_vcs_link()) @pytest.mark.dbsync @pytest.mark.parametrize("scenario", ("max", "max+1", "none")) - @common.PARAM_PLUTUS_VERSION + @common.PARAM_PLUTUS3_VERSION def test_collaterals( self, cluster: clusterlib.ClusterLib, diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py index 7fbb10d0b..6280a783d 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py @@ -134,12 +134,14 @@ def _fund_issuer_mint_token( common.check_missing_utxos(cluster_obj=cluster_obj, utxos=out_utxos) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize("algorithm", ("ecdsa", "schnorr")) def test_use_secp_builtin_functions( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], algorithm: str, + plutus_version: str, ): """Test that is possible to use the two SECP256k1 builtin functions. @@ -151,9 +153,9 @@ def test_use_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( @@ -203,6 +205,7 @@ def test_use_secp_builtin_functions( raise @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize( "test_vector", ("invalid_sig", "invalid_pubkey", "no_msg", "no_pubkey", "no_sig"), @@ -214,6 +217,7 @@ def test_negative_secp_builtin_functions( payment_addrs: tp.List[clusterlib.AddressRecord], test_vector: str, algorithm: str, + plutus_version: str, ): """Try to mint a token with invalid test vectors. @@ -222,9 +226,9 @@ def test_negative_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py index c0ac983a1..aca8377bd 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py @@ -136,12 +136,14 @@ def _fund_issuer_mint_token( common.check_missing_utxos(cluster_obj=cluster_obj, utxos=out_utxos) @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize("algorithm", ("ecdsa", "schnorr")) def test_use_secp_builtin_functions( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], algorithm: str, + plutus_version: str, ): """Test that is possible to use the two SECP256k1 builtin functions. @@ -152,9 +154,9 @@ def test_use_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( @@ -180,6 +182,7 @@ def test_use_secp_builtin_functions( raise @allure.link(helpers.get_vcs_link()) + @common.PARAM_PLUTUS2ONWARDS_VERSION @pytest.mark.parametrize( "test_vector", ("invalid_sig", "invalid_pubkey", "no_msg", "no_pubkey", "no_sig"), @@ -191,6 +194,7 @@ def test_negative_secp_builtin_functions( payment_addrs: tp.List[clusterlib.AddressRecord], test_vector: str, algorithm: str, + plutus_version: str, ): """Try to mint a token with invalid test vectors. @@ -199,9 +203,9 @@ def test_negative_secp_builtin_functions( temp_template = common.get_test_id(cluster) script_file = ( - plutus_common.MINTING_SECP256K1_ECDSA_PLUTUS_V2 + plutus_common.MINTING_SECP256K1_ECDSA[plutus_version] if algorithm == "ecdsa" - else plutus_common.MINTING_SECP256K1_SCHNORR_PLUTUS_V2 + else plutus_common.MINTING_SECP256K1_SCHNORR[plutus_version] ) redeemer_dir = ( From 968a302caf156b58d7313a866ed4964ae61fac56 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 30 May 2024 16:38:46 +0200 Subject: [PATCH 34/47] Cleanups and fixes --- cardano_node_tests/tests/plutus_common.py | 2 +- .../tests/tests_plutus/test_mint_build.py | 14 +++---- .../tests_plutus/test_mint_negative_build.py | 20 +++++----- .../tests_plutus/test_mint_negative_raw.py | 40 ++++++++++++------- .../tests/tests_plutus/test_mint_raw.py | 21 +++++++--- .../tests/tests_plutus/test_spend_build.py | 12 +++--- 6 files changed, 66 insertions(+), 43 deletions(-) diff --git a/cardano_node_tests/tests/plutus_common.py b/cardano_node_tests/tests/plutus_common.py index 935031265..9b4bf75f4 100644 --- a/cardano_node_tests/tests/plutus_common.py +++ b/cardano_node_tests/tests/plutus_common.py @@ -237,7 +237,7 @@ class PlutusScriptData: ), "v3": PlutusScriptData( script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V3, - script_type=clusterlib.ScriptTypes.PLUTUS_V1, + script_type=clusterlib.ScriptTypes.PLUTUS_V3, execution_cost=MINTING_WITNESS_REDEEMER_COST, ), } diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_build.py index 23feb5f86..e5964a060 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_build.py @@ -240,7 +240,6 @@ def test_minting_one_token( dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_output_step2) @allure.link(helpers.get_vcs_link()) - @pytest.mark.dbsync @pytest.mark.parametrize( "plutus_version", ( @@ -249,8 +248,9 @@ def test_minting_one_token( ), ids=("plutus_v1", "plutus_v3"), ) - @pytest.mark.testnets @submit_utils.PARAM_SUBMIT_METHOD + @pytest.mark.dbsync + @pytest.mark.testnets def test_time_range_minting( self, cluster: clusterlib.ClusterLib, @@ -279,10 +279,10 @@ def test_time_range_minting( token_amount = 5 script_fund = 200_000_000 - plutus_script = plutus_common.MINTING_TIME_RANGE[plutus_version] + plutus_v_record = plutus_common.MINTING_TIME_RANGE[plutus_version] minting_cost = plutus_common.compute_cost( - execution_cost=plutus_script.execution_cost, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -312,7 +312,7 @@ def test_time_range_minting( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_script.script_file) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -322,7 +322,7 @@ def test_time_range_minting( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_script.script_file, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) @@ -390,7 +390,7 @@ def test_time_range_minting( plutus_common.check_plutus_costs( plutus_costs=plutus_costs, - expected_costs=[plutus_common.MINTING_TIME_RANGE_COST], + expected_costs=[plutus_v_record.execution_cost], ) # check tx_view diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py index 791b1fc54..2a6448897 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_build.py @@ -124,8 +124,10 @@ def test_witness_redeemer_missing_signer( token_amount = 5 script_fund = 200_000_000 + plutus_v_record = plutus_common.MINTING_WITNESS_REDEEMER[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_WITNESS_REDEEMER_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -142,9 +144,7 @@ def test_witness_redeemer_missing_signer( # Step 2: mint the "qacoin" - policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file - ) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -154,7 +154,7 @@ def test_witness_redeemer_missing_signer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER[plutus_version].script_file, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, redeemer_file=plutus_common.DATUM_WITNESS_GOLDEN_NORMAL, ) @@ -400,8 +400,10 @@ def test_time_range_missing_tx_validity( token_amount = 5 script_fund = 200_000_000 + plutus_v_record = plutus_common.MINTING_TIME_RANGE[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_TIME_RANGE_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -427,9 +429,7 @@ def test_time_range_missing_tx_validity( + timestamp_offset_ms ) - script_file = plutus_common.MINTING_TIME_RANGE[plutus_version].script_file - - policyid = cluster.g_transaction.get_policyid(script_file) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -439,7 +439,7 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=script_file, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py index c9d96f451..efdaa78cc 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_negative_raw.py @@ -97,9 +97,20 @@ def fund_execution_units_above_limit( return mint_utxos, collateral_utxos, plutus_op @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.testnets def test_witness_redeemer_missing_signer( - self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord] + self, + cluster: clusterlib.ClusterLib, + payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a Plutus script with invalid signers. @@ -119,8 +130,10 @@ def test_witness_redeemer_missing_signer( lovelace_amount = 2_000_000 token_amount = 5 + plutus_v_record = plutus_common.MINTING_WITNESS_REDEEMER[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_WITNESS_REDEEMER_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -137,9 +150,7 @@ def test_witness_redeemer_missing_signer( # Step 2: mint the "qacoin" - policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1 - ) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -149,11 +160,11 @@ def test_witness_redeemer_missing_signer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, execution_units=( - plutus_common.MINTING_WITNESS_REDEEMER_COST.per_time, - plutus_common.MINTING_WITNESS_REDEEMER_COST.per_space, + plutus_v_record.execution_cost.per_time, + plutus_v_record.execution_cost.per_space, ), redeemer_file=plutus_common.DATUM_WITNESS_GOLDEN_NORMAL, ) @@ -506,7 +517,6 @@ def test_execution_units_above_limit( ids=("plutus_v1", "plutus_v3"), ) @pytest.mark.testnets - @pytest.mark.testnets def test_time_range_missing_tx_validity( self, cluster: clusterlib.ClusterLib, @@ -530,8 +540,10 @@ def test_time_range_missing_tx_validity( lovelace_amount = 2_000_000 token_amount = 5 + plutus_v_record = plutus_common.MINTING_TIME_RANGE[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_TIME_RANGE_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -557,7 +569,7 @@ def test_time_range_missing_tx_validity( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -567,11 +579,11 @@ def test_time_range_missing_tx_validity( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE[plutus_version].script_file, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, execution_units=( - plutus_common.MINTING_TIME_RANGE_COST.per_time, - plutus_common.MINTING_TIME_RANGE_COST.per_space, + plutus_v_record.execution_cost.per_time, + plutus_v_record.execution_cost.per_space, ), redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_raw.py b/cardano_node_tests/tests/tests_plutus/test_mint_raw.py index c1ddd7670..8f9eedae1 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_raw.py @@ -366,12 +366,21 @@ def test_witness_redeemer( dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_raw_output_step2) @allure.link(helpers.get_vcs_link()) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) @pytest.mark.dbsync @pytest.mark.testnets def test_time_range_minting( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], + plutus_version: str, ): """Test minting a token with a time constraints Plutus script. @@ -389,8 +398,10 @@ def test_time_range_minting( lovelace_amount = 2_000_000 token_amount = 5 + plutus_v_record = plutus_common.MINTING_TIME_RANGE[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_TIME_RANGE_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -419,7 +430,7 @@ def test_time_range_minting( + timestamp_offset_ms ) - policyid = cluster.g_transaction.get_policyid(plutus_common.MINTING_TIME_RANGE_PLUTUS_V1) + policyid = cluster.g_transaction.get_policyid(plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -429,11 +440,11 @@ def test_time_range_minting( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_TIME_RANGE_PLUTUS_V1, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, execution_units=( - plutus_common.MINTING_TIME_RANGE_COST.per_time, - plutus_common.MINTING_TIME_RANGE_COST.per_space, + plutus_v_record.execution_cost.per_time, + plutus_v_record.execution_cost.per_space, ), redeemer_value=str(redeemer_value), ) diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_build.py index 26fd756cd..96759fb2b 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_build.py @@ -655,13 +655,13 @@ def test_always_fails( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) - plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_v_record = plutus_common.ALWAYS_FAILS[plutus_version] plutus_op = plutus_common.PlutusOp( - script_file=plutus_script.script_file, + script_file=plutus_v_record.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_script.execution_cost, + execution_cost=plutus_v_record.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( @@ -711,13 +711,13 @@ def test_script_invalid( __: tp.Any # mypy workaround temp_template = common.get_test_id(cluster) - plutus_script = plutus_common.ALWAYS_FAILS[plutus_version] + plutus_v_record = plutus_common.ALWAYS_FAILS[plutus_version] plutus_op = plutus_common.PlutusOp( - script_file=plutus_script.script_file, + script_file=plutus_v_record.script_file, datum_file=plutus_common.DATUM_42_TYPED, redeemer_file=plutus_common.REDEEMER_42_TYPED, - execution_cost=plutus_script.execution_cost, + execution_cost=plutus_v_record.execution_cost, ) script_utxos, collateral_utxos, tx_output_fund = spend_build._build_fund_script( From bec33b1db30335691a5457d7af6398412e9fa802 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 6 Jun 2024 12:19:24 +0200 Subject: [PATCH 35/47] Make the scripts untyped --- .../tests/data/plutus/v3/timeRangePolicyScriptV3.plutus | 2 +- .../tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus index 463dd0b67..f3de1996e 100644 --- a/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus +++ b/cardano_node_tests/tests/data/plutus/v3/timeRangePolicyScriptV3.plutus @@ -1,5 +1,5 @@ { "type": "PlutusScriptV3", "description": "", - "cborHex": "590265590262010100323232232232532323232933300100900b0058c0022b266600201201600f180146401e45200f225323293330020119006912c800c400a2b20052180099806809000a200510021200922590018801456400a430013300d0120014400a200422a00318014540042b2666002021200522590018801456400a430013300b0110014400a20042401244b200310028ac801486002660160220028801440084600118014600022253232900490a801456400e430048c00230044540042b20052150028c00a2a00215900290ac801484ccc02c0140080062d180222d15900190c00a2d1800004452003229002912994801454c8ca401642a0051328012801c540042b2a0052150028c0022a00215900390aca80148564ccc02c02400800630028c002300245a300245a2b2a0032180045a300222b2007213259500390ac999806005001000c60051800460048c002300219806004800c4ca004a003159500190c00230008c0080c801c8964006200515900290c004cc0300280051002880100a40064444444400e29001911110020a40064444400a900191480148888888888888888024800c0060058003001800800b00020020032337020029001480064003323001001223225333573466e2400c00460060073300230050030010c000c008008466e01200200180091199ab9a3370e0040030008014894ccd5cd19b8700200118000a999ab9a3371200400230041801488ccd5cd19b88002001800400a44666ae68cdc4801000c00200522333573466e2400800600500091199ab9a337100040030028004894ccd5cd19b8900200110011002912999ab9a33712004002200420021" + "cborHex": "590d1b590d180101003232323232323232323232323232225932325323232990049148014894c8ca400e2b20092130020058994009400a260020088ac802484c00a002660140340028994009400a26003004094ca5400e42a00518004540042b20032159500390ac99980480e001000c60051800460048b460048b4565400a430008b460040c801c8964006200515900290c004cc024068005100288010230008acc802c8a400a44a64652007159004909801002c4ca004a0051300100445640124260050013300a01a00144ca004a0051300180204a652a0072150028c0022a00215900190aca801c8564ccc02407000800630028c002300245a300245a2b2a0052180045a300206400e44b200310028ac801486002660120340028801440081180146401645200d2253232933300201a9006912c800c400a2b2005218009980600e000a200510021200922590018801456400a430013300c01c0014400a200422a00318014540042b2666002033200522590018801456400a430013300a01b0014400a20042401244b200310028ac801486002660140360028801440084600118014600022253232900490a801456400e430048c00230044540042b20052150028c00a2a00215900290ac801484ccc0280140080062d180222d15900190c00a2d180000520032222222200714800c8888880145200322222200649919192999ab9a3370e9000001099191919194004c8c8c94ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8cccccccccccc8ccc8cc8cc888888888888888a00202100f807403601900b80540260110078034016009003801400460026ae84050c004d5d0809981391919192999ab9a3370e90000010c004c078d5d0800cc014d5d09aba2001098172481035054310035573c0046aae74004dd5000998138009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c0c0d5d0800ccc0c48c8c8c94ccd5cd19b8748000008600260686ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba135744002357440022606c9201035054310035573c0046aae74004dd50009aba135744002130324901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e90000010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae8400426064921035054310035573c0046aae74004dd51aba1001998173ae357426ae880046ae88004d5d100089816a481035054310035573c0046aae74004dd50009bad3574201e60026ae84038c008c009d69981280b1aba100c33302902675a6ae8402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013302975a6ae8400660506ae84d5d100084c0b92401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0a5d69aba100198141aba1357440021302e491035054310035573c0046aae74004dd51aba1357440021302b491035054310035573c0046aae74004dd51aba100a3302575c6ae84024ccc0a4050084d5d0804198010109aba1007375c6ae84018ccc0a405ccc0a40908c8c8c94ccd5cd19b874800000860042a666ae68cdc3a4004004300415333573466e1d2004002180009816249035054310035573c0046aae74004dd50009aba1005330250153574200860026ae8400cc004d5d09aba2003302675a604eeb8d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200113018491035054310035573c0046aae74004dd51aba100698009aba13574400c23232325333573466e1d200000218019bae3574200215333573466e1d2002002180498041aba10010a999ab9a3370e90020010c01cc058d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc01cd5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc014d5d09aba20010980c249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba1002980b1aba10019919192999ab9a3370e90000010994024cc06c060d5d08014d5d0800ccc06dd71aba135744002357440022a666ae68cdc3a400400430013301a017357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c079241035054310035573c0046aae74004dd51aba13574400215333573466e1d2004002180599980e00cbad357420033301a75c6ae84d5d1000854ccd5cd19b8748018008600e6603402e6ae840042a666ae68cdc3a40100042646500d3301c019357420073301a01b3574200533301e01b75a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba2001098102481035054310035573c0046aae74004dd51aba13574400322330160020010d5d10009aba200115333573466e1d200a00218029980d00b9aba10019919192999ab9a3370e900000109980ebae357420022603c9201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c00218010980da481035054310035573c0046aae74004dd51aba135744002357440022602e921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c034c050d5d0800ccc055d69aba13574400215333573466e1d20020021809980a1aba10019980abad357426ae880042a64666ae68cdc3a400800630033015357420053001357426ae880082a666ae68cdc3a400c00626500b301635742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c054d5d08014dd69aba13574400415333573466e1d200a003180a980a9aba10020a999ab9a3370e90060018c044c054d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d20120031800980a9aba1002980a9aba13574400415333573466e1d20140031807980a9aba10020980ba49035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba1357440041301b491035054310023232325333573466e1d20000021800980e1aba10010a999ab9a3370e90010010c00854ccd5cd19b874801000860082603c921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d00137540024646464a666ae68cdc3a4000004300130133574200215333573466e1d2002002180198099aba10010a999ab9a3370e90020010c014dd71aba10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae8800426028921035054310035573c0046aae74004dd500089808249035054310035573c0046aae74004dd500148a400a44444444444444440124006003002c001800c004dd680130002300089806249035054350018069112999ab9a3370e9000000898062481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026018444a666ae68cdc3a4000002200426600600266e1800800480048c8c8c94ccd5cd19b874800000860042a666ae68cdc3a400400430001300a491035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a400800430041300a4901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae8800426010921035054310035573c0046aae74004dd5000919118011bac00130082233335573e0025000280198021aba100298019aba200240008c8c8c94ccd5cd19b874800000860026eb8d5d0800854ccd5cd19b874800800860066eb8d5d080084c0192401035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae840042600c921035054310035573c0046aae74004dd5000919319ab9c0018001119118011bab00130052233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a0010012337009001000c8cdc0800a400520019000cc0088894ccd5cd19b8900200118018014cc00ccdc02400400400218004888c8c8c94ccd5cd19b88003480004c0040184c008018c01c894ccd5cd19b8800100518000c00c006600466e00004010600c44a666ae68cdc48008020c00c006600466e0000400c30003370200400680091199ab9a3370e0040030008014894ccd5cd19b8700200118000a999ab9a3371200400230041801488ccd5cd19b88002001800400a44666ae68cdc4801000c00200522333573466e2400800600500091199ab9a337100040030028004894ccd5cd19b8900200110011002912999ab9a337120040022004200223230010012233003300200200101" } diff --git a/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus index f734ec8db..ba8f49bbe 100644 --- a/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus +++ b/cardano_node_tests/tests/data/plutus/v3/witnessRedeemerPolicyScriptV3.plutus @@ -1,5 +1,5 @@ { "type": "PlutusScriptV3", "description": "", - "cborHex": "583858360101002322900191480148888888888888888c0500203230010012232590028c00a442a666ae68cdc78030010c0004c00c0046004005" + "cborHex": "590a2d590a2a010100323232323232323232323232225932323232323232323293232325333573466e1d200000218009919192999ab9a3370e9000001099191919191919191919191919191919194004c004d5d08094c004d5d0808ccc094078d5d08084dd69aba100f99801280f9aba100e9981280d9aba100d9998140133ad357420193232325333573466e1d200000218009919192999ab9a3370e90000010c004cc0c5d69aba100198181aba135744002130334901035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0c5d69aba100198181aba13574400213033491035054310035573c0046aae74004dd51aba13574400213030491035054310035573c0046aae74004dd51aba100b99812bae35742015333028019029357420133300202935742011375c6ae8401e666050038660500584646464a666ae68cdc3a4000004300215333573466e1d200200218020a999ab9a3370e90020010c0004c0c5241035054310035573c0046aae74004dd50009aba10069981280d1aba100598019aba100498019aba135744008302423232325333573466e1d2000002180098101aba100198109aba135744002130304901035054310035573c0046aae74004dd500098133ae302475a6ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10008980e249035054310035573c0046aae74004dd51aba100198029aba13574400213019491035054310035573c0046aae74004dd500548a400a44444444444444446026010180b112c800c60052215333573466e3c03000860002600800223232325333573466e1d200000218019bae3574200215333573466e1d2002002180498041aba10010a999ab9a3370e90020010c01cc044d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc01cd5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc014d5d09aba20010980c249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298089aba10019919192999ab9a3370e90000010994024cc05806cd5d08014d5d0800ccc059d71aba135744002357440022a666ae68cdc3a400400430013301501a357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c079241035054310035573c0046aae74004dd51aba13574400215333573466e1d2004002180599980b00a3ad357420033301575c6ae84d5d1000854ccd5cd19b8748018008600e6602a0346ae840042a666ae68cdc3a40100042646500d3301701c35742007330150163574200533301801675a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba2001098102481035054310035573c0046aae74004dd51aba13574400322330150020010d5d10009aba200115333573466e1d200a00218029980a80d1aba10019919192999ab9a3370e900000109980c3ae357420022603c9201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c00218010980da481035054310035573c0046aae74004dd51aba135744002357440022602e921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c034c03cd5d0800ccc041d69aba13574400215333573466e1d2002002180998079aba1001998083ad357426ae880042a64666ae68cdc3a400800630033010357420053001357426ae880082a666ae68cdc3a400c00626500b301135742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c040d5d08014dd69aba13574400415333573466e1d200a003180a98081aba10020a999ab9a3370e90060018c044c040d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098081aba100298081aba13574400415333573466e1d2014003180798081aba10020980ba49035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba1357440041301b491035054310023232325333573466e1d20000021800980b9aba10010a999ab9a3370e90010010c00854ccd5cd19b874801000860082603c921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300e3574200215333573466e1d2002002180198071aba10010a999ab9a3370e90020010c014dd71aba10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae8800426028921035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099194004c8c8c94ccd5cd19b8748000008600260226ae84006660244646464a666ae68cdc3a4000004300130153574200215333573466e1d20020021328019bad35742005375a6ae840066eb4d5d09aba20011aba20011301c4901035054310035573c0046aae74004dd50009aba135744002130184901035054310035573c0046aae74004dd51aba10039998083ae5007357420053232325333573466e1d200000218000a999ab9a3370e90010010c014dd71aba10010a999ab9a3370e90020010c00cd5d080084c0612401035054310035573c0046aae74004dd51aba100199807bae357426ae880046ae88004d5d100089809a481035054310035573c0046aae74004dd5000899804bae75a6eb800a300089806a481035054350018059112999ab9a3370e900000089806a481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026014444a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc010d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a40040043003375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011bab00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c0018001191800800911980198010010009" } From 57f28526b5505feee3b08b1de72bde5b176f68fe Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 18 Jun 2024 15:14:10 +0200 Subject: [PATCH 36/47] Fix expected cost of PlutusV3 scripts --- cardano_node_tests/tests/plutus_common.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/tests/plutus_common.py b/cardano_node_tests/tests/plutus_common.py index 9b4bf75f4..2f8f6e88e 100644 --- a/cardano_node_tests/tests/plutus_common.py +++ b/cardano_node_tests/tests/plutus_common.py @@ -140,6 +140,12 @@ class ExecutionCost: MINTING_V3_COST = ExecutionCost(per_time=161_100, per_space=800, fixed_cost=58) MINTING_V3_REF_COST = ExecutionCost(per_time=161_100, per_space=800, fixed_cost=58) +MINTING_V3_TIME_RANGE_COST = ExecutionCost( + per_time=110_046_914, per_space=350_762, fixed_cost=28_174 +) +MINTING_V3_WITNESS_REDEEMER_COST = ExecutionCost( + per_time=106_217_335, per_space=333_824, fixed_cost=26_920 +) @dataclasses.dataclass(frozen=True, order=True) @@ -238,7 +244,7 @@ class PlutusScriptData: "v3": PlutusScriptData( script_file=MINTING_WITNESS_REDEEMER_PLUTUS_V3, script_type=clusterlib.ScriptTypes.PLUTUS_V3, - execution_cost=MINTING_WITNESS_REDEEMER_COST, + execution_cost=MINTING_V3_WITNESS_REDEEMER_COST, ), } @@ -251,7 +257,7 @@ class PlutusScriptData: "v3": PlutusScriptData( script_file=MINTING_TIME_RANGE_PLUTUS_V3, script_type=clusterlib.ScriptTypes.PLUTUS_V3, - execution_cost=MINTING_TIME_RANGE_COST, + execution_cost=MINTING_V3_TIME_RANGE_COST, ), } From 5b185d545be9d4218c0226a3cc9a4f89bad2f654 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Tue, 18 Jun 2024 15:17:24 +0200 Subject: [PATCH 37/47] Fix SECP256k1 PlutusV3 tests and scripts The scripts are bit different from the PlutusV2 ones, and the error output is different as well. --- .../v3/verifyEcdsaPolicyScriptV3.plutus | 2 +- .../v3/verifySchnorrPolicyScriptV3.plutus | 2 +- .../test_mint_secp256k1_build.py | 47 ++++++++++++------- .../test_mint_secp256k1_raw.py | 10 ++-- 4 files changed, 37 insertions(+), 24 deletions(-) diff --git a/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus index 316c5edc9..6b755a3c6 100644 --- a/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus +++ b/cardano_node_tests/tests/data/plutus/v3/verifyEcdsaPolicyScriptV3.plutus @@ -1,5 +1,5 @@ { "type": "PlutusScriptV3", "description": "", - "cborHex": "58ba58b801010032229003911199ab9a3337680060040030008010ccccd448800888a002007002800884a400a0024881210392d7b94bc6a11c335a043ee1ff326b6eacee6230d3685861cd62bce350a172e00048812016e0bf1f85594a11e75030981c0b670370b3ad83a43f49ae58a2fd6f6513cde9004881405fb12954b28be6456feb080cfb8467b6f5677f62eb9ad231de7a575f4b6857512754fb5ef7e0e60e270832e7bb0e2f0dc271012fa9c46c02504aa0e798be62950001" + "cborHex": "590a70590a6d010100323232323232323232323232225932329002911199ab9a3337680060040030008010c8c8c94ccd5cd19b87480000084c8c8c8c8ca002646464a666ae68cdc3a400000426464646464646464646464646464646466666666666646664664664444444444444445001010807c03a01b00c805c02a013008803c01a00b004801c00a00230013574202860026ae8404cc08c8c8c8c94ccd5cd19b87480000086002603c6ae84006600a6ae84d5d100084c0bd241035054310035573c0046aae74004dd5000998118009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c0b0d5d0800ccc0b48c8c8c94ccd5cd19b8748000008600260606ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba135744002357440022606e9201035054310035573c0046aae74004dd50009aba135744002130334901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e90000010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae8400426066921035054310035573c0046aae74004dd51aba1001998153ae357426ae880046ae88004d5d1000898172481035054310035573c0046aae74004dd50009bad3574201e60026ae84038c004c005d69981080b1aba100c33302402275a6ae8402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013302d75a6ae8400660586ae84d5d100084c0bd2401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0b5d69aba100198161aba1357440021302f491035054310035573c0046aae74004dd51aba1357440021302c491035054310035573c0046aae74004dd51aba100a3302175c6ae84024ccc090050094d5d0804198008129aba1007375c6ae84018ccc09005ccc0900a08c8c8c94ccd5cd19b874800000860042a666ae68cdc3a4004004300415333573466e1d2004002180009816a49035054310035573c0046aae74004dd50009aba1005330210153574200860046ae8400cc008d5d09aba2003302375c6042eb4d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200113019491035054310035573c0046aae74004dd51aba100698009aba13574400c23232325333573466e1d200000218019bae3574200215333573466e1d2002002180498041aba10010a999ab9a3370e90020010c01cc048d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc01cd5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc014d5d09aba20010980ca49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298091aba10019919192999ab9a3370e90000010994024cc05c070d5d08014d5d0800ccc05dd71aba135744002357440022a666ae68cdc3a400400430013301601b357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c07d241035054310035573c0046aae74004dd51aba13574400215333573466e1d2004002180599980b80abad357420033301675c6ae84d5d1000854ccd5cd19b8748018008600e6602c0366ae840042a666ae68cdc3a40100042646500d3301801d35742007330160173574200533301901775a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109810a481035054310035573c0046aae74004dd51aba13574400322330160020010d5d10009aba200115333573466e1d200a00218029980b00d9aba10019919192999ab9a3370e900000109980cbae357420022603e9201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c00218010980e2481035054310035573c0046aae74004dd51aba1357440023574400226030921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c034c040d5d0800ccc045d69aba13574400215333573466e1d2002002180998081aba100199808bad357426ae880042a64666ae68cdc3a400800630033011357420053001357426ae880082a666ae68cdc3a400c00626500b301235742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c044d5d08014dd69aba13574400415333573466e1d200a003180a98089aba10020a999ab9a3370e90060018c044c044d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098089aba100298089aba13574400415333573466e1d2014003180798089aba10020980c249035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba1357440041301c491035054310023232325333573466e1d20000021800980c1aba10010a999ab9a3370e90010010c00854ccd5cd19b874801000860082603e921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300f3574200215333573466e1d2002002180198079aba10010a999ab9a3370e90020010c014dd71aba10010980b249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042602a921035054310035573c0046aae74004dd500089808a49035054310035573c0046aae74004dd50011919192999ab9a3370e90000010994004dd71aba10029bae35742003375c6ae84d5d10008d5d100089808249035054310035573c0046aae74004dd5001460011300d4901035054350018059112999ab9a3370e900000089806a481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026014444a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc010d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a40040043003375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011bab00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c0018001191800800911980198010010009" } diff --git a/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus index b291da005..67fa6346c 100644 --- a/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus +++ b/cardano_node_tests/tests/data/plutus/v3/verifySchnorrPolicyScriptV3.plutus @@ -1,5 +1,5 @@ { "type": "PlutusScriptV3", "description": "", - "cborHex": "58d958d701010032229003911199ab9a33376a0060040030008010ccccd448800888a002007002800884a400a002488120599de3e582e2a3779208a210dfeae8f330b9af00a47a7fb22e9bb8ef596f301b0048814030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030004881405a56da88e6fd8419181dec4d3dd6997bab953d2fc71ab65e23cfc9e7e3d1a310613454a60f6703819a39fdac2a410a094442afd1fc083354443e8d8bb4461a9b0001" + "cborHex": "590a70590a6d010100323232323232323232323232225932329002911199ab9a33376a0060040030008010c8c8c94ccd5cd19b87480000084c8c8c8c8ca002646464a666ae68cdc3a400000426464646464646464646464646464646466666666666646664664664444444444444445001010807c03a01b00c805c02a013008803c01a00b004801c00a00230013574202860026ae8404cc08c8c8c8c94ccd5cd19b87480000086002603c6ae84006600a6ae84d5d100084c0bd241035054310035573c0046aae74004dd5000998118009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c0b0d5d0800ccc0b48c8c8c94ccd5cd19b8748000008600260606ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba135744002357440022606e9201035054310035573c0046aae74004dd50009aba135744002130334901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e90000010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae8400426066921035054310035573c0046aae74004dd51aba1001998153ae357426ae880046ae88004d5d1000898172481035054310035573c0046aae74004dd50009bad3574201e60026ae84038c004c005d69981080b1aba100c33302402275a6ae8402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013302d75a6ae8400660586ae84d5d100084c0bd2401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0b5d69aba100198161aba1357440021302f491035054310035573c0046aae74004dd51aba1357440021302c491035054310035573c0046aae74004dd51aba100a3302175c6ae84024ccc090050094d5d0804198008129aba1007375c6ae84018ccc09005ccc0900a08c8c8c94ccd5cd19b874800000860042a666ae68cdc3a4004004300415333573466e1d2004002180009816a49035054310035573c0046aae74004dd50009aba1005330210153574200860046ae8400cc008d5d09aba2003302375c6042eb4d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200113019491035054310035573c0046aae74004dd51aba100698009aba13574400c23232325333573466e1d200000218019bae3574200215333573466e1d2002002180498041aba10010a999ab9a3370e90020010c01cc048d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc01cd5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc014d5d09aba20010980ca49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010994004dd69aba100298091aba10019919192999ab9a3370e90000010994024cc05c070d5d08014d5d0800ccc05dd71aba135744002357440022a666ae68cdc3a400400430013301601b357420033232325333573466e1d200000218009bad35742003375a6ae84d5d100084c07d241035054310035573c0046aae74004dd51aba13574400215333573466e1d2004002180599980b80abad357420033301675c6ae84d5d1000854ccd5cd19b8748018008600e6602c0366ae840042a666ae68cdc3a40100042646500d3301801d35742007330160173574200533301901775a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109810a481035054310035573c0046aae74004dd51aba13574400322330160020010d5d10009aba200115333573466e1d200a00218029980b00d9aba10019919192999ab9a3370e900000109980cbae357420022603e9201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c00218010980e2481035054310035573c0046aae74004dd51aba1357440023574400226030921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c034c040d5d0800ccc045d69aba13574400215333573466e1d2002002180998081aba100199808bad357426ae880042a64666ae68cdc3a400800630033011357420053001357426ae880082a666ae68cdc3a400c00626500b301235742007300235742003375a6ae84d5d10008d5d10010a999ab9a3370e90040018c024c044d5d08014dd69aba13574400415333573466e1d200a003180a98089aba10020a999ab9a3370e90060018c044c044d5d08014dd69aba13574400415333573466e1d200e00318029bae35742005375c6ae84d5d1001054ccd5cd19b874804000c600e6eb8d5d08014dd69aba13574400415333573466e1d2012003180098089aba100298089aba13574400415333573466e1d2014003180798089aba10020980c249035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba1357440041301c491035054310023232325333573466e1d20000021800980c1aba10010a999ab9a3370e90010010c00854ccd5cd19b874801000860082603e921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d00137540024646464a666ae68cdc3a40000043001300f3574200215333573466e1d2002002180198079aba10010a999ab9a3370e90020010c014dd71aba10010980b249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042602a921035054310035573c0046aae74004dd500089808a49035054310035573c0046aae74004dd50011919192999ab9a3370e90000010994004dd71aba10029bae35742003375c6ae84d5d10008d5d100089808249035054310035573c0046aae74004dd5001460011300d4901035054350018059112999ab9a3370e900000089806a481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026014444a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc010d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a40040043003375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011bab00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c0018001191800800911980198010010009" } diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py index 6280a783d..c0580d7a6 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_build.py @@ -1,4 +1,4 @@ -"""SECP256k1 tests for minting with Plutus V2 using `transaction build`.""" +"""SECP256k1 tests for minting with Plutus using `transaction build`.""" import logging import pathlib as pl @@ -221,7 +221,7 @@ def test_negative_secp_builtin_functions( ): """Try to mint a token with invalid test vectors. - * Expect failure. + Expect failure. """ temp_template = common.get_test_id(cluster) @@ -252,8 +252,8 @@ def test_negative_secp_builtin_functions( err_msg = str(excinfo.value) - # before protocol version 8 the SECP256k1 is blocked - # after that the usage is limited by high cost model + # Before protocol version 8 the SECP256k1 is blocked. + # After that the usage is limited by high cost model. is_forbidden = ( "Forbidden builtin function: (builtin " f"verify{algorithm.capitalize()}Secp256k1Signature)" @@ -268,19 +268,32 @@ def test_negative_secp_builtin_functions( "overspending the budget." in err_msg ) - # from protocol version 8 the SECP256k1 functions are allowed and - # when we provide wrong data meaningful error messages are expected - expected_error_messages = { - "invalid_sig": "validation failed", - "invalid_pubkey": "validation failed", - "no_msg": ( - "Invalid message hash" if algorithm == "ecdsa" else "Schnorr validation failed" - ), - "no_pubkey": "Invalid verification key", - "no_sig": "Invalid signature", - } - if before_pv8: assert is_forbidden or is_overspending, err_msg - else: + # From protocol version 8 the SECP256k1 functions are allowed and + # when we provide wrong data meaningful error messages are expected. + elif plutus_version == "v2": + expected_error_messages = { + "invalid_sig": "validation failed", + "invalid_pubkey": "validation failed", + "no_msg": ( + "Invalid message hash" if algorithm == "ecdsa" else "Schnorr validation failed" + ), + "no_pubkey": "Invalid verification key", + "no_sig": "Invalid signature", + } assert expected_error_messages[test_vector] in err_msg, err_msg + elif plutus_version == "v3": + # PT5: PlutusTx.Prelude.check: input is 'False'. The untyped script we use for + # PlutusV3 is different from the PlutusV2 script, and doesn't produce the same error + # messages. + expected_error_messages = { + "invalid_sig": "PT5", + "invalid_pubkey": "PT5", + "no_msg": ("Invalid message hash" if algorithm == "ecdsa" else "PT5"), + "no_pubkey": "PT5", + "no_sig": "PT5", + } + else: + _msg = f"Unsupported plutus version: {plutus_version}" + raise ValueError(_msg) diff --git a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py index aca8377bd..18389e0e1 100644 --- a/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py +++ b/cardano_node_tests/tests/tests_plutus_v2/test_mint_secp256k1_raw.py @@ -1,4 +1,4 @@ -"""SECP256k1 tests for minting with Plutus V2 using `transaction build-raw`.""" +"""SECP256k1 tests for minting with Plutus using `transaction build-raw`.""" import logging import pathlib as pl @@ -198,7 +198,7 @@ def test_negative_secp_builtin_functions( ): """Try to mint a token with invalid test vectors. - * Expect failure. + Expect failure. """ temp_template = common.get_test_id(cluster) @@ -229,8 +229,8 @@ def test_negative_secp_builtin_functions( err_msg = str(excinfo.value) - # before protocol version 8 the SECP256k1 is blocked - # after that the usage is limited by high cost model + # Before protocol version 8 the SECP256k1 is blocked. + # After that the usage is limited by high cost model. is_forbidden = "MalformedScriptWitnesses" in err_msg is_overspending = ( @@ -238,7 +238,7 @@ def test_negative_secp_builtin_functions( "overspending the budget." in err_msg ) - # from protocol version 8 the SECP256k1 functions are allowed + # From protocol version 8 the SECP256k1 functions are allowed decoding_error = f"Caused by: (verify{algorithm.capitalize()}Secp256k1Signature" validation_error = ( From 9c671b39f1f9b34ea9c10be027698b0dd3b630d0 Mon Sep 17 00:00:00 2001 From: saratomaz Date: Tue, 18 Jun 2024 15:38:00 +0100 Subject: [PATCH 38/47] Use dbsync version sancho-5.0.0 on nightly job --- .github/env_nightly_dbsync | 2 +- cardano_node_tests/utils/dbsync_queries.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/env_nightly_dbsync b/.github/env_nightly_dbsync index 02183d23c..9c91b4f89 100644 --- a/.github/env_nightly_dbsync +++ b/.github/env_nightly_dbsync @@ -2,6 +2,6 @@ CLUSTER_ERA=babbage TX_ERA=babbage MARKEXPR=dbsync CLUSTERS_COUNT=5 -DBSYNC_REV=sancho-4-2-1 +DBSYNC_REV=sancho-5.0.0 DBSYNC_SKIP_INDEXES=true CI_BYRON_CLUSTER=true diff --git a/cardano_node_tests/utils/dbsync_queries.py b/cardano_node_tests/utils/dbsync_queries.py index e4aba4218..05b785476 100644 --- a/cardano_node_tests/utils/dbsync_queries.py +++ b/cardano_node_tests/utils/dbsync_queries.py @@ -1063,9 +1063,11 @@ def query_committee_registration( ) -> tp.Generator[CommitteeRegistrationDBRow, None, None]: """Query committee registration in db-sync.""" query = ( - "SELECT id, tx_id, cert_index, cold_key, hot_key " - "FROM committee_registration " - "WHERE cold_key = %s;" + "SELECT cr.id, cr.tx_id, cr.cert_index, chc.raw, chh.raw " + "FROM committee_registration as cr " + "INNER JOIN committee_hash as chh ON chh.id = cr.hot_key_id " + "INNER JOIN committee_hash as chc ON chc.id = cr.cold_key_id " + "WHERE chc.raw = %s;" ) with execute(query=query, vars=(rf"\x{cold_key}",)) as cur: @@ -1078,9 +1080,10 @@ def query_committee_deregistration( ) -> tp.Generator[CommitteeDeregistrationDBRow, None, None]: """Query committee registration in db-sync.""" query = ( - "SELECT id, tx_id, cert_index, voting_anchor_id, cold_key " - "FROM committee_de_registration " - "WHERE cold_key = %s;" + "SELECT cd.id, cd.tx_id, cd.cert_index, cd.voting_anchor_id, committee_hash.raw " + "FROM committee_de_registration as cd " + "INNER JOIN committee_hash ON committee_hash.id = cd.cold_key_id " + "WHERE committee_hash.raw = %s;" ) with execute(query=query, vars=(rf"\x{cold_key}",)) as cur: From 98ad8cd4a1a4221de1450ba0ffc597ece42709c0 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 19 Jun 2024 11:48:21 +0200 Subject: [PATCH 39/47] Add PlutusV3 variant of `test_witness_redeemer` Using `transaction build-raw`. --- .../tests/tests_plutus/test_mint_raw.py | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_raw.py b/cardano_node_tests/tests/tests_plutus/test_mint_raw.py index 8f9eedae1..661f605a3 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_raw.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_raw.py @@ -245,11 +245,20 @@ def test_minting_two_tokens( "extended", ), ) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) def test_witness_redeemer( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], key: str, + plutus_version: str, ): """Test minting a token with a Plutus script. @@ -268,8 +277,10 @@ def test_witness_redeemer( lovelace_amount = 2_000_000 token_amount = 5 + plutus_v_record = plutus_common.MINTING_WITNESS_REDEEMER[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_WITNESS_REDEEMER_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -295,9 +306,7 @@ def test_witness_redeemer( # Step 2: mint the "qacoin" - policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1 - ) + policyid = cluster.g_transaction.get_policyid(script_file=plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -307,11 +316,11 @@ def test_witness_redeemer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, execution_units=( - plutus_common.MINTING_WITNESS_REDEEMER_COST.per_time, - plutus_common.MINTING_WITNESS_REDEEMER_COST.per_space, + plutus_v_record.execution_cost.per_time, + plutus_v_record.execution_cost.per_space, ), redeemer_file=redeemer_file, ) From 9aaac419fad119b58f5c42c9a667cf2a894713ac Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Wed, 19 Jun 2024 11:50:21 +0200 Subject: [PATCH 40/47] Add PlutusV3 variant of `test_witness_redeemer` Using `transaction build`. --- .../tests/tests_plutus/test_mint_build.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cardano_node_tests/tests/tests_plutus/test_mint_build.py b/cardano_node_tests/tests/tests_plutus/test_mint_build.py index e5964a060..2bd702b5e 100644 --- a/cardano_node_tests/tests/tests_plutus/test_mint_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_mint_build.py @@ -868,11 +868,20 @@ def test_minting_context_equivalence( "extended", ), ) + @pytest.mark.parametrize( + "plutus_version", + ( + "v1", + pytest.param("v3", marks=common.SKIPIF_PLUTUSV3_UNUSABLE), + ), + ids=("plutus_v1", "plutus_v3"), + ) def test_witness_redeemer( self, cluster: clusterlib.ClusterLib, payment_addrs: tp.List[clusterlib.AddressRecord], key: str, + plutus_version: str, submit_method: str, ): """Test minting a token with a Plutus script. @@ -897,8 +906,10 @@ def test_witness_redeemer( token_amount = 5 script_fund = 200_000_000 + plutus_v_record = plutus_common.MINTING_WITNESS_REDEEMER[plutus_version] + minting_cost = plutus_common.compute_cost( - execution_cost=plutus_common.MINTING_WITNESS_REDEEMER_COST, + execution_cost=plutus_v_record.execution_cost, protocol_params=cluster.g_query.get_protocol_params(), ) @@ -925,9 +936,7 @@ def test_witness_redeemer( # Step 2: mint the "qacoin" - policyid = cluster.g_transaction.get_policyid( - plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1 - ) + policyid = cluster.g_transaction.get_policyid(script_file=plutus_v_record.script_file) asset_name = f"qacoin{clusterlib.get_rand_str(4)}".encode().hex() token = f"{policyid}.{asset_name}" mint_txouts = [ @@ -937,7 +946,7 @@ def test_witness_redeemer( plutus_mint_data = [ clusterlib.Mint( txouts=mint_txouts, - script_file=plutus_common.MINTING_WITNESS_REDEEMER_PLUTUS_V1, + script_file=plutus_v_record.script_file, collaterals=collateral_utxos, redeemer_file=redeemer_file, ) @@ -1009,7 +1018,7 @@ def test_witness_redeemer( plutus_common.check_plutus_costs( plutus_costs=plutus_costs, - expected_costs=[plutus_common.MINTING_WITNESS_REDEEMER_COST], + expected_costs=[plutus_v_record.execution_cost], ) dbsync_utils.check_tx(cluster_obj=cluster, tx_raw_output=tx_output_step1) From 7ebf67b86be13c22b3f1c1d7766c3be002890f4d Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Thu, 20 Jun 2024 11:42:36 +0200 Subject: [PATCH 41/47] Remove PlutusV3 cost models from alonzo genesis spec The PlutusV3 cost model is now taken from `genesis.conway.spec.json`. --- .../conway/genesis.alonzo.spec.json | 241 +----------------- .../conway_fast/genesis.alonzo.spec.json | 241 +----------------- 2 files changed, 2 insertions(+), 480 deletions(-) diff --git a/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json b/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json index 7df7b1e59..abcaab932 100644 --- a/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json +++ b/cardano_node_tests/cluster_scripts/conway/genesis.alonzo.spec.json @@ -345,246 +345,7 @@ 38887044, 32947, 10 - ], - "PlutusV3": { - "addInteger-cpu-arguments-intercept": 205665, - "addInteger-cpu-arguments-slope": 812, - "addInteger-memory-arguments-intercept": 1, - "addInteger-memory-arguments-slope": 1, - "appendByteString-cpu-arguments-intercept": 1000, - "appendByteString-cpu-arguments-slope": 571, - "appendByteString-memory-arguments-intercept": 0, - "appendByteString-memory-arguments-slope": 1, - "appendString-cpu-arguments-intercept": 1000, - "appendString-cpu-arguments-slope": 24177, - "appendString-memory-arguments-intercept": 4, - "appendString-memory-arguments-slope": 1, - "bData-cpu-arguments": 1000, - "bData-memory-arguments": 32, - "blake2b_224-cpu-arguments-intercept": 117366, - "blake2b_224-cpu-arguments-slope": 10475, - "blake2b_224-memory-arguments": 4, - "blake2b_256-cpu-arguments-intercept": 117366, - "blake2b_256-cpu-arguments-slope": 10475, - "blake2b_256-memory-arguments": 4, - "bls12_381_G1_add-cpu-arguments": 832808, - "bls12_381_G1_add-memory-arguments": 18, - "bls12_381_G1_compress-cpu-arguments": 3209094, - "bls12_381_G1_compress-memory-arguments": 6, - "bls12_381_G1_equal-cpu-arguments": 331451, - "bls12_381_G1_equal-memory-arguments": 1, - "bls12_381_G1_hashToGroup-cpu-arguments-intercept": 65990684, - "bls12_381_G1_hashToGroup-cpu-arguments-slope": 23097, - "bls12_381_G1_hashToGroup-memory-arguments": 18, - "bls12_381_G1_neg-cpu-arguments": 114242, - "bls12_381_G1_neg-memory-arguments": 18, - "bls12_381_G1_scalarMul-cpu-arguments-intercept": 94393407, - "bls12_381_G1_scalarMul-cpu-arguments-slope": 87060, - "bls12_381_G1_scalarMul-memory-arguments": 18, - "bls12_381_G1_uncompress-cpu-arguments": 16420089, - "bls12_381_G1_uncompress-memory-arguments": 18, - "bls12_381_G2_add-cpu-arguments": 2145798, - "bls12_381_G2_add-memory-arguments": 36, - "bls12_381_G2_compress-cpu-arguments": 3795345, - "bls12_381_G2_compress-memory-arguments": 12, - "bls12_381_G2_equal-cpu-arguments": 889023, - "bls12_381_G2_equal-memory-arguments": 1, - "bls12_381_G2_hashToGroup-cpu-arguments-intercept": 204237282, - "bls12_381_G2_hashToGroup-cpu-arguments-slope": 23271, - "bls12_381_G2_hashToGroup-memory-arguments": 36, - "bls12_381_G2_neg-cpu-arguments": 129165, - "bls12_381_G2_neg-memory-arguments": 36, - "bls12_381_G2_scalarMul-cpu-arguments-intercept": 189977790, - "bls12_381_G2_scalarMul-cpu-arguments-slope": 85902, - "bls12_381_G2_scalarMul-memory-arguments": 36, - "bls12_381_G2_uncompress-cpu-arguments": 33012864, - "bls12_381_G2_uncompress-memory-arguments": 36, - "bls12_381_finalVerify-cpu-arguments": 388443360, - "bls12_381_finalVerify-memory-arguments": 1, - "bls12_381_millerLoop-cpu-arguments": 401885761, - "bls12_381_millerLoop-memory-arguments": 72, - "bls12_381_mulMlResult-cpu-arguments": 2331379, - "bls12_381_mulMlResult-memory-arguments": 72, - "cekApplyCost-exBudgetCPU": 23000, - "cekApplyCost-exBudgetMemory": 100, - "cekBuiltinCost-exBudgetCPU": 23000, - "cekBuiltinCost-exBudgetMemory": 100, - "cekCaseCost-exBudgetCPU": 23000, - "cekCaseCost-exBudgetMemory": 100, - "cekConstCost-exBudgetCPU": 23000, - "cekConstCost-exBudgetMemory": 100, - "cekConstrCost-exBudgetCPU": 23000, - "cekConstrCost-exBudgetMemory": 100, - "cekDelayCost-exBudgetCPU": 23000, - "cekDelayCost-exBudgetMemory": 100, - "cekForceCost-exBudgetCPU": 23000, - "cekForceCost-exBudgetMemory": 100, - "cekLamCost-exBudgetCPU": 23000, - "cekLamCost-exBudgetMemory": 100, - "cekStartupCost-exBudgetCPU": 100, - "cekStartupCost-exBudgetMemory": 100, - "cekVarCost-exBudgetCPU": 23000, - "cekVarCost-exBudgetMemory": 100, - "chooseData-cpu-arguments": 19537, - "chooseData-memory-arguments": 32, - "chooseList-cpu-arguments": 175354, - "chooseList-memory-arguments": 32, - "chooseUnit-cpu-arguments": 46417, - "chooseUnit-memory-arguments": 4, - "consByteString-cpu-arguments-intercept": 221973, - "consByteString-cpu-arguments-slope": 511, - "consByteString-memory-arguments-intercept": 0, - "consByteString-memory-arguments-slope": 1, - "constrData-cpu-arguments": 89141, - "constrData-memory-arguments": 32, - "decodeUtf8-cpu-arguments-intercept": 497525, - "decodeUtf8-cpu-arguments-slope": 14068, - "decodeUtf8-memory-arguments-intercept": 4, - "decodeUtf8-memory-arguments-slope": 2, - "divideInteger-cpu-arguments-constant": 196500, - "divideInteger-cpu-arguments-model-arguments-intercept": 453240, - "divideInteger-cpu-arguments-model-arguments-slope": 220, - "divideInteger-memory-arguments-intercept": 0, - "divideInteger-memory-arguments-minimum": 1, - "divideInteger-memory-arguments-slope": 1, - "encodeUtf8-cpu-arguments-intercept": 1000, - "encodeUtf8-cpu-arguments-slope": 28662, - "encodeUtf8-memory-arguments-intercept": 4, - "encodeUtf8-memory-arguments-slope": 2, - "equalsByteString-cpu-arguments-constant": 245000, - "equalsByteString-cpu-arguments-intercept": 216773, - "equalsByteString-cpu-arguments-slope": 62, - "equalsByteString-cpu-arguments-model-arguments-intercept": 150000, - "equalsByteString-cpu-arguments-model-arguments-slope": 247, - "equalsByteString-memory-arguments": 1, - "equalsData-cpu-arguments-intercept": 1060367, - "equalsData-cpu-arguments-slope": 12586, - "equalsData-memory-arguments": 1, - "equalsInteger-cpu-arguments-intercept": 208512, - "equalsInteger-cpu-arguments-slope": 421, - "equalsInteger-memory-arguments": 1, - "equalsString-cpu-arguments-constant": 187000, - "equalsString-cpu-arguments-intercept": 1000, - "equalsString-cpu-arguments-slope": 52998, - "equalsString-cpu-arguments-model-arguments-intercept": 150000, - "equalsString-cpu-arguments-model-arguments-slope": 1000, - "equalsString-memory-arguments": 1, - "fstPair-cpu-arguments": 80436, - "fstPair-memory-arguments": 32, - "headList-cpu-arguments": 43249, - "headList-memory-arguments": 32, - "iData-cpu-arguments": 1000, - "iData-memory-arguments": 32, - "ifThenElse-cpu-arguments": 80556, - "ifThenElse-memory-arguments": 1, - "indexByteString-cpu-arguments": 57667, - "indexByteString-memory-arguments": 4, - "integerToByteString-cpu-arguments-c0": 1292075, - "integerToByteString-cpu-arguments-c1": 24469, - "integerToByteString-cpu-arguments-c2": 74, - "integerToByteString-memory-arguments-intercept": 0, - "integerToByteString-memory-arguments-slope": 1, - "byteStringToInteger-cpu-arguments-c0": 936157, - "byteStringToInteger-cpu-arguments-c1": 49601, - "byteStringToInteger-cpu-arguments-c2": 237, - "byteStringToInteger-memory-arguments-intercept": 0, - "byteStringToInteger-memory-arguments-slope": 1, - "keccak_256-cpu-arguments-intercept": 1927926, - "keccak_256-cpu-arguments-slope": 82523, - "keccak_256-memory-arguments": 4, - "lengthOfByteString-cpu-arguments": 1000, - "lengthOfByteString-memory-arguments": 10, - "lessThanByteString-cpu-arguments-intercept": 197145, - "lessThanByteString-cpu-arguments-slope": 156, - "lessThanByteString-memory-arguments": 1, - "lessThanEqualsByteString-cpu-arguments-intercept": 197145, - "lessThanEqualsByteString-cpu-arguments-slope": 156, - "lessThanEqualsByteString-memory-arguments": 1, - "lessThanEqualsInteger-cpu-arguments-intercept": 204924, - "lessThanEqualsInteger-cpu-arguments-slope": 473, - "lessThanEqualsInteger-memory-arguments": 1, - "lessThanInteger-cpu-arguments-intercept": 208896, - "lessThanInteger-cpu-arguments-slope": 511, - "lessThanInteger-memory-arguments": 1, - "listData-cpu-arguments": 52467, - "listData-memory-arguments": 32, - "mapData-cpu-arguments": 64832, - "mapData-memory-arguments": 32, - "mkCons-cpu-arguments": 65493, - "mkCons-memory-arguments": 32, - "mkNilData-cpu-arguments": 22558, - "mkNilData-memory-arguments": 32, - "mkNilPairData-cpu-arguments": 16563, - "mkNilPairData-memory-arguments": 32, - "mkPairData-cpu-arguments": 76511, - "mkPairData-memory-arguments": 32, - "modInteger-cpu-arguments-constant": 196500, - "modInteger-cpu-arguments-model-arguments-intercept": 453240, - "modInteger-cpu-arguments-model-arguments-slope": 220, - "modInteger-memory-arguments-intercept": 0, - "modInteger-memory-arguments-minimum": 1, - "modInteger-memory-arguments-slope": 1, - "multiplyInteger-cpu-arguments-intercept": 69522, - "multiplyInteger-cpu-arguments-slope": 11687, - "multiplyInteger-memory-arguments-intercept": 0, - "multiplyInteger-memory-arguments-slope": 1, - "nullList-cpu-arguments": 60091, - "nullList-memory-arguments": 32, - "quotientInteger-cpu-arguments-constant": 196500, - "quotientInteger-cpu-arguments-model-arguments-intercept": 453240, - "quotientInteger-cpu-arguments-model-arguments-slope": 220, - "quotientInteger-memory-arguments-intercept": 0, - "quotientInteger-memory-arguments-minimum": 1, - "quotientInteger-memory-arguments-slope": 1, - "remainderInteger-cpu-arguments-constant": 196500, - "remainderInteger-cpu-arguments-model-arguments-intercept": 453240, - "remainderInteger-cpu-arguments-model-arguments-slope": 220, - "remainderInteger-memory-arguments-intercept": 0, - "remainderInteger-memory-arguments-minimum": 1, - "remainderInteger-memory-arguments-slope": 1, - "serialiseData-cpu-arguments-intercept": 1159724, - "serialiseData-cpu-arguments-slope": 392670, - "serialiseData-memory-arguments-intercept": 0, - "serialiseData-memory-arguments-slope": 2, - "sha2_256-cpu-arguments-intercept": 806990, - "sha2_256-cpu-arguments-slope": 30482, - "sha2_256-memory-arguments": 4, - "sha3_256-cpu-arguments-intercept": 1927926, - "sha3_256-cpu-arguments-slope": 82523, - "sha3_256-memory-arguments": 4, - "sliceByteString-cpu-arguments-intercept": 265318, - "sliceByteString-cpu-arguments-slope": 0, - "sliceByteString-memory-arguments-intercept": 4, - "sliceByteString-memory-arguments-slope": 0, - "sndPair-cpu-arguments": 85931, - "sndPair-memory-arguments": 32, - "subtractInteger-cpu-arguments-intercept": 205665, - "subtractInteger-cpu-arguments-slope": 812, - "subtractInteger-memory-arguments-intercept": 1, - "subtractInteger-memory-arguments-slope": 1, - "tailList-cpu-arguments": 41182, - "tailList-memory-arguments": 32, - "trace-cpu-arguments": 212342, - "trace-memory-arguments": 32, - "unBData-cpu-arguments": 31220, - "unBData-memory-arguments": 32, - "unConstrData-cpu-arguments": 32696, - "unConstrData-memory-arguments": 32, - "unIData-cpu-arguments": 43357, - "unIData-memory-arguments": 32, - "unListData-cpu-arguments": 32247, - "unListData-memory-arguments": 32, - "unMapData-cpu-arguments": 38314, - "unMapData-memory-arguments": 32, - "verifyEcdsaSecp256k1Signature-cpu-arguments": 35190005, - "verifyEcdsaSecp256k1Signature-memory-arguments": 10, - "verifyEd25519Signature-cpu-arguments-intercept": 57996947, - "verifyEd25519Signature-cpu-arguments-slope": 18975, - "verifyEd25519Signature-memory-arguments": 10, - "verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 39121781, - "verifySchnorrSecp256k1Signature-cpu-arguments-slope": 32260, - "verifySchnorrSecp256k1Signature-memory-arguments": 10 - } + ] }, "executionPrices": { "prMem": 0.0577, diff --git a/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json b/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json index 7df7b1e59..abcaab932 100644 --- a/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json +++ b/cardano_node_tests/cluster_scripts/conway_fast/genesis.alonzo.spec.json @@ -345,246 +345,7 @@ 38887044, 32947, 10 - ], - "PlutusV3": { - "addInteger-cpu-arguments-intercept": 205665, - "addInteger-cpu-arguments-slope": 812, - "addInteger-memory-arguments-intercept": 1, - "addInteger-memory-arguments-slope": 1, - "appendByteString-cpu-arguments-intercept": 1000, - "appendByteString-cpu-arguments-slope": 571, - "appendByteString-memory-arguments-intercept": 0, - "appendByteString-memory-arguments-slope": 1, - "appendString-cpu-arguments-intercept": 1000, - "appendString-cpu-arguments-slope": 24177, - "appendString-memory-arguments-intercept": 4, - "appendString-memory-arguments-slope": 1, - "bData-cpu-arguments": 1000, - "bData-memory-arguments": 32, - "blake2b_224-cpu-arguments-intercept": 117366, - "blake2b_224-cpu-arguments-slope": 10475, - "blake2b_224-memory-arguments": 4, - "blake2b_256-cpu-arguments-intercept": 117366, - "blake2b_256-cpu-arguments-slope": 10475, - "blake2b_256-memory-arguments": 4, - "bls12_381_G1_add-cpu-arguments": 832808, - "bls12_381_G1_add-memory-arguments": 18, - "bls12_381_G1_compress-cpu-arguments": 3209094, - "bls12_381_G1_compress-memory-arguments": 6, - "bls12_381_G1_equal-cpu-arguments": 331451, - "bls12_381_G1_equal-memory-arguments": 1, - "bls12_381_G1_hashToGroup-cpu-arguments-intercept": 65990684, - "bls12_381_G1_hashToGroup-cpu-arguments-slope": 23097, - "bls12_381_G1_hashToGroup-memory-arguments": 18, - "bls12_381_G1_neg-cpu-arguments": 114242, - "bls12_381_G1_neg-memory-arguments": 18, - "bls12_381_G1_scalarMul-cpu-arguments-intercept": 94393407, - "bls12_381_G1_scalarMul-cpu-arguments-slope": 87060, - "bls12_381_G1_scalarMul-memory-arguments": 18, - "bls12_381_G1_uncompress-cpu-arguments": 16420089, - "bls12_381_G1_uncompress-memory-arguments": 18, - "bls12_381_G2_add-cpu-arguments": 2145798, - "bls12_381_G2_add-memory-arguments": 36, - "bls12_381_G2_compress-cpu-arguments": 3795345, - "bls12_381_G2_compress-memory-arguments": 12, - "bls12_381_G2_equal-cpu-arguments": 889023, - "bls12_381_G2_equal-memory-arguments": 1, - "bls12_381_G2_hashToGroup-cpu-arguments-intercept": 204237282, - "bls12_381_G2_hashToGroup-cpu-arguments-slope": 23271, - "bls12_381_G2_hashToGroup-memory-arguments": 36, - "bls12_381_G2_neg-cpu-arguments": 129165, - "bls12_381_G2_neg-memory-arguments": 36, - "bls12_381_G2_scalarMul-cpu-arguments-intercept": 189977790, - "bls12_381_G2_scalarMul-cpu-arguments-slope": 85902, - "bls12_381_G2_scalarMul-memory-arguments": 36, - "bls12_381_G2_uncompress-cpu-arguments": 33012864, - "bls12_381_G2_uncompress-memory-arguments": 36, - "bls12_381_finalVerify-cpu-arguments": 388443360, - "bls12_381_finalVerify-memory-arguments": 1, - "bls12_381_millerLoop-cpu-arguments": 401885761, - "bls12_381_millerLoop-memory-arguments": 72, - "bls12_381_mulMlResult-cpu-arguments": 2331379, - "bls12_381_mulMlResult-memory-arguments": 72, - "cekApplyCost-exBudgetCPU": 23000, - "cekApplyCost-exBudgetMemory": 100, - "cekBuiltinCost-exBudgetCPU": 23000, - "cekBuiltinCost-exBudgetMemory": 100, - "cekCaseCost-exBudgetCPU": 23000, - "cekCaseCost-exBudgetMemory": 100, - "cekConstCost-exBudgetCPU": 23000, - "cekConstCost-exBudgetMemory": 100, - "cekConstrCost-exBudgetCPU": 23000, - "cekConstrCost-exBudgetMemory": 100, - "cekDelayCost-exBudgetCPU": 23000, - "cekDelayCost-exBudgetMemory": 100, - "cekForceCost-exBudgetCPU": 23000, - "cekForceCost-exBudgetMemory": 100, - "cekLamCost-exBudgetCPU": 23000, - "cekLamCost-exBudgetMemory": 100, - "cekStartupCost-exBudgetCPU": 100, - "cekStartupCost-exBudgetMemory": 100, - "cekVarCost-exBudgetCPU": 23000, - "cekVarCost-exBudgetMemory": 100, - "chooseData-cpu-arguments": 19537, - "chooseData-memory-arguments": 32, - "chooseList-cpu-arguments": 175354, - "chooseList-memory-arguments": 32, - "chooseUnit-cpu-arguments": 46417, - "chooseUnit-memory-arguments": 4, - "consByteString-cpu-arguments-intercept": 221973, - "consByteString-cpu-arguments-slope": 511, - "consByteString-memory-arguments-intercept": 0, - "consByteString-memory-arguments-slope": 1, - "constrData-cpu-arguments": 89141, - "constrData-memory-arguments": 32, - "decodeUtf8-cpu-arguments-intercept": 497525, - "decodeUtf8-cpu-arguments-slope": 14068, - "decodeUtf8-memory-arguments-intercept": 4, - "decodeUtf8-memory-arguments-slope": 2, - "divideInteger-cpu-arguments-constant": 196500, - "divideInteger-cpu-arguments-model-arguments-intercept": 453240, - "divideInteger-cpu-arguments-model-arguments-slope": 220, - "divideInteger-memory-arguments-intercept": 0, - "divideInteger-memory-arguments-minimum": 1, - "divideInteger-memory-arguments-slope": 1, - "encodeUtf8-cpu-arguments-intercept": 1000, - "encodeUtf8-cpu-arguments-slope": 28662, - "encodeUtf8-memory-arguments-intercept": 4, - "encodeUtf8-memory-arguments-slope": 2, - "equalsByteString-cpu-arguments-constant": 245000, - "equalsByteString-cpu-arguments-intercept": 216773, - "equalsByteString-cpu-arguments-slope": 62, - "equalsByteString-cpu-arguments-model-arguments-intercept": 150000, - "equalsByteString-cpu-arguments-model-arguments-slope": 247, - "equalsByteString-memory-arguments": 1, - "equalsData-cpu-arguments-intercept": 1060367, - "equalsData-cpu-arguments-slope": 12586, - "equalsData-memory-arguments": 1, - "equalsInteger-cpu-arguments-intercept": 208512, - "equalsInteger-cpu-arguments-slope": 421, - "equalsInteger-memory-arguments": 1, - "equalsString-cpu-arguments-constant": 187000, - "equalsString-cpu-arguments-intercept": 1000, - "equalsString-cpu-arguments-slope": 52998, - "equalsString-cpu-arguments-model-arguments-intercept": 150000, - "equalsString-cpu-arguments-model-arguments-slope": 1000, - "equalsString-memory-arguments": 1, - "fstPair-cpu-arguments": 80436, - "fstPair-memory-arguments": 32, - "headList-cpu-arguments": 43249, - "headList-memory-arguments": 32, - "iData-cpu-arguments": 1000, - "iData-memory-arguments": 32, - "ifThenElse-cpu-arguments": 80556, - "ifThenElse-memory-arguments": 1, - "indexByteString-cpu-arguments": 57667, - "indexByteString-memory-arguments": 4, - "integerToByteString-cpu-arguments-c0": 1292075, - "integerToByteString-cpu-arguments-c1": 24469, - "integerToByteString-cpu-arguments-c2": 74, - "integerToByteString-memory-arguments-intercept": 0, - "integerToByteString-memory-arguments-slope": 1, - "byteStringToInteger-cpu-arguments-c0": 936157, - "byteStringToInteger-cpu-arguments-c1": 49601, - "byteStringToInteger-cpu-arguments-c2": 237, - "byteStringToInteger-memory-arguments-intercept": 0, - "byteStringToInteger-memory-arguments-slope": 1, - "keccak_256-cpu-arguments-intercept": 1927926, - "keccak_256-cpu-arguments-slope": 82523, - "keccak_256-memory-arguments": 4, - "lengthOfByteString-cpu-arguments": 1000, - "lengthOfByteString-memory-arguments": 10, - "lessThanByteString-cpu-arguments-intercept": 197145, - "lessThanByteString-cpu-arguments-slope": 156, - "lessThanByteString-memory-arguments": 1, - "lessThanEqualsByteString-cpu-arguments-intercept": 197145, - "lessThanEqualsByteString-cpu-arguments-slope": 156, - "lessThanEqualsByteString-memory-arguments": 1, - "lessThanEqualsInteger-cpu-arguments-intercept": 204924, - "lessThanEqualsInteger-cpu-arguments-slope": 473, - "lessThanEqualsInteger-memory-arguments": 1, - "lessThanInteger-cpu-arguments-intercept": 208896, - "lessThanInteger-cpu-arguments-slope": 511, - "lessThanInteger-memory-arguments": 1, - "listData-cpu-arguments": 52467, - "listData-memory-arguments": 32, - "mapData-cpu-arguments": 64832, - "mapData-memory-arguments": 32, - "mkCons-cpu-arguments": 65493, - "mkCons-memory-arguments": 32, - "mkNilData-cpu-arguments": 22558, - "mkNilData-memory-arguments": 32, - "mkNilPairData-cpu-arguments": 16563, - "mkNilPairData-memory-arguments": 32, - "mkPairData-cpu-arguments": 76511, - "mkPairData-memory-arguments": 32, - "modInteger-cpu-arguments-constant": 196500, - "modInteger-cpu-arguments-model-arguments-intercept": 453240, - "modInteger-cpu-arguments-model-arguments-slope": 220, - "modInteger-memory-arguments-intercept": 0, - "modInteger-memory-arguments-minimum": 1, - "modInteger-memory-arguments-slope": 1, - "multiplyInteger-cpu-arguments-intercept": 69522, - "multiplyInteger-cpu-arguments-slope": 11687, - "multiplyInteger-memory-arguments-intercept": 0, - "multiplyInteger-memory-arguments-slope": 1, - "nullList-cpu-arguments": 60091, - "nullList-memory-arguments": 32, - "quotientInteger-cpu-arguments-constant": 196500, - "quotientInteger-cpu-arguments-model-arguments-intercept": 453240, - "quotientInteger-cpu-arguments-model-arguments-slope": 220, - "quotientInteger-memory-arguments-intercept": 0, - "quotientInteger-memory-arguments-minimum": 1, - "quotientInteger-memory-arguments-slope": 1, - "remainderInteger-cpu-arguments-constant": 196500, - "remainderInteger-cpu-arguments-model-arguments-intercept": 453240, - "remainderInteger-cpu-arguments-model-arguments-slope": 220, - "remainderInteger-memory-arguments-intercept": 0, - "remainderInteger-memory-arguments-minimum": 1, - "remainderInteger-memory-arguments-slope": 1, - "serialiseData-cpu-arguments-intercept": 1159724, - "serialiseData-cpu-arguments-slope": 392670, - "serialiseData-memory-arguments-intercept": 0, - "serialiseData-memory-arguments-slope": 2, - "sha2_256-cpu-arguments-intercept": 806990, - "sha2_256-cpu-arguments-slope": 30482, - "sha2_256-memory-arguments": 4, - "sha3_256-cpu-arguments-intercept": 1927926, - "sha3_256-cpu-arguments-slope": 82523, - "sha3_256-memory-arguments": 4, - "sliceByteString-cpu-arguments-intercept": 265318, - "sliceByteString-cpu-arguments-slope": 0, - "sliceByteString-memory-arguments-intercept": 4, - "sliceByteString-memory-arguments-slope": 0, - "sndPair-cpu-arguments": 85931, - "sndPair-memory-arguments": 32, - "subtractInteger-cpu-arguments-intercept": 205665, - "subtractInteger-cpu-arguments-slope": 812, - "subtractInteger-memory-arguments-intercept": 1, - "subtractInteger-memory-arguments-slope": 1, - "tailList-cpu-arguments": 41182, - "tailList-memory-arguments": 32, - "trace-cpu-arguments": 212342, - "trace-memory-arguments": 32, - "unBData-cpu-arguments": 31220, - "unBData-memory-arguments": 32, - "unConstrData-cpu-arguments": 32696, - "unConstrData-memory-arguments": 32, - "unIData-cpu-arguments": 43357, - "unIData-memory-arguments": 32, - "unListData-cpu-arguments": 32247, - "unListData-memory-arguments": 32, - "unMapData-cpu-arguments": 38314, - "unMapData-memory-arguments": 32, - "verifyEcdsaSecp256k1Signature-cpu-arguments": 35190005, - "verifyEcdsaSecp256k1Signature-memory-arguments": 10, - "verifyEd25519Signature-cpu-arguments-intercept": 57996947, - "verifyEd25519Signature-cpu-arguments-slope": 18975, - "verifyEd25519Signature-memory-arguments": 10, - "verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 39121781, - "verifySchnorrSecp256k1Signature-cpu-arguments-slope": 32260, - "verifySchnorrSecp256k1Signature-memory-arguments": 10 - } + ] }, "executionPrices": { "prMem": 0.0577, From 1972e692721f25e543cf67913ac93e40b9ce8116 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 15:23:56 +0200 Subject: [PATCH 42/47] Xfail on CLI issue 796 https://github.com/IntersectMBO/cardano-cli/issues/796 --- cardano_node_tests/tests/issues.py | 6 ++++++ cardano_node_tests/tests/test_tx_negative.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index f9ad20085..b245e1969 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -45,6 +45,12 @@ fixed_in="8.23.1.1", # Fixed in a release after 8.23.1.0 message="Option `--fee` not required.", ) +cli_796 = blockers.GH( + issue=796, + repo="IntersectMBO/cardano-cli", + fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 + message="Option `--fee` not required.", +) consensus_973 = blockers.GH( issue=973, diff --git a/cardano_node_tests/tests/test_tx_negative.py b/cardano_node_tests/tests/test_tx_negative.py index 2365bce31..8245fc457 100644 --- a/cardano_node_tests/tests/test_tx_negative.py +++ b/cardano_node_tests/tests/test_tx_negative.py @@ -1336,7 +1336,10 @@ def test_missing_fee( except clusterlib.CLIError as exc: err_str = str(exc) else: - issues.cli_768.finish_test() + if VERSIONS.node < version.parse("8.12.0"): + issues.cli_768.finish_test() + else: + issues.cli_796.finish_test() if "Transaction _ fee not supported in" in err_str: issues.node_4591.finish_test() @@ -1344,6 +1347,7 @@ def test_missing_fee( assert ( "fee must be specified" in err_str or "Implicit transaction fee not supported" in err_str + or "Missing: --fee LOVELACE" in err_str # node >= 8.12.0 ), err_str @allure.link(helpers.get_vcs_link()) From 3435160e6f1e372991a2fa98c51ee02e39a9d94c Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 15:39:23 +0200 Subject: [PATCH 43/47] Fix expected pparam keys in 8.12.0 --- cardano_node_tests/tests/test_protocol.py | 28 +++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/tests/test_protocol.py b/cardano_node_tests/tests/test_protocol.py index 7795ee560..2acb728e2 100644 --- a/cardano_node_tests/tests/test_protocol.py +++ b/cardano_node_tests/tests/test_protocol.py @@ -7,11 +7,13 @@ 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__) @@ -58,8 +60,26 @@ ) PROTOCOL_PARAM_KEYS_1_35_2 = frozenset(("utxoCostPerByte",)) +PROTOCOL_PARAM_KEYS_CONWAY = frozenset( + ( + "govActionLifetime", + "govActionDeposit", + "committeeMaxTermLength", + "dRepDeposit", + "poolVotingThresholds", + "dRepVotingThresholds", + "committeeMinSize", + "minFeeRefScriptCostPerByte", + "dRepActivity", + ) +) + PROTOCOL_PARAM_KEYS_MISSING_8_6_0 = frozenset(("utxoCostPerWord",)) +PROTOCOL_PARAM_KEYS_MISSING_8_12_0 = frozenset( + ("minUTxOValue", "decentralization", "extraPraosEntropy") +) + @common.SKIPIF_WRONG_ERA @pytest.mark.testnets @@ -108,10 +128,14 @@ def test_protocol_params(self, cluster: clusterlib.ClusterLib): union_with: tp.FrozenSet[str] = frozenset() if clusterlib_utils.cli_has("governance create-update-proposal --utxo-cost-per-byte"): - union_with = PROTOCOL_PARAM_KEYS_1_35_2 + 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 = PROTOCOL_PARAM_KEYS_MISSING_8_6_0 + 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) From 82e858a9bb926d01495c6a4434efd32e0bf1667e Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 15:46:09 +0200 Subject: [PATCH 44/47] The "decentralization" pparam is now gone alltogether --- cardano_node_tests/tests/test_update_proposals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cardano_node_tests/tests/test_update_proposals.py b/cardano_node_tests/tests/test_update_proposals.py index 5abdfa2ca..f9189a7e2 100644 --- a/cardano_node_tests/tests/test_update_proposals.py +++ b/cardano_node_tests/tests/test_update_proposals.py @@ -359,4 +359,4 @@ def test_update_proposal( # check param proposal on dbsync dbsync_utils.check_param_proposal(protocol_params=protocol_params) - assert protocol_params["decentralization"] is None + assert protocol_params.get("decentralization") is None From 91ee949f586b6accf00a3ba07c6cec9b5cb6c633 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 22:11:17 +0200 Subject: [PATCH 45/47] Xfail on CLI issue 799 https://github.com/IntersectMBO/cardano-cli/issues/799 --- cardano_node_tests/tests/issues.py | 6 ++++++ cardano_node_tests/tests/test_cli.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index b245e1969..c1ae4b7e2 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -51,6 +51,12 @@ fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 message="Option `--fee` not required.", ) +cli_799 = blockers.GH( + issue=799, + repo="IntersectMBO/cardano-cli", + fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 + message="Conway era fields shown in Babbage Tx.", +) consensus_973 = blockers.GH( issue=973, diff --git a/cardano_node_tests/tests/test_cli.py b/cardano_node_tests/tests/test_cli.py index 6d05e81d9..e5e8205f8 100644 --- a/cardano_node_tests/tests/test_cli.py +++ b/cardano_node_tests/tests/test_cli.py @@ -148,6 +148,10 @@ def test_tx_view(self, cluster: clusterlib.ClusterLib): with open(self.TX_BODY_OUT_JSON, encoding="utf-8") as infile: tx_body_golden = infile.read() + + if '"governance actions":' in tx: + issues.cli_799.finish_test() + assert tx_body == tx_body_golden.strip() with open(self.TX_OUT_JSON, encoding="utf-8") as infile: From 83901dcdd01749cd381922d0f8111517c00dee17 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 22:55:43 +0200 Subject: [PATCH 46/47] Xfail on CLI issue 800 https://github.com/IntersectMBO/cardano-cli/issues/800 --- cardano_node_tests/tests/issues.py | 6 ++++++ .../tests_plutus/test_spend_datum_build.py | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/cardano_node_tests/tests/issues.py b/cardano_node_tests/tests/issues.py index c1ae4b7e2..960050e24 100644 --- a/cardano_node_tests/tests/issues.py +++ b/cardano_node_tests/tests/issues.py @@ -57,6 +57,12 @@ fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 message="Conway era fields shown in Babbage Tx.", ) +cli_800 = blockers.GH( + issue=800, + repo="IntersectMBO/cardano-cli", + fixed_in="8.24.0.1", # Fixed in a release after 8.24.0.0 + message="Datum not checked for PlutusV1 and PlutusV2 spending scripts.", +) consensus_973 = blockers.GH( issue=973, diff --git a/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py b/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py index 327eef5d7..97458825b 100644 --- a/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py +++ b/cardano_node_tests/tests/tests_plutus/test_spend_datum_build.py @@ -236,7 +236,7 @@ def test_no_datum_txout( ) txouts = [ - clusterlib.TxOut(address=redeem_address, amount=amount + redeem_cost.fee), + clusterlib.TxOut(address=redeem_address, amount=amount + redeem_cost.fee + 5_000_000), clusterlib.TxOut(address=payment_addr.address, amount=redeem_cost.collateral), ] tx_files = clusterlib.TxFiles(signing_key_files=[payment_addr.skey_file]) @@ -259,7 +259,8 @@ def test_no_datum_txout( script_utxos = clusterlib.filter_utxos(utxos=out_utxos, utxo_ix=utxo_ix_offset) collateral_utxos = clusterlib.filter_utxos(utxos=out_utxos, utxo_ix=utxo_ix_offset + 1) - with pytest.raises(clusterlib.CLIError) as excinfo: + err_str = "" + try: spend_build._build_spend_locked_txin( temp_template=temp_template, cluster_obj=cluster, @@ -271,7 +272,10 @@ def test_no_datum_txout( amount=amount, submit_tx=False, ) - err_str = str(excinfo.value) + except clusterlib.CLIError as exc: + err_str = str(exc) + else: + issues.cli_800.finish_test() if address_type == "script_address": assert "txin does not have a script datum" in err_str, err_str @@ -362,7 +366,8 @@ def test_unlock_tx_wrong_datum( execution_cost=plutus_common.ALWAYS_SUCCEEDS[plutus_version].execution_cost, ) - with pytest.raises(clusterlib.CLIError) as excinfo: + err_str = "" + try: spend_build._build_spend_locked_txin( temp_template=temp_template, cluster_obj=cluster, @@ -374,8 +379,11 @@ def test_unlock_tx_wrong_datum( amount=2_000_000, submit_tx=False, ) + except clusterlib.CLIError as exc: + err_str = str(exc) + else: + issues.cli_800.finish_test() - err_str = str(excinfo.value) assert ( "The Plutus script witness has the wrong datum (according to the UTxO)." in err_str ), err_str From 4ba2a47c5125d36a005a6774810634016d2f19e1 Mon Sep 17 00:00:00 2001 From: Martin Kourim Date: Fri, 21 Jun 2024 23:27:14 +0200 Subject: [PATCH 47/47] Temporarily disable PlutusV3 tests on 8.12.0+ The PlutusV3 scripts need to be rewritten because of CIP-69. --- cardano_node_tests/tests/common.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cardano_node_tests/tests/common.py b/cardano_node_tests/tests/common.py index b7a8bacc9..c323e4ad5 100644 --- a/cardano_node_tests/tests/common.py +++ b/cardano_node_tests/tests/common.py @@ -64,9 +64,15 @@ reason="Plutus V2 is available only in Babbage+ eras", ) +_PLUTUSV3_SKIP_REASON = "" +if VERSIONS.transaction_era < VERSIONS.CONWAY: + _PLUTUSV3_SKIP_REASON = "Plutus V3 is available only in Conway+ eras" +elif VERSIONS.node >= version.parse("8.12.0"): + _PLUTUSV3_SKIP_REASON = "PlutusV3 scripts need to be rewritten because of CIP-69" +PLUTUSV3_UNUSABLE = bool(_PLUTUSV3_SKIP_REASON) SKIPIF_PLUTUSV3_UNUSABLE = pytest.mark.skipif( - VERSIONS.transaction_era < VERSIONS.CONWAY, - reason="Plutus V3 is available only in Conway+ eras", + PLUTUSV3_UNUSABLE, + reason=_PLUTUSV3_SKIP_REASON, )