From 4e1cbe20bdef3efae18dc7cbeb0005a620e8bd59 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 13:42:25 +0200 Subject: [PATCH 1/7] Proto: check [sc_rollup_origination_size] constant The constant is here to calculate the storage cost for a rollup origination. If the constant is negative, it could eventually lead to a negative storage's cost, which does not make sense. --- src/proto_alpha/lib_protocol/constants_repr.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 05d0eecc038c..4f49b57c9339 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -202,6 +202,12 @@ let check_constants constants = (Invalid_protocol_constants "The ratio blocks_per_cycle per blocks_per_stake_snapshot should be \ between 1 and 65535") + >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.origination_size >= 0) + (Invalid_protocol_constants + "The smart contract rollup origination size must be non-negative.") + >>? fun () -> >>? fun () -> Result.return_unit module Generated = struct -- GitLab From 237fe16d849e52e8eac18e3194ee2881e0e90e8f Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 13:43:24 +0200 Subject: [PATCH 2/7] Proto: check [sc_rollup_challenge_window_in_blocks] constant The constant is here to calculate the number of blocks to wait before cementing a commitment. Even if the constant is null, from the cementing's operation semantic, the challenge window in block will require to wait a least 1 block to cement. --- src/proto_alpha/lib_protocol/constants_repr.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 4f49b57c9339..84bfb508f60c 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -208,6 +208,12 @@ let check_constants constants = (Invalid_protocol_constants "The smart contract rollup origination size must be non-negative.") >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.challenge_window_in_blocks >= 0) + (Invalid_protocol_constants + "The smart contract rollup challenge window in blocks must be \ + non-negative.") + >>? fun () -> >>? fun () -> Result.return_unit module Generated = struct -- GitLab From a1cb02c1f505d63c3afa392928621a0fcc58638e Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 13:44:59 +0200 Subject: [PATCH 3/7] Proto: check [sc_rollup_max_available_messages] constant The constant gives the maximum number of messages in the inbox. A smart contract rollup with a unusable inbox makes the rollup completely useless. --- src/proto_alpha/lib_protocol/constants_repr.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 84bfb508f60c..cb96dd9c439a 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -214,6 +214,11 @@ let check_constants constants = "The smart contract rollup challenge window in blocks must be \ non-negative.") >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.max_available_messages > 0) + (Invalid_protocol_constants + "The smart contract rollup max available messages must be strictly \ + greater than 0.") >>? fun () -> Result.return_unit module Generated = struct -- GitLab From 83ac58ff616a6ad10b51a1cc9c12678dd933a649 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 13:49:24 +0200 Subject: [PATCH 4/7] Proto: check [sc_rollup_stake_amount] constant The constant gives the minimal stake amount in mutez for a rollup operator to pay in order to post a commitment. It cannot pay a negative amount. --- src/proto_alpha/lib_protocol/constants_repr.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index cb96dd9c439a..7d2ced079bda 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -219,6 +219,11 @@ let check_constants constants = (Invalid_protocol_constants "The smart contract rollup max available messages must be strictly \ greater than 0.") + >>? fun () -> + error_unless + Tez_repr.(constants.sc_rollup.stake_amount >= zero) + (Invalid_protocol_constants + "The smart contract rollup max stake amount must be non-negative.") >>? fun () -> Result.return_unit module Generated = struct -- GitLab From bc041eb8f6c698985f62fc9e546a5fff65a44641 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 13:52:26 +0200 Subject: [PATCH 5/7] Proto: check [sc_rollup_commitment_period_in_blocks] constant This constant gives the period in blocks for the rollup commitments. --- src/proto_alpha/lib_protocol/constants_repr.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 7d2ced079bda..d5684e2c6ac5 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -224,6 +224,12 @@ let check_constants constants = Tez_repr.(constants.sc_rollup.stake_amount >= zero) (Invalid_protocol_constants "The smart contract rollup max stake amount must be non-negative.") + >>? fun () -> + error_unless + Compare.Int.(constants.sc_rollup.commitment_period_in_blocks > 0) + (Invalid_protocol_constants + "The smart contract rollup commitment period in blocks must be strictly \ + greater than 0.") >>? fun () -> Result.return_unit module Generated = struct -- GitLab From 32c4f82df60b9e7dd4dea5f0ed36fdd126d9702d Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Fri, 20 May 2022 14:21:15 +0200 Subject: [PATCH 6/7] Proto: check [sc_rollup_max_lookahead_in_blocks] constant This constant gives the maximum number of lookahead in blocks during a commitment submission. The commitment must be posted with a frequency defined in [sc_rollup_frequency_in_blocks], if the max lookahead in blocks is lower than the frequency, the commitments will always be rejected as the lookahead will be at least the frequency. --- src/proto_alpha/lib_protocol/constants_repr.ml | 18 ++++++++++++++++++ tests_python/tests_alpha/test_mockup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index d5684e2c6ac5..f1c7ab23f378 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -230,6 +230,24 @@ let check_constants constants = (Invalid_protocol_constants "The smart contract rollup commitment period in blocks must be strictly \ greater than 0.") + >>? fun () -> + error_unless + (let sc_rollup_max_lookahead_in_blocks = + constants.sc_rollup.max_lookahead_in_blocks + in + Compare.Int32.( + sc_rollup_max_lookahead_in_blocks + > Int32.of_int constants.sc_rollup.commitment_period_in_blocks + && (* Check that [sc_rollup_challenge_window_in_blocks < + sc_rollup_max_lookahead_in_blocks]. Otherwise committers would be + forced to commit at an artificially slow rate, affecting the + throughput of the rollup. *) + sc_rollup_max_lookahead_in_blocks + > Int32.of_int constants.sc_rollup.challenge_window_in_blocks)) + (Invalid_protocol_constants + "The smart contract rollup max lookahead in blocks must be greater than \ + [sc_rollup_commitment_period_in_blocks] and \ + [sc_rollup_challenge_window_in_blocks].") >>? fun () -> Result.return_unit module Generated = struct diff --git a/tests_python/tests_alpha/test_mockup.py b/tests_python/tests_alpha/test_mockup.py index 5535e1c3bfd8..65613b0f4c13 100644 --- a/tests_python/tests_alpha/test_mockup.py +++ b/tests_python/tests_alpha/test_mockup.py @@ -684,7 +684,7 @@ def _test_create_mockup_init_show_roundtrip( "sc_rollup_stake_amount": "42000000", "sc_rollup_commitment_period_in_blocks": 40, "sc_rollup_commitment_storage_size_in_bytes": 84, - "sc_rollup_max_lookahead_in_blocks": 10_000, + "sc_rollup_max_lookahead_in_blocks": 30_000, "sc_rollup_max_active_outbox_levels": 20_160, "sc_rollup_max_outbox_messages_per_level": 100, } -- GitLab From 2461f2f7c72c97c88526069d8c3e91c509bd93d7 Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Mon, 23 May 2022 16:09:03 +0200 Subject: [PATCH 7/7] Proto,Scoru: remove [sc_rollup_commitment_storage_size_in_bytes] from constants --- src/proto_alpha/lib_client/mockup.ml | 15 +-------------- .../lib_parameters/default_parameters.ml | 1 - src/proto_alpha/lib_protocol/alpha_context.mli | 3 --- .../lib_protocol/constants_parametric_repr.ml | 8 +------- .../lib_protocol/constants_parametric_repr.mli | 2 -- src/proto_alpha/lib_protocol/constants_storage.ml | 4 ---- .../lib_protocol/constants_storage.mli | 2 -- src/proto_alpha/lib_protocol/raw_context.ml | 4 ---- .../lib_protocol/sc_rollup_stake_storage.ml | 11 +++++++---- .../lib_protocol/sc_rollup_stake_storage.mli | 3 +++ .../test/integration/test_constants.ml | 10 +++++----- tests_python/tests_alpha/test_mockup.py | 1 - ...(mode client) RPC regression tests- others.out | 1 - ... (mode light) RPC regression tests- others.out | 1 - ... (mode proxy) RPC regression tests- others.out | 1 - ...ver_data_dir) RPC regression tests- others.out | 1 - ...y_server_rpc) RPC regression tests- others.out | 1 - ...of commitments in the rollup node (commitm.out | 1 - ...of commitments in the rollup node (first_p.out | 1 - ...of commitments in the rollup node (handles.out | 1 - ...of commitments in the rollup node (message.out | 1 - ...of commitments in the rollup node (non_fin.out | 1 - 22 files changed, 17 insertions(+), 57 deletions(-) diff --git a/src/proto_alpha/lib_client/mockup.ml b/src/proto_alpha/lib_client/mockup.ml index a258a667bdfb..61f6f7764854 100644 --- a/src/proto_alpha/lib_client/mockup.ml +++ b/src/proto_alpha/lib_client/mockup.ml @@ -60,7 +60,6 @@ module Protocol_constants_overrides = struct max_available_messages : int option; stake_amount : Tez.t option; commitment_period_in_blocks : int option; - commitment_storage_size_in_bytes : int option; max_lookahead_in_blocks : int32 option; max_active_outbox_levels : int32 option; max_outbox_messages_per_level : int option; @@ -192,7 +191,6 @@ module Protocol_constants_overrides = struct c.max_available_messages, c.stake_amount, c.commitment_period_in_blocks, - c.commitment_storage_size_in_bytes, c.max_lookahead_in_blocks, c.max_active_outbox_levels, c.max_outbox_messages_per_level )) @@ -202,7 +200,6 @@ module Protocol_constants_overrides = struct sc_rollup_max_available_messages, sc_rollup_stake_amount, sc_rollup_commitment_period_in_blocks, - sc_rollup_commitment_storage_size_in_bytes, sc_rollup_max_lookahead_in_blocks, sc_rollup_max_active_outbox_levels, sc_rollup_max_outbox_messages_per_level ) -> @@ -213,21 +210,18 @@ module Protocol_constants_overrides = struct max_available_messages = sc_rollup_max_available_messages; stake_amount = sc_rollup_stake_amount; commitment_period_in_blocks = sc_rollup_commitment_period_in_blocks; - commitment_storage_size_in_bytes = - sc_rollup_commitment_storage_size_in_bytes; max_lookahead_in_blocks = sc_rollup_max_lookahead_in_blocks; max_active_outbox_levels = sc_rollup_max_active_outbox_levels; max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; }) - (obj10 + (obj9 (opt "sc_rollup_enable" bool) (opt "sc_rollup_origination_size" int31) (opt "sc_rollup_challenge_window_in_blocks" int31) (opt "sc_rollup_max_available_messages" int31) (opt "sc_rollup_stake_amount" Tez.encoding) (opt "sc_rollup_commitment_period_in_blocks" int31) - (opt "sc_rollup_commitment_storage_size_in_bytes" int31) (opt "sc_rollup_max_lookahead_in_blocks" int32) (opt "sc_rollup_max_active_outbox_levels" int32) (opt "sc_rollup_max_outbox_messages_per_level" int31)) @@ -488,8 +482,6 @@ module Protocol_constants_overrides = struct stake_amount = Some parametric.sc_rollup.stake_amount; commitment_period_in_blocks = Some parametric.sc_rollup.commitment_period_in_blocks; - commitment_storage_size_in_bytes = - Some parametric.sc_rollup.commitment_storage_size_in_bytes; max_lookahead_in_blocks = Some parametric.sc_rollup.max_lookahead_in_blocks; max_active_outbox_levels = @@ -577,7 +569,6 @@ module Protocol_constants_overrides = struct max_available_messages = None; stake_amount = None; commitment_period_in_blocks = None; - commitment_storage_size_in_bytes = None; max_lookahead_in_blocks = None; max_active_outbox_levels = None; max_outbox_messages_per_level = None; @@ -1040,10 +1031,6 @@ module Protocol_constants_overrides = struct Option.value ~default:c.sc_rollup.commitment_period_in_blocks o.sc_rollup.commitment_period_in_blocks; - commitment_storage_size_in_bytes = - Option.value - ~default:c.sc_rollup.commitment_storage_size_in_bytes - o.sc_rollup.commitment_storage_size_in_bytes; max_lookahead_in_blocks = Option.value ~default:c.sc_rollup.max_lookahead_in_blocks diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index ddbce004124b..36ce5101dabd 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -195,7 +195,6 @@ let constants_mainnet = The following constants need to be refined. *) stake_amount = Tez.of_mutez_exn 32_000_000L; commitment_period_in_blocks = 30; - commitment_storage_size_in_bytes = 84; 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; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index f5f9cade4a78..5b9d279b7dae 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -756,7 +756,6 @@ module Constants : sig max_available_messages : int; stake_amount : Tez.t; commitment_period_in_blocks : int; - commitment_storage_size_in_bytes : int; max_lookahead_in_blocks : int32; max_active_outbox_levels : int32; max_outbox_messages_per_level : int; @@ -926,8 +925,6 @@ module Constants : sig val sc_rollup_commitment_period_in_blocks : Raw_context.t -> int - val sc_rollup_commitment_storage_size_in_bytes : Raw_context.t -> int - val sc_rollup_max_lookahead_in_blocks : Raw_context.t -> int32 (** All constants: fixed and parametric *) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 2d8d2770ebdd..2ca203edaa06 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -101,7 +101,6 @@ type sc_rollup = { max_available_messages : int; stake_amount : Tez_repr.t; commitment_period_in_blocks : int; - commitment_storage_size_in_bytes : int; max_lookahead_in_blocks : int32; max_active_outbox_levels : int32; max_outbox_messages_per_level : int; @@ -231,7 +230,6 @@ let sc_rollup_encoding = c.max_available_messages, c.stake_amount, c.commitment_period_in_blocks, - c.commitment_storage_size_in_bytes, c.max_lookahead_in_blocks, c.max_active_outbox_levels, c.max_outbox_messages_per_level )) @@ -241,7 +239,6 @@ let sc_rollup_encoding = sc_rollup_max_available_messages, sc_rollup_stake_amount, sc_rollup_commitment_period_in_blocks, - sc_rollup_commitment_storage_size_in_bytes, sc_rollup_max_lookahead_in_blocks, sc_rollup_max_active_outbox_levels, sc_rollup_max_outbox_messages_per_level ) -> @@ -252,20 +249,17 @@ let sc_rollup_encoding = max_available_messages = sc_rollup_max_available_messages; stake_amount = sc_rollup_stake_amount; commitment_period_in_blocks = sc_rollup_commitment_period_in_blocks; - commitment_storage_size_in_bytes = - sc_rollup_commitment_storage_size_in_bytes; max_lookahead_in_blocks = sc_rollup_max_lookahead_in_blocks; max_active_outbox_levels = sc_rollup_max_active_outbox_levels; max_outbox_messages_per_level = sc_rollup_max_outbox_messages_per_level; }) - (obj10 + (obj9 (req "sc_rollup_enable" bool) (req "sc_rollup_origination_size" int31) (req "sc_rollup_challenge_window_in_blocks" int31) (req "sc_rollup_max_available_messages" int31) (req "sc_rollup_stake_amount" Tez_repr.encoding) (req "sc_rollup_commitment_period_in_blocks" int31) - (req "sc_rollup_commitment_storage_size_in_bytes" int31) (req "sc_rollup_max_lookahead_in_blocks" int32) (req "sc_rollup_max_active_outbox_levels" int32) (req "sc_rollup_max_outbox_messages_per_level" int31)) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index 79ae0c2deb43..d5d38f698506 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -92,8 +92,6 @@ type sc_rollup = { stake_amount : Tez_repr.t; (* The period with which commitments are made. *) commitment_period_in_blocks : int; - (* The storage size requirement (in bytes) of a commitment *) - commitment_storage_size_in_bytes : int; (* The maximum depth of a staker's position - chosen alongside [commitment_period_in_blocks] to prevent the cost of a staker's commitments' storage being greater than their deposit. *) diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 96f2802654da..85d75f3fc71b 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -238,10 +238,6 @@ let sc_rollup_commitment_period_in_blocks c = let sc_rollup = Raw_context.sc_rollup c in sc_rollup.commitment_period_in_blocks -let sc_rollup_commitment_storage_size_in_bytes c = - let sc_rollup = Raw_context.sc_rollup c in - sc_rollup.commitment_storage_size_in_bytes - let sc_rollup_max_lookahead_in_blocks c = let sc_rollup = Raw_context.sc_rollup c in sc_rollup.max_lookahead_in_blocks diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index 9d5371cee536..a278ae0d67ea 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -141,8 +141,6 @@ val sc_rollup_stake_amount : Raw_context.t -> Tez_repr.t val sc_rollup_commitment_period_in_blocks : Raw_context.t -> int -val sc_rollup_commitment_storage_size_in_bytes : Raw_context.t -> int - val sc_rollup_max_lookahead_in_blocks : Raw_context.t -> int32 val sc_rollup_max_active_outbox_levels : Raw_context.t -> int32 diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index 2454cf0a3a15..f14d37096401 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -998,10 +998,6 @@ let prepare_first_block ~level ~timestamp ctxt = The following constants need to be refined. *) stake_amount = Tez_repr.of_mutez_exn 32_000_000L; commitment_period_in_blocks = 30; - (* 76 for Commitments entry + 4 for Commitment_stake_count entry - + 4 for Commitment_added entry - + 0 for Staker_count_update entry *) - commitment_storage_size_in_bytes = 84; max_lookahead_in_blocks = 30_000l; (* Number of active levels kept for executing outbox messages. WARNING: Changing this value impacts the storage charge for diff --git a/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml b/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml index 1e9edfa2f686..d8d05c4c0331 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml @@ -235,6 +235,11 @@ let increase_commitment_stake_count ctxt rollup node = in return (size_diff, ctxt) +(* 76 for Commitments entry + 4 for Commitment_stake_count entry + + 4 for Commitment_added entry + + 0 for Staker_count_update entry *) +let commitment_storage_size_in_bytes = 84 + let refine_stake ctxt rollup staker commitment = let open Lwt_tzresult_syntax in let* lcc, ctxt = Commitment_storage.last_cemented_commitment ctxt rollup in @@ -271,10 +276,8 @@ let refine_stake ctxt rollup staker commitment = commitment_size_diff + commitment_added_size_diff + stake_count_size_diff + staker_count_diff in - let expected_size_diff = - Constants_storage.sc_rollup_commitment_storage_size_in_bytes ctxt - in - (* First submission adds [sc_rollup_commitment_storage_size_in_bytes] to storage. + let expected_size_diff = commitment_storage_size_in_bytes in + (* First submission adds [commitment_storage_size_in_bytes] to storage. Later submission adds 0 due to content-addressing. *) assert (Compare.Int.(size_diff = 0 || size_diff = expected_size_diff)) ; return (new_hash, commitment_added_level, ctxt) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.mli b/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.mli index 14859261eb13..428728fef846 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.mli @@ -123,6 +123,9 @@ val find_staker : Signature.public_key_hash -> (Sc_rollup_commitment_repr.Hash.t * Raw_context.t) tzresult Lwt.t +(** The storage size requirement (in bytes) of a commitment *) +val commitment_storage_size_in_bytes : int + (**/**) module Internal_for_tests : sig diff --git a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml index 08ed46c5d786..bf2ed7bd16e2 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml @@ -86,7 +86,7 @@ let test_sc_rollup_max_commitment_storage_cost_lt_deposit () = Alpha_context.Tez.to_mutez constants.cost_per_byte in let commitment_storage_size = - Int64.of_int constants.sc_rollup.commitment_storage_size_in_bytes + Int64.of_int Sc_rollup_stake_storage.commitment_storage_size_in_bytes in let commitment_storage_cost = Int64.mul cost_per_byte_mutez commitment_storage_size @@ -108,15 +108,15 @@ let test_sc_rollup_max_commitment_storage_cost_lt_deposit () = stake_amount (* Check that - [sc_rollup_commitment_storage_size_in_bytes = commitments_entry_size + - commitment_stake_count_entry_size + commitment_added_entry_size] + [{!Sc_rollup_stake_storage.commitment_storage_size_in_bytes} = + commitments_entry_size + commitment_stake_count_entry_size + + commitment_added_entry_size] Required to ensure [sc_rollup_stake_amount] and [sc_rollup_max_lookahead] are correctly scaled with respect to each other - see {!test_sc_rollup_max_commitment_storage_cost_lt_deposit} *) let test_sc_rollup_commitment_storage_size () = - let constants = Default_parameters.constants_mainnet in let open Protocol in Assert.get_some ~loc:__LOC__ @@ -152,7 +152,7 @@ let test_sc_rollup_commitment_storage_size () = in Assert.equal_int ~loc:__LOC__ - constants.sc_rollup.commitment_storage_size_in_bytes + Sc_rollup_stake_storage.commitment_storage_size_in_bytes (Bytes.length commitment_bytes + Bytes.length level_bytes + Bytes.length commitment_stake_count_bytes) diff --git a/tests_python/tests_alpha/test_mockup.py b/tests_python/tests_alpha/test_mockup.py index 65613b0f4c13..1a39706f7306 100644 --- a/tests_python/tests_alpha/test_mockup.py +++ b/tests_python/tests_alpha/test_mockup.py @@ -683,7 +683,6 @@ def _test_create_mockup_init_show_roundtrip( "sc_rollup_max_available_messages": 1_000_000, "sc_rollup_stake_amount": "42000000", "sc_rollup_commitment_period_in_blocks": 40, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30_000, "sc_rollup_max_active_outbox_levels": 20_160, "sc_rollup_max_outbox_messages_per_level": 100, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- others.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- others.out index 63715d6a638c..08af28a81f4b 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- others.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- others.out @@ -50,7 +50,6 @@ "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- others.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- others.out index bb66cdfcd14a..5921e5de50ed 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- others.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- others.out @@ -50,7 +50,6 @@ "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- others.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- others.out index 3e5f789a7bc1..b10b690d4c7e 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- others.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- others.out @@ -50,7 +50,6 @@ "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- others.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- others.out index 4e1784032912..9cec6efb7351 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- others.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- others.out @@ -50,7 +50,6 @@ "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- others.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- others.out index 4e1784032912..9cec6efb7351 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- others.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- others.out @@ -50,7 +50,6 @@ "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (commitm.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (commitm.out index 83bdd59e1861..9f6dee7f3b17 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (commitm.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (commitm.out @@ -83,7 +83,6 @@ This sequence of operations was run: "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (first_p.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (first_p.out index cd2c971b1914..b35035d5f5d0 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (first_p.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (first_p.out @@ -83,7 +83,6 @@ This sequence of operations was run: "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (handles.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (handles.out index ef7e4df7dbb7..3a8879936092 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (handles.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (handles.out @@ -83,7 +83,6 @@ This sequence of operations was run: "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (message.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (message.out index 7adc069a5e59..36b6f9d5f930 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (message.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (message.out @@ -83,7 +83,6 @@ This sequence of operations was run: "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (non_fin.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (non_fin.out index f35c6f59e5f9..fbe57dab1d56 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (non_fin.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (non_fin.out @@ -83,7 +83,6 @@ This sequence of operations was run: "sc_rollup_max_available_messages": 1000000, "sc_rollup_stake_amount": "32000000", "sc_rollup_commitment_period_in_blocks": 30, - "sc_rollup_commitment_storage_size_in_bytes": 84, "sc_rollup_max_lookahead_in_blocks": 30000, "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100 } -- GitLab