From 5cd9067c2c8a52a9da18f398815e28c130936c84 Mon Sep 17 00:00:00 2001 From: "G.B. Fefe" Date: Fri, 1 Jul 2022 08:07:29 +0200 Subject: [PATCH] Proto/Ghostnet: reduce `cycles_per_voting_period` to 1 cycle --- src/proto_alpha/lib_protocol/init_storage.ml | 6 ++++- tezt/tests/ghostnet_dictator_migration.ml | 23 +++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index b0de089b17e9..2e49c84bf062 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -70,7 +70,11 @@ module Patch_dictator_for_ghostnet = struct let patch_constant chain_id ctxt = if Chain_id.equal chain_id ghostnet_id then Raw_context.patch_constants ctxt (fun c -> - {c with testnet_dictator = Some oxhead_testnet_baker}) + { + c with + testnet_dictator = Some oxhead_testnet_baker; + cycles_per_voting_period = 1l; + }) else Lwt.return ctxt end diff --git a/tezt/tests/ghostnet_dictator_migration.ml b/tezt/tests/ghostnet_dictator_migration.ml index 638fb23d2778..843cccd4baea 100644 --- a/tezt/tests/ghostnet_dictator_migration.ml +++ b/tezt/tests/ghostnet_dictator_migration.ml @@ -79,7 +79,7 @@ let init chain_id ~from_protocol ~to_protocol = ~base:(Right (from_protocol, None)) [ (["blocks_per_cycle"], Some "4"); - (["cycles_per_voting_period"], Some "1"); + (["cycles_per_voting_period"], Some "2"); ] in let* () = @@ -110,13 +110,26 @@ let register_migration_test chain_id = client (Protocol.hash from_protocol, Protocol.hash to_protocol) in - let expected_dictator = + let expected_dictator, expected_remaining = match chain_id with | Chain_id_ghostnet when to_protocol = Alpha -> - Some "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8" - | _ -> None + (Some "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8", 1) + | _ -> (None, 5) in - check_dictator client expected_dictator + + let* () = check_dictator client expected_dictator in + let* () = + Voting.check_current_period + client + { + Voting.index = 0; + kind = Proposal; + start_position = 0; + position = 2; + remaining = expected_remaining; + } + in + return () let register ~protocols = (* Testing migration with the chain_id of Ghostnet. -- GitLab