diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index b4a9ae0e3442b3df614effad6ee67d9e8756643c..578850785b856fe100713730c4cc59baf1f0f684 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -224,6 +224,7 @@ let constants_mainnet = 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; }; } diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 3150f31907004f5c72161159dab6810939e5e7f1..7ca1a80b4f566a93df50e336d3a53269138c666b 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -814,6 +814,7 @@ module Constants : sig max_outbox_messages_per_level : int; number_of_sections_in_dissection : int; timeout_period_in_blocks : int; + max_number_of_stored_cemented_commitments : int; } type t = { @@ -1001,6 +1002,8 @@ module Constants : sig val sc_rollup_number_of_sections_in_dissection : context -> int + val max_number_of_stored_cemented_commitments : context -> int + (** All constants: fixed and parametric *) type t = private {fixed : fixed; parametric : Parametric.t} diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index da776f8de3b7322d1fe8893da47c3f153525b457..2244d5bb9dbcc7aa842eb2fb323098fdc618cd19 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -124,6 +124,7 @@ type sc_rollup = { max_outbox_messages_per_level : int; number_of_sections_in_dissection : int; timeout_period_in_blocks : int; + max_number_of_stored_cemented_commitments : int; } type t = { @@ -257,7 +258,8 @@ let sc_rollup_encoding = c.max_active_outbox_levels, c.max_outbox_messages_per_level, c.number_of_sections_in_dissection ), - c.timeout_period_in_blocks )) + (c.timeout_period_in_blocks, c.max_number_of_stored_cemented_commitments) + )) (fun ( ( sc_rollup_enable, sc_rollup_origination_size, sc_rollup_challenge_window_in_blocks, @@ -268,7 +270,8 @@ let sc_rollup_encoding = sc_rollup_max_active_outbox_levels, sc_rollup_max_outbox_messages_per_level, sc_rollup_number_of_sections_in_dissection ), - sc_rollup_timeout_period_in_blocks ) -> + ( sc_rollup_timeout_period_in_blocks, + sc_rollup_max_number_of_cemented_commitments ) ) -> { enable = sc_rollup_enable; origination_size = sc_rollup_origination_size; @@ -283,6 +286,8 @@ let sc_rollup_encoding = number_of_sections_in_dissection = sc_rollup_number_of_sections_in_dissection; timeout_period_in_blocks = sc_rollup_timeout_period_in_blocks; + max_number_of_stored_cemented_commitments = + sc_rollup_max_number_of_cemented_commitments; }) (merge_objs (obj10 @@ -296,7 +301,9 @@ let sc_rollup_encoding = (req "sc_rollup_max_active_outbox_levels" int32) (req "sc_rollup_max_outbox_messages_per_level" int31) (req "sc_rollup_number_of_sections_in_dissection" uint8)) - (obj1 (req "sc_rollup_timeout_period_in_blocks" int31))) + (obj2 + (req "sc_rollup_timeout_period_in_blocks" int31) + (req "sc_rollup_max_number_of_cemented_commitments" int31))) let encoding = let open Data_encoding in diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index 565e61662c8cc71a65d4b4aec57349564a07e8d0..6f3e1d83470fe3df0c4e327e5a788784c4c6242f 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -122,6 +122,8 @@ type sc_rollup = { (Int32.max_int) + 2 = 33]. See {!Sc_rollup_game_repr.check_dissection} for more information on the dissection logic. *) timeout_period_in_blocks : int; + (* The maximum number of cemented commitments stored for a sc rollup. *) + max_number_of_stored_cemented_commitments : int; } type t = { diff --git a/src/proto_alpha/lib_protocol/constants_repr.ml b/src/proto_alpha/lib_protocol/constants_repr.ml index 1a4a5e33bb784b8d51cc77c5ec9c91b5c2e14ece..7bd942b9bec7405aecc50f29cef396f3af425469 100644 --- a/src/proto_alpha/lib_protocol/constants_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_repr.ml @@ -321,6 +321,13 @@ let check_constants constants = constants.dal.number_of_slots > 0 && constants.dal.number_of_slots <= 256) (Invalid_protocol_constants "The number of data availability slot must be between 1 and 256") + >>? fun () -> + error_unless + Compare.Int.( + constants.sc_rollup.max_number_of_stored_cemented_commitments > 0) + (Invalid_protocol_constants + "The number of maximum stored cemented commitments must be strictly \ + positive") >>? fun () -> Result.return_unit module Generated = struct diff --git a/src/proto_alpha/lib_protocol/constants_storage.ml b/src/proto_alpha/lib_protocol/constants_storage.ml index 7d8db97777c939e7d6af30634155e8d951ac5aa5..22f603cb6630c8cdd23743fee0fed13431c2ec18 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.ml +++ b/src/proto_alpha/lib_protocol/constants_storage.ml @@ -270,6 +270,10 @@ let sc_rollup_timeout_period_in_blocks c = let sc_rollup = Raw_context.sc_rollup c in sc_rollup.timeout_period_in_blocks +let max_number_of_stored_cemented_commitments c = + let sc_rollup = Raw_context.sc_rollup c in + sc_rollup.max_number_of_stored_cemented_commitments + let dal_number_of_slots c = let constants = Raw_context.constants c in constants.dal.number_of_slots diff --git a/src/proto_alpha/lib_protocol/constants_storage.mli b/src/proto_alpha/lib_protocol/constants_storage.mli index aaa7341a8d462802c7f5f2ef44aea109551d04e8..0169e9299a4b6a9bdfa7d588d84dc1e6f2ebbcde 100644 --- a/src/proto_alpha/lib_protocol/constants_storage.mli +++ b/src/proto_alpha/lib_protocol/constants_storage.mli @@ -156,6 +156,8 @@ val sc_rollup_max_outbox_messages_per_level : Raw_context.t -> int val sc_rollup_number_of_sections_in_dissection : Raw_context.t -> int +val max_number_of_stored_cemented_commitments : Raw_context.t -> int + val sc_rollup_timeout_period_in_blocks : Raw_context.t -> int val dal_number_of_slots : Raw_context.t -> int diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index ee0ba79c35ee3223ceeba7a4125b2d883137160c..c38aaca8542d66a2845b0abf2d83c1394ecfc876 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -961,6 +961,24 @@ let prepare_first_block ~level ~timestamp ctxt = (* TODO: https://gitlab.com/tezos/tezos/-/issues/2902 This constant needs to be refined. *) timeout_period_in_blocks = 20_160; + (* We store multiple cemented commitments because we want to + allow the execution of outbox messages against cemented + commitments that are older than the last cemented commitment. + The execution of an outbox message is a manager operation, + and manager operations are kept in the mempool for one + hour. Hence we only need to ensure that an outbox message + can be validated against a cemented commitment produced in the + last hour. If we assume that the rollup is operating without + issues, that is no commitments are being refuted and commitments + are published and cemented regularly by one rollup node, we can + expect commitments to be cemented approximately every 15 + minutes, or equivalently we can expect 5 commitments to be + published in one hour (at minutes 0, 15, 30, 45 and 60). + Therefore, we need to keep 5 cemented commitments to guarantee + that the execution of an outbox operation can always be + validated against a cemented commitment while it is in the + mempool. *) + max_number_of_stored_cemented_commitments = 5; } in let constants = diff --git a/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.ml b/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.ml index b6e5f1f23abc6097f67430cb85be674eb3d0317a..1d9f8bda6b81044ae7c9b95dc740fcb1514c8364 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.ml @@ -29,9 +29,14 @@ module Store = Storage.Sc_rollup module Commitment = Sc_rollup_commitment_repr module Commitment_hash = Commitment.Hash +let get_commitment_opt_unsafe ctxt rollup commitment = + let open Lwt_result_syntax in + let* ctxt, res = Store.Commitments.find (ctxt, rollup) commitment in + return (res, ctxt) + let get_commitment_unsafe ctxt rollup commitment = let open Lwt_tzresult_syntax in - let* ctxt, res = Store.Commitments.find (ctxt, rollup) commitment in + let* res, ctxt = get_commitment_opt_unsafe ctxt rollup commitment in match res with | None -> fail (Sc_rollup_unknown_commitment commitment) | Some commitment -> return (commitment, ctxt) @@ -70,6 +75,11 @@ let set_commitment_added ctxt rollup node new_value = in return (size_diff, new_value, ctxt) +let get_predecessor_opt_unsafe ctxt rollup node = + let open Lwt_result_syntax in + let* commitment, ctxt = get_commitment_opt_unsafe ctxt rollup node in + return (Option.map (fun (c : Commitment.t) -> c.predecessor) commitment, ctxt) + let get_predecessor_unsafe ctxt rollup node = let open Lwt_tzresult_syntax in let* commitment, ctxt = get_commitment_unsafe ctxt rollup node in @@ -97,3 +107,23 @@ let hash ctxt commitment = Raw_context.consume_gas ctxt (Sc_rollup_costs.cost_hash_bytes ~bytes_len) in return (ctxt, Sc_rollup_commitment_repr.Hash.hash_bytes [commitment_bytes]) + +module Internal_for_tests = struct + let get_cemented_commitments_with_levels ctxt rollup = + let open Lwt_tzresult_syntax in + let rec aux ctxt commitments_with_levels commitment_hash = + let* commitment_opt, ctxt = + get_commitment_opt_unsafe ctxt rollup commitment_hash + in + match commitment_opt with + | None -> return (commitments_with_levels, ctxt) + | Some {predecessor; inbox_level; _} -> + (aux [@ocaml.tailcall]) + ctxt + ((commitment_hash, inbox_level) :: commitments_with_levels) + predecessor + in + let* lcc_hash, ctxt = last_cemented_commitment ctxt rollup in + let+ commitments_with_levels, ctxt = aux ctxt [] lcc_hash in + (commitments_with_levels, ctxt) +end diff --git a/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.mli b/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.mli index 95e8ae6936015d6250cbea1783d61b6d9c35e10f..b126d0b2ab2f1f22399e9eccc3bfcbdeb1d2ae91 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_commitment_storage.mli @@ -158,6 +158,20 @@ val get_commitment : Commitment_hash.t -> (Commitment.t * Raw_context.t) tzresult Lwt.t +(** [get_commitment_opt_unsafe context rollup commitment_hash] returns an + [Option.t] which is either a defined value containing the commitment with + the given hash, or `None` if such a commitment does not exist. This + function *must* be called only after they have checked for the existence + of the rollup, and therefore it is not necessary for it to check for the + existence of the rollup again. Otherwise, use the safe function + {!get_commitment}. +*) +val get_commitment_opt_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment.t Option.t * Raw_context.t) tzresult Lwt.t + (** [get_commitment_unsafe context rollup commitment_hash] returns the commitment with the given hash. This function *must* be called only after they have checked for the existence @@ -187,6 +201,16 @@ val set_commitment_added : Raw_level_repr.t -> (int * Raw_level_repr.t * Raw_context.t) tzresult Lwt.t +(** [get_predecessor_opt_unsafe ctxt rollup commitment_hash] returns an + [Option.t] value containing the [rollup] commitment predecessor of + [commitment_hash] in the [ctxt], if any. It does not check for the + existence of the [rollup]. *) +val get_predecessor_opt_unsafe : + Raw_context.t -> + Sc_rollup_repr.t -> + Commitment_hash.t -> + (Commitment_hash.t Option.t * Raw_context.t) tzresult Lwt.t + (** [get_predecessor_unsafe ctxt rollup commitment_hash] returns the [rollup] commitment predecessor of [commitment_hash] in the [ctxt]. It is unsafe as the current commitment is retrived using {!get_commitment_unsafe}. @@ -200,3 +224,19 @@ val get_predecessor_unsafe : (** Hash a commitment and account for gas spent. *) val hash : Raw_context.t -> Commitment.t -> (Raw_context.t * Commitment_hash.t) tzresult + +module Internal_for_tests : sig + (** [get_cemented_commitments_with_levels ctxt rollup] returns a list of all + cemented commitment hashes and corresponding inbox levels that are present + in the storage, ordered by inbox level. + + May fail with: + {ul + {li [Sc_rollup_does_not_exist] if [rollup] does not exist} + } +*) + val get_cemented_commitments_with_levels : + Raw_context.t -> + Sc_rollup_repr.t -> + ((Commitment_hash.t * Raw_level_repr.t) list * Raw_context.t) tzresult Lwt.t +end 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 b0e6f0ac6263baa9698aff574af66a2f26c2d4be..7603f88c6b15ad7af9745338a48e0ea779535765 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_stake_storage.ml @@ -216,13 +216,19 @@ let modify_commitment_stake_count ctxt rollup node f = in return (new_count, size_diff, ctxt) -let deallocate ctxt rollup node = +let deallocate_commitment ctxt rollup node = let open Lwt_tzresult_syntax in if Commitment_hash.(node = zero) then return ctxt else let* ctxt, _size_freed = Store.Commitments.remove_existing (ctxt, rollup) node in + return ctxt + +let deallocate_commitment_metadata ctxt rollup node = + let open Lwt_tzresult_syntax in + if Commitment_hash.(node = zero) then return ctxt + else let* ctxt, _size_freed = Store.Commitment_added.remove_existing (ctxt, rollup) node in @@ -231,6 +237,29 @@ let deallocate ctxt rollup node = in return ctxt +let deallocate ctxt rollup node = + let open Lwt_tzresult_syntax in + let* ctxt = deallocate_commitment_metadata ctxt rollup node in + deallocate_commitment ctxt rollup node + +let find_commitment_to_deallocate ctxt rollup commitment_hash + ~num_commitments_to_keep = + let open Lwt_result_syntax in + let rec aux ctxt commitment_hash n = + if Compare.Int.(n = 0) then return (Some commitment_hash, ctxt) + else + let* pred_hash, ctxt = + Commitment_storage.get_predecessor_opt_unsafe + ctxt + rollup + commitment_hash + in + match pred_hash with + | None -> return (None, ctxt) + | Some pred_hash -> (aux [@ocaml.tailcall]) ctxt pred_hash (n - 1) + in + aux ctxt commitment_hash num_commitments_to_keep + let decrease_commitment_stake_count ctxt rollup node = let open Lwt_tzresult_syntax in let* new_count, _size_diff, ctxt = @@ -368,12 +397,32 @@ let cement_commitment ctxt rollup new_lcc = Store.Last_cemented_commitment.update ctxt rollup new_lcc in assert (Compare.Int.(lcc_size_diff = 0)) ; - (* At this point we know all stakers are implicitly staked - on the new LCC, and no one is directly staked on the old LCC. We - can safely deallocate the old LCC. + (* At this point we know that all stakers are implicitly staked on the new + LCC, and no one is directly staked on the old LCC. Therefore we can safely + deallocate the metadata ([Commitment_added] and [Commitment_stake_count]) + of the old LCC. + However, we must not remove the commitment itself as we need it to allow + executing outbox messages for a limited period. The maximum number of + active cemented commitments available for execution is specified in + [ctxt.sc_rollup.max_number_of_stored_cemented_commitments]. + Instead, we remove the oldest cemented commitment that would exceed + [max_number_of_cemented_commitments], if such exist. *) - let+ ctxt = deallocate ctxt rollup old_lcc in - (ctxt, new_lcc_commitment) + let* ctxt = deallocate_commitment_metadata ctxt rollup old_lcc in + (* Decrease max_number_of_stored_cemented_commitments by one because + we start counting commitments from old_lcc, rather than from new_lcc. *) + let num_commitments_to_keep = + (Raw_context.constants ctxt).sc_rollup + .max_number_of_stored_cemented_commitments - 1 + in + let* commitment_to_deallocate, ctxt = + find_commitment_to_deallocate ~num_commitments_to_keep ctxt rollup old_lcc + in + match commitment_to_deallocate with + | None -> return (ctxt, new_lcc_commitment) + | Some old_lcc -> + let+ ctxt = deallocate_commitment ctxt rollup old_lcc in + (ctxt, new_lcc_commitment) let remove_staker ctxt rollup staker = let open Lwt_tzresult_syntax in 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 fce3d4bf825b3bbca1257be8488ccc945310c759..beef07429ecd0569e98bffc5c807cafa22c11acd 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 @@ -266,6 +266,26 @@ let assert_commitment_equal ~loc x y = x y +let assert_commitments_with_levels_equal ~loc cs1 cs2 = + let commitment_with_level_pp ppf (hash, level) = + Format.fprintf + ppf + "(%a, %a)" + Sc_rollup_commitment_repr.Hash.pp + hash + Raw_level_repr.pp + level + in + Assert.assert_equal_list + ~loc + (fun (commitment1, level1) (commitment2, level2) -> + Sc_rollup_commitment_repr.Hash.(commitment1 = commitment2) + && Raw_level_repr.(level1 = level2)) + "Unexpected list of cemented commitments" + commitment_with_level_pp + cs1 + cs2 + let assert_kinds_are_equal ~loc x y = Assert.equal ~loc @@ -457,6 +477,40 @@ let valid_inbox_level ctxt = Raw_level_repr.of_int32_exn (Int32.add root_level (Int32.mul (Int32.of_int commitment_freq) i)) +let produce_and_refine ctxt ~number_of_commitments ?(start_at_level = 1l) + ~predecessor staker rollup = + let rec aux ctxt n l predecessor result = + if n = 0 then return @@ (List.rev result, ctxt) + else + let commitment = + Commitment_repr. + { + predecessor; + inbox_level = valid_inbox_level ctxt l; + number_of_ticks = number_of_ticks_exn 1232909l; + compressed_state = Sc_rollup_repr.State_hash.zero; + } + in + let* c, _level, ctxt = + Sc_rollup_stake_storage.Internal_for_tests.refine_stake + ctxt + rollup + staker + commitment + in + aux ctxt (n - 1) (Int32.succ l) c (c :: result) + in + aux ctxt number_of_commitments start_at_level predecessor [] + +let rec cement_commitments ctxt commitments rollup = + match commitments with + | [] -> return ctxt + | c :: commitments -> + let* ctxt, _commitment = + Sc_rollup_stake_storage.cement_commitment ctxt rollup c + in + cement_commitments ctxt commitments rollup + let test_deposit_then_refine () = let* ctxt = new_context () in let* rollup, genesis_hash, ctxt = lift @@ new_sc_rollup ctxt in @@ -2822,6 +2876,78 @@ let test_subscribed_slots_of_missing_rollup () = rollup (Raw_context.current_level ctxt).level) +let test_get_cemented_commitments_with_levels_of_missing_rollup () = + assert_fails_with_missing_rollup ~loc:__LOC__ (fun ctxt rollup -> + Sc_rollup_commitment_storage.Internal_for_tests + .get_cemented_commitments_with_levels + ctxt + rollup) + +let test_get_cemented_commitments_with_levels () = + let* ctxt, rollup, c0, staker = + originate_rollup_and_deposit_with_one_staker () + in + let level = valid_inbox_level ctxt in + let challenge_window = + Constants_storage.sc_rollup_challenge_window_in_blocks ctxt + in + (* Produce and stake on n commitments, each on top of the other. *) + (* Fetch number of stored commitments in context. *) + let max_num_stored_cemented_commitments = + (Raw_context.constants ctxt).sc_rollup + .max_number_of_stored_cemented_commitments + in + (* Produce and stake more commitments than the number of cemented + commitments that can be stored. *) + let number_of_commitments = max_num_stored_cemented_commitments + 5 in + let* commitments, ctxt = + lift + @@ produce_and_refine + ~number_of_commitments + ~predecessor:c0 + ctxt + staker + rollup + in + let ctxt = Raw_context.Internal_for_tests.add_level ctxt challenge_window in + (* Cement all commitments that have been produced. *) + let* ctxt = lift @@ cement_commitments ctxt commitments rollup in + (* Add genesis commitment to list of produced commitments. *) + let commitments = c0 :: commitments in + let number_of_cemented_commitments = List.length commitments in + (* Fetch cemented commitments that are kept in context. *) + let* cemented_commitments_with_levels, _ctxt = + lift + @@ Sc_rollup_commitment_storage.Internal_for_tests + .get_cemented_commitments_with_levels + ctxt + rollup + in + (* Check that only ctxt.sc_rollup.max_number_of_stored_cemented_commitments + are kept in context. *) + let* () = + Assert.equal_int + ~loc:__LOC__ + (List.length cemented_commitments_with_levels) + max_num_stored_cemented_commitments + in + (* Check that the commitments that are kept in context are the + last [ctxt.sc_rollup.max_number_of_stored_cemented_commitments]. + commitments that have been cemented. *) + let dropped_commitments = + number_of_cemented_commitments - max_num_stored_cemented_commitments + in + let expected_commitments_with_levels = + commitments + |> List.drop_n dropped_commitments + |> List.mapi (fun i c -> + (c, level @@ Int32.of_int (i + dropped_commitments))) + in + assert_commitments_with_levels_equal + ~loc:__LOC__ + cemented_commitments_with_levels + expected_commitments_with_levels + let tests = [ Tztest.tztest @@ -3115,6 +3241,14 @@ let tests = "Originating a rollup creates a genesis commitment" `Quick test_last_cemented_commitment_hash_with_level_when_genesis; + Tztest.tztest + "Getting cemented commitments with levels of missing rollups fails" + `Quick + test_get_cemented_commitments_with_levels_of_missing_rollup; + Tztest.tztest + "Getting cemented commitments returns multiple cemented commitments" + `Quick + test_get_cemented_commitments_with_levels; ] (* FIXME: https://gitlab.com/tezos/tezos/-/issues/2460 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 db728451b1aa52035bb5981640353891033de2e1..26dade38ca1b1ab478fdc6c76a335585e153b956 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 @@ -57,7 +57,8 @@ "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 2, "delegate": "[PUBLIC_KEY_HASH]", diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out index 336bf7c4485aaf96c0e5e95862a43c331583cec9..147daeffe854454f77a7f097aab23a06b4e3345c 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 @@ -57,7 +57,8 @@ "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } protocol of light mode unspecified, using the node's protocol: ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im ./tezos-client --mode light rpc get /chains/main/blocks/head/helpers/baking_rights 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 74760a09996a0b6304213f6dcc0b4168e534f772..b2b35d89d30c21bde806eacbc568f1b28a06a55c 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 @@ -57,7 +57,8 @@ "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } protocol of proxy unspecified, using the node's protocol: ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im ./tezos-client --mode proxy rpc get /chains/main/blocks/head/helpers/baking_rights 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 6379f2f380fb0f2506b669a196b6643931bd7781..f8ede612433b081f139ddfd985d91e4f7340b05e 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 @@ -57,7 +57,8 @@ "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", 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 6379f2f380fb0f2506b669a196b6643931bd7781..f8ede612433b081f139ddfd985d91e4f7340b05e 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 @@ -57,7 +57,8 @@ "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client rpc get /chains/main/blocks/head/helpers/baking_rights [ { "level": 3, "delegate": "[PUBLIC_KEY_HASH]", 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 363c631282d279b0b0d06582cbd16a777355191f..7bb192ce8263db688e796e1a0a9efe691a29a003 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 @@ -113,7 +113,8 @@ This sequence of operations was run: "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client --wait none recover bond of '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' --fee 1 Node is bootstrapped. @@ -137,7 +138,7 @@ Error: ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4115.508 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -148,18 +149,18 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000719 Expected counter: 3 - Gas limit: 3726 + Gas limit: 4216 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000719 + payload fees(the block proposer) ....... +ꜩ0.000719 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4115.508 Inbox level: 32 @@ -221,7 +222,8 @@ This sequence of operations was run: "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client --wait none recover bond of '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' --fee 1 Node is bootstrapped. diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- commitments- publish- and try to cement not on top of LCC or disputed.out b/tezt/tests/expected/sc_rollup.ml/Alpha- commitments- publish- and try to cement not on top of LCC or disputed.out index bd729b84bd452fc9bfbe3ceea447711c5298ddaa..5c43b420ab25c84e8115db98cdb56015919cf0bd 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- commitments- publish- and try to cement not on top of LCC or disputed.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- commitments- publish- and try to cement not on top of LCC or disputed.out @@ -343,7 +343,7 @@ Error: ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4115.508 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -354,24 +354,24 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000719 Expected counter: 6 - Gas limit: 3726 + Gas limit: 4216 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000719 + payload fees(the block proposer) ....... +ꜩ0.000719 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4115.508 Inbox level: 5 ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4575.654 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -382,18 +382,18 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000765 Expected counter: 7 - Gas limit: 3726 + Gas limit: 4676 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000765 + payload fees(the block proposer) ....... +ꜩ0.000765 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4575.654 Inbox level: 8 @@ -501,7 +501,7 @@ Error: ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 5035.800 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -512,24 +512,24 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000811 Expected counter: 8 - Gas limit: 3726 + Gas limit: 5136 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000811 + payload fees(the block proposer) ....... +ꜩ0.000811 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 5035.800 Inbox level: 11 ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 5265.946 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -540,17 +540,17 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000834 Expected counter: 9 - Gas limit: 3726 + Gas limit: 5366 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000834 + payload fees(the block proposer) ....... +ꜩ0.000834 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 5265.946 Inbox level: 14 diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- valid dispute dissection.out b/tezt/tests/expected/sc_rollup.ml/Alpha- valid dispute dissection.out index 4c5f64c64e85f7210a1bee990d709e0649eec695..b895eaf6f4d82c9507164842ad21c81f5e8093ac 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- valid dispute dissection.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- valid dispute dissection.out @@ -239,7 +239,7 @@ This sequence of operations was run: ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4115.508 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -250,24 +250,24 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000719 Expected counter: 6 - Gas limit: 3726 + Gas limit: 4216 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000719 + payload fees(the block proposer) ....... +ꜩ0.000719 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4115.508 Inbox level: 5 ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4575.654 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -278,18 +278,18 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000765 Expected counter: 7 - Gas limit: 3726 + Gas limit: 4676 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000765 + payload fees(the block proposer) ....... +ꜩ0.000765 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4575.654 Inbox level: 8 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 30952b36d28c2082e351345e1bf9ef9ec34cca50..059fa042c164e7c8d2e68010dc7d317e866c599b 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 @@ -113,7 +113,8 @@ This sequence of operations was run: "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client --wait none recover bond of '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' --fee 1 Node is bootstrapped. @@ -137,7 +138,7 @@ Error: ./tezos-client --wait none cement commitment '[SC_ROLLUP_COMMITMENT_HASH]' from bootstrap1 for sc rollup '[SC_ROLLUP_HASH]' Node is bootstrapped. -Estimated gas: 3625.362 units (will add 100 for safety) +Estimated gas: 4115.508 units (will add 100 for safety) Estimated storage: no bytes added Operation successfully injected in the node. Operation hash is '[OPERATION_HASH]' @@ -148,18 +149,18 @@ and/or an external block explorer to make sure that it has been included. This sequence of operations was run: Manager signed operations: From: [PUBLIC_KEY_HASH] - Fee to the baker: ꜩ0.00067 + Fee to the baker: ꜩ0.000719 Expected counter: 3 - Gas limit: 3726 + Gas limit: 4216 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.00067 - payload fees(the block proposer) ....... +ꜩ0.00067 + [PUBLIC_KEY_HASH] ... -ꜩ0.000719 + payload fees(the block proposer) ....... +ꜩ0.000719 Smart contract rollup commitment cementing: Address: [SC_ROLLUP_HASH] Commitment: [SC_ROLLUP_COMMITMENT_HASH] This smart contract rollup commitment cementing was successfully applied - Consumed gas: 3625.362 + Consumed gas: 4115.508 Inbox level: 32 @@ -221,7 +222,8 @@ This sequence of operations was run: "sc_rollup_max_active_outbox_levels": 20160, "sc_rollup_max_outbox_messages_per_level": 100, "sc_rollup_number_of_sections_in_dissection": 32, - "sc_rollup_timeout_period_in_blocks": 20160 } + "sc_rollup_timeout_period_in_blocks": 20160, + "sc_rollup_max_number_of_cemented_commitments": 5 } ./tezos-client --wait none recover bond of '[PUBLIC_KEY_HASH]' for sc rollup '[SC_ROLLUP_HASH]' --fee 1 Node is bootstrapped.