From 7fe7e478a3b1c80fee9bd0ec2ef1ddf228c6d862 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Fri, 21 Jun 2024 11:00:43 -0300 Subject: [PATCH] Update protocol to ParisC --- src/pytezos/sandbox/node.py | 2 +- src/pytezos/sandbox/parameters.py | 65 +++++++++++++++-------------- tests/sandbox_tests/test_sandbox.py | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/pytezos/sandbox/node.py b/src/pytezos/sandbox/node.py index 167162ba..3a009428 100644 --- a/src/pytezos/sandbox/node.py +++ b/src/pytezos/sandbox/node.py @@ -22,7 +22,7 @@ from pytezos.sandbox.parameters import LATEST from pytezos.sandbox.parameters import sandbox_addresses -DOCKER_IMAGE = 'bakingbad/sandboxed-node:v20.0-3' +DOCKER_IMAGE = 'bakingbad/sandboxed-node:v20.1-2' MAX_ATTEMPTS = 60 ATTEMPT_DELAY = 0.5 TEZOS_NODE_PORT = 8732 diff --git a/src/pytezos/sandbox/parameters.py b/src/pytezos/sandbox/parameters.py index 097e4d4e..18a2136f 100644 --- a/src/pytezos/sandbox/parameters.py +++ b/src/pytezos/sandbox/parameters.py @@ -15,7 +15,8 @@ NAIROBI = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf' OXFORD = 'ProxfordYmVfjWnRcgjWH36fW6PArwqykTFzotUxRs6gmTcZDuH' PARIS = 'PtParisBxoLz5gzMmn3d9WBQNoPSZakgnkMC2VNuQ3KXfUtUQeZ' -LATEST = PARIS +PARISC = 'PsParisCZo7KAh1Z1smVd9ZMZ1HHn5gkzbM94V3PLCpknFWhUAi' +LATEST = PARISC protocol_hashes = { 'edo': EDO, @@ -30,6 +31,7 @@ 'nairobi': NAIROBI, 'oxford': OXFORD, 'paris': PARIS, + 'parisc': PARISC, } protocol_version = { @@ -45,6 +47,7 @@ NAIROBI: 17, OXFORD: 18, PARIS: 19, + PARISC: 20, } sandbox_commitment = { @@ -98,7 +101,7 @@ ], ], # NOTE: Shorter cycles, voting periods and other parameters - # NOTE: From https://gitlab.com/tezos/tezos/-/blob/master/src/proto_019_PtParisB/lib_parameters/default_parameters.ml#L317 + # NOTE: From https://gitlab.com/tezos/tezos/-/blob/master/src/proto_020_PsParisC/lib_parameters/default_parameters.ml#L317 'blocks_preservation_cycles': 1, 'consensus_rights_delay': 2, 'delegate_parameters_activation_delay': 2, @@ -117,23 +120,24 @@ } # NOTE: https://rpc.tzkt.io/parisnet/chains/main/blocks/head/context/constants/parametric -paris_params = { +# NOTE: https://rpc.pariscnet.teztnets.com/chains/main/blocks/head/context/constants/parametric +protocol_params = { "consensus_rights_delay": 2, "blocks_preservation_cycles": 1, - "delegate_parameters_activation_delay": 5, - "blocks_per_cycle": 12288, - "blocks_per_commitment": 96, - "nonce_revelation_threshold": 768, + "delegate_parameters_activation_delay": 3, + "blocks_per_cycle": 128, + "blocks_per_commitment": 16, + "nonce_revelation_threshold": 32, "cycles_per_voting_period": 1, "hard_gas_limit_per_operation": "1040000", - "hard_gas_limit_per_block": "1733333", + "hard_gas_limit_per_block": "5200000", "proof_of_work_threshold": "-1", "minimal_stake": "6000000000", "minimal_frozen_stake": "600000000", - "vdf_difficulty": "10000000000", + "vdf_difficulty": "10000000", "origination_size": 257, "issuance_weights": { - "base_total_issued_per_minute": "80007812", + "base_total_issued_per_minute": "85007812", "baking_reward_fixed_portion_weight": 5120, "baking_reward_bonus_weight": 5120, "attesting_reward_weight": 10240, @@ -146,19 +150,18 @@ "quorum_max": 7000, "min_proposal_quorum": 500, "liquidity_baking_subsidy": "5000000", - "liquidity_baking_toggle_ema_threshold": 1000000000, - "max_operations_time_to_live": 360, - "minimal_block_delay": "5", - "delay_increment_per_round": "2", + "liquidity_baking_toggle_ema_threshold": 100000, + "max_operations_time_to_live": 120, + "minimal_block_delay": "7", + "delay_increment_per_round": "7", "consensus_committee_size": 7000, "consensus_threshold": 4667, "minimal_participation_ratio": {"numerator": 2, "denominator": 3}, "limit_of_delegation_over_baking": 9, - "percentage_of_frozen_deposits_slashed_per_double_baking": 500, + "percentage_of_frozen_deposits_slashed_per_double_baking": 700, "percentage_of_frozen_deposits_slashed_per_double_attestation": 5000, "max_slashing_per_block": 10000, "max_slashing_threshold": 2334, - "testnet_dictator": "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8", "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, @@ -173,28 +176,28 @@ "slot_size": 126944, "number_of_shards": 512, }, - "smart_rollup_arith_pvm_enable": False, + "smart_rollup_arith_pvm_enable": True, "smart_rollup_origination_size": 6314, - "smart_rollup_challenge_window_in_blocks": 241920, - "smart_rollup_stake_amount": "10000000000", - "smart_rollup_commitment_period_in_blocks": 180, - "smart_rollup_max_lookahead_in_blocks": 518400, - "smart_rollup_max_active_outbox_levels": 241920, + "smart_rollup_challenge_window_in_blocks": 40, + "smart_rollup_stake_amount": "32000000", + "smart_rollup_commitment_period_in_blocks": 20, + "smart_rollup_max_lookahead_in_blocks": 30000, + "smart_rollup_max_active_outbox_levels": 20160, "smart_rollup_max_outbox_messages_per_level": 100, "smart_rollup_number_of_sections_in_dissection": 32, - "smart_rollup_timeout_period_in_blocks": 120960, + "smart_rollup_timeout_period_in_blocks": 500, "smart_rollup_max_number_of_cemented_commitments": 5, "smart_rollup_max_number_of_parallel_games": 32, "smart_rollup_reveal_activation_level": { "raw_data": {"Blake2B": 0}, "metadata": 0, - "dal_page": 8193, - "dal_parameters": 8193, + "dal_page": 1, + "dal_parameters": 1, "dal_attested_slots_validity_lag": 241920, }, "smart_rollup_private_enable": True, - "smart_rollup_riscv_pvm_enable": False, - "zk_rollup_enable": False, + "smart_rollup_riscv_pvm_enable": True, + "zk_rollup_enable": True, "zk_rollup_origination_size": 4000, "zk_rollup_min_pending_to_process": 10, "zk_rollup_max_ticket_payload_size": 2048, @@ -209,22 +212,20 @@ "initial_period": 10, "transition_period": 50, "max_bonus": "50000000000000", - "growth_rate": {"numerator": "1", "denominator": "25"}, + "growth_rate": {"numerator": "1", "denominator": "100"}, "center_dz": {"numerator": "1", "denominator": "2"}, "radius_dz": {"numerator": "1", "denominator": "50"}, }, "adaptive_issuance_activation_vote_enable": True, "autostaking_enable": True, - "adaptive_issuance_force_activation": False, + "adaptive_issuance_force_activation": True, "ns_enable": True, "direct_ticket_spending_enable": False, } def get_protocol_parameters(protocol_hash: str) -> Dict[str, Any]: - # https://gitlab.com/tezos/tezos/-/blob/master/src/proto_018_Proxford/lib_parameters/default_parameters.ml return { - **paris_params, - # **old_params, + **protocol_params, **sandbox_params, } diff --git a/tests/sandbox_tests/test_sandbox.py b/tests/sandbox_tests/test_sandbox.py index 17fa9df5..c165e8b2 100644 --- a/tests/sandbox_tests/test_sandbox.py +++ b/tests/sandbox_tests/test_sandbox.py @@ -29,7 +29,7 @@ def test_3_create_transaction(self) -> None: def test_4_bake_block(self) -> None: self.bake_block() bootstrap3 = self.client.shell.contracts[sandbox_addresses['bootstrap3']]() - self.assertEqual(3800000316708, int(bootstrap3['balance'])) + self.assertEqual(3800000336497, int(bootstrap3['balance'])) def test_5_activate_account(self) -> None: client = self.get_client(key=sandbox_commitment)