From e3c797eea7de71059a7c239cb9ead9c2d4d8b111 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Thu, 7 Dec 2023 16:50:19 +0100 Subject: [PATCH 1/5] proto/adaptive_issuance_storage: remove useless qualified path --- src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml b/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml index 18adf5206617..c9968fac1f91 100644 --- a/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml +++ b/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml @@ -357,7 +357,7 @@ let update_ema ctxt ~vote = let open Constants_storage in let+ ctxt, launch_cycle = if - (not (Constants_storage.adaptive_issuance_activation_vote_enable ctxt)) + (not (adaptive_issuance_activation_vote_enable ctxt)) || Per_block_votes_repr.Adaptive_issuance_launch_EMA.( new_ema < adaptive_issuance_launch_ema_threshold ctxt) then return (ctxt, launch_cycle) -- GitLab From 7bccfdcb5aa89a6c43d32418cbc9cd5ee406c735 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Tue, 19 Dec 2023 09:45:38 +0100 Subject: [PATCH 2/5] tezt/tests: use blocks_preservation_cycles --- tezt/tests/bootstrap.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tezt/tests/bootstrap.ml b/tezt/tests/bootstrap.ml index b94998e4a081..02f0bf01a932 100644 --- a/tezt/tests/bootstrap.ml +++ b/tezt/tests/bootstrap.ml @@ -93,7 +93,7 @@ let check_bootstrap_with_history_modes hmode1 hmode2 = starts. - When the checkpoint is set, its level is [preserved_blocks = - preserved_cycles * blocks_per_cycle] behind the current level of + blocks_preservation_cycles * blocks_per_cycle] behind the current level of the head - When the [caboose] is set, its level is [max(0, (checkpoint - @@ -106,7 +106,7 @@ let check_bootstrap_with_history_modes hmode1 hmode2 = mod blocks_per_cycle] (the modulo 1 comes from the activation block). - In sandbox mode, we have [preserved_cycles = 2] and + In sandbox mode, we have [blocks_preservation_cycles = 2] and [blocks_per_cycle = 8]. Hence, when [node_1] has baked [49] blocks, the checkpoint should -- GitLab From 3e73b5f94622933f1c33b3b04ca3b98698164777 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Tue, 19 Dec 2023 21:03:47 +0100 Subject: [PATCH 3/5] shell_services/history_mode: change comment referencing preserved_cycles --- src/lib_shell_services/history_mode.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib_shell_services/history_mode.ml b/src/lib_shell_services/history_mode.ml index 365abf05433a..90254796cc04 100644 --- a/src/lib_shell_services/history_mode.ml +++ b/src/lib_shell_services/history_mode.ml @@ -44,7 +44,8 @@ type t = (* The default_offset value defines a window of stored cycles which is suitable for baking services. It currently corresponds to 6 as we store 1 cycle below the last preserved block level of the current - head, which is set to [preserved_cycles] cycles in the past. + head, which is set to [blocks_preservation_cycles] cycles in the + past. TODO: https://gitlab.com/tezos/tezos/-/issues/1406 As this value is potentially both network and protocol specific, it could be lifted as a protocol value or an hardcoded node -- GitLab From 2b741b0f245e31543a671a82458e81a44b10f744 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Mon, 18 Dec 2023 16:45:31 +0100 Subject: [PATCH 4/5] proto/client_proto_args: variable renaming This variable has nothing to do with cycles --- src/proto_alpha/lib_client/client_proto_args.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proto_alpha/lib_client/client_proto_args.ml b/src/proto_alpha/lib_client/client_proto_args.ml index 3c182ec5ae19..5b86f37a4912 100644 --- a/src/proto_alpha/lib_client/client_proto_args.ml +++ b/src/proto_alpha/lib_client/client_proto_args.ml @@ -684,9 +684,9 @@ let preserved_levels_arg = ~default:"200" (Tezos_clic.parameter (fun _ s -> try - let preserved_cycles = int_of_string s in - if preserved_cycles < 0 then tzfail (Bad_preserved_levels s) - else return preserved_cycles + let preserved_levels = int_of_string s in + if preserved_levels < 0 then tzfail (Bad_preserved_levels s) + else return preserved_levels with _ -> tzfail (Bad_preserved_levels s))) let no_print_source_flag = -- GitLab From 6a0e545319bef29b420e9627280a628b3b072860 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Tue, 19 Dec 2023 21:03:04 +0100 Subject: [PATCH 5/5] store/tests: use blocks_preservation_cycles term This is just a variable renaming. --- src/lib_store/unix/test/test_snapshots.ml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib_store/unix/test/test_snapshots.ml b/src/lib_store/unix/test/test_snapshots.ml index bff2e5a861a4..547c77d42e2a 100644 --- a/src/lib_store/unix/test/test_snapshots.ml +++ b/src/lib_store/unix/test/test_snapshots.ml @@ -391,11 +391,7 @@ let make_tests speed genesis_parameters = let open Tezos_protocol_alpha.Protocol.Alpha_context in let { Parameters.constants = - { - Constants.Parametric.blocks_per_cycle; - blocks_preservation_cycles = preserved_cycles; - _; - }; + {Constants.Parametric.blocks_per_cycle; blocks_preservation_cycles; _}; _; } = genesis_parameters @@ -406,13 +402,13 @@ let make_tests speed genesis_parameters = match speed with | `Slow -> [ - preserved_cycles * blocks_per_cycle; - ((2 * preserved_cycles) + 1) * blocks_per_cycle; + blocks_preservation_cycles * blocks_per_cycle; + ((2 * blocks_preservation_cycles) + 1) * blocks_per_cycle; 65; 77; 89; ] - | `Quick -> [((2 * preserved_cycles) + 1) * blocks_per_cycle; 77] + | `Quick -> [((2 * blocks_preservation_cycles) + 1) * blocks_per_cycle; 77] in let exporter_history_modes = let open History_mode in -- GitLab