From a400631572232c7343782cf2fce14f5a305c7ee6 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 1 Mar 2024 11:17:54 +0100 Subject: [PATCH 1/4] Proto/Paris-p: make AI vote threshold to 0 --- src/proto_alpha/lib_parameters/default_parameters.ml | 2 +- src/proto_alpha/lib_protocol/raw_context.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 84221c87ba73..e150514d3f4d 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -285,7 +285,7 @@ let constants_mainnet : Constants.Parametric.t = { global_limit_of_staking_over_baking = 5; edge_of_staking_over_delegation = 2; - launch_ema_threshold = 1_600_000_000l; + launch_ema_threshold = 0l; adaptive_rewards_params = { issuance_ratio_final_min = Q.(0_25 // 100_00); diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 9ccc46907926..80b457124f2f 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1160,7 +1160,7 @@ let prepare_first_block ~level ~timestamp _chain_id ctxt = c.adaptive_issuance.global_limit_of_staking_over_baking; edge_of_staking_over_delegation = c.adaptive_issuance.edge_of_staking_over_delegation; - launch_ema_threshold = c.adaptive_issuance.launch_ema_threshold; + launch_ema_threshold = 0l; adaptive_rewards_params; activation_vote_enable = true; autostaking_enable = c.adaptive_issuance.autostaking_enable; -- GitLab From 6d1fed41a959fd3b806d63a2860c8c453c029133 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 1 Mar 2024 11:26:18 +0100 Subject: [PATCH 2/4] Proto/tests: remove long tests --- .../test_adaptive_issuance_launch.ml | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/integration/test_adaptive_issuance_launch.ml b/src/proto_alpha/lib_protocol/test/integration/test_adaptive_issuance_launch.ml index 50f2cd2155a4..ef4f67283c69 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_adaptive_issuance_launch.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_adaptive_issuance_launch.ml @@ -590,17 +590,6 @@ let tests = (test_launch 1000000l (* This means that the threshold is set at 0.05% *) 88l); - Tztest.tztest - "the EMA reaches the vote threshold at the expected level and adaptive \ - issuance launches (realistic threshold, vote enabled)" - `Slow - (test_launch - Default_parameters.constants_test.adaptive_issuance - .launch_ema_threshold - 280894l - (* This vote duration is consistent with the result of the - unit test for this EMA in - ../unit/test_adaptive_issuance_ema.ml*)); Tztest.tztest "the EMA reaches the vote threshold at the expected level and adaptive \ issuance does not launch (very low threshold, vote disabled)" @@ -608,17 +597,6 @@ let tests = (test_does_not_launch_without_feature_flag 1000000l (* This means that the threshold is set at 0.05% *) 88l); - Tztest.tztest - "the EMA reaches the vote threshold at the expected level and adaptive \ - issuance does not launch (realistic threshold, vote disabled)" - `Slow - (test_does_not_launch_without_feature_flag - Default_parameters.constants_test.adaptive_issuance - .launch_ema_threshold - 280894l - (* This vote duration is consistent with the result of the - unit test for this EMA in - ../unit/test_adaptive_issuance_ema.ml*)); ] let () = -- GitLab From 0440ddc9490f0ae02f9e7e501bac267e68e59343 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 1 Mar 2024 11:28:52 +0100 Subject: [PATCH 3/4] Proto/tests: reset regression tests --- ...Alpha- (mode client) RPC regression tests- misc_protocol.out | 2 +- .../Alpha- (mode light) RPC regression tests- misc_protocol.out | 2 +- .../Alpha- (mode proxy) RPC regression tests- misc_protocol.out | 2 +- ...server_data_dir) RPC regression tests- adaptive_issuance.out | 2 +- ...oxy_server_data_dir) RPC regression tests- misc_protocol.out | 2 +- ...roxy_server_rpc) RPC regression tests- adaptive_issuance.out | 2 +- ...de proxy_server_rpc) RPC regression tests- misc_protocol.out | 2 +- tezt/tests/expected/baker_test.ml/Alpha- Baker rewards.out | 1 + 8 files changed, 8 insertions(+), 7 deletions(-) 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 23fd8a4909f5..7b3a6b1d2504 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 @@ -62,7 +62,7 @@ "zk_rollup_max_ticket_payload_size": 2048, "global_limit_of_staking_over_baking": 5, "edge_of_staking_over_delegation": 2, - "adaptive_issuance_launch_ema_threshold": 1600000000, + "adaptive_issuance_launch_ema_threshold": 0, "adaptive_rewards_params": { "issuance_ratio_final_min": { "numerator": "1", "denominator": "400" }, "issuance_ratio_final_max": { "numerator": "1", "denominator": "10" }, 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 18fb176fa807..e3fcc9f9b786 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 @@ -62,7 +62,7 @@ "zk_rollup_max_ticket_payload_size": 2048, "global_limit_of_staking_over_baking": 5, "edge_of_staking_over_delegation": 2, - "adaptive_issuance_launch_ema_threshold": 1600000000, + "adaptive_issuance_launch_ema_threshold": 0, "adaptive_rewards_params": { "issuance_ratio_final_min": { "numerator": "1", "denominator": "400" }, "issuance_ratio_final_max": { "numerator": "1", "denominator": "10" }, 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 e32252a663fe..67dcdd688e71 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 @@ -62,7 +62,7 @@ "zk_rollup_max_ticket_payload_size": 2048, "global_limit_of_staking_over_baking": 5, "edge_of_staking_over_delegation": 2, - "adaptive_issuance_launch_ema_threshold": 1600000000, + "adaptive_issuance_launch_ema_threshold": 0, "adaptive_rewards_params": { "issuance_ratio_final_min": { "numerator": "1", "denominator": "400" }, "issuance_ratio_final_max": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- adaptive_issuance.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- adaptive_issuance.out index 4f69a65ab9fd..ad45f80f6fde 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- adaptive_issuance.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- adaptive_issuance.out @@ -32,7 +32,7 @@ "80007812" ./octez-client rpc get /chains/main/blocks/head/context/adaptive_issuance_launch_cycle -null +5 ./octez-client rpc get /chains/main/blocks/head/context/issuance/expected_issuance [ { "cycle": 0, "baking_reward_fixed_portion": "333333", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index fa4874fddcc1..01b7d506f3af 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -62,7 +62,7 @@ "zk_rollup_max_ticket_payload_size": 2048, "global_limit_of_staking_over_baking": 5, "edge_of_staking_over_delegation": 2, - "adaptive_issuance_launch_ema_threshold": 1600000000, + "adaptive_issuance_launch_ema_threshold": 0, "adaptive_rewards_params": { "issuance_ratio_final_min": { "numerator": "1", "denominator": "400" }, "issuance_ratio_final_max": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- adaptive_issuance.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- adaptive_issuance.out index 4f69a65ab9fd..ad45f80f6fde 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- adaptive_issuance.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- adaptive_issuance.out @@ -32,7 +32,7 @@ "80007812" ./octez-client rpc get /chains/main/blocks/head/context/adaptive_issuance_launch_cycle -null +5 ./octez-client rpc get /chains/main/blocks/head/context/issuance/expected_issuance [ { "cycle": 0, "baking_reward_fixed_portion": "333333", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index fa4874fddcc1..01b7d506f3af 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -62,7 +62,7 @@ "zk_rollup_max_ticket_payload_size": 2048, "global_limit_of_staking_over_baking": 5, "edge_of_staking_over_delegation": 2, - "adaptive_issuance_launch_ema_threshold": 1600000000, + "adaptive_issuance_launch_ema_threshold": 0, "adaptive_rewards_params": { "issuance_ratio_final_min": { "numerator": "1", "denominator": "400" }, "issuance_ratio_final_max": { "numerator": "1", "denominator": "10" }, diff --git a/tezt/tests/expected/baker_test.ml/Alpha- Baker rewards.out b/tezt/tests/expected/baker_test.ml/Alpha- Baker rewards.out index d6488bf8922d..a2feb408a1b1 100644 --- a/tezt/tests/expected/baker_test.ml/Alpha- Baker rewards.out +++ b/tezt/tests/expected/baker_test.ml/Alpha- Baker rewards.out @@ -67,6 +67,7 @@ "contract": "[PUBLIC_KEY_HASH]", "change": "2999999", "origin": "block" } ], "liquidity_baking_toggle_ema": 0, "adaptive_issuance_vote_ema": 0, + "adaptive_issuance_activation_cycle": 5, "implicit_operations_results": [ { "kind": "origination", "balance_updates": -- GitLab From 24ea2b55dd172f035398f0c3c3623e84f1ffe39d Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Mon, 4 Mar 2024 16:45:43 +0100 Subject: [PATCH 4/4] Proto/tests: fix test --- .../integration/consensus/test_frozen_deposits.ml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 594b17134a07..327f955f7a3a 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 @@ -647,6 +647,16 @@ let test_deposits_unfrozen_after_deactivation () = let rec loop b n = if n = 0 then return b else + let* ai_activation_cycle = + Context.get_adaptive_issuance_launch_cycle (B b) + in + let frozen_deposits_when_deactivated = + match ai_activation_cycle with + | None -> Tez.zero + | Some cycle -> + if Cycle.(cycle > add root last_active_cycle) then Tez.zero + else initial_frozen_deposits + in let* b = Block.bake_until_cycle_end ~policy:(By_account account2) b in let* is_deactivated = Context.Delegate.deactivated (B b) account1 in let* frozen_deposits = @@ -664,7 +674,8 @@ let test_deposits_unfrozen_after_deactivation () = Assert.equal_tez ~loc:__LOC__ frozen_deposits - (if is_deactivated then Tez.zero else initial_frozen_deposits) + (if is_deactivated then frozen_deposits_when_deactivated + else initial_frozen_deposits) in loop b (pred n) in -- GitLab