From 9f2f237929f0dcd27636ba8f5f50f8009d4753f6 Mon Sep 17 00:00:00 2001 From: Yann Regis-Gianas Date: Wed, 10 Aug 2022 17:41:47 +0200 Subject: [PATCH 1/3] Proto,SCORU: Increase max number of messages per commitment period Fixes https://gitlab.com/tezos/tezos/-/issues/2373 The value is chosen to limit the length of inbox refutation proofs. In the worst case, the length of inbox refutation proofs are logarithmic (in basis 2) in the number of messages in the inboxes during the commitment period. With the following value, an inbox refutation proof is made of at most 35 hashes, hence a payload bounded by 35 * 48 bytes, which far below than the 32kb of a Tezos Signed-off-by: Yann Regis-Gianas --- .../lib_parameters/default_parameters.ml | 59 +++++++++++-------- src/proto_alpha/lib_protocol/raw_context.ml | 21 +++++-- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 578850785b85..3394195ddb7e 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -199,33 +199,46 @@ let constants_mainnet = (minus overhead), since we need to limit our proofs to those that can fit in an operation. *) rejection_max_proof_size = 30000; - (* This is the first block of cycle 618, which is expected to be - about one year after the activation of protocol J. - See https://tzstats.com/cycle/618 *) + (* This is the first block of cycle 618, which is expected to + be about one year after the activation of protocol J. See + https://tzstats.com/cycle/618 *) sunset_level = 3_473_409l; }; dal = default_dal; sc_rollup = - { - enable = false; - (* The following value is chosen to prevent spam. *) - origination_size = 6_314; - challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; - (* The following value is chosen to limit the length of inbox refutation proofs. *) - (* TODO: https://gitlab.com/tezos/tezos/-/issues/2373 - check this is reasonable. *) - max_number_of_messages_per_commitment_period = 32_765; - (* TODO: https://gitlab.com/tezos/tezos/-/issues/2756 - The following constants need to be refined. *) - stake_amount = Tez.of_mutez_exn 10_000_000_000L; - commitment_period_in_blocks = 30; - max_lookahead_in_blocks = 30_000l; - max_active_outbox_levels = sc_rollup_max_active_outbox_levels; - max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; - number_of_sections_in_dissection = 32; - timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; - max_number_of_stored_cemented_commitments = 5; - }; + (let commitment_period_in_blocks = 30 in + { + enable = false; + (* The following value is chosen to prevent spam. *) + origination_size = 6_314; + challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + commitment_period_in_blocks; + (* + + The following value is chosen to limit the length of inbox + refutation proofs. In the worst case, the length of inbox + refutation proofs are logarithmic (in basis 2) in the + number of messages in the inboxes during the commitment + period. + + With the following value, an inbox refutation proof is + made of at most 35 hashes, hence a payload bounded by + 35 * 48 bytes, which far below than the 32kb of a Tezos + operations. + + *) + max_number_of_messages_per_commitment_period = + commitment_period_in_blocks * 10_000_000; + (* TODO: https://gitlab.com/tezos/tezos/-/issues/2756 + The following constants need to be refined. *) + stake_amount = Tez.of_mutez_exn 10_000_000_000L; + max_lookahead_in_blocks = 30_000l; + max_active_outbox_levels = sc_rollup_max_active_outbox_levels; + max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; + number_of_sections_in_dissection = 32; + timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; + max_number_of_stored_cemented_commitments = 5; + }); } let default_dal_sandbox = diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index c38aaca8542d..f7de291e1bb5 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -935,11 +935,22 @@ let prepare_first_block ~level ~timestamp ctxt = enable = c.sc_rollup.enable; origination_size = c.sc_rollup.origination_size; challenge_window_in_blocks = c.sc_rollup.challenge_window_in_blocks; - (* The following value is chosen to limit the maximal - length of an inbox refutation proof. *) - (* TODO: https://gitlab.com/tezos/tezos/-/issues/2373 - check this is reasonable. *) - max_number_of_messages_per_commitment_period = 32_765; + (* + + The following value is chosen to limit the length of inbox + refutation proofs. In the worst case, the length of inbox + refutation proofs are logarithmic (in basis 2) in the + number of messages in the inboxes during the commitment + period. + + With the following value, an inbox refutation proof is + made of at most 35 hashes, hence a payload bounded by + 35 * 48 bytes, which far below than the 32kb of a Tezos + operations. + + *) + max_number_of_messages_per_commitment_period = + c.sc_rollup.commitment_period_in_blocks * 10_000_000; (* TODO: https://gitlab.com/tezos/tezos/-/issues/2756 The following constants need to be refined. *) stake_amount = Tez_repr.of_mutez_exn 10_000_000_000L; -- GitLab From c99cfd57548d86118ddc8774cd1b581a5979ad76 Mon Sep 17 00:00:00 2001 From: Yann Regis-Gianas Date: Thu, 11 Aug 2022 08:48:46 +0200 Subject: [PATCH 2/3] Tezt: Update regression traces --- ...pha- (mode client) RPC regression tests- misc_protocol.out | 2 +- ...lpha- (mode light) RPC regression tests- misc_protocol.out | 2 +- ...lpha- (mode proxy) RPC regression tests- misc_protocol.out | 2 +- ...y_server_data_dir) RPC regression tests- misc_protocol.out | 2 +- ... proxy_server_rpc) RPC regression tests- misc_protocol.out | 2 +- ... - correct handling of commitments (no_commitment_publ.out | 4 ++-- ... node - correct handling of commitments (no_commitment.out | 4 ++-- 7 files changed, 9 insertions(+), 9 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 26dade38ca1b..d0820eac95fd 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 @@ -50,7 +50,7 @@ "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 20160, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, 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 147daeffe854..8e88f208fcd9 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 @@ -50,7 +50,7 @@ "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 20160, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, 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 b2b35d89d30c..2e32dff28cc8 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 @@ -50,7 +50,7 @@ "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 20160, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, 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 f8ede612433b..5b37e1c8add2 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 @@ -50,7 +50,7 @@ "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 20160, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, 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 f8ede612433b..5b37e1c8add2 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 @@ -50,7 +50,7 @@ "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": false, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 20160, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (no_commitment_publ.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (no_commitment_publ.out index 7bb192ce8263..a379c4399ca0 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (no_commitment_publ.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - rollup node - correct handling of commitments (no_commitment_publ.out @@ -106,7 +106,7 @@ This sequence of operations was run: "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": true, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 1, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, @@ -215,7 +215,7 @@ This sequence of operations was run: "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": true, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 1, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - rollup node - correct handling of commitments (no_commitment.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - rollup node - correct handling of commitments (no_commitment.out index 059fa042c164..18df2c9eb118 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - rollup node - correct handling of commitments (no_commitment.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - rollup node - correct handling of commitments (no_commitment.out @@ -106,7 +106,7 @@ This sequence of operations was run: "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": true, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 1, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, @@ -215,7 +215,7 @@ This sequence of operations was run: "redundancy_factor": 4, "segment_size": 4096 }, "sc_rollup_enable": true, "sc_rollup_origination_size": 6314, "sc_rollup_challenge_window_in_blocks": 1, - "sc_rollup_max_number_of_messages_per_commitment_period": 32765, + "sc_rollup_max_number_of_messages_per_commitment_period": 300000000, "sc_rollup_stake_amount": "10000000000", "sc_rollup_commitment_period_in_blocks": 30, "sc_rollup_max_lookahead_in_blocks": 30000, -- GitLab From 95d0cd075783812015eb70511fd9173fa1c9c1e4 Mon Sep 17 00:00:00 2001 From: Yann Regis-Gianas Date: Fri, 12 Aug 2022 07:50:58 +0200 Subject: [PATCH 3/3] Proto,SCORU: Fix tests that were not robust to high limit values The parameter max_number_of_messages_per_commitment_period is now very high and some tests were not prepared to that possibility. For these tests, we override the default value to use a smaller one. Signed-off-by: Yann Regis-Gianas --- .../lib_protocol/test/helpers/block.ml | 21 +++++++++++--- .../lib_protocol/test/helpers/block.mli | 2 ++ .../lib_protocol/test/helpers/context.ml | 4 ++- .../lib_protocol/test/helpers/context.mli | 1 + .../integration/operations/test_sc_rollup.ml | 29 ++++++++++++++++++- .../test/unit/test_sc_rollup_storage.ml | 12 +++++++- 6 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.ml b/src/proto_alpha/lib_protocol/test/helpers/block.ml index 77660df04024..53f70e3a3f42 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/block.ml @@ -445,8 +445,8 @@ let prepare_initial_context_params ?consensus_threshold ?min_proposal_quorum ?baking_reward_bonus_per_slot ?baking_reward_fixed_portion ?origination_size ?blocks_per_cycle ?cycles_per_voting_period ?tx_rollup_enable ?tx_rollup_sunset_level ?tx_rollup_origination_size ?sc_rollup_enable - ?dal_enable ?hard_gas_limit_per_block ?nonce_revelation_threshold - initial_accounts = + ?sc_rollup_max_number_of_messages_per_commitment_period ?dal_enable + ?hard_gas_limit_per_block ?nonce_revelation_threshold initial_accounts = let open Tezos_protocol_alpha_parameters in let constants = Default_parameters.constants_test in let min_proposal_quorum = @@ -505,6 +505,11 @@ let prepare_initial_context_params ?consensus_threshold ?min_proposal_quorum let sc_rollup_enable = Option.value ~default:constants.sc_rollup.enable sc_rollup_enable in + let sc_rollup_max_number_of_messages_per_commitment_period = + Option.value + ~default:constants.sc_rollup.max_number_of_messages_per_commitment_period + sc_rollup_max_number_of_messages_per_commitment_period + in let dal_enable = Option.value ~default:constants.dal.feature_enable dal_enable in @@ -538,7 +543,13 @@ let prepare_initial_context_params ?consensus_threshold ?min_proposal_quorum sunset_level = tx_rollup_sunset_level; origination_size = tx_rollup_origination_size; }; - sc_rollup = {constants.sc_rollup with enable = sc_rollup_enable}; + sc_rollup = + { + constants.sc_rollup with + enable = sc_rollup_enable; + max_number_of_messages_per_commitment_period = + sc_rollup_max_number_of_messages_per_commitment_period; + }; dal = {constants.dal with feature_enable = dal_enable}; hard_gas_limit_per_block; nonce_revelation_threshold; @@ -591,7 +602,8 @@ let genesis ?commitments ?consensus_threshold ?min_proposal_quorum ?endorsing_reward_per_slot ?baking_reward_bonus_per_slot ?baking_reward_fixed_portion ?origination_size ?blocks_per_cycle ?cycles_per_voting_period ?tx_rollup_enable ?tx_rollup_sunset_level - ?tx_rollup_origination_size ?sc_rollup_enable ?dal_enable + ?tx_rollup_origination_size ?sc_rollup_enable + ?sc_rollup_max_number_of_messages_per_commitment_period ?dal_enable ?hard_gas_limit_per_block ?nonce_revelation_threshold (initial_accounts : (Account.t * Tez.t * Signature.Public_key_hash.t option) list) = @@ -611,6 +623,7 @@ let genesis ?commitments ?consensus_threshold ?min_proposal_quorum ?tx_rollup_sunset_level ?tx_rollup_origination_size ?sc_rollup_enable + ?sc_rollup_max_number_of_messages_per_commitment_period ?dal_enable ?hard_gas_limit_per_block ?nonce_revelation_threshold diff --git a/src/proto_alpha/lib_protocol/test/helpers/block.mli b/src/proto_alpha/lib_protocol/test/helpers/block.mli index dc3d70f88721..ce57cd710fba 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/block.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/block.mli @@ -128,6 +128,7 @@ val genesis : ?tx_rollup_sunset_level:int32 -> ?tx_rollup_origination_size:int -> ?sc_rollup_enable:bool -> + ?sc_rollup_max_number_of_messages_per_commitment_period:int -> ?dal_enable:bool -> ?hard_gas_limit_per_block:Gas.Arith.integral -> ?nonce_revelation_threshold:int32 -> @@ -272,6 +273,7 @@ val prepare_initial_context_params : ?tx_rollup_sunset_level:int32 -> ?tx_rollup_origination_size:int -> ?sc_rollup_enable:bool -> + ?sc_rollup_max_number_of_messages_per_commitment_period:int -> ?dal_enable:bool -> ?hard_gas_limit_per_block:Gas.Arith.integral -> ?nonce_revelation_threshold:int32 -> diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.ml b/src/proto_alpha/lib_protocol/test/helpers/context.ml index f4a461f70e40..b102aa4a31ed 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/context.ml @@ -449,7 +449,8 @@ let init_gen tup ?rng_state ?commitments ?(initial_balances = []) ?endorsing_reward_per_slot ?baking_reward_bonus_per_slot ?baking_reward_fixed_portion ?origination_size ?blocks_per_cycle ?cycles_per_voting_period ?tx_rollup_enable ?tx_rollup_sunset_level - ?tx_rollup_origination_size ?sc_rollup_enable ?dal_enable + ?tx_rollup_origination_size ?sc_rollup_enable + ?sc_rollup_max_number_of_messages_per_commitment_period ?dal_enable ?hard_gas_limit_per_block ?nonce_revelation_threshold () = let n = tup_n tup in let accounts = @@ -482,6 +483,7 @@ let init_gen tup ?rng_state ?commitments ?(initial_balances = []) ?tx_rollup_sunset_level ?tx_rollup_origination_size ?sc_rollup_enable + ?sc_rollup_max_number_of_messages_per_commitment_period ?dal_enable ?hard_gas_limit_per_block ?nonce_revelation_threshold diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.mli b/src/proto_alpha/lib_protocol/test/helpers/context.mli index e9e504eb5f22..66fed3b9e5c5 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.mli +++ b/src/proto_alpha/lib_protocol/test/helpers/context.mli @@ -273,6 +273,7 @@ type 'accounts init := ?tx_rollup_sunset_level:int32 -> ?tx_rollup_origination_size:int -> ?sc_rollup_enable:bool -> + ?sc_rollup_max_number_of_messages_per_commitment_period:int -> ?dal_enable:bool -> ?hard_gas_limit_per_block:Gas.Arith.integral -> ?nonce_revelation_threshold:int32 -> diff --git a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml index 071046c2ad16..3e92585ca863 100644 --- a/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/integration/operations/test_sc_rollup.ml @@ -81,7 +81,15 @@ let assert_equal_z ~loc x y = [sc_rollup_enable] constant is set to true. It returns the created context and contracts. *) let context_init ?(sc_rollup_challenge_window_in_blocks = 10) + ?sc_rollup_max_number_of_messages_per_commitment_period ?(timeout_period_in_blocks = 10) tup = + let max_number_of_messages_per_commitment_period = + match sc_rollup_max_number_of_messages_per_commitment_period with + | None -> + Context.default_test_constants.sc_rollup + .max_number_of_messages_per_commitment_period + | Some v -> v + in Context.init_with_constants_gen tup { @@ -92,6 +100,7 @@ let context_init ?(sc_rollup_challenge_window_in_blocks = 10) Context.default_test_constants.sc_rollup with enable = true; challenge_window_in_blocks = sc_rollup_challenge_window_in_blocks; + max_number_of_messages_per_commitment_period; timeout_period_in_blocks; }; } @@ -1393,7 +1402,25 @@ let test_insufficient_ticket_balances () = output) let test_inbox_max_number_of_messages_per_commitment_period () = - let* block, (account1, account2) = context_init Context.T2 in + let sc_rollup_max_number_of_messages_per_commitment_period = + (* + + We set this parameter constant with a low value for this test + because the default value is too high to be tested. + + This limit exists to implement a (theoretical) defensive + programming scheme against large inbox refutations proofs. It + is theoretical because the lenght of these proofs is + logarithmic in the number of messages. + + *) + 1000 + in + let* block, (account1, account2) = + context_init + ~sc_rollup_max_number_of_messages_per_commitment_period + Context.T2 + in let* block, rollup = sc_originate block account1 "unit" in let* constants = Context.get_constants (B block) in let Constants.Parametric.{max_number_of_messages_per_commitment_period; _} = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml index beef07429ecd..76c1beaa3bac 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_sc_rollup_storage.ml @@ -46,7 +46,17 @@ let new_context_with_stakers nb_stakers = let*? initial_balances = List.init ~when_negative_length:[] nb_stakers (fun _ -> initial_balance) in - let* b, contracts = Context.init_n ~initial_balances nb_stakers () in + let sc_rollup_max_number_of_messages_per_commitment_period = + (* The default value is too large for testing. *) + 1000 + in + let* b, contracts = + Context.init_n + ~initial_balances + nb_stakers + ~sc_rollup_max_number_of_messages_per_commitment_period + () + in let+ inc = Incremental.begin_construction b in let state = Incremental.validation_state inc in let ctxt = state.ctxt in -- GitLab