diff --git a/src/lib_shell_services/history_mode.ml b/src/lib_shell_services/history_mode.ml index 365abf05433a8f4955166c18540323a5768c37b5..90254796cc0498c38464048c96f16c9c32fd1b5c 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 diff --git a/src/lib_store/unix/test/test_snapshots.ml b/src/lib_store/unix/test/test_snapshots.ml index bff2e5a861a43a145d540ffcba9e8c08d1b5bf35..547c77d42e2a1ab173ce19209618791a9eb615b4 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 diff --git a/src/proto_alpha/lib_client/client_proto_args.ml b/src/proto_alpha/lib_client/client_proto_args.ml index 3c182ec5ae19252cd362e59c2466c837d7885594..5b86f37a491278fdfd665b443fd2e695f015bfed 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 = diff --git a/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml b/src/proto_alpha/lib_protocol/adaptive_issuance_storage.ml index 18adf520661755c6dd15f1e1aeeabbb368125c1e..c9968fac1f91e023ba2073b269419e378dc1f414 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) diff --git a/tezt/tests/bootstrap.ml b/tezt/tests/bootstrap.ml index b94998e4a0819dd5680c4d98b0315c77123a4652..02f0bf01a93275d02063dbc630d9182780abaaf5 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