From fc44d399a4c4e911b0fcbddefa279fbc829b7ca9 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:07:19 +0200 Subject: [PATCH 01/18] Revert "Proto/deactivation: more precise comparison" This reverts commit d894591d2a5fb381fdd333de16721f06c4da8612. --- .../lib_protocol/delegate_activation_storage.ml | 14 ++++++-------- .../lib_protocol/test/helpers/scenario_activity.ml | 10 ++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml index ff1a89403753..1b81194cd6bd 100644 --- a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml @@ -73,17 +73,15 @@ let tolerated_inactivity_period ctxt delegate = ctxt current_cycle in - (* If [(delegate_baking_power / total_baking_power) > (tolerance_threshold / 1000)] - use low tolerance, otherwise use high tolerance. *) - let compare_power_ratio_with_threshold = + let compare_stake_ratio_with_threshold = Int64.( compare - (mul 1000L (Stake_repr.staking_weight delegate_stake)) - (mul - (of_int tolerance_threshold) - (Stake_repr.staking_weight total_stake))) + (div + (mul 1000L (Stake_repr.staking_weight delegate_stake)) + (Stake_repr.staking_weight total_stake)) + (of_int tolerance_threshold)) in - if Compare.Int.(compare_power_ratio_with_threshold > 0) then + if Compare.Int.(compare_stake_ratio_with_threshold > 0) then (ctxt, tolerance_low) else (ctxt, tolerance_high) diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml index 89622d13ca20..40c03278292a 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml @@ -8,8 +8,6 @@ open State_account open State -(** Mimics - {!Protocol.Delegate_activation_storage.tolerated_inactivity_period}. *) let tolerated_inactivity_period ~block ~state account = let open Lwt_result_syntax in let tolerance_threshold = @@ -26,13 +24,13 @@ let tolerated_inactivity_period ~block ~state account = match delegate_stake with | None -> tolerance_low | Some delegate_stake -> - let compare_power_ratio_with_threshold = + let compare_stake_ratio_with_threshold = Int64.( compare - (mul 1000L delegate_stake) - (mul (of_int tolerance_threshold) total_stake)) + (div (mul 1000L delegate_stake) total_stake) + (of_int tolerance_threshold)) in - if Compare.Int.(compare_power_ratio_with_threshold > 0) then + if Compare.Int.(compare_stake_ratio_with_threshold > 0) then tolerance_low else tolerance_high -- GitLab From fb08d2d6bb5b5a56ff1c5a49b672db5614baced8 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:10:19 +0200 Subject: [PATCH 02/18] Revert "Docs/Alpha: update docs with new tolerated inactivity period" This reverts commit 871fa5b815afd5b7481d6c15e0c47676eb55d321. --- docs/alpha/proof_of_stake.rst | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/docs/alpha/proof_of_stake.rst b/docs/alpha/proof_of_stake.rst index b2fe2aa819c1..3ce82d76f1ae 100644 --- a/docs/alpha/proof_of_stake.rst +++ b/docs/alpha/proof_of_stake.rst @@ -117,22 +117,9 @@ back when it was still active), then it gets automatically marked as active again. At the end of a cycle, a delegate gets deactivated if the chain has -not witnessed any consensus activity (baking, attesting) from it -during the past ``tolerated_inactivity_period`` cycles, including the -currently ending cycle. The tolerated inactivity period depends on the -delegate's :doc:`baking power` ratio over the total -active baking power. If the ratio is greater than the -:ref:`proof-of-stake protocol parameter` -``TOLERATED_INACTIVITY_PERIOD_THRESHOLD`` (expressed in 'per -thousand'), the delegate has a low tolerance -``TOLERATED_INACTIVITY_PERIOD_LOW``, otherwise it has a high tolerance -``TOLERATED_INACTIVITY_PERIOD_HIGH``. With current parameters, -delegates with more than 1% of the total active baking power have a -``tolerated_inactivity_period`` of 1 cycle, and for delegates with 1% -or less, it is 12 cycles. In cases where the baking power is unknown, -the low tolerance is also applied (e.g., after a delegate's -registration, reactivation, or if its baking power is below -``MINIMAL_STAKE``). +not witnessed any consensus activity (baking, attesting) from it during the +past ``TOLERATED_INACTIVITY_PERIOD`` cycles, including the currently +ending cycle. Note that there is an extra grace period of ``CONSENSUS_RIGHTS_DELAY`` cycles when a delegate has just registered or has just been @@ -210,16 +197,8 @@ Proof-of-stake parameters - 6,000 ꜩ * - ``MINIMAL_FROZEN_STAKE`` - 600 ꜩ - * - ``TOLERATED_INACTIVITY_PERIOD_LOW`` - - 1 cycle - * - ``TOLERATED_INACTIVITY_PERIOD_HIGH`` - - 12 cycles - * - ``TOLERATED_INACTIVITY_PERIOD_THRESHOLD`` - - 10 per thousand - -.. /!\ When updating the values of these constants, search for - "ps_constants_alpha" to check places where explicit use of those - values might need to be updated too. + * - ``TOLERATED_INACTIVITY_PERIOD`` + - 2 cycles Further External Resources -------------------------- -- GitLab From c09b305665c4eb742953c2599a74e31916bc8c79 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:13:58 +0200 Subject: [PATCH 03/18] Revert "Docs: update changelog" This reverts commit 3141a9c809e9bd16b6f169b693f66e8f6172f848. --- docs/protocols/alpha.rst | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index fbfb56f1ed23..3e0115398122 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -131,20 +131,6 @@ Protocol parameters ``consensus_rights_delay + slashing_delay + 2 = 1 + 1 + 2 = 4`` cycles are needed. (MR :gl:`!18783`) -- Replaced the ``tolerated_inactivity_period`` protocol constant with - three new protocol constants: ``tolerated_inactivity_period_low``, - ``tolerated_inactivity_period_high`` and - ``tolerated_inactivity_period_threshold``. The tolerated inactivity - period now depends on the delegate's stake ratio over the total - active stake. If the ratio is greater than the - ``tolerated_inactivity_period_threshold = 10`` (expressed in 'per - thousand'), we apply a low tolerance - ``tolerated_inactivity_period_low = 1``. Otherwise, we apply a high - tolerance ``tolerated_inactivity_period_high = 12``. If the stake is - unknown, we apply a low tolerance (e.g., after the delegate's - registration, reactivation, or decreasing its stake below - ``minimal_stake``). (MR :gl:`!17582`) - 6s Block Time (MR :gl:`!19045`) --------------------------------- -- GitLab From c8fd40b8073633fa933c2e462a672de95978e284 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:19:41 +0200 Subject: [PATCH 04/18] Revert "kaitai: update structs" This reverts commit b4755da3201918da187d42a1d507554f0336a20c. --- client-libs/kaitai-struct-files/files/alpha__constants.ksy | 6 +----- .../files/alpha__constants__parametric.ksy | 6 +----- client-libs/kaitai-struct-files/files/alpha__parameters.ksy | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/client-libs/kaitai-struct-files/files/alpha__constants.ksy b/client-libs/kaitai-struct-files/files/alpha__constants.ksy index cefc214bf6b6..7b998b07bf47 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants.ksy @@ -258,11 +258,7 @@ seq: type: u1 - id: delegate_parameters_activation_delay type: u1 -- id: tolerated_inactivity_period_high - type: u1 -- id: tolerated_inactivity_period_low - type: u1 -- id: tolerated_inactivity_period_threshold +- id: tolerated_inactivity_period type: u1 - id: blocks_per_cycle type: s4be diff --git a/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy b/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy index 87b9e4821d5e..d796274b7222 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy @@ -228,11 +228,7 @@ seq: type: u1 - id: delegate_parameters_activation_delay type: u1 -- id: tolerated_inactivity_period_high - type: u1 -- id: tolerated_inactivity_period_low - type: u1 -- id: tolerated_inactivity_period_threshold +- id: tolerated_inactivity_period type: u1 - id: blocks_per_cycle type: s4be diff --git a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy index b97351ef151a..760147f2fbba 100644 --- a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy @@ -506,11 +506,7 @@ seq: type: u1 - id: delegate_parameters_activation_delay type: u1 -- id: tolerated_inactivity_period_high - type: u1 -- id: tolerated_inactivity_period_low - type: u1 -- id: tolerated_inactivity_period_threshold +- id: tolerated_inactivity_period type: u1 - id: blocks_per_cycle type: s4be -- GitLab From f11e60d66c0a893ccc4212ce4ac4152d8ae11b11 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:21:19 +0200 Subject: [PATCH 05/18] Revert "Tezt/Tests: reset regressions" This reverts commit bf4917fbd1895cc599eac0f9bb83627005e5d958. --- ...- (mode client) RPC regression tests- delegates.out | 4 ++-- ...ode client) RPC regression tests- misc_protocol.out | 4 +--- ...a- (mode light) RPC regression tests- delegates.out | 4 ++-- ...mode light) RPC regression tests- misc_protocol.out | 4 +--- ...a- (mode proxy) RPC regression tests- delegates.out | 4 ++-- ...mode proxy) RPC regression tests- misc_protocol.out | 4 +--- ...th (baker - delegate - consensus - destination).out | 10 +++++----- ...h (baker - delegate - consensus -- destination).out | 10 +++++----- ...h (baker -- delegate - consensus - destination).out | 10 +++++----- ... (baker -- delegate - consensus -- destination).out | 10 +++++----- .../Alpha- Test register with consensus key.out | 4 ++-- ...pha- Test set consensus key - baker is delegate.out | 6 +++--- ... Test set consensus key - baker is not delegate.out | 6 +++--- ... Test following dal and baker tutorial commands.out | 2 +- .../weeklynet.ml/Alpha- weeklynet regression test.out | 4 +--- tezt/tests/weeklynet_configs/alpha.json | 4 +--- 16 files changed, 40 insertions(+), 50 deletions(-) diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out index 967f9a11d20a..99040169f154 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- delegates.out @@ -27,7 +27,7 @@ { "expected_assigned_shards_per_slot": 409, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "212680", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -73,7 +73,7 @@ false [ "[PUBLIC_KEY_HASH]" ] ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' -2 +3 ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' "4000000000000" diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out index dc9279135227..71bd7be0fdc9 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out @@ -11,9 +11,7 @@ "smart_rollup_max_number_of_messages_per_level": "1000000", "consensus_rights_delay": 1, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, - "tolerated_inactivity_period_high": 12, - "tolerated_inactivity_period_low": 1, - "tolerated_inactivity_period_threshold": 10, "blocks_per_cycle": 8, + "tolerated_inactivity_period": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1040000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out index d011a90b9a37..69f51408067c 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- delegates.out @@ -27,7 +27,7 @@ { "expected_assigned_shards_per_slot": 409, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "212680", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -73,7 +73,7 @@ false [ "[PUBLIC_KEY_HASH]" ] ./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' -2 +3 ./octez-client --mode light rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' "4000000000000" diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out index 8b8c2dd48933..c6f8fe3c3008 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out @@ -11,9 +11,7 @@ "smart_rollup_max_number_of_messages_per_level": "1000000", "consensus_rights_delay": 1, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, - "tolerated_inactivity_period_high": 12, - "tolerated_inactivity_period_low": 1, - "tolerated_inactivity_period_threshold": 10, "blocks_per_cycle": 8, + "tolerated_inactivity_period": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1040000", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out index 139d55caf65e..3bf5048ed0f0 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- delegates.out @@ -27,7 +27,7 @@ { "expected_assigned_shards_per_slot": 409, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "212680", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -73,7 +73,7 @@ false [ "[PUBLIC_KEY_HASH]" ] ./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' -2 +3 ./octez-client --mode proxy rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' "4000000000000" diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out index d5378e0bedd9..80fd8d6f220e 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out @@ -11,9 +11,7 @@ "smart_rollup_max_number_of_messages_per_level": "1000000", "consensus_rights_delay": 1, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 2, - "tolerated_inactivity_period_high": 12, - "tolerated_inactivity_period_low": 1, - "tolerated_inactivity_period_threshold": 10, "blocks_per_cycle": 8, + "tolerated_inactivity_period": 2, "blocks_per_cycle": 8, "blocks_per_commitment": 4, "nonce_revelation_threshold": 4, "cycles_per_voting_period": 8, "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "1040000", diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out index 58de931a6381..eb0a97ec31e9 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus - destination).out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -163,7 +163,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -254,7 +254,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "2652", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 3, + "denounced": false }, "grace_period": 4, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out index 38c1c3aa0c84..61839ead13d4 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker - delegate - consensus -- destination).out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -163,7 +163,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -254,7 +254,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "2652", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 3, + "denounced": false }, "grace_period": 4, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out index de18e2d7ea1f..f1bd85a9dbc8 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus - destination).out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -163,7 +163,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -254,7 +254,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "2652", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 3, + "denounced": false }, "grace_period": 4, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out index 7e0bf901c137..04770d690c6e 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test drain delegate with (baker -- delegate - consensus -- destination).out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -163,7 +163,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -254,7 +254,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "2652", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 3, + "denounced": false }, "grace_period": 4, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out index 213c47266aee..a6a9ac81d45d 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test register with consensus key.out @@ -87,7 +87,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 0, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "0", "sufficient_dal_participation": false, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -134,7 +134,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 0, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "0", "sufficient_dal_participation": false, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out index 20a4e3558d5e..9fee318e827e 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is delegate.out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out index 15c31dfa8718..997db597a783 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test set consensus key - baker is not delegate.out @@ -36,7 +36,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -77,7 +77,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 204, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "106080", "sufficient_dal_participation": true, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/dal.ml/Alpha- Test following dal and baker tutorial commands.out b/tezt/tests/expected/dal.ml/Alpha- Test following dal and baker tutorial commands.out index abbbcb3e2a4a..02e16155dd64 100644 --- a/tezt/tests/expected/dal.ml/Alpha- Test following dal and baker tutorial commands.out +++ b/tezt/tests/expected/dal.ml/Alpha- Test following dal and baker tutorial commands.out @@ -121,7 +121,7 @@ This sequence of operations was run: { "expected_assigned_shards_per_slot": 0, "delegate_attested_dal_slots": 0, "delegate_attestable_dal_slots": 0, "expected_dal_rewards": "0", "sufficient_dal_participation": false, - "denounced": false }, "grace_period": 2, + "denounced": false }, "grace_period": 3, "active_staking_parameters": { "limit_of_staking_over_baking_millionth": 0, "edge_of_baking_over_staking_billionth": 1000000000 }, diff --git a/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out b/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out index 3a08ff0e2280..bf24772678fa 100644 --- a/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out +++ b/tezt/tests/expected/weeklynet.ml/Alpha- weeklynet regression test.out @@ -2,9 +2,7 @@ ./octez-client rpc get /chains/main/blocks/head/context/constants/parametric { "consensus_rights_delay": 1, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 3, - "tolerated_inactivity_period_high": 1, - "tolerated_inactivity_period_low": 1, - "tolerated_inactivity_period_threshold": 10, "blocks_per_cycle": 200, + "tolerated_inactivity_period": 1, "blocks_per_cycle": 200, "blocks_per_commitment": 25, "nonce_revelation_threshold": 50, "cycles_per_voting_period": 1, "hard_gas_limit_per_operation": "1040000", "hard_gas_limit_per_block": "3328000", "proof_of_work_threshold": "-1", diff --git a/tezt/tests/weeklynet_configs/alpha.json b/tezt/tests/weeklynet_configs/alpha.json index 5153ab8162a2..4da1c9537b09 100644 --- a/tezt/tests/weeklynet_configs/alpha.json +++ b/tezt/tests/weeklynet_configs/alpha.json @@ -24,9 +24,7 @@ "consensus_rights_delay": 1, "blocks_preservation_cycles": 1, "delegate_parameters_activation_delay": 3, - "tolerated_inactivity_period_low": 1, - "tolerated_inactivity_period_high": 2, - "tolerated_inactivity_period_threshold": 10, + "tolerated_inactivity_period": 1, "blocks_per_cycle": 200, "blocks_per_commitment": 25, "nonce_revelation_threshold": 50, -- GitLab From 43255061fea542df07e590f8347140700c927f14 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:22:32 +0200 Subject: [PATCH 06/18] Revert "Tezt/Tests: increase tolerated_inactivity_period_low in some testing scenarios" This reverts commit 9abc075b159ce9141702b603e1106a3e22010f95. --- tezt/tests/adaptive_issuance.ml | 6 +----- tezt/tests/baker_test.ml | 8 -------- tezt/tests/voting.ml | 8 +------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/tezt/tests/adaptive_issuance.ml b/tezt/tests/adaptive_issuance.ml index 6da1910e8028..d5a50c8badd2 100644 --- a/tezt/tests/adaptive_issuance.ml +++ b/tezt/tests/adaptive_issuance.ml @@ -306,11 +306,7 @@ let test_staking = let overrides = (* TODO: https://gitlab.com/tezos/tezos/-/issues/7576 use a default value for [tolerated_inactivity_period] *) - ( [ - (if Protocol.(number protocol <= 023) then "tolerated_inactivity_period" - else "tolerated_inactivity_period_low"); - ], - `Int 3 ) + (["tolerated_inactivity_period"], `Int 3) :: (["issuance_weights"; "dal_rewards_weight"], `Int 0) :: default_overrides in diff --git a/tezt/tests/baker_test.ml b/tezt/tests/baker_test.ml index 234c363bc510..d597d63009b6 100644 --- a/tezt/tests/baker_test.ml +++ b/tezt/tests/baker_test.ml @@ -894,14 +894,6 @@ let attestations_aggregation_on_reproposal ~remote_mode protocol = (["minimal_block_delay"], `String "4"); (["delay_increment_per_round"], `String "0"); (["blocks_per_cycle"], `Int 2); - (* [blocks_per_cycle] is too short in this testing scenario, - so we increase [tolerated_inactivity_period] *) - ( [ - (if Protocol.(number protocol <= 023) then - "tolerated_inactivity_period" - else "tolerated_inactivity_period_low"); - ], - `Int 2 ); (["nonce_revelation_threshold"], `Int 1); (["consensus_rights_delay"], `Int consensus_rights_delay); (["cache_sampler_state_cycles"], `Int (consensus_rights_delay + 3)); diff --git a/tezt/tests/voting.ml b/tezt/tests/voting.ml index 2feb2abbbb7d..a22892d1612f 100644 --- a/tezt/tests/voting.ml +++ b/tezt/tests/voting.ml @@ -298,13 +298,7 @@ let test_voting ~from_protocol ~(to_protocol : target_protocol) ~loser_protocols let parameters = (* TODO: https://gitlab.com/tezos/tezos/-/issues/7576 use a default value for [tolerated_inactivity_period] *) - ( [ - (if Protocol.(number from_protocol <= 023) then - "tolerated_inactivity_period" - else "tolerated_inactivity_period_low"); - ], - `Int 3 ) - :: parameters + (["tolerated_inactivity_period"], `Int 3) :: parameters in let* parameter_file = -- GitLab From 2ba579ae5de58d047e9b24368bfc374d483ae7cc Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:23:21 +0200 Subject: [PATCH 07/18] Revert "Tezt/Test: update tolerated_inactivity migration test" This reverts commit 4782143e830eaa74c8dbb1745fa474b045b320c7. --- tezt/tests/protocol_migration.ml | 65 ++++++++++++++------------------ 1 file changed, 28 insertions(+), 37 deletions(-) diff --git a/tezt/tests/protocol_migration.ml b/tezt/tests/protocol_migration.ml index dfcddc47d931..b65b2b2231eb 100644 --- a/tezt/tests/protocol_migration.ml +++ b/tezt/tests/protocol_migration.ml @@ -2187,78 +2187,69 @@ let test_tolerated_inactivity_period () = in (* Migration at the end of C3: - - D0, D1, D2 are deactivated at the end of C4 -> C5 - - D3 is deactivated at the end of C5 -> C6 + - D0, D1, D2 are deactivated at the end of C4 -> C6 + - D3 is deactivated at the end of C5 -> C7 -------------------------[proto migration] - - D4 is deactivated at the end of C5 -> C6 - - D5 is deactivated at the end of C6 - - D6 is deactivated at the end of C7 - - D7 is deactivated at the end of C8 + - D4 is deactivated at the end of C6 -> C7 + - D5 is deactivated at the end of C7 + - D6 is deactivated at the end of C8 + - D7 is deactivated at the end of C9 Migration at the end of C4: - D0, D1, D2 are deactivated at the end of C4 - - D3 is deactivated at the end of C5 -> C6 - - D4 is deactivated at the end of C6 -> C7 + - D3 is deactivated at the end of C5 -> C7 + - D4 is deactivated at the end of C6 -> C8 -------------------------[proto migration] - - D5 is deactivated at the end of C6 -> C7 - - D6 is deactivated at the end of C7 - - D7 is deactivated at the end of C8 + - D5 is deactivated at the end of C7 -> C8 + - D6 is deactivated at the end of C8 + - D7 is deactivated at the end of C9 Migration at the end of C5: - D0, D1, D2 are deactivated at the end of C4 - D3 is deactivated at the end of C5 - - D4 is deactivated at the end of C6 -> C7 - - D5 is deactivated at the end of C7 -> C8 + - D4 is deactivated at the end of C6 -> C8 + - D5 is deactivated at the end of C7 -> C9 -------------------------[proto migration] - - D6 is deactivated at the end of C7 -> C8 - - D7 is deactivated at the end of C8 + - D6 is deactivated at the end of C8 -> C9 + - D7 is deactivated at the end of C9 *) let expected_list = match target_cycle with | 3 | 4 -> all_activated | 5 -> - (* Deactivated at the end of C4. Migration at the end of - - [migration_cycle = 4] C3: None - - [migration_cycle = 5] C4: D0, D1, D2 - - [migration_cycle = 6] C5: D0, D1, D2 *) let is_deactivated i = if i <= 2 then migration_cycle >= 5 else false in List.init 8 is_deactivated | 6 -> - (* Deactivated at the end of C5. Migration at the end of - - [migration_cycle = 4] C3: D0, D1, D2 - - [migration_cycle = 5] C4: D0, D1, D2 - - [migration_cycle = 6] C5: D0, D1, D2, D3 *) let is_deactivated i = - if i <= 2 then true + if i <= 2 then migration_cycle >= 5 else if i = 3 then migration_cycle >= 6 else false in List.init 8 is_deactivated | 7 -> - (* Deactivated at the end of C6. Migration at the end of - - [migration_cycle = 4] C3: D0, D1, D2, D3, D4, D5 - - [migration_cycle = 5] C4: D0, D1, D2, D3 - - [migration_cycle = 6] C5: D0, D1, D2, D3 *) let is_deactivated i = - if i <= 3 then true - else if i = 4 || i = 5 then migration_cycle = 4 + if i <= 2 then true + else if i = 3 then migration_cycle >= 6 else false in List.init 8 is_deactivated | 8 -> - (* Deactivated at the end of C7. Migration at the end of - - [migration_cycle = 4] C3: D0, D1, D2, D3, D4, D5, D6 - - [migration_cycle = 5] C4: D0, D1, D2, D3, D4, D5, D6 - - [migration_cycle = 6] C5: D0, D1, D2, D3, D4 *) let is_deactivated i = - if i <= 4 then true - else if i = 5 || i = 6 then migration_cycle <= 5 + if i <= 3 then true + else if i = 4 || i = 5 then migration_cycle = 4 else false in List.init 8 is_deactivated - | 9 | 10 -> all_deactivated + | 9 -> + let is_deactivated i = + if i = 5 || i = 6 then migration_cycle <= 5 + else if i = 7 then false + else true + in + List.init 8 is_deactivated + | 10 -> all_deactivated | _ -> failwith "unexpected input" in (* [default_baker] must be always active *) -- GitLab From 75a96580ea87b7bad99e0a1999fe405d96f22dcb Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:23:52 +0200 Subject: [PATCH 08/18] Revert "proto: remove unused tolerated_inactivity_period constant" This reverts commit 4c93d9af52dac45500c812277d497305a64ac52b. --- src/proto_alpha/lib_parameters/default_parameters.ml | 2 ++ src/proto_alpha/lib_protocol/alpha_context.mli | 1 + src/proto_alpha/lib_protocol/constants_parametric_repr.ml | 7 ++++++- src/proto_alpha/lib_protocol/constants_parametric_repr.mli | 1 + src/proto_alpha/lib_protocol/raw_context.ml | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index a99a5879776c..215f53cd77b6 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -286,6 +286,8 @@ let constants_mainnet : Constants.Parametric.t = [minimal_stake]). Last updated in protocol T. *) + (* to be removed *) + tolerated_inactivity_period = 2; tolerated_inactivity_period_high = 12; tolerated_inactivity_period_low = 1; (* threshold is in per thousand *) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 0161a2611eee..fee1e8645d77 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -929,6 +929,7 @@ module Constants : sig consensus_rights_delay : int; blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; + tolerated_inactivity_period : int; tolerated_inactivity_period_high : int; tolerated_inactivity_period_low : int; tolerated_inactivity_period_threshold : int; diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 068c5422a653..5e2440411c08 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -259,6 +259,7 @@ type t = { consensus_rights_delay : int; blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; + tolerated_inactivity_period : int; tolerated_inactivity_period_high : int; tolerated_inactivity_period_low : int; tolerated_inactivity_period_threshold : int; @@ -569,6 +570,7 @@ let encoding = ( ( ( c.consensus_rights_delay, c.blocks_preservation_cycles, c.delegate_parameters_activation_delay, + c.tolerated_inactivity_period, c.tolerated_inactivity_period_high, c.tolerated_inactivity_period_low, c.tolerated_inactivity_period_threshold ), @@ -617,6 +619,7 @@ let encoding = (fun ( ( ( consensus_rights_delay, blocks_preservation_cycles, delegate_parameters_activation_delay, + tolerated_inactivity_period, tolerated_inactivity_period_high, tolerated_inactivity_period_low, tolerated_inactivity_period_threshold ), @@ -667,6 +670,7 @@ let encoding = consensus_rights_delay; blocks_preservation_cycles; delegate_parameters_activation_delay; + tolerated_inactivity_period; tolerated_inactivity_period_high; tolerated_inactivity_period_low; tolerated_inactivity_period_threshold; @@ -715,10 +719,11 @@ let encoding = }) (merge_objs (merge_objs - (obj6 + (obj7 (req "consensus_rights_delay" uint8) (req "blocks_preservation_cycles" uint8) (req "delegate_parameters_activation_delay" uint8) + (req "tolerated_inactivity_period" uint8) (req "tolerated_inactivity_period_high" uint8) (req "tolerated_inactivity_period_low" uint8) (req "tolerated_inactivity_period_threshold" uint8)) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index c7b9deca3140..39311f40946a 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -211,6 +211,7 @@ type t = { keep them in its history. *) blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; + tolerated_inactivity_period : int; tolerated_inactivity_period_high : int; tolerated_inactivity_period_low : int; tolerated_inactivity_period_threshold : int; diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index a83689e43882..d769d9c02881 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1346,6 +1346,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = consensus_rights_delay; blocks_preservation_cycles; delegate_parameters_activation_delay; + tolerated_inactivity_period; tolerated_inactivity_period_high; tolerated_inactivity_period_low; tolerated_inactivity_period_threshold; @@ -1400,6 +1401,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = Constants_parametric_repr.consensus_rights_delay; blocks_preservation_cycles; delegate_parameters_activation_delay; + tolerated_inactivity_period; tolerated_inactivity_period_high; tolerated_inactivity_period_low; tolerated_inactivity_period_threshold; @@ -1782,6 +1784,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = Constants_parametric_repr.consensus_rights_delay; blocks_preservation_cycles; delegate_parameters_activation_delay; + tolerated_inactivity_period; tolerated_inactivity_period_high; tolerated_inactivity_period_low; tolerated_inactivity_period_threshold = 10; -- GitLab From d3e47e99a676208c0865582ce873dd6e282a2148 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:25:02 +0200 Subject: [PATCH 09/18] Revert "Proto/Tests: update tests with new tolerated inactivity period" This reverts commit bb5eb82b619a28c38ff1c1622a962a1437f1dedc. --- .../test/helpers/scenario_bake.ml | 9 ----- .../consensus/test_frozen_deposits.ml | 3 +- .../consensus/test_scenario_attestation.ml | 3 +- .../integration/test_scenario_deactivation.ml | 34 ++++++++++++++----- .../integration/test_scenario_slashing.ml | 6 +--- .../test/integration/test_scenario_stake.ml | 3 +- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml index 572443f0e848..1c1e1b345390 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml @@ -602,12 +602,3 @@ let wait_n_cycles_f (n_cycles : t -> int) = let open Lwt_result_syntax in let n_cycles n = return @@ n_cycles n in wait_n_cycles_f_es n_cycles - -let wait_tolerated_inactivity_period ?(cycle_offset = 0) name = - wait_n_cycles_f_es (fun (block, state) -> - let open Lwt_result_syntax in - let account = State.find_account name state in - let* tolerated_inactivity_period = - Scenario_activity.tolerated_inactivity_period ~block ~state account - in - return @@ (tolerated_inactivity_period + cycle_offset)) diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml index 79f51538bb7a..412bb3e831fa 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_frozen_deposits.ml @@ -454,8 +454,7 @@ let test_frozen_deposits_with_deactivation () = expected last cycles at which it is considered active and at which it has non-zero deposits *) let last_active_cycle = - (* at activation, accounts have a low tolerance grace period *) - constants.tolerated_inactivity_period_low + constants.consensus_rights_delay + constants.tolerated_inactivity_period + constants.consensus_rights_delay (* according to [Delegate_activation_storage.set_active] *) in let last_cycle_with_deposits = diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_scenario_attestation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_scenario_attestation.ml index c23e5bf60ed4..3040e90d6863 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_scenario_attestation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_scenario_attestation.ml @@ -340,9 +340,8 @@ let test_attestations_keep_activation_status = --> set_baker ~min_round:1 "baker" --> set_payload_round (Some 0) --> wait_n_cycles_f (fun (_, state) -> - (* at activation, accounts have a low tolerance grace period *) state.State.constants.consensus_rights_delay - + state.State.constants.tolerated_inactivity_period_low + 2) + + state.State.constants.tolerated_inactivity_period + 2) (* Check is still activated *) --> exec_unit (fun (block, state) -> let src = State.find_account "delegate" state in diff --git a/src/proto_alpha/lib_protocol/test/integration/test_scenario_deactivation.ml b/src/proto_alpha/lib_protocol/test/integration/test_scenario_deactivation.ml index 9fa749753370..680c5205f85c 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_scenario_deactivation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_scenario_deactivation.ml @@ -56,6 +56,25 @@ let check_cannot_bake_next_block ~loc src_name = let check_can_bake_next_block ~loc src_name = assert_success ~loc (next_block_with_baker src_name) +let check_grace_period ~loc src_name = + let open Lwt_result_syntax in + exec_unit @@ fun (block, state) -> + let src = State.find_account src_name state in + let last_seen_activity = Stdlib.Option.get src.last_seen_activity in + let grace = + Cycle.add + last_seen_activity + state.State.constants.tolerated_inactivity_period + in + let* rpc_grace = Context.Delegate.grace_period (B block) src.pkh in + Assert.equal + ( = ) + "Grace period is not correct: expected vs RPC" + ~loc + Cycle.pp + grace + rpc_grace + (** Test that a delegate gets deactivated after a set period of time if it is not baking. @@ -67,9 +86,8 @@ let test_simple_scenario = --> check_balance_field "delegate" `Staked (Tez.of_mutez 200_000_000_000L) --> set_baker "baker" --> wait_n_cycles_f (fun (_, state) -> - (* at activation, accounts have a low tolerance grace period *) state.State.constants.consensus_rights_delay - + state.State.constants.tolerated_inactivity_period_low) + + state.State.constants.tolerated_inactivity_period) --> check_balance_field "delegate" `Staked (Tez.of_mutez 200_000_000_000L) --> check_is_active ~loc:__LOC__ "delegate" --> next_cycle @@ -95,9 +113,8 @@ let test_baking_deactivation = --> begin_test ["delegate"; "baker"] --> unstake "delegate" All --> wait_n_cycles_f (fun (_, state) -> - (* at activation, accounts have a low tolerance grace period *) state.State.constants.consensus_rights_delay - + state.State.constants.tolerated_inactivity_period_low) + + state.State.constants.tolerated_inactivity_period) --> check_is_active ~loc:__LOC__ "delegate" --> next_cycle --> check_is_not_active ~loc:__LOC__ "delegate" @@ -117,7 +134,8 @@ let test_baking_deactivation = --> next_block_with_baker "delegate" (* Get deactivated by doing nothing *) --> set_baker "baker" - --> wait_tolerated_inactivity_period "delegate" + --> wait_n_cycles_f (fun (_, state) -> + state.State.constants.tolerated_inactivity_period) --> check_is_active ~loc:__LOC__ "delegate" --> next_cycle --> check_is_not_active ~loc:__LOC__ "delegate" @@ -135,14 +153,14 @@ let test_deactivation_timing = --> staked_balance_no_change --> (Tag "Delegate is never active" --> set_baker "baker" --> wait_n_cycles_f (fun (_, state) -> - (* at activation, accounts have a low tolerance grace period *) state.State.constants.consensus_rights_delay - + state.State.constants.tolerated_inactivity_period_low) + + state.State.constants.tolerated_inactivity_period) |+ Tag "Delegate is active for a few cycles" --> set_baker "delegate" --> wait_n_cycles_f (fun (_, state) -> state.State.constants.consensus_rights_delay + 1) --> set_baker "baker" - --> wait_tolerated_inactivity_period "delegate") + --> wait_n_cycles_f (fun (_, state) -> + state.State.constants.tolerated_inactivity_period)) --> exec bake_until_next_cycle_end_but_one --> check_is_active ~loc:__LOC__ "delegate" --> staked_balance_no_change --> next_block diff --git a/src/proto_alpha/lib_protocol/test/integration/test_scenario_slashing.ml b/src/proto_alpha/lib_protocol/test/integration/test_scenario_slashing.ml index 713fbb9a8d8a..e8bec9309ea1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_scenario_slashing.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_scenario_slashing.ml @@ -331,11 +331,7 @@ let test_slash_timing = stake to get unforbidden, see the comment in Protocol.Forbidden_delegates_storage.should_unforbid. *) --> stake "delegate" Half - (* With [tolerated_inactivity_period] = 1 and - [consensus_rights_delay] = 1, [delegate] is deactivated in the - end of cycle 2, before computing the consensus rights for cycle - 4, so [delegate] has no slots during cycle 4 *) - --> list_map_branched [0; 2; 3; 4] (fun i -> + --> list_map_branched [0; 1; 2; 3; 4] (fun i -> let i = Protocol.Constants_repr.slashing_delay + i in Tag (string_of_int i ^ " cycles lag") --> wait_n_cycles i) --> double_bake "delegate" diff --git a/src/proto_alpha/lib_protocol/test/integration/test_scenario_stake.ml b/src/proto_alpha/lib_protocol/test/integration/test_scenario_stake.ml index ac87a1d2215a..9afc52444c51 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_scenario_stake.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_scenario_stake.ml @@ -609,7 +609,8 @@ let test_deactivation_after_unstake_all = --> check_is_not_deactivated ~loc:__LOC__ "delegate" (* We already waited for [consensus_rights_delay] + 1 cycles since 0 stake, we must wait for [tolerated_inactivity_period - 1] more. *) - --> wait_tolerated_inactivity_period ~cycle_offset:(-1) "delegate" + --> wait_n_cycles_f (fun (_, state) -> + state.State.constants.tolerated_inactivity_period - 1) --> check_is_not_deactivated ~loc:__LOC__ "delegate" --> next_cycle --> check_is_deactivated ~loc:__LOC__ "delegate" -- GitLab From 9d34d837d30031e6a8a7b9bf21a5a94b0b4ba9a8 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:25:47 +0200 Subject: [PATCH 10/18] Revert "Proto/Tests: tolerated_inactivity_period depends on stake weight" This reverts commit bade9c1011e2ebcc6a1e2a5a5fe664696598eaed. --- .../test/helpers/scenario_activity.ml | 63 +++++-------------- .../test/helpers/scenario_attestation.ml | 20 +++--- .../test/helpers/scenario_bake.ml | 11 ++-- .../lib_protocol/test/helpers/scenario_op.ml | 10 +-- 4 files changed, 30 insertions(+), 74 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml index 40c03278292a..30598ac72833 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_activity.ml @@ -8,36 +8,10 @@ open State_account open State -let tolerated_inactivity_period ~block ~state account = - let open Lwt_result_syntax in - let tolerance_threshold = - state.State.constants.tolerated_inactivity_period_threshold - in - let tolerance_low = state.State.constants.tolerated_inactivity_period_low in - let tolerance_high = state.State.constants.tolerated_inactivity_period_high in - let current_cycle = Block.current_cycle block in - if Cycle.(current_cycle = root) then return tolerance_low - else - let+ total_stake, delegate_stake = - Context.Delegate.stake_info (B block) ~manager_pkh:account.pkh - in - match delegate_stake with - | None -> tolerance_low - | Some delegate_stake -> - let compare_stake_ratio_with_threshold = - Int64.( - compare - (div (mul 1000L delegate_stake) total_stake) - (of_int tolerance_threshold)) - in - if Compare.Int.(compare_stake_ratio_with_threshold > 0) then - tolerance_low - else tolerance_high - -let is_inactive ~block ~state current_activity_cycle account = - let open Lwt_result_syntax in - let+ tolerated_inactivity_period = - tolerated_inactivity_period ~block ~state account +let is_inactive constants current_activity_cycle account = + let tolerated_inactivity_period = + constants + .Protocol.Alpha_context.Constants.Parametric.tolerated_inactivity_period in match account.last_seen_activity with | None -> assert false (* delegates have a minimum activity cycle *) @@ -46,26 +20,20 @@ let is_inactive ~block ~state current_activity_cycle account = add last_seen_activity_cycle tolerated_inactivity_period < current_activity_cycle) -let update_activity_account ~block ~state current_activity_cycle name = - let open Lwt_result_syntax in +let update_activity_account constants current_activity_cycle account = let consensus_rights_delay = - state.constants - .Protocol.Alpha_context.Constants.Parametric.consensus_rights_delay + constants.Protocol.Alpha_context.Constants.Parametric.consensus_rights_delay in - let account = State.find_account name state in - let+ last_seen_activity = + let last_seen_activity = (* When a delegate is initialized or reactivated (either from [set_delegate] or participating in the consensus again), we put extra [consensus_rights_delay] cycles in the future to account for its extended grace period *) match account.last_seen_activity with - | None -> return @@ Cycle.add current_activity_cycle consensus_rights_delay + | None -> Cycle.add current_activity_cycle consensus_rights_delay | Some last_seen_activity_cycle -> - let+ is_inactive = - is_inactive ~block ~state current_activity_cycle account - in let updated = - if is_inactive then + if is_inactive constants current_activity_cycle account then Cycle.add current_activity_cycle consensus_rights_delay else current_activity_cycle in @@ -73,11 +41,8 @@ let update_activity_account ~block ~state current_activity_cycle name = in {account with last_seen_activity = Some last_seen_activity} -let update_activity ~block ~state current_activity_cycle name : - State.t tzresult Lwt.t = - let open Lwt_result_syntax in - let+ baker_acc = - update_activity_account ~block ~state current_activity_cycle name - in - let account_map = String.Map.add name baker_acc state.account_map in - {state with account_map} +let update_activity name state current_activity_cycle : State.t = + State.update_account_f + name + (update_activity_account state.constants current_activity_cycle) + state diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_attestation.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_attestation.ml index f4bcf5f2a091..7f012a6bc74b 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_attestation.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_attestation.ml @@ -12,12 +12,8 @@ open Log_helpers open Scenario_base open Protocol -let update_activity name block state : State.t tzresult Lwt.t = - Scenario_activity.update_activity - ~block - ~state - (Block.cycle_of_next_block block) - name +let update_activity name block state : State.t = + Scenario_activity.update_activity name state (Block.cycle_of_next_block block) type kind = Preattestation | Attestation @@ -274,7 +270,7 @@ let attest_with ?dal_content (delegate_name : string) : (t, t) scenarios = (* Fails to produce an attestation if the delegate has no slot for the block *) let* op = Op.attestation ?dal_content ~manager_pkh:delegate.pkh block in (* Update the activity of the delegate *) - let* state = update_activity delegate_name block state in + let state = update_activity delegate_name block state in let state = State.add_pending_operations [op] state in (* Check metadata *) let state = @@ -326,7 +322,7 @@ let attest_aggreg_with ?(delegates_with_dal = ([] : (string * Z.t) list)) else failwith "Cannot aggregate with non-BLS key" in (* Update the activity of the committee *) - let* state = update_activity delegate_name block state in + let state = update_activity delegate_name block state in let* attesting_slot = Op.get_attesting_slot_of_delegate ~manager_pkh:delegate.pkh @@ -410,7 +406,7 @@ let attest_with_all_ : t -> t tzresult Lwt.t = let delegate_name, _ = State.find_account_from_pkh manager_pkh state in - let* state = update_activity delegate_name block state in + let state = update_activity delegate_name block state in if state.constants.aggregate_attestation && Signature.Public_key_hash.is_bls consensus_pkh @@ -503,7 +499,7 @@ let preattest_with ?payload_round (delegate_name : string) : (* Fails to produce an attestation if the delegate has no slot for the block *) let* op = Op.preattestation ~manager_pkh:delegate.pkh fake_block in (* Update the activity of the delegate *) - let* state = + let state = update_activity delegate_name (Incremental.predecessor incr) state in (* Check metadata *) @@ -549,7 +545,7 @@ let preattest_aggreg_with ?payload_round (delegates : string list) : else failwith "Cannot aggregate non-BLS preattestation" in (* Update the activity of the committee *) - let* state = + let state = update_activity delegate_name (Incremental.predecessor incr) @@ -633,7 +629,7 @@ let preattest_with_all_ ?payload_round : t_incr -> t_incr tzresult Lwt.t = let delegate_name, _ = State.find_account_from_pkh manager_pkh state in - let* state = + let state = update_activity delegate_name (Incremental.predecessor incr) state in if diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml index 1c1e1b345390..efc55c14d62f 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_bake.ml @@ -152,8 +152,8 @@ let check_misc _full_metadata (block, state) : unit tzresult Lwt.t = if not (Block.last_block_of_cycle block) then current_cycle else Cycle.succ current_cycle in - let* deactivated = - Scenario_activity.is_inactive ~block ~state ctxt_cycle account + let deactivated = + Scenario_activity.is_inactive state.constants ctxt_cycle account in let*! r3 = Assert.equal_bool ~loc:__LOC__ deactivated deactivated_rpc @@ -332,12 +332,11 @@ let finalize_block_ : t_incr -> t tzresult Lwt.t = let baker = Incremental.delegate i in let baker_name, _ = State.find_account_from_pkh baker.pkh state in (* Update baker activity *) - let* state = + let state = Scenario_activity.update_activity - ~block - ~state - (Block.current_cycle block) baker_name + state + (Block.current_cycle block) in let* () = check_ai_launch_cycle_is_zero ~loc:__LOC__ block in let* state = State.apply_rewards ~baker:baker_name block state in diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_op.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_op.ml index bf05adda4e7f..c1095ea689ca 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_op.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_op.ml @@ -163,16 +163,12 @@ let set_delegate src_name delegate_name_opt : (t, t) scenarios = in let state = State.update_delegate src_name delegate_name_opt state in (* update delegate activation status *) - let* state = + let state = (* if self delegating *) if Option.equal String.equal delegate_name_opt (Some src_name) then let activity_cycle = current_cycle in - Scenario_activity.update_activity - ~block - ~state - activity_cycle - src_name - else return state + Scenario_activity.update_activity src_name state activity_cycle + else state in return (state, [operation])) -- GitLab From 4305367ea1bc4ccf38bb0cf7d9af02a44ecf0154 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:50:01 +0200 Subject: [PATCH 11/18] Revert "proto/delegate_activation: apply differentiated tolerance for inactivity" This reverts commit 1c009d08f4351f7ff0608184e56ed6f34facfd41. This commit also reverts some changes introduced in !19134 --- devtools/yes_wallet/get_delegates_alpha.ml | 6 +- .../lib_plugin/delegate_services.ml | 18 ++-- .../lib_protocol/alpha_context.mli | 7 +- .../lib_protocol/constants_storage.ml | 5 ++ .../lib_protocol/constants_storage.mli | 4 + .../delegate_activation_storage.ml | 84 +++---------------- .../delegate_activation_storage.mli | 8 +- .../lib_protocol/delegate_cycles.ml | 2 +- .../lib_protocol/delegate_storage.ml | 4 +- src/proto_alpha/lib_protocol/stake_storage.ml | 8 +- 10 files changed, 37 insertions(+), 109 deletions(-) diff --git a/devtools/yes_wallet/get_delegates_alpha.ml b/devtools/yes_wallet/get_delegates_alpha.ml index 4b2cc23624e2..28008403e93e 100644 --- a/devtools/yes_wallet/get_delegates_alpha.ml +++ b/devtools/yes_wallet/get_delegates_alpha.ml @@ -122,11 +122,7 @@ module Get_delegates = struct |> Lwt.map Environment.wrap_tzresult let deactivated ctxt pkh = - let open Lwt_result_syntax in - let* _ctxt, deactivated = - deactivated ctxt pkh |> Lwt.map Environment.wrap_tzresult - in - return deactivated + deactivated ctxt pkh |> Lwt.map Environment.wrap_tzresult let consensus_keys ctxt pkh : (Signature.public_key * Signature.public_key list) tzresult Lwt.t = diff --git a/src/proto_alpha/lib_plugin/delegate_services.ml b/src/proto_alpha/lib_plugin/delegate_services.ml index e02908cb1a53..ef8b96b4d6bb 100644 --- a/src/proto_alpha/lib_plugin/delegate_services.ml +++ b/src/proto_alpha/lib_plugin/delegate_services.ml @@ -1300,7 +1300,7 @@ let f_total_currently_staked ctxt = let info ctxt pkh = let open Lwt_result_syntax in (* General baking information *) - let* ctxt, deactivated = Delegate.deactivated ctxt pkh in + let* deactivated = Delegate.deactivated ctxt pkh in let is_forbidden = Delegate.is_forbidden_delegate ctxt pkh in let* participation = Delegate.For_RPC.participation_info ctxt pkh in let* dal_participation = @@ -1314,7 +1314,7 @@ let info ctxt pkh = return_some dal_participation else return_none in - let* ctxt, grace_period = Delegate.last_cycle_before_deactivation ctxt pkh in + let* grace_period = Delegate.last_cycle_before_deactivation ctxt pkh in let* active_staking_parameters = Delegate.Staking_parameters.of_delegate ctxt pkh in @@ -1416,15 +1416,11 @@ let register () = | {active = true; inactive = false; _} -> List.filter_es (fun pkh -> - let+ _ctxt, deactivated = Delegate.deactivated ctxt pkh in + let+ deactivated = Delegate.deactivated ctxt pkh in not deactivated) delegates | {active = false; inactive = true; _} -> - List.filter_es - (fun pkh -> - let+ _ctxt, deactivated = Delegate.deactivated ctxt pkh in - deactivated) - delegates + List.filter_es (fun pkh -> Delegate.deactivated ctxt pkh) delegates | {active = false; inactive = false; _} (* This case is counter-intuitive, but it represents the default behavior, when no arguments are given *) | {active = true; inactive = true; _} -> @@ -1497,12 +1493,10 @@ let register () = ~delegate:pkh) ; register1 ~chunked:false S.deactivated (fun ctxt pkh () () -> let* () = check_delegate_registered ctxt pkh in - let+ _ctxt, deactivated = Delegate.deactivated ctxt pkh in - deactivated) ; + Delegate.deactivated ctxt pkh) ; register1 ~chunked:false S.grace_period (fun ctxt pkh () () -> let* () = check_delegate_registered ctxt pkh in - let+ _ctxt, lcbd = Delegate.last_cycle_before_deactivation ctxt pkh in - lcbd) ; + Delegate.last_cycle_before_deactivation ctxt pkh) ; register1 ~chunked:false S.current_voting_power (fun ctxt pkh () () -> let* () = check_delegate_registered ctxt pkh in Vote.get_current_voting_power_free ctxt pkh) ; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index fee1e8645d77..f2e5a3f0689e 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -1013,6 +1013,8 @@ module Constants : sig val delegate_parameters_activation_delay : context -> int + val tolerated_inactivity_period : context -> int + val slashable_deposits_period : context -> int (** See {!Constants_storage.unstake_finalization_delay}. *) @@ -2421,15 +2423,14 @@ module Delegate : sig val registered : context -> public_key_hash -> bool Lwt.t - val deactivated : - context -> public_key_hash -> (context * bool) tzresult Lwt.t + val deactivated : context -> public_key_hash -> bool tzresult Lwt.t (** See {!Forbidden_delegates_storage.is_forbidden}. *) val is_forbidden_delegate : t -> public_key_hash -> bool (** See {!Delegate_activation_storage.last_cycle_before_deactivation}. *) val last_cycle_before_deactivation : - context -> public_key_hash -> (context * Cycle.t) tzresult Lwt.t + context -> public_key_hash -> Cycle.t tzresult Lwt.t module Consensus_key : sig val check_not_tz4 : diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 082cfece25b9..179e7b3b7b83 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -54,6 +54,11 @@ let tolerated_inactivity_period_low c = let constants = Raw_context.constants c in constants.tolerated_inactivity_period_low +(* temporary, to introduce new constants incrementally *) +let tolerated_inactivity_period c = + let constants = Raw_context.constants c in + constants.tolerated_inactivity_period + let tolerated_inactivity_period_threshold c = let constants = Raw_context.constants c in constants.tolerated_inactivity_period_threshold diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 61f81fd3fe06..a945432b34ff 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -155,6 +155,10 @@ val direct_ticket_spending_enable : Raw_context.t -> bool val allow_tz4_delegate_enable : Raw_context.t -> bool +(** Temporary value to be removed when discriminated inactivity tolerance is + implemented *) +val tolerated_inactivity_period : Raw_context.t -> int + (** Tolerated period of inactivity, in cycles, before a delegate is deactivated *) val tolerated_inactivity_period_high : Raw_context.t -> int diff --git a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml index 1b81194cd6bd..0f08ca1ba523 100644 --- a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml @@ -23,68 +23,6 @@ (* *) (*****************************************************************************) -(** Tolerated inactivity period depends on the delegate's stake ratio - over the total active stake. - - If the stake is unknown, it means that the baker had no staking - rights for the current cycle. In this case, the call to - [set_active] is subsequent to a delegate registration or - reactivation. As we do not know its future weight in the - consensus, we take a conservative approach and assign it a low - tolerance [tolerated_inactivity_period_low]. - - If the ratio is greater than the threshold (expressed in 'per - thousand'), we apply a low tolerance. Otherwise, we apply a high - tolerance. *) -let tolerated_inactivity_period ctxt delegate = - let open Lwt_result_syntax in - let tolerance_threshold = - Constants_storage.tolerated_inactivity_period_threshold ctxt - in - let tolerance_low = Constants_storage.tolerated_inactivity_period_low ctxt in - let tolerance_high = - Constants_storage.tolerated_inactivity_period_high ctxt - in - let current_cycle = Cycle_storage.current ctxt in - if Cycle_repr.(current_cycle = root) then - (* There is no selected distribution at chain initialisation, so - we give a low tolerance *) - return (ctxt, tolerance_low) - else - let* ctxt, delegates_stakes = - Selected_distribution_storage.get_selected_distribution ctxt current_cycle - in - match - List.assoc - ~equal:Signature.Public_key_hash.equal - delegate - delegates_stakes - with - | None -> - (* There is no stake registered at - - a first delegate registration - - a delegate reactivation - - after decreasing its stake below [minimal_stake] - so we give a low tolerance *) - return (ctxt, tolerance_low) - | Some delegate_stake -> - let+ total_stake = - Selected_distribution_storage.get_total_active_stake - ctxt - current_cycle - in - let compare_stake_ratio_with_threshold = - Int64.( - compare - (div - (mul 1000L (Stake_repr.staking_weight delegate_stake)) - (Stake_repr.staking_weight total_stake)) - (of_int tolerance_threshold)) - in - if Compare.Int.(compare_stake_ratio_with_threshold > 0) then - (ctxt, tolerance_low) - else (ctxt, tolerance_high) - let is_inactive ctxt delegate = let open Lwt_result_syntax in let*! inactive = @@ -92,42 +30,42 @@ let is_inactive ctxt delegate = ctxt (Contract_repr.Implicit delegate) in - if inactive then return (ctxt, inactive) + if inactive then return inactive else - let* cycle_opt = + let+ cycle_opt = Storage.Contract.Delegate_last_cycle_before_deactivation.find ctxt (Contract_repr.Implicit delegate) in - let+ ctxt, tolerance = tolerated_inactivity_period ctxt delegate in + let tolerance = Constants_storage.tolerated_inactivity_period ctxt in match cycle_opt with | Some last_active_cycle -> let ({Level_repr.cycle = current_cycle; _} : Level_repr.t) = Raw_context.current_level ctxt in - (ctxt, Cycle_repr.(add last_active_cycle tolerance < current_cycle)) + Cycle_repr.(add last_active_cycle tolerance < current_cycle) | None -> (* This case is only when called from `set_active`, when creating a contract. *) - (ctxt, false) + false let last_cycle_before_deactivation ctxt delegate = let open Lwt_result_syntax in - let* ctxt, tolerance = tolerated_inactivity_period ctxt delegate in + let tolerance = Constants_storage.tolerated_inactivity_period ctxt in let contract = Contract_repr.Implicit delegate in let+ cycle = Storage.Contract.Delegate_last_cycle_before_deactivation.get ctxt contract in (* we give [tolerance] cycles to the delegate after its last active cycle before it can be deactivated *) - (ctxt, Cycle_repr.add cycle tolerance) + Cycle_repr.add cycle tolerance let set_inactive ctxt delegate = Storage.Contract.Inactive_delegate.add ctxt (Contract_repr.Implicit delegate) let set_active ctxt delegate = let open Lwt_result_syntax in - let* ctxt, inactive = is_inactive ctxt delegate in + let* inactive = is_inactive ctxt delegate in let current_cycle = (Raw_context.current_level ctxt).cycle in let consensus_rights_delay = Constants_storage.consensus_rights_delay ctxt in let delegate_contract = Contract_repr.Implicit delegate in @@ -136,18 +74,18 @@ let set_active ctxt delegate = ctxt delegate_contract in - let ctxt, last_active_cycle = + let last_active_cycle = (* if the delegate is new or inactive, we give it additionally [consensus_rights_delay] because the delegate needs this number of cycles to receive the rights *) match current_last_active_cycle with - | None -> (ctxt, Cycle_repr.add current_cycle consensus_rights_delay) + | None -> Cycle_repr.add current_cycle consensus_rights_delay | Some current_last_active_cycle -> let updated = if inactive then Cycle_repr.add current_cycle consensus_rights_delay else current_cycle in - (ctxt, Cycle_repr.max current_last_active_cycle updated) + Cycle_repr.max current_last_active_cycle updated in let*! ctxt = Storage.Contract.Delegate_last_cycle_before_deactivation.add diff --git a/src/proto_alpha/lib_protocol/delegate_activation_storage.mli b/src/proto_alpha/lib_protocol/delegate_activation_storage.mli index 9607173db0eb..ed30e8e2974d 100644 --- a/src/proto_alpha/lib_protocol/delegate_activation_storage.mli +++ b/src/proto_alpha/lib_protocol/delegate_activation_storage.mli @@ -39,16 +39,12 @@ rights yet during the first [consensus_rights_delay] cycles *) val is_inactive : - Raw_context.t -> - Signature.Public_key_hash.t -> - (Raw_context.t * bool) tzresult Lwt.t + Raw_context.t -> Signature.Public_key_hash.t -> bool tzresult Lwt.t (** [last_cycle_before_deactivation ctxt delegate] is the cycle at which the delegate is scheduled to become inactive. *) val last_cycle_before_deactivation : - Raw_context.t -> - Signature.Public_key_hash.t -> - (Raw_context.t * Cycle_repr.t) tzresult Lwt.t + Raw_context.t -> Signature.Public_key_hash.t -> Cycle_repr.t tzresult Lwt.t (** [set_inactive context delegate] adds [delegate] to the set of inactive contracts. *) diff --git a/src/proto_alpha/lib_protocol/delegate_cycles.ml b/src/proto_alpha/lib_protocol/delegate_cycles.ml index 8e7805228bce..2a0bdad18cf4 100644 --- a/src/proto_alpha/lib_protocol/delegate_cycles.ml +++ b/src/proto_alpha/lib_protocol/delegate_cycles.ml @@ -39,7 +39,7 @@ let update_activity ctxt last_cycle = ~init:(Ok (ctxt, [])) ~f:(fun delegate acc -> let*? ctxt, deactivated = acc in - let* ctxt, cycle = + let* cycle = Delegate_activation_storage.last_cycle_before_deactivation ctxt delegate diff --git a/src/proto_alpha/lib_protocol/delegate_storage.ml b/src/proto_alpha/lib_protocol/delegate_storage.ml index b529ea3e9c9f..1f259f11ce25 100644 --- a/src/proto_alpha/lib_protocol/delegate_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_storage.ml @@ -120,9 +120,7 @@ module Contract = struct let open Lwt_result_syntax in let*! is_registered = registered c delegate in if is_registered then - let* c, is_inactive = - Delegate_activation_storage.is_inactive c delegate - in + let* is_inactive = Delegate_activation_storage.is_inactive c delegate in let* () = fail_unless is_inactive Active_delegate in Stake_storage.set_active c delegate else diff --git a/src/proto_alpha/lib_protocol/stake_storage.ml b/src/proto_alpha/lib_protocol/stake_storage.ml index 4ff6c4debaf3..12fcad37c15c 100644 --- a/src/proto_alpha/lib_protocol/stake_storage.ml +++ b/src/proto_alpha/lib_protocol/stake_storage.ml @@ -68,9 +68,7 @@ let update_stake ~f ctxt delegate = match (had_minimal_stake_before, has_minimal_stake_after) with | true, false -> (* Decrease below the minimal stake. *) - let* ctxt, inactive = - Delegate_activation_storage.is_inactive ctxt delegate - in + let* inactive = Delegate_activation_storage.is_inactive ctxt delegate in if inactive then (* The delegate is inactive so it wasn't in the set and we don't need to update it. *) @@ -82,9 +80,7 @@ let update_stake ~f ctxt delegate = return ctxt | false, true -> (* Increase above the minimal stake. *) - let* ctxt, inactive = - Delegate_activation_storage.is_inactive ctxt delegate - in + let* inactive = Delegate_activation_storage.is_inactive ctxt delegate in if inactive then (* The delegate is inactive so we don't need to add it to the set. *) -- GitLab From 03578a523254775742c33f5e73df83679d0a1989 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 18:59:13 +0200 Subject: [PATCH 12/18] Revert "proto/tests: adapt period correlation test" This reverts commit cb91f280f39911e3e4ae118e7d46e718f96e125e. --- .../test/integration/test_constants.ml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml index aa7e2f4ea8e6..70769f548db5 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml @@ -193,22 +193,12 @@ let () = ~duration:(Days 5l) let () = - register_test ~title:"tolerated inactivity period is 2 days for small bakers" - @@ fun () -> - let constants = Default_parameters.constants_mainnet in - check_protocol_time_correlation - ~constants - ~cycles:(Int32.of_int constants.tolerated_inactivity_period_high) - ~duration:(Days 2l) - -let () = - register_test ~title:"tolerated inactivity period is 4 hours for big bakers" - @@ fun () -> + register_test ~title:"tolerated inactivity period is 8 hours" @@ fun () -> let constants = Default_parameters.constants_mainnet in check_protocol_time_correlation ~constants - ~cycles:(Int32.of_int constants.tolerated_inactivity_period_low) - ~duration:(Hours 4l) + ~cycles:(Int32.of_int constants.tolerated_inactivity_period) + ~duration:(Hours 8l) let () = register_test ~title:"Nonce commitment per cycle is above 128" @@ fun () -> -- GitLab From 2aadcbe71d2a14081ee315a9c524b3aeae5c74fe Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 19:03:10 +0200 Subject: [PATCH 13/18] Revert "proto: add new parametric constants tolerated_inactivity_period_(high|low|threshold)" This reverts commit 24eb2d0d55a6c7593b055a3f7745282d907ea2df. --- .../lib_parameters/default_parameters.ml | 17 +---------- .../lib_protocol/alpha_context.mli | 3 -- .../lib_protocol/constants_parametric_repr.ml | 23 +++------------ .../constants_parametric_repr.mli | 3 -- .../lib_protocol/constants_storage.ml | 15 +--------- .../lib_protocol/constants_storage.mli | 10 +------ src/proto_alpha/lib_protocol/raw_context.ml | 29 +++---------------- 7 files changed, 11 insertions(+), 89 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 215f53cd77b6..ff41684fdcf8 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -275,23 +275,8 @@ let constants_mainnet : Constants.Parametric.t = first [consensus_rights_delay] cycles, so of course the chain will not witness any activity from it then. - [tolerated_inactivity_period] depends on the delegate's stake - ratio over the total active stake. If the ratio is greater than - the [tolerated_inactivity_period_threshold] (expressed in 'per - thousand'), we apply a low tolerance - [tolerated_inactivity_period_low]. Otherwise, we apply a high - tolerance [tolerated_inactivity_period_high]. If the stake is - unknown, we apply a low tolerance (e.g., after the delegate's - registration, reactivation, or decreasing its stake below - [minimal_stake]). - - Last updated in protocol T. *) - (* to be removed *) + Last updated in protocol R. *) tolerated_inactivity_period = 2; - tolerated_inactivity_period_high = 12; - tolerated_inactivity_period_low = 1; - (* threshold is in per thousand *) - tolerated_inactivity_period_threshold = 10; (* [blocks_per_cycle] is the duration of a cycle in number of blocks. Multiply it by [minimal_block_delay] to get the minimal duration of a cycle in seconds. diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index f2e5a3f0689e..371a7a86efad 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -930,9 +930,6 @@ module Constants : sig blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; tolerated_inactivity_period : int; - tolerated_inactivity_period_high : int; - tolerated_inactivity_period_low : int; - tolerated_inactivity_period_threshold : int; blocks_per_cycle : int32; blocks_per_commitment : int32; nonce_revelation_threshold : int32; diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 5e2440411c08..4ee710afe937 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -260,9 +260,6 @@ type t = { blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; tolerated_inactivity_period : int; - tolerated_inactivity_period_high : int; - tolerated_inactivity_period_low : int; - tolerated_inactivity_period_threshold : int; blocks_per_cycle : int32; blocks_per_commitment : int32; nonce_revelation_threshold : int32; @@ -570,10 +567,7 @@ let encoding = ( ( ( c.consensus_rights_delay, c.blocks_preservation_cycles, c.delegate_parameters_activation_delay, - c.tolerated_inactivity_period, - c.tolerated_inactivity_period_high, - c.tolerated_inactivity_period_low, - c.tolerated_inactivity_period_threshold ), + c.tolerated_inactivity_period ), ( c.blocks_per_cycle, c.blocks_per_commitment, c.nonce_revelation_threshold, @@ -619,10 +613,7 @@ let encoding = (fun ( ( ( consensus_rights_delay, blocks_preservation_cycles, delegate_parameters_activation_delay, - tolerated_inactivity_period, - tolerated_inactivity_period_high, - tolerated_inactivity_period_low, - tolerated_inactivity_period_threshold ), + tolerated_inactivity_period ), ( blocks_per_cycle, blocks_per_commitment, nonce_revelation_threshold, @@ -671,9 +662,6 @@ let encoding = blocks_preservation_cycles; delegate_parameters_activation_delay; tolerated_inactivity_period; - tolerated_inactivity_period_high; - tolerated_inactivity_period_low; - tolerated_inactivity_period_threshold; blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; @@ -719,14 +707,11 @@ let encoding = }) (merge_objs (merge_objs - (obj7 + (obj4 (req "consensus_rights_delay" uint8) (req "blocks_preservation_cycles" uint8) (req "delegate_parameters_activation_delay" uint8) - (req "tolerated_inactivity_period" uint8) - (req "tolerated_inactivity_period_high" uint8) - (req "tolerated_inactivity_period_low" uint8) - (req "tolerated_inactivity_period_threshold" uint8)) + (req "tolerated_inactivity_period" uint8)) (obj8 (req "blocks_per_cycle" int32) (req "blocks_per_commitment" int32) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index 39311f40946a..152721db2884 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -212,9 +212,6 @@ type t = { blocks_preservation_cycles : int; delegate_parameters_activation_delay : int; tolerated_inactivity_period : int; - tolerated_inactivity_period_high : int; - tolerated_inactivity_period_low : int; - tolerated_inactivity_period_threshold : int; blocks_per_cycle : int32; blocks_per_commitment : int32; nonce_revelation_threshold : int32; diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 179e7b3b7b83..823fe2c7c31f 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -45,24 +45,11 @@ let adaptive_issuance_activation_delay c = let constants = Raw_context.constants c in 1 + constants.consensus_rights_delay + Constants_repr.slashing_delay + 1 -(** Tolerated inactivity periods for delegates before being deactivated. *) -let tolerated_inactivity_period_high c = - let constants = Raw_context.constants c in - constants.tolerated_inactivity_period_high - -let tolerated_inactivity_period_low c = - let constants = Raw_context.constants c in - constants.tolerated_inactivity_period_low - -(* temporary, to introduce new constants incrementally *) +(** Tolerated inactivity period for delegates before being deactivated. *) let tolerated_inactivity_period c = let constants = Raw_context.constants c in constants.tolerated_inactivity_period -let tolerated_inactivity_period_threshold c = - let constants = Raw_context.constants c in - constants.tolerated_inactivity_period_threshold - (** Number of cycles during which a misbehavior of the delegate will induce a slashing of the funds that are currently in its frozen deposits. *) let slashable_deposits_period c = diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index a945432b34ff..41e341743c66 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -155,17 +155,9 @@ val direct_ticket_spending_enable : Raw_context.t -> bool val allow_tz4_delegate_enable : Raw_context.t -> bool -(** Temporary value to be removed when discriminated inactivity tolerance is - implemented *) -val tolerated_inactivity_period : Raw_context.t -> int - (** Tolerated period of inactivity, in cycles, before a delegate is deactivated *) -val tolerated_inactivity_period_high : Raw_context.t -> int - -val tolerated_inactivity_period_low : Raw_context.t -> int - -val tolerated_inactivity_period_threshold : Raw_context.t -> int +val tolerated_inactivity_period : Raw_context.t -> int (* attestation aggregation feature flag *) val aggregate_attestation : Raw_context.t -> bool diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index d769d9c02881..fb41195a5507 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1061,7 +1061,6 @@ type cycle_duration_delays = { blocks_per_cycle : int32; delegate_parameters_activation_delay : int; cycles_per_voting_period : int32; - tolerated_inactivity_period : int; blocks_per_commitment : int32; nonce_revelation_threshold : int32; vdf_difficulty : int64; @@ -1108,16 +1107,10 @@ let new_constants_four_hours_cycles ~preserve_duration_in_days let cycles_per_voting_period = preserve_duration previous_delays.cycles_per_voting_period in - let tolerated_inactivity_period = - Int32.to_int - @@ preserve_duration - (Int32.of_int previous_delays.tolerated_inactivity_period) - in { blocks_per_cycle; delegate_parameters_activation_delay; cycles_per_voting_period; - tolerated_inactivity_period; blocks_per_commitment; nonce_revelation_threshold; vdf_difficulty; @@ -1347,9 +1340,6 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = blocks_preservation_cycles; delegate_parameters_activation_delay; tolerated_inactivity_period; - tolerated_inactivity_period_high; - tolerated_inactivity_period_low; - tolerated_inactivity_period_threshold; blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; @@ -1402,9 +1392,6 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = blocks_preservation_cycles; delegate_parameters_activation_delay; tolerated_inactivity_period; - tolerated_inactivity_period_high; - tolerated_inactivity_period_low; - tolerated_inactivity_period_threshold; blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; @@ -1729,7 +1716,6 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = blocks_per_cycle; delegate_parameters_activation_delay; cycles_per_voting_period; - tolerated_inactivity_period; blocks_per_commitment; nonce_revelation_threshold; vdf_difficulty; @@ -1739,7 +1725,6 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = blocks_per_cycle; blocks_per_commitment; delegate_parameters_activation_delay; - tolerated_inactivity_period; cycles_per_voting_period; nonce_revelation_threshold; vdf_difficulty; @@ -1747,10 +1732,9 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = in if is_new_constants then (* we keep the same duration in days for the - [cycles_per_voting_period], - [delegate_parameters_activation_delay], - [tolerated_inactivity_period] protocol constants on - mainnet *) + [cycles_per_voting_period] and + [delegate_parameters_activation_delay] protocol + constants on mainnet *) let is_mainnet = Compare.Int64.(Period_repr.to_seconds c.minimal_block_delay = 8L) in @@ -1776,18 +1760,13 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = ~new_blocks_per_commitment:blocks_per_commitment else return ctxt in + let consensus_rights_delay = 1 in let constants = - let consensus_rights_delay = 1 in - let tolerated_inactivity_period_high = tolerated_inactivity_period in - let tolerated_inactivity_period_low = 1 in { Constants_parametric_repr.consensus_rights_delay; blocks_preservation_cycles; delegate_parameters_activation_delay; tolerated_inactivity_period; - tolerated_inactivity_period_high; - tolerated_inactivity_period_low; - tolerated_inactivity_period_threshold = 10; blocks_per_cycle; blocks_per_commitment; nonce_revelation_threshold; -- GitLab From b3b7b39b78638fc7b180595fc8c7fcfd664e3ca6 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 19:08:01 +0200 Subject: [PATCH 14/18] Revert "Tezt/Test: update tolerated_inactivity migration test" This reverts commit 76528c4da0b3bafb9d2a73a13962e8611344d0bf. --- tezt/tests/protocol_migration.ml | 83 ++++++-------------------------- 1 file changed, 14 insertions(+), 69 deletions(-) diff --git a/tezt/tests/protocol_migration.ml b/tezt/tests/protocol_migration.ml index b65b2b2231eb..eb47df74a434 100644 --- a/tezt/tests/protocol_migration.ml +++ b/tezt/tests/protocol_migration.ml @@ -2088,18 +2088,7 @@ let test_consensus_rights_delay_shortening () = let test_tolerated_inactivity_period () = (* Given that [grace_period] for the current scenario is equal to 4 - cycles, we check a protocol migration near that cycle. - - In proto T, we update the Delegate_last_cycle_before_deactivation - table with the actual last activity cycle without doing a - stitching during the protocol migration. It means that the - [grace_period] is off by: - - - 2 cycles for the delegates with the last activity in the last - cycle or last but one cycle of proto S - - - 1 cycle for the delegates with the last activity in the first - cycle of proto T *) + cycles, we check a protocol migration near that cycle *) let migrate_from = Option.get Protocol.(previous_protocol Alpha) in let migrate_to = Protocol.Alpha in @@ -2185,71 +2174,27 @@ let test_tolerated_inactivity_period () = delegates_array.(target_cycle).alias ) else ([], default_baker) in - - (* Migration at the end of C3: - - D0, D1, D2 are deactivated at the end of C4 -> C6 - - D3 is deactivated at the end of C5 -> C7 - -------------------------[proto migration] - - D4 is deactivated at the end of C6 -> C7 - - D5 is deactivated at the end of C7 - - D6 is deactivated at the end of C8 - - D7 is deactivated at the end of C9 - - Migration at the end of C4: - - D0, D1, D2 are deactivated at the end of C4 - - D3 is deactivated at the end of C5 -> C7 - - D4 is deactivated at the end of C6 -> C8 - -------------------------[proto migration] - - D5 is deactivated at the end of C7 -> C8 - - D6 is deactivated at the end of C8 - - D7 is deactivated at the end of C9 - - Migration at the end of C5: - - D0, D1, D2 are deactivated at the end of C4 - - D3 is deactivated at the end of C5 - - D4 is deactivated at the end of C6 -> C8 - - D5 is deactivated at the end of C7 -> C9 - -------------------------[proto migration] - - D6 is deactivated at the end of C8 -> C9 - - D7 is deactivated at the end of C9 - *) let expected_list = match target_cycle with | 3 | 4 -> all_activated | 5 -> - let is_deactivated i = - if i <= 2 then migration_cycle >= 5 else false - in - List.init 8 is_deactivated + (* D0, D1, D2 are deactivated at the end of C4 *) + List.init 8 (fun i -> if i <= 2 then true else false) | 6 -> - let is_deactivated i = - if i <= 2 then migration_cycle >= 5 - else if i = 3 then migration_cycle >= 6 - else false - in - List.init 8 is_deactivated + (* D3 is deactivated at the end of C5 *) + List.init 8 (fun i -> if i <= 3 then true else false) | 7 -> - let is_deactivated i = - if i <= 2 then true - else if i = 3 then migration_cycle >= 6 - else false - in - List.init 8 is_deactivated + (* D4 is deactivated at the end of C6 *) + List.init 8 (fun i -> if i <= 4 then true else false) | 8 -> - let is_deactivated i = - if i <= 3 then true - else if i = 4 || i = 5 then migration_cycle = 4 - else false - in - List.init 8 is_deactivated + (* D5 is deactivated at the end of C7 *) + List.init 8 (fun i -> if i <= 5 then true else false) | 9 -> - let is_deactivated i = - if i = 5 || i = 6 then migration_cycle <= 5 - else if i = 7 then false - else true - in - List.init 8 is_deactivated - | 10 -> all_deactivated + (* D6 is deactivated at the end of C8 *) + List.init 8 (fun i -> if i <= 6 then true else false) + | 10 -> + (* D7 is deactivated at the end of C9 *) + all_deactivated | _ -> failwith "unexpected input" in (* [default_baker] must be always active *) -- GitLab From 850a5c6b18130c1a33f6281595459019507ed0bf Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 19:08:50 +0200 Subject: [PATCH 15/18] Revert "Proto: update delegate deactivation table with the actual last activity cycle" This reverts commit 6e66764bbe1138efc750ff6497a335ebf8d54e1e. --- .../delegate_activation_storage.ml | 30 ++++++++----------- .../delegate_activation_storage.mli | 9 +----- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml index 0f08ca1ba523..fdb529cbaa38 100644 --- a/src/proto_alpha/lib_protocol/delegate_activation_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_activation_storage.ml @@ -37,28 +37,20 @@ let is_inactive ctxt delegate = ctxt (Contract_repr.Implicit delegate) in - let tolerance = Constants_storage.tolerated_inactivity_period ctxt in match cycle_opt with | Some last_active_cycle -> let ({Level_repr.cycle = current_cycle; _} : Level_repr.t) = Raw_context.current_level ctxt in - Cycle_repr.(add last_active_cycle tolerance < current_cycle) + Cycle_repr.(last_active_cycle < current_cycle) | None -> (* This case is only when called from `set_active`, when creating a contract. *) false let last_cycle_before_deactivation ctxt delegate = - let open Lwt_result_syntax in - let tolerance = Constants_storage.tolerated_inactivity_period ctxt in let contract = Contract_repr.Implicit delegate in - let+ cycle = - Storage.Contract.Delegate_last_cycle_before_deactivation.get ctxt contract - in - (* we give [tolerance] cycles to the delegate after its last active - cycle before it can be deactivated *) - Cycle_repr.add cycle tolerance + Storage.Contract.Delegate_last_cycle_before_deactivation.get ctxt contract let set_inactive ctxt delegate = Storage.Contract.Inactive_delegate.add ctxt (Contract_repr.Implicit delegate) @@ -67,7 +59,14 @@ let set_active ctxt delegate = let open Lwt_result_syntax in let* inactive = is_inactive ctxt delegate in let current_cycle = (Raw_context.current_level ctxt).cycle in + let tolerance = Constants_storage.tolerated_inactivity_period ctxt in let consensus_rights_delay = Constants_storage.consensus_rights_delay ctxt in + (* We allow a number of cycles before a delegate is deactivated as follows: + - if the delegate is active, we give it at least `tolerance` cycles + after the current cycle before to be deactivated. + - if the delegate is new or inactive, we give it additionally + `consensus_rights_delay` because the delegate needs this number of cycles to + receive rights, so `tolerance + consensus_rights_delay` in total. *) let delegate_contract = Contract_repr.Implicit delegate in let* current_last_active_cycle = Storage.Contract.Delegate_last_cycle_before_deactivation.find @@ -75,16 +74,13 @@ let set_active ctxt delegate = delegate_contract in let last_active_cycle = - (* if the delegate is new or inactive, we give it additionally - [consensus_rights_delay] because the delegate needs this number - of cycles to receive the rights *) match current_last_active_cycle with - | None -> Cycle_repr.add current_cycle consensus_rights_delay + | None -> Cycle_repr.add current_cycle (tolerance + consensus_rights_delay) | Some current_last_active_cycle -> - let updated = - if inactive then Cycle_repr.add current_cycle consensus_rights_delay - else current_cycle + let delay = + if inactive then tolerance + consensus_rights_delay else tolerance in + let updated = Cycle_repr.add current_cycle delay in Cycle_repr.max current_last_active_cycle updated in let*! ctxt = diff --git a/src/proto_alpha/lib_protocol/delegate_activation_storage.mli b/src/proto_alpha/lib_protocol/delegate_activation_storage.mli index ed30e8e2974d..390d37cbef2f 100644 --- a/src/proto_alpha/lib_protocol/delegate_activation_storage.mli +++ b/src/proto_alpha/lib_protocol/delegate_activation_storage.mli @@ -29,14 +29,7 @@ This module is responsible for maintaining the following tables: - {!Storage.Contract.Inactive_delegate} - - {!Storage.Contract.Delegate_last_cycle_before_deactivation} - - Note that [Delegate_last_cycle_before_deactivation] represents the - last active cycle of a delegate without taking into account - [tolerated_inactivity_period]. When a delegate is initialized or - reactivated, we give it additionally [consensus_rights_delay] - cycles to account for the fact that it will not receive consensus - rights yet during the first [consensus_rights_delay] cycles *) + - {!Storage.Contract.Delegate_last_cycle_before_deactivation} *) val is_inactive : Raw_context.t -> Signature.Public_key_hash.t -> bool tzresult Lwt.t -- GitLab From c23ce99ec4d221d0a2ac9bd8e1c589fcdbe81085 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Wed, 1 Oct 2025 19:09:36 +0200 Subject: [PATCH 16/18] Revert "Tezt/Test: add protocol migration test for tolerated_inactivity_period" This reverts commit de45d46cd62892a854b84da971201113b095edea. --- tezt/tests/protocol_migration.ml | 132 +------------------------------ 1 file changed, 1 insertion(+), 131 deletions(-) diff --git a/tezt/tests/protocol_migration.ml b/tezt/tests/protocol_migration.ml index eb47df74a434..c23e10539476 100644 --- a/tezt/tests/protocol_migration.ml +++ b/tezt/tests/protocol_migration.ml @@ -2086,135 +2086,6 @@ let test_consensus_rights_delay_shortening () = unit done -let test_tolerated_inactivity_period () = - (* Given that [grace_period] for the current scenario is equal to 4 - cycles, we check a protocol migration near that cycle *) - let migrate_from = Option.get Protocol.(previous_protocol Alpha) in - let migrate_to = Protocol.Alpha in - - for migration_cycle = 4 to 6 do - Test.register - ~__FILE__ - ~title: - (Printf.sprintf - "protocol migration for tolerated_inactivity_period at the end of \ - cycle %d" - (migration_cycle - 1)) - ~tags:[team; "protocol"; "migration"; "tolerated_inactivity_period"] - @@ fun () -> - let parameter_file = Protocol.parameter_file migrate_from in - let parameters = JSON.parse_file parameter_file in - let blocks_per_cycle = JSON.(get "blocks_per_cycle" parameters |> as_int) in - let migration_level = migration_cycle * blocks_per_cycle in - let () = Local_helpers.print_parameters ~parameter_file ~migration_level in - - let* client, _node = - Local_helpers.activate_protocol - ~parameter_file - ~migrate_from - ~migrate_to - ~migration_level - in - let bake_until_cycle_with_and_check = - Local_helpers.bake_until_cycle_with_and_check - ~migration_level - ~migrate_from - ~migrate_to - ~blocks_per_cycle - in - (* [default_baker] never gets deactivated *) - let default_baker = Constant.bootstrap1.alias in - (* [funder] is used to fund all new accounts *) - let funder = Constant.bootstrap2.alias in - - (* [delegate_i] stops participating in cycle (i + 1) *) - let* delegates = - Local_helpers.create_delegates_and_stake - ~baker:default_baker - ~giver:funder - ~delegates: - (List.init 8 (fun i -> - ("delegate_" ^ Int.to_string i, Tez.of_int 300_000))) - client - in - let delegates_array = Array.of_list delegates in - let all_activated = List.init 8 (fun _i -> false) in - let all_deactivated = List.init 8 (fun _i -> true) in - - let check_deactivated_list expected_status_for_delegates = - Lwt_list.iteri_s - (fun i expected -> - let* () = - Local_helpers.check_deactivated delegates_array.(i) ~expected client - in - unit) - expected_status_for_delegates - in - - let* () = - Local_helpers.check_current_level_and_cycle ~level:4 ~cycle:0 client - in - (* grace_period = tolerated_inactivity_period + consensus_rights_delay = 2 + 2 = 4 *) - (* all delegates are marked as active with [grace_period] = 4 *) - let* () = check_deactivated_list all_activated in - - let* () = - Lwt_list.iter_s - (fun target_cycle -> - let delegates_i_and_higher i = - List.init (8 - i) (fun x -> delegates_array.(x + i).alias) - in - (* [delegate_i] cannot bake during cycle_{0,1,2} as they - have no baking rights, so we wait for cycle 3 to start - baking with new delegates; delegate_{0,1,2} never bake in - this testing scenario *) - let bakers, delegate = - if 3 <= target_cycle && target_cycle <= 7 then - ( delegates_i_and_higher target_cycle, - delegates_array.(target_cycle).alias ) - else ([], default_baker) - in - let expected_list = - match target_cycle with - | 3 | 4 -> all_activated - | 5 -> - (* D0, D1, D2 are deactivated at the end of C4 *) - List.init 8 (fun i -> if i <= 2 then true else false) - | 6 -> - (* D3 is deactivated at the end of C5 *) - List.init 8 (fun i -> if i <= 3 then true else false) - | 7 -> - (* D4 is deactivated at the end of C6 *) - List.init 8 (fun i -> if i <= 4 then true else false) - | 8 -> - (* D5 is deactivated at the end of C7 *) - List.init 8 (fun i -> if i <= 5 then true else false) - | 9 -> - (* D6 is deactivated at the end of C8 *) - List.init 8 (fun i -> if i <= 6 then true else false) - | 10 -> - (* D7 is deactivated at the end of C9 *) - all_deactivated - | _ -> failwith "unexpected input" - in - (* [default_baker] must be always active *) - let bakers = default_baker :: bakers in - let* () = - bake_until_cycle_with_and_check - ~bakers - ~target_cycle - ~delegate - ~check_last_block:(fun () -> check_deactivated_list expected_list) - ~check_next_block:(fun _ -> unit) - client - in - unit) - (* From cycle 3 to 10 *) - (List.init 8 (fun i -> i + 3)) - in - unit - done - let register ~migrate_from ~migrate_to = test_migration_for_whole_cycle ~migrate_from ~migrate_to ; test_migration_with_bakers ~migrate_from ~migrate_to () ; @@ -2226,5 +2097,4 @@ let register ~migrate_from ~migrate_to = test_reveal_migration () ; test_tz4_manager_operation ~with_empty_mempool:true ; test_tz4_manager_operation ~with_empty_mempool:false ; - test_consensus_rights_delay_shortening () ; - test_tolerated_inactivity_period () + test_consensus_rights_delay_shortening () -- GitLab From 1ea767301b90e6fac77cf1690fb25d44024f0c81 Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Thu, 2 Oct 2025 10:25:24 +0200 Subject: [PATCH 17/18] etherlink/tezt/tests: reset regressions --- ...n test for the FA deposit and withdrawal events.out | 10 +++++----- ...egression test for the claimed FA deposit event.out | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out index 1054d9c2a464..f86e44576fed 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the FA deposit and withdrawal events.out @@ -3,19 +3,19 @@ Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7ee7a1de9c18ce695c95b8b19fbdf26cce3544e3ca9e08c9f487776783d7599f -- 0xaae62aa8b05684f4d3b44b6b9adbacca4383d67954508459fcf1b1f81d2a5047 +- 0xa60d1e2c988c19d2d06e5f80d682446a48d2b388802eaca76d753e3eaae584c8 Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000002a00000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000002 # FA Withdrawal ## Log 0 Address: 0xff00000000000000000000000000000000000002 Topics: - 0xab68450c9e546f6062a861eebf8ec5bbd41b4425e26b20199c91227c7f9038ca -- 0xaae62aa8b05684f4d3b44b6b9adbacca4383d67954508459fcf1b1f81d2a5047 -Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000000001d99577527c5d940d29f489ca7d591806fe07f345000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000 +- 0xa60d1e2c988c19d2d06e5f80d682446a48d2b388802eaca76d753e3eaae584c8 +Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c000000000000000000000000000000000000000000000000000000000000000001a85cd662d446daf941cf712573b39960b1b22b91000000000000000000000000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000000 # FA Fast Withdrawal ## Log 0 Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7e40c982e82bccb5e8bbd29f38bcfa3996f341ef9f51e2a9cffe086ec87a11c7 -- 0xaae62aa8b05684f4d3b44b6b9adbacca4383d67954508459fcf1b1f81d2a5047 -Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000c55cf02dbeecc978d9c84625dcae72bb77ea4fbd0000000000000000000001d99577527c5d940d29f489ca7d591806fe07f345000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000005e0be103000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001 +- 0xa60d1e2c988c19d2d06e5f80d682446a48d2b388802eaca76d753e3eaae584c8 +Data: 0x0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000000000000000000000006ce4d79d4e77402e1ef3417fdda433aa744c6e1c0000c55cf02dbeecc978d9c84625dcae72bb77ea4fbd0000000000000000000001a85cd662d446daf941cf712573b39960b1b22b91000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000005e0be103000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001 diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out index a26255a4b3ce..d66ffd0fa49c 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/Alpha- Regression test for the claimed FA deposit event.out @@ -3,5 +3,5 @@ Address: 0xff00000000000000000000000000000000000002 Topics: - 0x7ee7a1de9c18ce695c95b8b19fbdf26cce3544e3ca9e08c9f487776783d7599f -- 0x4ded93cfe9b0be27a29b6d0942fa9e2ab49b14e374d1684b92d1aa3c3edf492d +- 0xbba86a75f12158891af02a9635e6f335bef9039292de6e72865fb544104a1600 Data: 0x000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344000000000000000000000000d77420f73b4612a7a99dba8c2afd30a1886b0344000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000003 -- GitLab From b803ba8444b54f38cc2c9a465aa0319ce342644a Mon Sep 17 00:00:00 2001 From: Marina Polubelova Date: Tue, 7 Oct 2025 17:28:48 +0200 Subject: [PATCH 18/18] Docs: update changelog --- docs/protocols/alpha.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index 3e0115398122..d730f1d25386 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -207,8 +207,7 @@ Bug Fixes - Updated cache functions to include the context when needed. Previously backtracked gas costs for some cache calls are now properly accounted for, increasing by at most 2 units of gas per - function call. Notably, **the ``set delegate`` operation now has a - slightly higher gas cost.** (MR :gl:`!19134`) + function call. (MR :gl:`!19134`) Minor Changes ------------- -- GitLab