From 548b6c8801c0ce62f77258494379abc1b9d860ee Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 16 May 2023 09:56:12 +0200 Subject: [PATCH 1/5] Proto: convert parameter ratio_of_frozen_deposits_slashed_per_double_endorsement to a percentage This is to ease summing several percentages later on. --- .../lib_parameters/default_parameters.ml | 3 +-- .../lib_protocol/alpha_context.mli | 6 ++--- .../lib_protocol/constants_parametric_repr.ml | 12 +++++----- .../constants_parametric_repr.mli | 2 +- .../lib_protocol/constants_repr.ml | 13 ++++++----- .../lib_protocol/constants_storage.ml | 4 ++-- .../lib_protocol/constants_storage.mli | 4 ++-- .../delegate_slashed_deposits_storage.ml | 9 ++++---- src/proto_alpha/lib_protocol/raw_context.ml | 8 +++++-- .../consensus/test_double_baking.ml | 18 +++++---------- .../consensus/test_double_endorsement.ml | 23 ++++++++----------- .../consensus/test_double_preendorsement.ml | 8 +++---- 12 files changed, 50 insertions(+), 60 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 85ce8ea4152c..7688ec11da24 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -181,8 +181,7 @@ let constants_mainnet = max_slashing_period = 2; frozen_deposits_percentage = 10; double_baking_punishment = Tez.(mul_exn one 640); - ratio_of_frozen_deposits_slashed_per_double_endorsement = - {numerator = 1; denominator = 2}; + percentage_of_frozen_deposits_slashed_per_double_endorsement = 50; (* The `testnet_dictator` should absolutely be None on mainnet *) testnet_dictator = None; initial_seed = None; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 62f800366a9a..66434cb47ff9 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -885,7 +885,7 @@ module Constants : sig max_slashing_period : int; frozen_deposits_percentage : int; double_baking_punishment : Tez.t; - ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio.t; + percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : public_key_hash option; initial_seed : State_hash.t option; cache_script_size : int; @@ -973,8 +973,8 @@ module Constants : sig val double_baking_punishment : context -> Tez.t - val ratio_of_frozen_deposits_slashed_per_double_endorsement : - context -> Ratio.t + val percentage_of_frozen_deposits_slashed_per_double_endorsement : + context -> int val testnet_dictator : context -> public_key_hash option diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 6ef035b0b4ad..aa434f4c633d 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -168,7 +168,7 @@ type t = { max_slashing_period : int; frozen_deposits_percentage : int; double_baking_punishment : Tez_repr.t; - ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : Signature.Public_key_hash.t option; initial_seed : State_hash.t option; (* If a new cache is added, please also modify the @@ -430,7 +430,7 @@ let encoding = c.max_slashing_period, c.frozen_deposits_percentage, c.double_baking_punishment, - c.ratio_of_frozen_deposits_slashed_per_double_endorsement, + c.percentage_of_frozen_deposits_slashed_per_double_endorsement, c.testnet_dictator, c.initial_seed ), ( ( c.cache_script_size, @@ -467,7 +467,7 @@ let encoding = max_slashing_period, frozen_deposits_percentage, double_baking_punishment, - ratio_of_frozen_deposits_slashed_per_double_endorsement, + percentage_of_frozen_deposits_slashed_per_double_endorsement, testnet_dictator, initial_seed ), ( ( cache_script_size, @@ -505,7 +505,7 @@ let encoding = consensus_threshold; frozen_deposits_percentage; double_baking_punishment; - ratio_of_frozen_deposits_slashed_per_double_endorsement; + percentage_of_frozen_deposits_slashed_per_double_endorsement; testnet_dictator; initial_seed; cache_script_size; @@ -558,8 +558,8 @@ let encoding = (req "frozen_deposits_percentage" int31) (req "double_baking_punishment" Tez_repr.encoding) (req - "ratio_of_frozen_deposits_slashed_per_double_endorsement" - Ratio_repr.encoding) + "percentage_of_frozen_deposits_slashed_per_double_endorsement" + uint8) (opt "testnet_dictator" Signature.Public_key_hash.encoding) (opt "initial_seed" State_hash.encoding)) (merge_objs diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index b6b57acbacdb..fe372876d5e4 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -197,7 +197,7 @@ type t = { frozen_deposits_percentage : int; (* that is, (100 * delegated tz / own tz) *) double_baking_punishment : Tez_repr.t; - ratio_of_frozen_deposits_slashed_per_double_endorsement : Ratio_repr.t; + percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : Signature.Public_key_hash.t option; initial_seed : State_hash.t option; cache_script_size : int; diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index b4faea3ebb68..cac2ae167168 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -234,13 +234,14 @@ let check_constants constants = "The double baking punishment must be non-negative.") >>? fun () -> error_unless - (let Ratio_repr.{numerator; denominator} = - constants.ratio_of_frozen_deposits_slashed_per_double_endorsement - in - Compare.Int.(numerator >= 0 && denominator > 0)) + Compare.Int.( + constants.percentage_of_frozen_deposits_slashed_per_double_endorsement + >= 0 + && constants.percentage_of_frozen_deposits_slashed_per_double_endorsement + <= 100) (Invalid_protocol_constants - "The ratio of frozen deposits ratio slashed per double endorsement must \ - be a non-negative valid ratio.") + "The percentage of frozen deposits slashed per double endorsement must \ + be between 0 and 100 included.") >>? fun () -> error_unless (let snapshot_frequence = diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index dacae7e11584..a32689eef73d 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -198,9 +198,9 @@ let tx_rollup_rejection_max_proof_size c = let tx_rollup = Raw_context.tx_rollup c in tx_rollup.rejection_max_proof_size -let ratio_of_frozen_deposits_slashed_per_double_endorsement c = +let percentage_of_frozen_deposits_slashed_per_double_endorsement c = let constants = Raw_context.constants c in - constants.ratio_of_frozen_deposits_slashed_per_double_endorsement + constants.percentage_of_frozen_deposits_slashed_per_double_endorsement let testnet_dictator c = let constants = Raw_context.constants c in diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index b89922965046..b33e1e5c289d 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -116,8 +116,8 @@ val tx_rollup_rejection_max_proof_size : Raw_context.t -> int val tx_rollup_sunset_level : Raw_context.t -> int32 -val ratio_of_frozen_deposits_slashed_per_double_endorsement : - Raw_context.t -> Ratio_repr.t +val percentage_of_frozen_deposits_slashed_per_double_endorsement : + Raw_context.t -> int val testnet_dictator : Raw_context.t -> Signature.Public_key_hash.t option diff --git a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml index 7b0406f2d0ac..8d7500e90300 100644 --- a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml @@ -65,15 +65,14 @@ let punish_double_endorsing ctxt delegate (level : Level_repr.t) = in let delegate_contract = Contract_repr.Implicit delegate in let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in - let slashing_ratio : Ratio_repr.t = - Constants_storage.ratio_of_frozen_deposits_slashed_per_double_endorsement + let slashing_percentage = + Constants_storage + .percentage_of_frozen_deposits_slashed_per_double_endorsement ctxt in let punish_value = Tez_repr.( - div_exn - (mul_exn frozen_deposits.initial_amount slashing_ratio.numerator) - slashing_ratio.denominator) + div_exn (mul_exn frozen_deposits.initial_amount slashing_percentage) 100) in let punishing_amount = Tez_repr.(min frozen_deposits.current_amount punish_value) diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 1e83a1d7a2e8..bafa6c1425dc 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -990,6 +990,11 @@ let prepare_first_block ~level ~timestamp ctxt = c_gen.reward_weights in + let percentage_of_frozen_deposits_slashed_per_double_endorsement = + 100 + * c.ratio_of_frozen_deposits_slashed_per_double_endorsement.numerator + / c.ratio_of_frozen_deposits_slashed_per_double_endorsement.denominator + in let constants = Constants_parametric_repr. { @@ -1023,8 +1028,7 @@ let prepare_first_block ~level ~timestamp ctxt = max_slashing_period = c.max_slashing_period; frozen_deposits_percentage = c.frozen_deposits_percentage; double_baking_punishment = c.double_baking_punishment; - ratio_of_frozen_deposits_slashed_per_double_endorsement = - c.ratio_of_frozen_deposits_slashed_per_double_endorsement; + percentage_of_frozen_deposits_slashed_per_double_endorsement; (* The `testnet_dictator` should absolutely be None on mainnet *) testnet_dictator = c.testnet_dictator; initial_seed = c.initial_seed; diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml index c9047155bb61..54faa940a253 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -129,14 +129,11 @@ let test_valid_double_baking_followed_by_double_endorsing () = Context.Delegate.current_frozen_deposits (B blk_final) baker1 >>=? fun frozen_deposits_after -> Context.get_constants (B genesis) >>=? fun csts -> - let r = - csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + let p = + csts.parametric.percentage_of_frozen_deposits_slashed_per_double_endorsement in let expected_frozen_deposits_after_de = - Test_tez.( - frozen_deposits_before - *! Int64.of_int (r.denominator - r.numerator) - /! Int64.of_int r.denominator) + Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in (* the deposit after double baking and double endorsing equals the expected deposit after double endorsing minus the double baking @@ -180,14 +177,11 @@ let test_valid_double_endorsing_followed_by_double_baking () = Context.Delegate.current_frozen_deposits (B blk_with_db_evidence) baker1 >>=? fun frozen_deposits_after -> Context.get_constants (B genesis) >>=? fun csts -> - let r = - csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + let p = + csts.parametric.percentage_of_frozen_deposits_slashed_per_double_endorsement in let expected_frozen_deposits_after_de = - Test_tez.( - frozen_deposits_before - *! Int64.of_int (r.denominator - r.numerator) - /! Int64.of_int r.denominator) + Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in (* the deposit after double baking and double endorsing equals the expected deposit after double endorsing minus the double baking diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml index 06378385be48..7222d4fb9ce0 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -99,14 +99,11 @@ let test_valid_double_endorsement_evidence () = Context.Delegate.current_frozen_deposits (B blk_final) delegate >>=? fun frozen_deposits_after -> Context.get_constants (B genesis) >>=? fun csts -> - let r = - csts.parametric.ratio_of_frozen_deposits_slashed_per_double_endorsement + let p = + csts.parametric.percentage_of_frozen_deposits_slashed_per_double_endorsement in let expected_frozen_deposits_after = - Test_tez.( - frozen_deposits_before - *! Int64.of_int (r.denominator - r.numerator) - /! Int64.of_int r.denominator) + Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in Assert.equal_tez ~loc:__LOC__ @@ -392,9 +389,9 @@ let test_freeze_more_with_low_balance = consensus_threshold = 0; origination_size = 0; preserved_cycles = 5; - ratio_of_frozen_deposits_slashed_per_double_endorsement = - (* enforce that ratio is 50% is the test's params. *) - {numerator = 1; denominator = 2}; + percentage_of_frozen_deposits_slashed_per_double_endorsement = + (* enforce that percentage is 50% in the test's params. *) + 50; } in Context.init_with_constants2 constants >>=? fun (genesis, (c1, c2)) -> @@ -430,14 +427,12 @@ let test_freeze_more_with_low_balance = >>=? fun () -> (* We also check that compared to deposits at block [b2], [account1] lost 50% of its deposits. *) - let slash_ratio = - constants.ratio_of_frozen_deposits_slashed_per_double_endorsement + let slash_percentage = + constants.percentage_of_frozen_deposits_slashed_per_double_endorsement in let expected_frozen_deposits_after = Test_tez.( - info2.frozen_deposits - *! Int64.of_int (slash_ratio.denominator - slash_ratio.numerator) - /! Int64.of_int slash_ratio.denominator) + info2.frozen_deposits *! Int64.of_int (100 - slash_percentage) /! 100L) in Assert.equal_tez ~loc:__LOC__ diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml index eeeff16940ce..f6a264121cd4 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_preendorsement.ml @@ -126,7 +126,8 @@ end = struct { parametric = { - ratio_of_frozen_deposits_slashed_per_double_endorsement = r; + percentage_of_frozen_deposits_slashed_per_double_endorsement = + p; _; }; _; @@ -141,10 +142,7 @@ end = struct (* the diff of the two balances in normal and in denunciation cases *) let diff_end_bal = Test_tez.(bal_good -! bal_bad) in (* amount lost due to denunciation *) - let lost_deposit = - Test_tez.( - frozen_deposit *! Int64.of_int r.numerator /! Int64.of_int r.denominator) - in + let lost_deposit = Test_tez.(frozen_deposit *! Int64.of_int p /! 100L) in (* have of the lost deposts will be earned by the baker *) let denun_reward = Test_tez.(lost_deposit /! 2L) in (* if the baker is the endorser, he'll only loose half of the deposits *) -- GitLab From fd0bdf1f5f168c2dace5936fa0589d45e0144138 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 16 May 2023 10:19:21 +0200 Subject: [PATCH 2/5] Proto: convert parameter double_baking_punishment to a percentage --- .../lib_parameters/default_parameters.ml | 2 +- .../lib_protocol/alpha_context.mli | 4 +- .../lib_protocol/constants_parametric_repr.ml | 12 ++-- .../constants_parametric_repr.mli | 2 +- .../lib_protocol/constants_repr.ml | 8 ++- .../lib_protocol/constants_storage.ml | 4 +- .../lib_protocol/constants_storage.mli | 3 +- .../delegate_slashed_deposits_storage.ml | 11 ++- src/proto_alpha/lib_protocol/raw_context.ml | 13 +++- .../consensus/test_double_baking.ml | 67 ++++++++++++------- 10 files changed, 82 insertions(+), 44 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 7688ec11da24..9694edbbe003 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -180,7 +180,7 @@ let constants_mainnet = minimal_participation_ratio = {numerator = 2; denominator = 3}; max_slashing_period = 2; frozen_deposits_percentage = 10; - double_baking_punishment = Tez.(mul_exn one 640); + percentage_of_frozen_deposits_slashed_per_double_baking = 11; percentage_of_frozen_deposits_slashed_per_double_endorsement = 50; (* The `testnet_dictator` should absolutely be None on mainnet *) testnet_dictator = None; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 66434cb47ff9..ddbb4ac64692 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -884,7 +884,7 @@ module Constants : sig consensus_threshold : int; max_slashing_period : int; frozen_deposits_percentage : int; - double_baking_punishment : Tez.t; + percentage_of_frozen_deposits_slashed_per_double_baking : int; percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : public_key_hash option; initial_seed : State_hash.t option; @@ -971,7 +971,7 @@ module Constants : sig val frozen_deposits_percentage : context -> int - val double_baking_punishment : context -> Tez.t + val percentage_of_frozen_deposits_slashed_per_double_baking : context -> int val percentage_of_frozen_deposits_slashed_per_double_endorsement : context -> int diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index aa434f4c633d..46de36c9137f 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -167,7 +167,7 @@ type t = { consensus_threshold : int; max_slashing_period : int; frozen_deposits_percentage : int; - double_baking_punishment : Tez_repr.t; + percentage_of_frozen_deposits_slashed_per_double_baking : int; percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : Signature.Public_key_hash.t option; initial_seed : State_hash.t option; @@ -429,7 +429,7 @@ let encoding = ( ( c.minimal_participation_ratio, c.max_slashing_period, c.frozen_deposits_percentage, - c.double_baking_punishment, + c.percentage_of_frozen_deposits_slashed_per_double_baking, c.percentage_of_frozen_deposits_slashed_per_double_endorsement, c.testnet_dictator, c.initial_seed ), @@ -466,7 +466,7 @@ let encoding = ( ( minimal_participation_ratio, max_slashing_period, frozen_deposits_percentage, - double_baking_punishment, + percentage_of_frozen_deposits_slashed_per_double_baking, percentage_of_frozen_deposits_slashed_per_double_endorsement, testnet_dictator, initial_seed ), @@ -504,7 +504,7 @@ let encoding = consensus_committee_size; consensus_threshold; frozen_deposits_percentage; - double_baking_punishment; + percentage_of_frozen_deposits_slashed_per_double_baking; percentage_of_frozen_deposits_slashed_per_double_endorsement; testnet_dictator; initial_seed; @@ -556,7 +556,9 @@ let encoding = (req "minimal_participation_ratio" Ratio_repr.encoding) (req "max_slashing_period" int31) (req "frozen_deposits_percentage" int31) - (req "double_baking_punishment" Tez_repr.encoding) + (req + "percentage_of_frozen_deposits_slashed_per_double_baking" + uint8) (req "percentage_of_frozen_deposits_slashed_per_double_endorsement" uint8) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index fe372876d5e4..e21bc9a37a17 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -196,7 +196,7 @@ type t = { (* in cycles *) frozen_deposits_percentage : int; (* that is, (100 * delegated tz / own tz) *) - double_baking_punishment : Tez_repr.t; + percentage_of_frozen_deposits_slashed_per_double_baking : int; percentage_of_frozen_deposits_slashed_per_double_endorsement : int; testnet_dictator : Signature.Public_key_hash.t option; initial_seed : State_hash.t option; diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index cac2ae167168..16a1b80597a9 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -229,9 +229,13 @@ let check_constants constants = or equal than 100.") >>? fun () -> error_unless - Tez_repr.(constants.double_baking_punishment >= zero) + Compare.Int.( + constants.percentage_of_frozen_deposits_slashed_per_double_baking >= 0 + && constants.percentage_of_frozen_deposits_slashed_per_double_baking + <= 100) (Invalid_protocol_constants - "The double baking punishment must be non-negative.") + "The percentage of frozen deposits slashed per double baking must be \ + between 0 and 100 included.") >>? fun () -> error_unless Compare.Int.( diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index a32689eef73d..abcf569dd7fc 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -134,9 +134,9 @@ let frozen_deposits_percentage c = let constants = Raw_context.constants c in constants.frozen_deposits_percentage -let double_baking_punishment c = +let percentage_of_frozen_deposits_slashed_per_double_baking c = let constants = Raw_context.constants c in - constants.double_baking_punishment + constants.percentage_of_frozen_deposits_slashed_per_double_baking let tx_rollup_enable c = let tx_rollup = Raw_context.tx_rollup c in diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index b33e1e5c289d..688f68a517a5 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -84,7 +84,8 @@ val max_slashing_period : Raw_context.t -> int val frozen_deposits_percentage : Raw_context.t -> int -val double_baking_punishment : Raw_context.t -> Tez_repr.t +val percentage_of_frozen_deposits_slashed_per_double_baking : + Raw_context.t -> int val tx_rollup_enable : Raw_context.t -> bool diff --git a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml index 8d7500e90300..63b7b03740b1 100644 --- a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml @@ -98,11 +98,16 @@ let punish_double_baking ctxt delegate (level : Level_repr.t) = in let delegate_contract = Contract_repr.Implicit delegate in let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in - let slashing_for_one_block = - Constants_storage.double_baking_punishment ctxt + let slashing_percentage = + Constants_storage.percentage_of_frozen_deposits_slashed_per_double_baking + ctxt + in + let punish_value = + Tez_repr.( + div_exn (mul_exn frozen_deposits.initial_amount slashing_percentage) 100) in let punishing_amount = - Tez_repr.(min frozen_deposits.current_amount slashing_for_one_block) + Tez_repr.(min frozen_deposits.current_amount punish_value) in finish_punish ctxt diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index bafa6c1425dc..765dbae7a0c3 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -995,6 +995,17 @@ let prepare_first_block ~level ~timestamp ctxt = * c.ratio_of_frozen_deposits_slashed_per_double_endorsement.numerator / c.ratio_of_frozen_deposits_slashed_per_double_endorsement.denominator in + let percentage_of_frozen_deposits_slashed_per_double_baking = + let double_baking_punishment_times_100 = + Int64.mul 100L (Tez_repr.to_mutez c.double_baking_punishment) + in + let percentage_rounded_down = + Int64.div + double_baking_punishment_times_100 + (Tez_repr.to_mutez c.minimal_stake) + in + 1 + Int64.to_int percentage_rounded_down + in let constants = Constants_parametric_repr. { @@ -1027,7 +1038,7 @@ let prepare_first_block ~level ~timestamp ctxt = minimal_participation_ratio = c.minimal_participation_ratio; max_slashing_period = c.max_slashing_period; frozen_deposits_percentage = c.frozen_deposits_percentage; - double_baking_punishment = c.double_baking_punishment; + percentage_of_frozen_deposits_slashed_per_double_baking; percentage_of_frozen_deposits_slashed_per_double_endorsement; (* The `testnet_dictator` should absolutely be None on mainnet *) testnet_dictator = c.testnet_dictator; diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml index 54faa940a253..85a208162934 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_baking.ml @@ -68,8 +68,10 @@ let double_baking ctxt ?(correct_order = true) bh1 bh2 = exposed by a double baking evidence operation. *) let test_valid_double_baking_evidence () = Context.init2 ~consensus_threshold:0 () >>=? fun (genesis, contracts) -> - Context.get_constants (B genesis) - >>=? fun Constants.{parametric = {double_baking_punishment; _}; _} -> + Context.get_constants (B genesis) >>=? fun c -> + let p = + c.parametric.percentage_of_frozen_deposits_slashed_per_double_baking + in Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> block_fork ~policy:(By_account baker1) contracts genesis >>=? fun (blk_a, blk_b) -> @@ -80,10 +82,13 @@ let test_valid_double_baking_evidence () = >>=? fun frozen_deposits_before -> Context.Delegate.current_frozen_deposits (B blk_final) baker1 >>=? fun frozen_deposits_after -> - let slashed_amount = - Test_tez.(frozen_deposits_before -! frozen_deposits_after) + let expected_frozen_deposits_after = + Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in - Assert.equal_tez ~loc:__LOC__ slashed_amount double_baking_punishment + Assert.equal_tez + ~loc:__LOC__ + frozen_deposits_after + expected_frozen_deposits_after >>=? fun () -> (* Check that the initial frozen deposits has not changed *) Context.Delegate.initial_frozen_deposits (B blk_final) baker1 @@ -129,20 +134,21 @@ let test_valid_double_baking_followed_by_double_endorsing () = Context.Delegate.current_frozen_deposits (B blk_final) baker1 >>=? fun frozen_deposits_after -> Context.get_constants (B genesis) >>=? fun csts -> - let p = + let p_de = csts.parametric.percentage_of_frozen_deposits_slashed_per_double_endorsement in - let expected_frozen_deposits_after_de = + let p_db = + csts.parametric.percentage_of_frozen_deposits_slashed_per_double_baking + in + let p = p_de + p_db (* assuming the sum doesn't exceed 100% *) in + let expected_frozen_deposits_after = Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in - (* the deposit after double baking and double endorsing equals the - expected deposit after double endorsing minus the double baking - punishment *) + (* Both slashings are computed on the initial amount of frozen deposits so + the percentages are additive, not multiplicative. *) Assert.equal_tez ~loc:__LOC__ - Test_tez.( - expected_frozen_deposits_after_de - -! csts.parametric.double_baking_punishment) + expected_frozen_deposits_after frozen_deposits_after (* auxiliary function used in [test_valid_double_endorsing_followed_by_double_baking] *) @@ -177,20 +183,21 @@ let test_valid_double_endorsing_followed_by_double_baking () = Context.Delegate.current_frozen_deposits (B blk_with_db_evidence) baker1 >>=? fun frozen_deposits_after -> Context.get_constants (B genesis) >>=? fun csts -> - let p = + let p_de = csts.parametric.percentage_of_frozen_deposits_slashed_per_double_endorsement in - let expected_frozen_deposits_after_de = + let p_db = + csts.parametric.percentage_of_frozen_deposits_slashed_per_double_baking + in + let p = p_de + p_db (* assuming the sum doesn't exceed 100% *) in + let expected_frozen_deposits_after = Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) in - (* the deposit after double baking and double endorsing equals the - expected deposit after double endorsing minus the double baking - punishment *) + (* Both slashings are computed on the initial amount of frozen deposits so + the percentages are additive, not multiplicative. *) Assert.equal_tez ~loc:__LOC__ - Test_tez.( - expected_frozen_deposits_after_de - -! csts.parametric.double_baking_punishment) + expected_frozen_deposits_after frozen_deposits_after (** Test that the payload producer of the block containing a double @@ -198,8 +205,10 @@ let test_valid_double_endorsing_followed_by_double_baking () = the reward. *) let test_payload_producer_gets_evidence_rewards () = Context.init_n ~consensus_threshold:0 10 () >>=? fun (genesis, contracts) -> - Context.get_constants (B genesis) - >>=? fun Constants.{parametric = {double_baking_punishment; _}; _} -> + Context.get_constants (B genesis) >>=? fun c -> + let p = + c.parametric.percentage_of_frozen_deposits_slashed_per_double_baking + in Context.get_baking_reward_fixed_portion (B genesis) >>=? fun baking_reward_fixed_portion -> Context.get_first_different_bakers (B genesis) >>=? fun (baker1, baker2) -> @@ -233,11 +242,17 @@ let test_payload_producer_gets_evidence_rewards () = >>=? fun frozen_deposits_before -> Context.Delegate.current_frozen_deposits (B b') baker1 >>=? fun frozen_deposits_after -> + let expected_frozen_deposits_after = + Test_tez.(frozen_deposits_before *! Int64.of_int (100 - p) /! 100L) + in + Assert.equal_tez + ~loc:__LOC__ + frozen_deposits_after + expected_frozen_deposits_after + >>=? fun () -> let slashed_amount = Test_tez.(frozen_deposits_before -! frozen_deposits_after) in - Assert.equal_tez ~loc:__LOC__ slashed_amount double_baking_punishment - >>=? fun () -> (* [baker2] included the double baking evidence in [b_with_evidence] and so it receives the reward for the evidence included in [b'] (besides the reward for proposing the payload). *) @@ -257,7 +272,7 @@ let test_payload_producer_gets_evidence_rewards () = Assert.equal_tez ~loc:__LOC__ full_balance_at_b' - Test_tez.(full_balance_at_b1 -! double_baking_punishment) + Test_tez.(full_balance_at_b1 -! slashed_amount) (****************************************************************) (* The following test scenarios are supposed to raise errors. *) -- GitLab From ea9cee4d4043f2dfd88a3361efd2f30fb5c39931 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 16 May 2023 10:31:26 +0200 Subject: [PATCH 3/5] Proto/Slashing: factor punish_double_endorsing/baking --- .../delegate_slashed_deposits_storage.ml | 96 ++++++++----------- src/proto_alpha/lib_protocol/storage.ml | 3 + src/proto_alpha/lib_protocol/storage.mli | 3 + 3 files changed, 44 insertions(+), 58 deletions(-) diff --git a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml index 63b7b03740b1..28ad5832b23c 100644 --- a/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml +++ b/src/proto_alpha/lib_protocol/delegate_slashed_deposits_storage.ml @@ -39,37 +39,30 @@ let already_slashed_for_double_baking ctxt delegate (level : Level_repr.t) = type punishing_amounts = {reward : Tez_repr.t; amount_to_burn : Tez_repr.t} -let finish_punish ctxt delegate (level : Level_repr.t) updated_slashed - punishing_amount = - let open Lwt_result_syntax in - let reward, amount_to_burn = Tez_repr.div2_sub punishing_amount in - let*! ctxt = - Storage.Slashed_deposits.add - (ctxt, level.cycle) - (level.level, delegate) - updated_slashed - in - return (ctxt, {reward; amount_to_burn}) +(** [punish_double_signing ~get ~set ~get_percentage ctxt delegate level] record + in the context that the given [delegate] has now been slashed for the + double signing event for the given [level] and return the amounts of the + frozen deposits to burn and to reward the denuncer. -let punish_double_endorsing ctxt delegate (level : Level_repr.t) = + The double signing event corresponds to a field in {!Storage.slashed_level}, + retrieved with [get] and set to true with [set]. + + The part to burn is retrieved with [get_percentage]. +*) +let punish_double_signing ~get ~set ~get_percentage ctxt delegate + (level : Level_repr.t) = let open Lwt_result_syntax in - let* slashed = + let* slashed_opt = Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) in - let updated_slashed = - match slashed with - | None -> {Storage.for_double_endorsing = true; for_double_baking = false} - | Some slashed -> - assert (Compare.Bool.(slashed.for_double_endorsing = false)) ; - {slashed with for_double_endorsing = true} + let slashed = + Option.value slashed_opt ~default:Storage.default_slashed_level in + assert (Compare.Bool.(get slashed = false)) ; + let updated_slashed = set slashed in let delegate_contract = Contract_repr.Implicit delegate in let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in - let slashing_percentage = - Constants_storage - .percentage_of_frozen_deposits_slashed_per_double_endorsement - ctxt - in + let slashing_percentage = get_percentage ctxt in let punish_value = Tez_repr.( div_exn (mul_exn frozen_deposits.initial_amount slashing_percentage) 100) @@ -77,44 +70,31 @@ let punish_double_endorsing ctxt delegate (level : Level_repr.t) = let punishing_amount = Tez_repr.(min frozen_deposits.current_amount punish_value) in - finish_punish - ctxt - delegate - (level : Level_repr.t) - updated_slashed - punishing_amount - -let punish_double_baking ctxt delegate (level : Level_repr.t) = - let open Lwt_result_syntax in - let* slashed = - Storage.Slashed_deposits.find (ctxt, level.cycle) (level.level, delegate) + let reward, amount_to_burn = Tez_repr.div2_sub punishing_amount in + let*! ctxt = + Storage.Slashed_deposits.add + (ctxt, level.cycle) + (level.level, delegate) + updated_slashed in - let updated_slashed = - match slashed with - | None -> {Storage.for_double_baking = true; for_double_endorsing = false} - | Some slashed -> - assert (Compare.Bool.(slashed.for_double_baking = false)) ; - {slashed with for_double_baking = true} + return (ctxt, {reward; amount_to_burn}) + +let punish_double_endorsing = + let get Storage.{for_double_endorsing; _} = for_double_endorsing in + let set slashed = Storage.{slashed with for_double_endorsing = true} in + let get_percentage = + Constants_storage + .percentage_of_frozen_deposits_slashed_per_double_endorsement in - let delegate_contract = Contract_repr.Implicit delegate in - let* frozen_deposits = Frozen_deposits_storage.get ctxt delegate_contract in - let slashing_percentage = + punish_double_signing ~get ~set ~get_percentage + +let punish_double_baking = + let get Storage.{for_double_baking; _} = for_double_baking in + let set slashed = Storage.{slashed with for_double_baking = true} in + let get_percentage = Constants_storage.percentage_of_frozen_deposits_slashed_per_double_baking - ctxt - in - let punish_value = - Tez_repr.( - div_exn (mul_exn frozen_deposits.initial_amount slashing_percentage) 100) - in - let punishing_amount = - Tez_repr.(min frozen_deposits.current_amount punish_value) in - finish_punish - ctxt - delegate - (level : Level_repr.t) - updated_slashed - punishing_amount + punish_double_signing ~get ~set ~get_percentage let clear_outdated_slashed_deposits ctxt ~new_cycle = let max_slashable_period = Constants_storage.max_slashing_period ctxt in diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 2a2850b7f2ce..7124f5ba6cd7 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -967,6 +967,9 @@ module Consensus_keys = type slashed_level = {for_double_endorsing : bool; for_double_baking : bool} +let default_slashed_level = + {for_double_endorsing = false; for_double_baking = false} + module Slashed_level = struct type t = slashed_level diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index b1280cff1f98..9e0b6257cf9f 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -385,6 +385,9 @@ module Consensus_keys : type slashed_level = {for_double_endorsing : bool; for_double_baking : bool} +(** [slashed_level] with all fields being [false]. *) +val default_slashed_level : slashed_level + (** Set used to avoid slashing multiple times the same event *) module Slashed_deposits : Indexed_data_storage -- GitLab From e547dc4fe7599dfb0504ebfe60ae0ba1230ad740 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 23 May 2023 15:23:27 +0200 Subject: [PATCH 4/5] Docs: add changelog entry --- docs/protocols/alpha.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/protocols/alpha.rst b/docs/protocols/alpha.rst index 92c4550dbfae..6706d1353320 100644 --- a/docs/protocols/alpha.rst +++ b/docs/protocols/alpha.rst @@ -36,6 +36,15 @@ Gas improvements Breaking Changes ---------------- +- Protocol parameter ``ratio_of_frozen_deposits_slashed_per_double_endorsement`` is + converted from the ratio ``1/5`` into the percentage ``50%`` and renamed to + ``percentage_of_frozen_deposits_slashed_per_double_endorsement``. (MR :gl:`!8753`) + +- Protocol parameter ``double_baking_punishment`` is converted from a fixed + value of ``640tz`` into the percentage ``11%`` and renamed to + ``percentage_of_frozen_deposits_slashed_per_double_baking``. (MR :gl:`!8753`) + + RPC Changes ----------- -- GitLab From 47dd7f358098b3e1d0510a0abda9ebae2d190ac3 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 23 May 2023 15:25:07 +0200 Subject: [PATCH 5/5] Tezt: update regression output --- ...ode client) RPC regression tests- misc_protocol.out | 10 +++++----- ...mode light) RPC regression tests- misc_protocol.out | 10 +++++----- ...mode proxy) RPC regression tests- misc_protocol.out | 10 +++++----- ...r_data_dir) RPC regression tests- misc_protocol.out | 10 +++++----- ...server_rpc) RPC regression tests- misc_protocol.out | 10 +++++----- 5 files changed, 25 insertions(+), 25 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 7b6d69a7516e..0d6678583369 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 @@ -30,11 +30,11 @@ "consensus_threshold": 0, "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, "max_slashing_period": 2, "frozen_deposits_percentage": 5, - "double_baking_punishment": "640000000", - "ratio_of_frozen_deposits_slashed_per_double_endorsement": - { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, - "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, - "tx_rollup_enable": false, "tx_rollup_origination_size": 4000, + "percentage_of_frozen_deposits_slashed_per_double_baking": 11, + "percentage_of_frozen_deposits_slashed_per_double_endorsement": 50, + "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, + "cache_sampler_state_cycles": 8, "tx_rollup_enable": false, + "tx_rollup_origination_size": 4000, "tx_rollup_hard_size_limit_per_inbox": 500000, "tx_rollup_hard_size_limit_per_message": 5000, "tx_rollup_max_withdrawals_per_batch": 15, 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 5b3401c117aa..d1bd2a48e328 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 @@ -30,11 +30,11 @@ "consensus_threshold": 0, "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, "max_slashing_period": 2, "frozen_deposits_percentage": 5, - "double_baking_punishment": "640000000", - "ratio_of_frozen_deposits_slashed_per_double_endorsement": - { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, - "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, - "tx_rollup_enable": false, "tx_rollup_origination_size": 4000, + "percentage_of_frozen_deposits_slashed_per_double_baking": 11, + "percentage_of_frozen_deposits_slashed_per_double_endorsement": 50, + "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, + "cache_sampler_state_cycles": 8, "tx_rollup_enable": false, + "tx_rollup_origination_size": 4000, "tx_rollup_hard_size_limit_per_inbox": 500000, "tx_rollup_hard_size_limit_per_message": 5000, "tx_rollup_max_withdrawals_per_batch": 15, 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 501dbf592679..cd5381398575 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 @@ -30,11 +30,11 @@ "consensus_threshold": 0, "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, "max_slashing_period": 2, "frozen_deposits_percentage": 5, - "double_baking_punishment": "640000000", - "ratio_of_frozen_deposits_slashed_per_double_endorsement": - { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, - "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, - "tx_rollup_enable": false, "tx_rollup_origination_size": 4000, + "percentage_of_frozen_deposits_slashed_per_double_baking": 11, + "percentage_of_frozen_deposits_slashed_per_double_endorsement": 50, + "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, + "cache_sampler_state_cycles": 8, "tx_rollup_enable": false, + "tx_rollup_origination_size": 4000, "tx_rollup_hard_size_limit_per_inbox": 500000, "tx_rollup_hard_size_limit_per_message": 5000, "tx_rollup_max_withdrawals_per_batch": 15, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index 895898a83eaf..eb775a863701 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -30,11 +30,11 @@ "consensus_threshold": 0, "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, "max_slashing_period": 2, "frozen_deposits_percentage": 5, - "double_baking_punishment": "640000000", - "ratio_of_frozen_deposits_slashed_per_double_endorsement": - { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, - "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, - "tx_rollup_enable": false, "tx_rollup_origination_size": 4000, + "percentage_of_frozen_deposits_slashed_per_double_baking": 11, + "percentage_of_frozen_deposits_slashed_per_double_endorsement": 50, + "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, + "cache_sampler_state_cycles": 8, "tx_rollup_enable": false, + "tx_rollup_origination_size": 4000, "tx_rollup_hard_size_limit_per_inbox": 500000, "tx_rollup_hard_size_limit_per_message": 5000, "tx_rollup_max_withdrawals_per_batch": 15, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index 895898a83eaf..eb775a863701 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -30,11 +30,11 @@ "consensus_threshold": 0, "minimal_participation_ratio": { "numerator": 2, "denominator": 3 }, "max_slashing_period": 2, "frozen_deposits_percentage": 5, - "double_baking_punishment": "640000000", - "ratio_of_frozen_deposits_slashed_per_double_endorsement": - { "numerator": 1, "denominator": 2 }, "cache_script_size": 100000000, - "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, - "tx_rollup_enable": false, "tx_rollup_origination_size": 4000, + "percentage_of_frozen_deposits_slashed_per_double_baking": 11, + "percentage_of_frozen_deposits_slashed_per_double_endorsement": 50, + "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, + "cache_sampler_state_cycles": 8, "tx_rollup_enable": false, + "tx_rollup_origination_size": 4000, "tx_rollup_hard_size_limit_per_inbox": 500000, "tx_rollup_hard_size_limit_per_message": 5000, "tx_rollup_max_withdrawals_per_batch": 15, -- GitLab