diff --git a/src/proto_alpha/bin_sc_rollup_node/inbox.ml b/src/proto_alpha/bin_sc_rollup_node/inbox.ml index 6c587b8809922ed6da1f82db234ba02187121847..9c99c15c109074ff6625fbfa221eb5c4dd0c54af 100644 --- a/src/proto_alpha/bin_sc_rollup_node/inbox.ml +++ b/src/proto_alpha/bin_sc_rollup_node/inbox.ml @@ -70,39 +70,58 @@ module State = struct let set_message_tree = Store.MessageTrees.set end -(* FIXME: https://gitlab.com/tezos/tezos/-/issues/3199 - For the moment, the rollup node ignores L1 to L2 messages. -*) -let get_messages l1_ctxt head rollup = +let get_messages Node_context.{l1_ctxt; rollup_address; _} head = let open Lwt_result_syntax in let* block = Layer1.fetch_tezos_block l1_ctxt head in let apply (type kind) accu ~source:_ (operation : kind manager_operation) _result = + let open Result_syntax in + let+ accu = accu in match operation with - | Sc_rollup_add_messages {rollup = rollup'; messages} - when Sc_rollup.Address.(rollup' = rollup) -> + | Sc_rollup_add_messages {rollup; messages} + when Sc_rollup.Address.(rollup = rollup_address) -> + let messages = + List.map + (fun message -> Store.Inbox.Message.External message) + messages + in List.rev_append messages accu | _ -> accu in - let apply_internal (type kind) accu ~source:_ - (_operation : kind Apply_internal_results.internal_operation_contents) - (_result : + let apply_internal (type kind) accu ~source + (operation : kind Apply_internal_results.internal_operation) + (result : kind Apply_internal_results.successful_internal_operation_result) = - accu + let open Result_syntax in + let* accu = accu in + match (operation, result) with + | ( { + operation = Transaction {destination = Sc_rollup rollup; parameters; _}; + source = Originated sender; + _; + }, + ITransaction_result (Transaction_to_sc_rollup_result _) ) + when Sc_rollup.Address.(rollup = rollup_address) -> + let+ payload = + Environment.wrap_tzresult @@ Script_repr.force_decode parameters + in + let message = Store.Inbox.Message.{payload; sender; source} in + Store.Inbox.Message.Internal message :: accu + | _ -> return accu in - let messages = + let*? messages = Layer1_services.( process_applied_manager_operations - [] + (Ok []) block.operations {apply; apply_internal}) in return (List.rev messages) -let process_head Node_context.({l1_ctxt; rollup_address; _} as node_ctxt) store - Layer1.(Head {level; hash = head_hash} as head) = +let process_head node_ctxt store Layer1.(Head {level; hash = head_hash} as head) + = let open Lwt_result_syntax in - let*! res = get_messages l1_ctxt head_hash rollup_address in + let*! res = get_messages node_ctxt head_hash in match res with | Error e -> head_processing_failure e | Ok [] -> return_unit @@ -124,12 +143,7 @@ let process_head Node_context.({l1_ctxt; rollup_address; _} as node_ctxt) store @@ let*! history = State.history_of_hash store predecessor in let*! messages_tree = State.find_message_tree store predecessor in let*? level = Raw_level.of_int32 level in - let*? messages = - List.map_e - (fun message -> - Sc_rollup.Inbox.Message.(serialize @@ External message)) - messages - in + let*? messages = List.map_e Store.Inbox.Message.serialize messages in let* messages_tree, history, inbox = Store.Inbox.add_messages store diff --git a/src/proto_alpha/bin_sc_rollup_node/interpreter.ml b/src/proto_alpha/bin_sc_rollup_node/interpreter.ml index 38c15746e6a667a27c5bd4f6e7a3602f93193968..093a3c34b00ba4341615460b0c6eabdc1b84bad9 100644 --- a/src/proto_alpha/bin_sc_rollup_node/interpreter.ml +++ b/src/proto_alpha/bin_sc_rollup_node/interpreter.ml @@ -98,10 +98,7 @@ module Make (PVM : Pvm.S) : S = struct let*! messages = Store.Messages.get store hash in let* state = List.fold_left_i_es - (fun message_counter state external_message -> - let message = - Sc_rollup.Inbox.Message.External external_message - in + (fun message_counter state message -> let*? payload = Environment.wrap_tzresult (Sc_rollup.Inbox.Message.serialize message) diff --git a/src/proto_alpha/bin_sc_rollup_node/layer1_services.ml b/src/proto_alpha/bin_sc_rollup_node/layer1_services.ml index 6dcd12d01413d6bc42086278211cfdf2f93efc49..922c75ab8afe2fa7c645e133f587f132e6e78d14 100644 --- a/src/proto_alpha/bin_sc_rollup_node/layer1_services.ml +++ b/src/proto_alpha/bin_sc_rollup_node/layer1_services.ml @@ -40,7 +40,7 @@ type 'accu operation_processor = { 'kind. 'accu -> source:public_key_hash -> - 'kind Apply_internal_results.internal_operation_contents -> + 'kind Apply_internal_results.internal_operation -> 'kind Apply_internal_results.successful_internal_operation_result -> 'accu; } @@ -78,7 +78,7 @@ let process_applied_manager_operations operations accu f = and on_applied_internal_operations accu source internal_operation_results = let open Apply_internal_results in List.fold_left - (fun accu (Internal_operation_result ({operation; _}, result)) -> + (fun accu (Internal_operation_result (operation, result)) -> match result with | Applied result -> f.apply_internal accu ~source operation result | _ -> accu) diff --git a/src/proto_alpha/bin_sc_rollup_node/layer1_services.mli b/src/proto_alpha/bin_sc_rollup_node/layer1_services.mli index f6e5a10afecf985545ec24e125ebe4c0d0b9c174..669cacbe849526c151a95863d803106f72cd3d38 100644 --- a/src/proto_alpha/bin_sc_rollup_node/layer1_services.mli +++ b/src/proto_alpha/bin_sc_rollup_node/layer1_services.mli @@ -39,7 +39,7 @@ type 'accu operation_processor = { 'kind. 'accu -> source:public_key_hash -> - 'kind Apply_internal_results.internal_operation_contents -> + 'kind Apply_internal_results.internal_operation -> 'kind Apply_internal_results.successful_internal_operation_result -> 'accu; } @@ -48,4 +48,4 @@ type 'accu operation_processor = { folds over the list of [operations] applying [operator] to transform [accu] along the way. *) val process_applied_manager_operations : - 'a -> operation trace trace -> 'a operation_processor -> 'a + 'a -> operation list list -> 'a operation_processor -> 'a diff --git a/src/proto_alpha/bin_sc_rollup_node/store.ml b/src/proto_alpha/bin_sc_rollup_node/store.ml index 7ec698f4a6395eec7089827031d9c5281a77f473..d465aee1983e73f7606f4f61913a242bc2d5578e 100644 --- a/src/proto_alpha/bin_sc_rollup_node/store.ml +++ b/src/proto_alpha/bin_sc_rollup_node/store.ml @@ -23,7 +23,8 @@ (* *) (*****************************************************************************) -open Protocol.Alpha_context +open Protocol +open Alpha_context module Maker = Irmin_pack_unix.Maker (Tezos_context_encoding.Context.Conf) module IStore = struct @@ -410,14 +411,10 @@ module Messages = Make_append_only_map (struct let string_of_key = Block_hash.to_b58check - (* FIXME: https://gitlab.com/tezos/tezos/-/issues/3199 - For the moment, the rollup node ignores L1 to L2 messages. - When internal messages will also be considered, the following - should probably be changed into [Sc_rollup.Inbox.message list]. - *) - type value = string list + type value = Inbox.Message.t list - let value_encoding = Data_encoding.(list string) + let value_encoding = + Data_encoding.(list @@ dynamic_size Inbox.Message.encoding) end) (** Inbox state for each block *) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index b4aa6f4b162c8d7d834e8a6572340316c0fbd9cb..7235ef6faae84eb2d32f281c5ab24dbe5109f71a 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2787,6 +2787,8 @@ module Sc_rollup : sig type serialized = private string + val encoding : t Data_encoding.t + val unsafe_of_string : string -> serialized val serialize : t -> serialized tzresult diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index fe11af685a2c286fc02e9ded5e18419d811494f3..6df3ffac0caa966c1bf39562c713a6403a554c9c 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -837,15 +837,24 @@ module Make (Context : P) : let set_input_monadic {PS.inbox_level; message_counter; payload} = let open Monad.Syntax in - match Sc_rollup_inbox_message_repr.deserialize payload with - | Ok (External payload) -> + let payload = + match Sc_rollup_inbox_message_repr.deserialize payload with + | Error _ -> None + | Ok (External payload) -> Some payload + | Ok (Internal {payload; _}) -> ( + match Micheline.root payload with + | String (_, payload) -> Some payload + | _ -> None) + in + match payload with + | Some payload -> let* boot_sector = Boot_sector.get in let msg = boot_sector ^ payload in let* () = CurrentLevel.set inbox_level in let* () = MessageCounter.set (Some message_counter) in let* () = NextMessage.set (Some msg) in return () - | Error _ | Ok (Internal _) -> + | None -> let* () = CurrentLevel.set inbox_level in let* () = MessageCounter.set (Some message_counter) in let* () = Status.set WaitingForInputMessage in diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_message_repr.mli b/src/proto_alpha/lib_protocol/sc_rollup_inbox_message_repr.mli index 987b57e60b0a6d12aa8ad2c8c25a4a8ad2257fa8..7611afd6220ae770e956dd157f8dbd89a4abce12 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_message_repr.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_message_repr.mli @@ -63,6 +63,9 @@ type t = Internal of internal_inbox_message | External of string type serialized = private string +(** Encoding for messages from Layer 1 to Layer 2 *) +val encoding : t Data_encoding.t + (** [serialize msg] encodes the inbox message [msg] in binary format. *) val serialize : t -> serialized tzresult diff --git a/tezt/tests/contracts/proto_alpha/sc_rollup_forward.tz b/tezt/tests/contracts/proto_alpha/sc_rollup_forward.tz new file mode 100644 index 0000000000000000000000000000000000000000..22789dbc3e169adcf7e458b843b505b2761ed75f --- /dev/null +++ b/tezt/tests/contracts/proto_alpha/sc_rollup_forward.tz @@ -0,0 +1,12 @@ +parameter (pair address string) ; +storage unit ; +code { UNPAIR ; + DIP { NIL operation }; + UNPAIR ; + CONTRACT string ; + ASSERT_SOME; + SWAP; + DIP { PUSH mutez 0 }; + TRANSFER_TOKENS; + CONS; + PAIR; } \ No newline at end of file diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- configuration of a smart contract optimistic rollup node.out b/tezt/tests/expected/sc_rollup.ml/Alpha- configuration of a smart contract optimistic rollup node.out index 84c2be78f6289f388d664a1c3be011bab9953d96..de9331f43ea1e5e18063768d58431e77507341f1 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- configuration of a smart contract optimistic rollup node.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- configuration of a smart contract optimistic rollup node.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- consecutive commitments.out b/tezt/tests/expected/sc_rollup.ml/Alpha- consecutive commitments.out index 53b1f4bce04a009a65d83bed9515086b69a32a66..c9116db63b8654f0d2feb9444d9fecd43809059a 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- consecutive commitments.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- consecutive commitments.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- ensure boot sector is used.out b/tezt/tests/expected/sc_rollup.ml/Alpha- ensure boot sector is used.out index 1221615d6f31e06f43ab76d040696ab206d8e602..8b48c5f5d81550573ea9ceff07ab01fa780104db 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- ensure boot sector is used.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- ensure boot sector is used.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with '10 10 10 + +' --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with '10 10 10 + +' --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6626 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000626 payload fees(the block proposer) ....... +ꜩ0.000626 - Originate smart contract rollup of kind arith and type unit with boot sector '10 10 10 + +' + Originate smart contract rollup of kind arith and type string with boot sector '10 10 10 + +' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6626 bytes @@ -75,7 +75,7 @@ This sequence of operations was run: ./tezos-sc-rollup-client-alpha rpc get /global/state_hash "scs11h9A7VAzxxEkEW6ufnfbPnu717o4mc6hagzqvPLhLvHcXyRQVA" -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with 31 --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with 31 --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6616 bytes added (will add 20 for safety) @@ -95,7 +95,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000616 payload fees(the block proposer) ....... +ꜩ0.000616 - Originate smart contract rollup of kind arith and type unit with boot sector '31' + Originate smart contract rollup of kind arith and type string with boot sector '31' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6616 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- get genesis info of a sc rollup.out b/tezt/tests/expected/sc_rollup.ml/Alpha- get genesis info of a sc rollup.out index 84c2be78f6289f388d664a1c3be011bab9953d96..de9331f43ea1e5e18063768d58431e77507341f1 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- get genesis info of a sc rollup.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- get genesis info of a sc rollup.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- get last cemented commitment hash and inbox level of a sc rollup.out b/tezt/tests/expected/sc_rollup.ml/Alpha- get last cemented commitment hash and inbox level of a sc rollup.out index 84c2be78f6289f388d664a1c3be011bab9953d96..de9331f43ea1e5e18063768d58431e77507341f1 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- get last cemented commitment hash and inbox level of a sc rollup.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- get last cemented commitment hash and inbox level of a sc rollup.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- getting a smart-contract rollup address through the client.out b/tezt/tests/expected/sc_rollup.ml/Alpha- getting a smart-contract rollup address through the client.out index 84c2be78f6289f388d664a1c3be011bab9953d96..de9331f43ea1e5e18063768d58431e77507341f1 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- getting a smart-contract rollup address through the client.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- getting a smart-contract rollup address through the client.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- list originated rollups.out b/tezt/tests/expected/sc_rollup.ml/Alpha- list originated rollups.out index fa66c2b7a71399d306c471f8d321d44462ad9071..dec06cb9fe3b7f6ef36cc5dbf3e26e5d03b0d351 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- list originated rollups.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- list originated rollups.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -30,7 +30,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -50,7 +50,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -61,7 +61,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -81,7 +81,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -92,7 +92,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -112,7 +112,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -123,7 +123,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -143,7 +143,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -154,7 +154,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -174,7 +174,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -185,7 +185,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -205,7 +205,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -216,7 +216,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -236,7 +236,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -247,7 +247,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -267,7 +267,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes @@ -278,7 +278,7 @@ This sequence of operations was run: storage fees ........................... +ꜩ1.6535 -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -298,7 +298,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with internal messages.out b/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with internal messages.out new file mode 100644 index 0000000000000000000000000000000000000000..4a842d17f5f71abc7e744928088c22cf3a77e0b1 --- /dev/null +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with internal messages.out @@ -0,0 +1,185 @@ + +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 +Node is bootstrapped. +Estimated gas: 2509.092 units (will add 100 for safety) +Estimated storage: 6614 bytes added (will add 20 for safety) +Operation successfully injected in the node. +Operation hash is '[OPERATION_HASH]' +NOT waiting for the operation to be included. +Use command + tezos-client wait for [OPERATION_HASH] to be included --confirmations 1 --branch [BLOCK_HASH] +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.000614 + Expected counter: 1 + Gas limit: 2610 + Storage limit: 6634 bytes + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ0.000614 + payload fees(the block proposer) ....... +ꜩ0.000614 + Originate smart contract rollup of kind arith and type string with boot sector '' + This smart contract rollup origination was successfully applied + Consumed gas: 2509.092 + Storage size: 6614 bytes + Address: [SC_ROLLUP_HASH] + Genesis commitment hash: [SC_ROLLUP_COMMITMENT_HASH] + Balance updates: + [PUBLIC_KEY_HASH] ... -ꜩ1.6535 + storage fees ........................... +ꜩ1.6535 + + +./tezos-client rpc get '/chains/main/blocks/head/context/sc_rollup/[SC_ROLLUP_HASH]/genesis_info' +{ "level": 2, + "commitment_hash": "[SC_ROLLUP_COMMITMENT_HASH]" } + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs139rUcWoTB9MbNUEaWYn5RswKF7G2uENnRPq7Q9ByQRMahtB2NA" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"0" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\007" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs139EB5Ny4fma7o6nS9mGauvHFbwpfvsJijBU4tNjEr9QZ8ZJWQd" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"19" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs139EB5Ny4fma7o6nS9mGauvHFbwpfvsJijBU4tNjEr9QZ8ZJWQd" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"19" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\n" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs12UMx1ykNkh7mGwph7oc47aPAYSZfSdx6E6gqHdNuD3fWoY5z7V" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"37" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs12UMx1ykNkh7mGwph7oc47aPAYSZfSdx6E6gqHdNuD3fWoY5z7V" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"37" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\r" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs12ssnuPLi7HmVNDsZmAn38HQHQ3Yy7M8iqxALseKWEZjhetGdQj" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"56" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs12ssnuPLi7HmVNDsZmAn38HQHQ3Yy7M8iqxALseKWEZjhetGdQj" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"56" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\016" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11bU88Xg7RJhWwcd6xjATkP9KxurEXizBzGm99Y7f1AuwHSwMFr" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"75" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11bU88Xg7RJhWwcd6xjATkP9KxurEXizBzGm99Y7f1AuwHSwMFr" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"75" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\019" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11deEDoFvXGQjSLah1h2N13p1PJTVQNqm1qxaSHUhX9HnZGK3wZ" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"94" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11deEDoFvXGQjSLah1h2N13p1PJTVQNqm1qxaSHUhX9HnZGK3wZ" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"94" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\022" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs13DumkywYF7EtycrHEqToSzBFnYBvJeTA2XUZySvttgXzWWP14d" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"113" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs13DumkywYF7EtycrHEqToSzBFnYBvJeTA2XUZySvttgXzWWP14d" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"113" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\025" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs13RfGYbA1saxvGJMLCySU3tja9MNaqG4CRiWofbCuFiwNofAFCt" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"132" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs13RfGYbA1saxvGJMLCySU3tja9MNaqG4CRiWofbCuFiwNofAFCt" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"132" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\028" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11vJrzpmNeM3aydKLFC8LN2qzEiLPDW1hYUAWb9aFXKyveoZHGM" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"151" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11vJrzpmNeM3aydKLFC8LN2qzEiLPDW1hYUAWb9aFXKyveoZHGM" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"151" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\031" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11daEh8MqwPhDawd8n5frMeRhoASh46rnJYNvFz2eSWiVeUfYwS" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"170" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs11daEh8MqwPhDawd8n5frMeRhoASh46rnJYNvFz2eSWiVeUfYwS" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"170" + +./tezos-sc-rollup-client-alpha get state value for vars/value +"\000\000\000\"" + +./tezos-sc-rollup-client-alpha rpc get /global/state_hash +"scs12P2MF8NUnH7BrSuRCuSjpBcYpL3ZGJwwm6N3WYkBxvbbwGhdtz" + +./tezos-sc-rollup-client-alpha rpc get /global/total_ticks +"190" diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with messages.out b/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with messages.out index f100b69f970bc47c7626fdd8dacc53b77bbdfc81..6acafae0a4daa6da1cf68475b4c20f4ee289977b 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with messages.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- node advances PVM state with messages.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- node boots into the initial state.out b/tezt/tests/expected/sc_rollup.ml/Alpha- node boots into the initial state.out index 77e1fedd0efc594c08dc889b1745c34d00868c8f..13564d8816a0a6ef7d4cd8b94e390508d8c0aa3a 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- node boots into the initial state.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- node boots into the initial state.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes 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 521d45d24c569d3a7c8d18effe6c5fbb3cb9c698..58a2928ed662322914ff769494b8fa6bfc5bb0be 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 @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes 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 97123c74b8867447a34d694a0668f9d562c5b4c4..97ff8a99a1052d3ed66006ff00a587a2a5df5f3d 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 @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes 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 a1d68e90b5ab47068e6fa2b913d604e9728039db..f62b3c5b741ad27289f0783d24e759d78ad5f3e9 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 @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes 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 a43f2ad94eae4db39ac8bafeab4af1626c1df155..d25ce26b35643a530c0b4d58b7676f541dcab083 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 @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (no_comm.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (no_comm.out index 18695bb7f3bce050dba92913e8b8412916317127..e9640807e794dec29d5aadc70ef44caa53127426 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (no_comm.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (no_comm.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (node_us.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (node_us.out index 925fe7c72e47e41deabcc765068c7db08204fb82..b20cc1155cb07624ac91d538b7a213651d1255ee 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (node_us.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct handling of commitments in the rollup node (node_us.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes 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 1fbe5d1cfbe1c7d0fa87dd45843324d080d947cd..cba6a64c700ce054a90c8e63be385d05824f0258 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 @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (basic).out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (basic).out index 31462e9d15420221d77f38f965bf4228e63de43c..c388500287a6022ebeba989cc7cae48b69ef3fac 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (basic).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (basic).out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (handles_ch.out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (handles_ch.out index 679799b3f2df08f7c84f90cb796ab749593319dd..baee5739d0e569a2e047b33f2b78f1ded9bd30df 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (handles_ch.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (handles_ch.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (stops).out b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (stops).out index 30b726333f4bba25b4582102f3cb7fbf7fe06768..3170d2c2a6858e4dafeaa42b780139a062303091 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (stops).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- observing the correct maintenance of inbox in the rollup node (stops).out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- originate with boot sector.out b/tezt/tests/expected/sc_rollup.ml/Alpha- originate with boot sector.out index eea1e76a3d1967218dd4508ac020b20e5ad317a3..bc4abe91fc0d630e26a0b7198944099696c1083e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- originate with boot sector.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- originate with boot sector.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with '10 10 10 + +' --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with '10 10 10 + +' --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6626 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000626 payload fees(the block proposer) ....... +ꜩ0.000626 - Originate smart contract rollup of kind arith and type unit with boot sector '10 10 10 + +' + Originate smart contract rollup of kind arith and type string with boot sector '10 10 10 + +' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6626 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- origination of a SCORU executes without error.out b/tezt/tests/expected/sc_rollup.ml/Alpha- origination of a SCORU executes without error.out index 84c2be78f6289f388d664a1c3be011bab9953d96..de9331f43ea1e5e18063768d58431e77507341f1 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- origination of a SCORU executes without error.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- origination of a SCORU executes without error.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - check inbox size.out b/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - check inbox size.out index 63fb8c7e49022c83452cd48493add9f6bb7d4b17..f5cacfba21b8424c9b9ab1937e255ceba8a16252 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - check inbox size.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - check inbox size.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - current messages hash.out b/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - current messages hash.out index d09b3b1c5699e14b8d956ef020f9025238aaa9a6..28bd204f8482172b8735d6a5f74fff70c12fc60c 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - current messages hash.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- pushing messages in the inbox - current messages hash.out @@ -1,5 +1,5 @@ -./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type unit booting with --burn-cap 9999999 +./tezos-client --wait none originate sc rollup from '[PUBLIC_KEY_HASH]' of kind arith of type string booting with --burn-cap 9999999 Node is bootstrapped. Estimated gas: 2509.092 units (will add 100 for safety) Estimated storage: 6614 bytes added (will add 20 for safety) @@ -19,7 +19,7 @@ This sequence of operations was run: Balance updates: [PUBLIC_KEY_HASH] ... -ꜩ0.000614 payload fees(the block proposer) ....... +ꜩ0.000614 - Originate smart contract rollup of kind arith and type unit with boot sector '' + Originate smart contract rollup of kind arith and type string with boot sector '' This smart contract rollup origination was successfully applied Consumed gas: 2509.092 Storage size: 6614 bytes diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml index a15007f5d26c59354d7cfacc6281cb87e6d6201a..88eb31b37057135a1bc28525e051a74689e908a6 100644 --- a/tezt/tests/sc_rollup.ml +++ b/tezt/tests/sc_rollup.ml @@ -153,7 +153,7 @@ let with_fresh_rollup f tezos_node tezos_client bootstrap1_key = ~src:bootstrap1_key ~kind:"arith" ~boot_sector:"" - ~parameters_ty:"unit" + ~parameters_ty:"string" tezos_client in let sc_rollup_node = @@ -263,7 +263,7 @@ let test_origination = ~burn_cap:Tez.(of_int 9999999) ~src:bootstrap1_key ~kind:"arith" - ~parameters_ty:"unit" + ~parameters_ty:"string" ~boot_sector:"" client in @@ -282,7 +282,7 @@ let with_fresh_rollup ?(boot_sector = "") f tezos_node tezos_client ~burn_cap:Tez.(of_int 9999999) ~src:bootstrap1_key ~kind:"arith" - ~parameters_ty:"unit" + ~parameters_ty:"string" ~boot_sector tezos_client in @@ -923,8 +923,8 @@ let test_rollup_node_boots_into_initial_state = When the rollup node receives messages, we like to see evidence that the PVM has advanced. *) -let test_rollup_node_advances_pvm_state = - let go client sc_rollup sc_rollup_node = +let test_rollup_node_advances_pvm_state protocols = + let go ~internal client sc_rollup sc_rollup_node = let* genesis_info = RPC.Client.call ~hooks client @@ RPC.Sc_rollup.get_genesis_info sc_rollup in @@ -937,17 +937,48 @@ let test_rollup_node_advances_pvm_state = Check.(level = init_level) Check.int ~error_msg:"Current level has moved past origination level (%L = %R)" ; - + let* level, forwarder = + if not internal then return (level, None) + else + (* Originate forwarder contract to send internal messages to rollup *) + let* contract_id = + Client.originate_contract + ~alias:"rollup_deposit" + ~amount:Tez.zero + ~src:Constant.bootstrap1.alias + ~prg:"file:./tezt/tests/contracts/proto_alpha/sc_rollup_forward.tz" + ~init:"Unit" + ~burn_cap:Tez.(of_int 1) + client + in + let* () = Client.bake_for_and_wait client in + Log.info + "The forwarder %s contract was successfully originated" + contract_id ; + return (level + 1, Some contract_id) + in let test_message i = let* prev_state_hash = Sc_rollup_client.state_hash ~hooks sc_rollup_client in let* prev_ticks = Sc_rollup_client.total_ticks ~hooks sc_rollup_client in + let message = sf "%d %d + value" i ((i + 2) * 2) in let* () = - send_message - client - sc_rollup - (Printf.sprintf "[\"%d %d + value\"]" i ((i + 2) * 2)) + match forwarder with + | None -> + (* External message *) + send_message client sc_rollup (sf "[%S]" message) + | Some forwarder -> + (* Internal message through forwarder *) + let* () = + Client.transfer + client + ~amount:Tez.zero + ~giver:Constant.bootstrap1.alias + ~receiver:forwarder + ~arg:(sf "Pair %S %S" sc_rollup message) + in + Client.bake_for_and_wait client in let* _ = Sc_rollup_node.wait_for_level sc_rollup_node (level + i) in let* encoded_value = @@ -990,10 +1021,24 @@ let test_rollup_node_advances_pvm_state = (fun protocol -> setup ~protocol @@ fun node client -> with_fresh_rollup - (fun sc_rollup sc_rollup_node _filename -> - go client sc_rollup sc_rollup_node) + (fun sc_rollup_address sc_rollup_node _filename -> + go ~internal:false client sc_rollup_address sc_rollup_node) + node + client) + protocols ; + + regression_test + ~__FILE__ + ~tags:["run"; "node"; "internal"] + "node advances PVM state with internal messages" + (fun protocol -> + setup ~protocol @@ fun node client -> + with_fresh_rollup + (fun sc_rollup_address sc_rollup_node _filename -> + go ~internal:true client sc_rollup_address sc_rollup_node) node client) + protocols (* Ensure that commitments are stored and published properly. ---------------------------------------------------------- @@ -1887,7 +1932,7 @@ let test_consecutive_commitments = ~burn_cap:Tez.(of_int 9999999) ~src:bootstrap1_key ~kind:"arith" - ~parameters_ty:"unit" + ~parameters_ty:"string" ~boot_sector:"" client in