diff --git a/client-libs/kaitai-struct-files/files/alpha__constants.ksy b/client-libs/kaitai-struct-files/files/alpha__constants.ksy index 0806e89e8117d303e802fab796f53d4333a6b14b..51950c14d577821c4d2ba57cfec808a96b18ee40 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants.ksy @@ -49,6 +49,10 @@ types: type: u1 - id: attestation_threshold type: u1 + - id: minimal_participation_ratio + type: minimal_participation_ratio_0 + - id: rewards_ratio + type: rewards_ratio - id: redundancy_factor type: u1 - id: page_size @@ -108,12 +112,20 @@ types: type: int31 - id: vdf_revelation_tip_weight type: int31 + - id: dal_rewards_weight + type: int31 minimal_participation_ratio: seq: - id: numerator type: u2be - id: denominator type: u2be + minimal_participation_ratio_0: + seq: + - id: numerator + type: z + - id: denominator + type: z n: seq: - id: n @@ -149,6 +161,12 @@ types: type: z - id: denominator type: z + rewards_ratio: + seq: + - id: numerator + type: z + - id: denominator + type: z smart_rollup_reveal_activation_level: seq: - id: raw_data 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 f174aa9d43c1440f85a15e990dd5e69bd4a61e04..16dc5cf7c15f0a8b2aca29f1795cc4a0888dea4b 100644 --- a/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__constants__parametric.ksy @@ -49,6 +49,10 @@ types: type: u1 - id: attestation_threshold type: u1 + - id: minimal_participation_ratio + type: minimal_participation_ratio_0 + - id: rewards_ratio + type: rewards_ratio - id: redundancy_factor type: u1 - id: page_size @@ -108,12 +112,20 @@ types: type: int31 - id: vdf_revelation_tip_weight type: int31 + - id: dal_rewards_weight + type: int31 minimal_participation_ratio: seq: - id: numerator type: u2be - id: denominator type: u2be + minimal_participation_ratio_0: + seq: + - id: numerator + type: z + - id: denominator + type: z n: seq: - id: n @@ -149,6 +161,12 @@ types: type: z - id: denominator type: z + rewards_ratio: + seq: + - id: numerator + type: z + - id: denominator + type: z smart_rollup_reveal_activation_level: seq: - id: raw_data diff --git a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy index 7ede8f6871027b48bc4dbea453a3e8703d74b64c..6e3a8cd76b028b561bf389b05cb06f1aa0c7b087 100644 --- a/client-libs/kaitai-struct-files/files/alpha__parameters.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__parameters.ksy @@ -183,6 +183,10 @@ types: type: u1 - id: attestation_threshold type: u1 + - id: minimal_participation_ratio + type: minimal_participation_ratio_0 + - id: rewards_ratio + type: rewards_ratio - id: redundancy_factor type: u1 - id: page_size @@ -242,12 +246,20 @@ types: type: int31 - id: vdf_revelation_tip_weight type: int31 + - id: dal_rewards_weight + type: int31 minimal_participation_ratio: seq: - id: numerator type: u2be - id: denominator type: u2be + minimal_participation_ratio_0: + seq: + - id: numerator + type: z + - id: denominator + type: z n: seq: - id: n @@ -373,6 +385,12 @@ types: type: z - id: denominator type: z + rewards_ratio: + seq: + - id: numerator + type: z + - id: denominator + type: z smart_rollup_reveal_activation_level: seq: - id: raw_data diff --git a/src/proto_alpha/lib_dal/dal_plugin_registration.ml b/src/proto_alpha/lib_dal/dal_plugin_registration.ml index 3ad475ebfd5e5bea7950539513beeed336606eed..6dccd347025d9373a121a20f0156380871abf636 100644 --- a/src/proto_alpha/lib_dal/dal_plugin_registration.ml +++ b/src/proto_alpha/lib_dal/dal_plugin_registration.ml @@ -48,6 +48,8 @@ module Plugin = struct number_of_slots; attestation_lag; attestation_threshold; + minimal_participation_ratio = _; + rewards_ratio = _; cryptobox_parameters; } = parametric.dal diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 6689c08be0ef7ccb9ce5ca31ceae19089c8af862..cfe318dded28b53fd6ef9bb79e11d5258d56be17 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -145,6 +145,19 @@ let default_dal = attestation_lag = 8; attestation_threshold = 66; cryptobox_parameters = default_cryptobox_parameters; + minimal_participation_ratio = Q.(64 // 100); + (* Note that other values may make tests in tezt/tests/mockup.ml + fail. Indeed, some tests modify the constants' values a bit and then + perform some checks on the modified values. In case of [Q.t] values, + the numerator and the denominator are increased by 1. For instance, + when minimal_attestation_ratio is 60%, we have that the new value is + 2/3 = 4/6 = (3+1)/(5+1). However, the test fails because it does not + realize that 2/3 = 4/6... + That is why a value x of [minimal_participation_ratio] was chosen such + that we have x = a/b with a and b smallest such that they are relatively + prime, and (a+1, b+1) are relatively prime as well. The value x = 63% + works as well. *) + rewards_ratio = Q.zero; } let constants_mainnet : Constants.Parametric.t = @@ -161,10 +174,13 @@ let constants_mainnet : Constants.Parametric.t = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; }; max_slashing_threshold; } = - Constants.Generated.generate ~consensus_committee_size + Constants.Generated.generate + ~consensus_committee_size + ~dal_rewards_ratio:default_dal.rewards_ratio in let dal_activation_level = if default_dal.feature_enable then Raw_level.succ Raw_level.root @@ -230,6 +246,8 @@ let constants_mainnet : Constants.Parametric.t = (* 1/20480 of block rewards *) vdf_revelation_tip_weight; (* 1/20480 of block rewards *) + dal_rewards_weight; + (* 0 for now *) }; hard_storage_limit_per_operation = Z.of_int 60_000; cost_per_byte = Tez.of_mutez_exn 250L; @@ -326,7 +344,9 @@ let constants_sandbox = let block_time = 1 in let Constants.Generated. {max_slashing_threshold; consensus_threshold = _; issuance_weights} = - Constants.Generated.generate ~consensus_committee_size + Constants.Generated.generate + ~consensus_committee_size + ~dal_rewards_ratio:default_dal.rewards_ratio in { constants_mainnet with @@ -361,7 +381,9 @@ let constants_test = let consensus_committee_size = 67 in let Constants.Generated. {max_slashing_threshold = _; consensus_threshold; issuance_weights} = - Constants.Generated.generate ~consensus_committee_size + Constants.Generated.generate + ~consensus_committee_size + ~dal_rewards_ratio:default_dal.rewards_ratio in { constants_mainnet with diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index de30bace905e2596f4abb68d924f85c0b9a9a52f..60ccef1fbe7cd09e6fbbd981f4e0d038bc3bc37f 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -829,6 +829,8 @@ module Constants : sig attestation_lag : int; attestation_threshold : int; cryptobox_parameters : Dal.parameters; + minimal_participation_ratio : Q.t; + rewards_ratio : Q.t; } val dal_encoding : dal Data_encoding.t @@ -898,6 +900,7 @@ module Constants : sig attesting_reward_weight : int; seed_nonce_revelation_tip_weight : int; vdf_revelation_tip_weight : int; + dal_rewards_weight : int; } type t = { @@ -967,7 +970,7 @@ module Constants : sig max_slashing_threshold : int; } - val generate : consensus_committee_size:int -> t + val generate : consensus_committee_size:int -> dal_rewards_ratio:Q.t -> t end val parametric : context -> 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 7ead82db13c164675a0163d32f42e503bd068820..32dad28bbc270eaae0d8aed6a85a83600188909a 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -25,6 +25,26 @@ (* *) (*****************************************************************************) +let q_encoding cond error_msg = + Data_encoding.( + conv_with_guard + (fun Q.{num; den} -> (num, den)) + (fun (num, den) -> + if Compare.Z.(den > Z.zero) && cond num den then Ok (Q.make num den) + else Error error_msg) + (obj2 (req "numerator" z) (req "denominator" z))) + +let positive_q_encoding = q_encoding (fun num _den -> Compare.Z.(num > Z.zero)) + +let non_negative_q_encoding = + q_encoding (fun num _den -> Compare.Z.(num >= Z.zero)) + +let between_zero_and_one_q_encoding = + q_encoding (fun num den -> Compare.Z.(num >= Z.zero && num <= den)) + +let between_zero_and_excluding_one_q_encoding = + q_encoding (fun num den -> Compare.Z.(num >= Z.zero && num < den)) + type dal = { feature_enable : bool; incentives_enable : bool; @@ -32,8 +52,19 @@ type dal = { attestation_lag : int; attestation_threshold : int; cryptobox_parameters : Dal.parameters; + minimal_participation_ratio : Q.t; + rewards_ratio : Q.t; } +let minimal_participation_ratio_encoding = + between_zero_and_one_q_encoding + "dal.minimal_participation_ratio must be a value between zero and one" + +let rewards_ratio_encoding = + between_zero_and_excluding_one_q_encoding + "dal.rewards_ratio must be a value between zero (inclusive) and one \ + (exclusive)" + let dal_encoding = let open Data_encoding in conv @@ -44,18 +75,24 @@ let dal_encoding = attestation_lag; attestation_threshold; cryptobox_parameters; + minimal_participation_ratio; + rewards_ratio; } -> ( ( feature_enable, incentives_enable, number_of_slots, attestation_lag, - attestation_threshold ), + attestation_threshold, + minimal_participation_ratio, + rewards_ratio ), cryptobox_parameters )) (fun ( ( feature_enable, incentives_enable, number_of_slots, attestation_lag, - attestation_threshold ), + attestation_threshold, + minimal_participation_ratio, + rewards_ratio ), cryptobox_parameters ) -> { feature_enable; @@ -64,14 +101,20 @@ let dal_encoding = attestation_lag; attestation_threshold; cryptobox_parameters; + minimal_participation_ratio; + rewards_ratio; }) (merge_objs - (obj5 + (obj7 (req "feature_enable" bool) (req "incentives_enable" bool) (req "number_of_slots" uint16) (req "attestation_lag" uint8) - (req "attestation_threshold" uint8)) + (req "attestation_threshold" uint8) + (req + "minimal_participation_ratio" + minimal_participation_ratio_encoding) + (req "rewards_ratio" rewards_ratio_encoding)) Dal.parameters_encoding) (* The encoded representation of this type is stored in the context as @@ -200,6 +243,7 @@ type issuance_weights = { attesting_reward_weight : int; seed_nonce_revelation_tip_weight : int; vdf_revelation_tip_weight : int; + dal_rewards_weight : int; } type t = { @@ -355,48 +399,20 @@ let zk_rollup_encoding = (req "zk_rollup_max_ticket_payload_size" int31)) let extremum_encoding = - Data_encoding.( - conv_with_guard - (fun Q.{num; den} -> (num, den)) - (fun (num, den) -> - if Compare.Z.(num > Z.zero && den > Z.zero) then Ok (Q.make num den) - else - Error - "Invalid Reward Extremum Parameter: only positive values allowed") - (obj2 (req "numerator" z) (req "denominator" z))) + positive_q_encoding + "Invalid Reward Extremum Parameter: only positive values allowed" let center_encoding = - Data_encoding.( - conv_with_guard - (fun Q.{num; den} -> (num, den)) - (fun (num, den) -> - if Compare.Z.(num >= Z.zero && den > Z.zero && num <= den) then - Ok (Q.make num den) - else - Error - "Invalid Reward Parameter: dead zone center can only be between 0 \ - and 1") - (obj2 (req "numerator" z) (req "denominator" z))) + between_zero_and_one_q_encoding + "Invalid Reward Parameter: dead zone center can only be between 0 and 1" let radius_encoding = - Data_encoding.( - conv_with_guard - (fun Q.{num; den} -> (num, den)) - (fun (num, den) -> - if Compare.Z.(num >= Z.zero && den > Z.zero) then Ok (Q.make num den) - else - Error - "Invalid Reward Parameter: dead zone radius must be non-negative") - (obj2 (req "numerator" z) (req "denominator" z))) + non_negative_q_encoding + "Invalid Reward Parameter: dead zone radius must be non-negative" let growth_rate_encoding = - Data_encoding.( - conv_with_guard - (fun Q.{num; den} -> (num, den)) - (fun (num, den) -> - if Compare.Z.(num >= Z.zero && den > Z.zero) then Ok (Q.make num den) - else Error "Invalid Reward Parameter: growth rate must be non-negative") - (obj2 (req "numerator" z) (req "denominator" z))) + non_negative_q_encoding + "Invalid Reward Parameter: growth rate must be non-negative" let adaptive_rewards_params_encoding = let open Data_encoding in @@ -511,6 +527,7 @@ let issuance_weights_encoding = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; } : issuance_weights) -> ( base_total_issued_per_minute, @@ -518,13 +535,15 @@ let issuance_weights_encoding = baking_reward_bonus_weight, attesting_reward_weight, seed_nonce_revelation_tip_weight, - vdf_revelation_tip_weight )) + vdf_revelation_tip_weight, + dal_rewards_weight )) (fun ( base_total_issued_per_minute, baking_reward_fixed_portion_weight, baking_reward_bonus_weight, attesting_reward_weight, seed_nonce_revelation_tip_weight, - vdf_revelation_tip_weight ) -> + vdf_revelation_tip_weight, + dal_rewards_weight ) -> { base_total_issued_per_minute; baking_reward_fixed_portion_weight; @@ -532,14 +551,16 @@ let issuance_weights_encoding = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; }) - (obj6 + (obj7 (req "base_total_issued_per_minute" Tez_repr.encoding) (req "baking_reward_fixed_portion_weight" int31) (req "baking_reward_bonus_weight" int31) (req "attesting_reward_weight" int31) (req "seed_nonce_revelation_tip_weight" int31) - (req "vdf_revelation_tip_weight" int31)) + (req "vdf_revelation_tip_weight" int31) + (req "dal_rewards_weight" int31)) let encoding = let open Data_encoding in diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index f771c958365f08ff0f9e564f7602d02ab6538177..956f07659ca7acd837480685c0786b6f98b86057 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -33,6 +33,10 @@ type dal = { attestation_lag : int; attestation_threshold : int; cryptobox_parameters : Dal.parameters; + minimal_participation_ratio : Q.t; + (* the ratio of the protocol-attested slots that need to be attested by an + attester in order to receive rewards *) + rewards_ratio : Q.t; (* the ratio of DAL rewards versus total rewards *) } val dal_encoding : dal Data_encoding.t @@ -165,6 +169,7 @@ type issuance_weights = { attesting_reward_weight : int; seed_nonce_revelation_tip_weight : int; vdf_revelation_tip_weight : int; + dal_rewards_weight : int; } type t = { diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index ac692c1d79ff1574f83817781cd061d24873738a..6107f0e2f57a1ceb1c3ecd483a8cbfe74b01b6c7 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -332,6 +332,20 @@ let check_constants constants = (Invalid_protocol_constants "The DAL committee must be a subset of the Tenderbake committee.") in + let* () = + error_when + (Q.(constants.dal.rewards_ratio > zero) + && not constants.dal.incentives_enable) + (Invalid_protocol_constants + "When DAL incentives are not enabled, the DAL rewards_ratio should be \ + zero.") + in + let* () = + error_unless + Q.(constants.dal.rewards_ratio < one) + (Invalid_protocol_constants + "The DAL rewards_ratio should be strictly less than one.") + in let* () = error_unless Compare.Int.( @@ -374,17 +388,49 @@ module Generated = struct max_slashing_threshold : int; } - let generate ~consensus_committee_size = + let generate ~consensus_committee_size ~dal_rewards_ratio = (* The weights are expressed in [(256 * 80)]th of the total - reward, because it is the smallest proportion used so far*) + reward, because it is the smallest proportion used so far *) (* let f = consensus_committee_size / 3 in *) let max_slashing_threshold = (consensus_committee_size / 3) + 1 in let consensus_threshold = (consensus_committee_size * 2 / 3) + 1 in let bonus_committee_size = consensus_committee_size - consensus_threshold in let base_total_issued_per_minute = Tez_repr.of_mutez_exn 80_007_812L in - let _reward_parts_whole = 20480 (* = 256 * 80 *) in + let reward_parts_whole = 20480 (* = 256 * 80 *) in let reward_parts_half = 10240 (* = reward_parts_whole / 2 *) in let reward_parts_quarter = 5120 (* = reward_parts_whole / 4 *) in + let baking_reward_fixed_portion_weight = + (* 1/4 or 1/2 *) + if Compare.Int.(bonus_committee_size <= 0) then + (* a fortiori, consensus_committee_size < 4 *) + reward_parts_half + else reward_parts_quarter + in + let baking_reward_bonus_weight = + (* 1/4 or 0 *) + if Compare.Int.(bonus_committee_size <= 0) then 0 + else reward_parts_quarter + in + let attesting_reward_weight = + (* 1/2 *) + reward_parts_half + in + (* All block (baking + attesting) rewards sum to 1 ( *256*80 ) *) + let seed_nonce_revelation_tip_weight = (* 1/20480 *) 1 in + let vdf_revelation_tip_weight = (* 1/20480 *) 1 in + let sum_non_dal_weights = + reward_parts_whole + seed_nonce_revelation_tip_weight + + vdf_revelation_tip_weight + in + (* Compute the weight of DAL rewards such that these represent + [dal_rewards_ratio] of the total rewards. *) + let dal_rewards_weight = + let open Q in + div + (mul (of_int sum_non_dal_weights) dal_rewards_ratio) + (sub one dal_rewards_ratio) + |> to_int + in { max_slashing_threshold; consensus_threshold; @@ -392,23 +438,12 @@ module Generated = struct { base_total_issued_per_minute; (* 80.007812 tez/minute *) - baking_reward_fixed_portion_weight = - (* 1/4 or 1/2 *) - (if Compare.Int.(bonus_committee_size <= 0) then - (* a fortiori, consensus_committee_size < 4 *) - reward_parts_half - else reward_parts_quarter); - baking_reward_bonus_weight = - (* 1/4 or 0 *) - (if Compare.Int.(bonus_committee_size <= 0) then 0 - else reward_parts_quarter); - attesting_reward_weight = reward_parts_half; - (* 1/2 *) - (* All block (baking + attesting)rewards sum to 1 ( *256*80 ) *) - seed_nonce_revelation_tip_weight = 1; - (* 1/20480 *) - vdf_revelation_tip_weight = 1; - (* 1/20480 *) + baking_reward_fixed_portion_weight; + baking_reward_bonus_weight; + attesting_reward_weight; + dal_rewards_weight; + seed_nonce_revelation_tip_weight; + vdf_revelation_tip_weight; }; } end diff --git a/src/proto_alpha/lib_protocol/constants_repr.mli b/src/proto_alpha/lib_protocol/constants_repr.mli index 29e20a85e38ffa99600a8c0c3991aa41c536a255..a764bda265771a611ff6b984760dc3a2ae32b143 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_repr.mli @@ -125,7 +125,7 @@ module Generated : sig (* This function is meant to be used just in lib_parameters and in the migration code to be sure that the parameters are consistent. *) - val generate : consensus_committee_size:int -> t + val generate : consensus_committee_size:int -> dal_rewards_ratio:Q.t -> t end (** For each subcache, a size limit needs to be declared once. However, diff --git a/src/proto_alpha/lib_protocol/delegate_rewards.ml b/src/proto_alpha/lib_protocol/delegate_rewards.ml index 3d108c7e34df89decfc82c88fd54a47d9498507c..67b19ee0e28aea62f0c69a06e8d0f6d7bf807c58 100644 --- a/src/proto_alpha/lib_protocol/delegate_rewards.ml +++ b/src/proto_alpha/lib_protocol/delegate_rewards.ml @@ -32,6 +32,7 @@ let sum_weights attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; } : Constants_parametric_repr.issuance_weights) = let r = baking_reward_fixed_portion_weight in @@ -39,6 +40,7 @@ let sum_weights let r = attesting_reward_weight + r in let r = seed_nonce_revelation_tip_weight + r in let r = vdf_revelation_tip_weight + r in + let r = dal_rewards_weight + r in assert (Compare.Int.(r > 0)) ; r diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index d70c90e86e788abf713c7047e68cafd4c08c70bc..3230d55952c909cb90ee40b79ca2565103f62e87 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1003,6 +1003,8 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attestation_lag; attestation_threshold; cryptobox_parameters; + minimal_participation_ratio; + rewards_ratio; } : Previous.dal) = c.dal @@ -1014,6 +1016,8 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attestation_lag; attestation_threshold; cryptobox_parameters; + minimal_participation_ratio; + rewards_ratio; } in let reveal_activation_level = @@ -1158,6 +1162,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; } : Previous.issuance_weights) = c.issuance_weights @@ -1169,6 +1174,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight; } in let constants = @@ -1303,6 +1309,8 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attestation_lag; attestation_threshold; cryptobox_parameters; + minimal_participation_ratio = Q.(64 // 100); + rewards_ratio = Q.zero; } in let reveal_activation_level = @@ -1459,6 +1467,7 @@ let prepare_first_block ~level ~timestamp chain_id ctxt = attesting_reward_weight; seed_nonce_revelation_tip_weight; vdf_revelation_tip_weight; + dal_rewards_weight = 0; } in let constants = diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_begin.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_begin.ml index fc832fb202191b0dc7dc4d7296cb8ab4e02a9a34..99dadb0caf0c1252427e534ee175ea4fb07a0488 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_begin.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_begin.ml @@ -104,6 +104,7 @@ let init_constants ?(default = Test) ?(reward_per_block = 0L) attesting_reward_weight = 0; seed_nonce_revelation_tip_weight = 0; vdf_revelation_tip_weight = 0; + dal_rewards_weight = 0; } --> set S.liquidity_baking_subsidy Tez.zero --> set S.minimal_block_delay Protocol.Alpha_context.Period.one_minute diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml index 9344f0dd2e59aa97bbb4e009832644398e5b75b1..80b9145f9a057d27b64533c57832e43453e406a1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_seed.ml @@ -312,6 +312,7 @@ let test_unrevealed () = baking_reward_fixed_portion_weight = 0; seed_nonce_revelation_tip_weight = 0; vdf_revelation_tip_weight = 0; + dal_rewards_weight = 0; }; consensus_threshold = 0; minimal_participation_ratio = Ratio.{numerator = 0; denominator = 1}; diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml index df31d2f3cb8c37a047999b61ccd5dff0c1c6b424..a23fe5ffb8a4777b2a6f19979edfac7e80c1c71f 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_voting.ml @@ -279,6 +279,7 @@ let context_init_tup tup ?(blocks_per_cycle = 4l) = baking_reward_fixed_portion_weight = 1; seed_nonce_revelation_tip_weight = 1; vdf_revelation_tip_weight = 1; + dal_rewards_weight = 1; } ~nonce_revelation_threshold:2l 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 970ed0caadd9c29ac3221bad17ef5ac35a1e4d0e..da0e279e9c93aecf9789a442db540a3aab049741 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 @@ -22,9 +22,10 @@ { "base_total_issued_per_minute": "80007812", "baking_reward_fixed_portion_weight": 5120, "baking_reward_bonus_weight": 5120, "attesting_reward_weight": 10240, - "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1 }, - "cost_per_byte": "250", "hard_storage_limit_per_operation": "60000", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, + "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1, + "dal_rewards_weight": 0 }, "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "liquidity_baking_subsidy": "5000000", "liquidity_baking_toggle_ema_threshold": 1000000000, "max_operations_time_to_live": 8, "minimal_block_delay": "1", @@ -40,9 +41,12 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": false, "number_of_slots": 16, "attestation_lag": 8, - "attestation_threshold": 66, "redundancy_factor": 8, "page_size": 3967, - "slot_size": 126944, "number_of_shards": 256 }, - "smart_rollup_arith_pvm_enable": false, + "attestation_threshold": 66, + "minimal_participation_ratio": + { "numerator": "16", "denominator": "25" }, + "rewards_ratio": { "numerator": "0", "denominator": "1" }, + "redundancy_factor": 8, "page_size": 3967, "slot_size": 126944, + "number_of_shards": 256 }, "smart_rollup_arith_pvm_enable": false, "smart_rollup_origination_size": 6314, "smart_rollup_challenge_window_in_blocks": 151200, "smart_rollup_stake_amount": "10000000000", 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 7f261bd69435cd6d56d9a16725e395d8a4507cb8..abb88f3b582990dcaabbb88c793feb4a5404f37b 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 @@ -22,9 +22,10 @@ { "base_total_issued_per_minute": "80007812", "baking_reward_fixed_portion_weight": 5120, "baking_reward_bonus_weight": 5120, "attesting_reward_weight": 10240, - "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1 }, - "cost_per_byte": "250", "hard_storage_limit_per_operation": "60000", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, + "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1, + "dal_rewards_weight": 0 }, "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "liquidity_baking_subsidy": "5000000", "liquidity_baking_toggle_ema_threshold": 1000000000, "max_operations_time_to_live": 8, "minimal_block_delay": "1", @@ -40,9 +41,12 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": false, "number_of_slots": 16, "attestation_lag": 8, - "attestation_threshold": 66, "redundancy_factor": 8, "page_size": 3967, - "slot_size": 126944, "number_of_shards": 256 }, - "smart_rollup_arith_pvm_enable": false, + "attestation_threshold": 66, + "minimal_participation_ratio": + { "numerator": "16", "denominator": "25" }, + "rewards_ratio": { "numerator": "0", "denominator": "1" }, + "redundancy_factor": 8, "page_size": 3967, "slot_size": 126944, + "number_of_shards": 256 }, "smart_rollup_arith_pvm_enable": false, "smart_rollup_origination_size": 6314, "smart_rollup_challenge_window_in_blocks": 151200, "smart_rollup_stake_amount": "10000000000", 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 9885c93051ceef3c9b8d8dff5f447665407ad473..240d581287d774fb66a0e03181767e1716f60eb2 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 @@ -22,9 +22,10 @@ { "base_total_issued_per_minute": "80007812", "baking_reward_fixed_portion_weight": 5120, "baking_reward_bonus_weight": 5120, "attesting_reward_weight": 10240, - "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1 }, - "cost_per_byte": "250", "hard_storage_limit_per_operation": "60000", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, + "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1, + "dal_rewards_weight": 0 }, "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "liquidity_baking_subsidy": "5000000", "liquidity_baking_toggle_ema_threshold": 1000000000, "max_operations_time_to_live": 8, "minimal_block_delay": "1", @@ -40,9 +41,12 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": false, "number_of_slots": 16, "attestation_lag": 8, - "attestation_threshold": 66, "redundancy_factor": 8, "page_size": 3967, - "slot_size": 126944, "number_of_shards": 256 }, - "smart_rollup_arith_pvm_enable": false, + "attestation_threshold": 66, + "minimal_participation_ratio": + { "numerator": "16", "denominator": "25" }, + "rewards_ratio": { "numerator": "0", "denominator": "1" }, + "redundancy_factor": 8, "page_size": 3967, "slot_size": 126944, + "number_of_shards": 256 }, "smart_rollup_arith_pvm_enable": false, "smart_rollup_origination_size": 6314, "smart_rollup_challenge_window_in_blocks": 151200, "smart_rollup_stake_amount": "10000000000", 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 f982931035a9d85a0478b99f0746fa94f19201fe..acd11f96902b77a9273a3adb3cb7729711fd153e 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 @@ -12,9 +12,10 @@ { "base_total_issued_per_minute": "85007812", "baking_reward_fixed_portion_weight": 5120, "baking_reward_bonus_weight": 5120, "attesting_reward_weight": 10240, - "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1 }, - "cost_per_byte": "250", "hard_storage_limit_per_operation": "60000", - "quorum_min": 2000, "quorum_max": 7000, "min_proposal_quorum": 500, + "seed_nonce_revelation_tip_weight": 1, "vdf_revelation_tip_weight": 1, + "dal_rewards_weight": 0 }, "cost_per_byte": "250", + "hard_storage_limit_per_operation": "60000", "quorum_min": 2000, + "quorum_max": 7000, "min_proposal_quorum": 500, "liquidity_baking_subsidy": "5000000", "liquidity_baking_toggle_ema_threshold": 100000, "max_operations_time_to_live": 188, "minimal_block_delay": "4", @@ -30,9 +31,12 @@ "dal_parametric": { "feature_enable": true, "incentives_enable": false, "number_of_slots": 32, "attestation_lag": 8, - "attestation_threshold": 66, "redundancy_factor": 8, "page_size": 3967, - "slot_size": 126944, "number_of_shards": 512 }, - "smart_rollup_arith_pvm_enable": true, + "attestation_threshold": 66, + "minimal_participation_ratio": + { "numerator": "16", "denominator": "25" }, + "rewards_ratio": { "numerator": "0", "denominator": "1" }, + "redundancy_factor": 8, "page_size": 3967, "slot_size": 126944, + "number_of_shards": 512 }, "smart_rollup_arith_pvm_enable": true, "smart_rollup_origination_size": 6314, "smart_rollup_challenge_window_in_blocks": 62, "smart_rollup_stake_amount": "32000000",