From 40da32d2d20ef3e581dc714da3295e0b33c2033f Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 8 Nov 2024 16:08:48 +0100 Subject: [PATCH 1/4] Proto/alpha: add all_bakers_attest feature flag --- .../lib_parameters/default_parameters.ml | 1 + src/proto_alpha/lib_protocol/alpha_context.mli | 3 +++ .../lib_protocol/constants_parametric_repr.ml | 13 +++++++++---- .../lib_protocol/constants_parametric_repr.mli | 1 + src/proto_alpha/lib_protocol/constants_storage.ml | 3 +++ src/proto_alpha/lib_protocol/constants_storage.mli | 2 ++ src/proto_alpha/lib_protocol/raw_context.ml | 3 +++ 7 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 9c0858f4a462..a5591f44824e 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -337,6 +337,7 @@ let constants_mainnet : Constants.Parametric.t = (* TODO: https://gitlab.com/tezos/tezos/-/issues/7553 Enable once we built performance confidance *) allow_tz4_delegate_enable = false; + all_bakers_attest_enable = false; } let constants_sandbox = diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 8a91be654fac..c376cddfe128 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -953,6 +953,7 @@ module Constants : sig direct_ticket_spending_enable : bool; aggregate_attestation : bool; allow_tz4_delegate_enable : bool; + all_bakers_attest_enable : bool; } val encoding : t Data_encoding.t @@ -1091,6 +1092,8 @@ module Constants : sig val allow_tz4_delegate_enable : context -> bool + val all_bakers_attest_enable : context -> bool + (** All constants: fixed and parametric *) type t = private {fixed : fixed; parametric : Parametric.t} diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 32dad28bbc27..ad3bbd5d59ea 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -295,6 +295,7 @@ type t = { direct_ticket_spending_enable : bool; aggregate_attestation : bool; allow_tz4_delegate_enable : bool; + all_bakers_attest_enable : bool; } let sc_rollup_encoding = @@ -610,7 +611,8 @@ let encoding = ( c.adaptive_issuance, ( c.direct_ticket_spending_enable, c.aggregate_attestation, - c.allow_tz4_delegate_enable ) ) ) ) ) ) ) ) )) + c.allow_tz4_delegate_enable, + c.all_bakers_attest_enable ) ) ) ) ) ) ) ) )) (fun ( ( ( consensus_rights_delay, blocks_preservation_cycles, delegate_parameters_activation_delay, @@ -655,7 +657,8 @@ let encoding = ( adaptive_issuance, ( direct_ticket_spending_enable, aggregate_attestation, - allow_tz4_delegate_enable ) ) ) ) ) ) ) ) ) -> + allow_tz4_delegate_enable, + all_bakers_attest_enable ) ) ) ) ) ) ) ) ) -> { consensus_rights_delay; blocks_preservation_cycles; @@ -703,6 +706,7 @@ let encoding = direct_ticket_spending_enable; aggregate_attestation; allow_tz4_delegate_enable; + all_bakers_attest_enable; }) (merge_objs (merge_objs @@ -769,10 +773,11 @@ let encoding = (merge_objs sc_rollup_encoding zk_rollup_encoding) (merge_objs adaptive_issuance_encoding - (obj3 + (obj4 (req "direct_ticket_spending_enable" bool) (req "aggregate_attestation" bool) - (req "allow_tz4_delegate_enable" bool)))))))))) + (req "allow_tz4_delegate_enable" bool) + (req "all_bakers_attest_enable" bool)))))))))) let update_sc_rollup_parameter ratio_i32 c = (* Constants remain small enough to fit in [int32] after update (as a diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index 956f07659ca7..8bb3998f9531 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -233,6 +233,7 @@ type t = { (* attestation aggregation feature flag *) aggregate_attestation : bool; allow_tz4_delegate_enable : bool; + all_bakers_attest_enable : bool; } val encoding : t Data_encoding.encoding diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 46b63e8266f6..8e0c26e1c736 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -300,3 +300,6 @@ let aggregate_attestation c = (Raw_context.constants c).aggregate_attestation let allow_tz4_delegate_enable c = (Raw_context.constants c).allow_tz4_delegate_enable + +let all_bakers_attest_enable c = + (Raw_context.constants c).all_bakers_attest_enable diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 02d0a21ad23d..87b73ea0d85b 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -187,3 +187,5 @@ val slashable_deposits_period : Raw_context.t -> int (* attestation aggregation feature flag *) val aggregate_attestation : Raw_context.t -> bool + +val all_bakers_attest_enable : 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 3230d55952c9..1a9aa1a193f5 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1226,6 +1226,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = direct_ticket_spending_enable; aggregate_attestation; allow_tz4_delegate_enable; + all_bakers_attest_enable; } : Previous.t) = c @@ -1278,6 +1279,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = direct_ticket_spending_enable; aggregate_attestation; allow_tz4_delegate_enable; + all_bakers_attest_enable; } in let*! ctxt = add_constants ctxt constants in @@ -1570,6 +1572,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = direct_ticket_spending_enable; aggregate_attestation = false; allow_tz4_delegate_enable = false; + all_bakers_attest_enable = false; } in let new_constants : Constants_parametric_repr.t option = -- GitLab From a67ee6803a27768e779dc69b4951bb07d42aab8b Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 8 Nov 2024 16:14:42 +0100 Subject: [PATCH 2/4] Proto: Update kaitai files --- client-libs/kaitai-struct-files/files/alpha__constants.ksy | 3 +++ .../kaitai-struct-files/files/alpha__constants__parametric.ksy | 3 +++ client-libs/kaitai-struct-files/files/alpha__parameters.ksy | 3 +++ 3 files changed, 9 insertions(+) diff --git a/client-libs/kaitai-struct-files/files/alpha__constants.ksy b/client-libs/kaitai-struct-files/files/alpha__constants.ksy index 51950c14d577..e91dff4cc6c1 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants.ksy @@ -387,3 +387,6 @@ seq: - id: allow_tz4_delegate_enable type: u1 enum: bool +- id: all_bakers_attest_enable + type: u1 + enum: bool 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 16dc5cf7c15f..1b4e8371f950 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy @@ -359,3 +359,6 @@ seq: - id: allow_tz4_delegate_enable type: u1 enum: bool +- id: all_bakers_attest_enable + type: u1 + enum: bool diff --git a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy index 6e3a8cd76b02..469be38cb185 100644 --- a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy @@ -637,3 +637,6 @@ seq: - id: allow_tz4_delegate_enable type: u1 enum: bool +- id: all_bakers_attest_enable + type: u1 + enum: bool -- GitLab From 2a2f351aa917b7895600f60839dad34e84bdc025 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 8 Nov 2024 17:46:50 +0100 Subject: [PATCH 3/4] Proto/tezt: reset regressions --- ...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 +- .../protocol_migration.ml/Alpha- weeklynet regression test.out | 2 +- 4 files changed, 4 insertions(+), 4 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 bbe52aaca40c..8a22eae11331 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 @@ -82,7 +82,7 @@ "adaptive_issuance_activation_vote_enable": true, "adaptive_issuance_force_activation": false, "ns_enable": true, "direct_ticket_spending_enable": false, "aggregate_attestation": false, - "allow_tz4_delegate_enable": true } + "allow_tz4_delegate_enable": true, "all_bakers_attest_enable": false } ./octez-client rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 2, "delegate": "[PUBLIC_KEY_HASH]", 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 39bfa6aa99be..e56cd5fbbe64 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 @@ -82,7 +82,7 @@ "adaptive_issuance_activation_vote_enable": true, "adaptive_issuance_force_activation": false, "ns_enable": true, "direct_ticket_spending_enable": false, "aggregate_attestation": false, - "allow_tz4_delegate_enable": true } + "allow_tz4_delegate_enable": true, "all_bakers_attest_enable": false } ./octez-client --mode light rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 2, "delegate": "[PUBLIC_KEY_HASH]", 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 9bcabe705631..3070b3387917 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 @@ -82,7 +82,7 @@ "adaptive_issuance_activation_vote_enable": true, "adaptive_issuance_force_activation": false, "ns_enable": true, "direct_ticket_spending_enable": false, "aggregate_attestation": false, - "allow_tz4_delegate_enable": true } + "allow_tz4_delegate_enable": true, "all_bakers_attest_enable": false } ./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 2, "delegate": "[PUBLIC_KEY_HASH]", diff --git a/tezt/tests/expected/protocol_migration.ml/Alpha- weeklynet regression test.out b/tezt/tests/expected/protocol_migration.ml/Alpha- weeklynet regression test.out index acd11f96902b..a85d0a278773 100644 --- a/tezt/tests/expected/protocol_migration.ml/Alpha- weeklynet regression test.out +++ b/tezt/tests/expected/protocol_migration.ml/Alpha- weeklynet regression test.out @@ -72,4 +72,4 @@ "adaptive_issuance_activation_vote_enable": true, "adaptive_issuance_force_activation": false, "ns_enable": true, "direct_ticket_spending_enable": false, "aggregate_attestation": false, - "allow_tz4_delegate_enable": false } + "allow_tz4_delegate_enable": false, "all_bakers_attest_enable": false } -- GitLab From d31b672707e02842a49463cb6f08fda4c7e465ca Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 8 Nov 2024 17:48:21 +0100 Subject: [PATCH 4/4] Proto: update alpha doc --- docs/protocols/alpha.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index d7374e42e861..f32c44340e52 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -79,6 +79,8 @@ Minor Changes - Added a feature flag which would allow tz4 (BLS) addresses as delegate and or as consensus keys. (MR :gl:`!15311`) +- Added a feature flag for allowing all bakers to attest. (MR :gl:`!15584`) + Internal -------- -- GitLab