diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml index 4d265f187d305256ae2d0da70f188eccf96fb795..1688125c11b6eebac0134e4be925665a9ecaea7c 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_merkelized_payload_hashes_repr.ml @@ -116,7 +116,7 @@ let merkelized_and_payload_encoding = merkelized; payload = Sc_rollup_inbox_message_repr.unsafe_of_string payload; }) - (merge_objs encoding (obj1 (req "payload" (string Plain)))) + (merge_objs encoding (obj1 (req "payload" (string Hex)))) module History = struct include diff --git a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml index 7e8ae93dbdf7edf156fe82c48c84dfea97282aa7..5b547fcbd83973b7695dc69daecbf6ee59569c88 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_inbox_repr.ml @@ -314,7 +314,7 @@ let level_tree_proof_encoding = (req "proof" Sc_rollup_inbox_merkelized_payload_hashes_repr.proof_encoding) - (opt "payload" (string Plain))) + (opt "payload" (string Hex))) let add_protocol_internal_message payload payloads_history witness = Sc_rollup_inbox_merkelized_payload_hashes_repr.add_payload diff --git a/src/proto_alpha/lib_protocol/sc_rollup_repr.ml b/src/proto_alpha/lib_protocol/sc_rollup_repr.ml index 7e992ce3f689b002acbc329cd28a7201b96291e8..5f9d1b350dc26a8db2d6cedf126188fd3b8950bb 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_repr.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_repr.ml @@ -112,31 +112,6 @@ let description = "A smart contract rollup is identified by a base58 address starting with " ^ Address.prefix -type error += (* `Permanent *) Invalid_sc_rollup_address of string - -let error_description = - Format.sprintf - "A smart contract rollup address must be a valid hash starting with '%s'." - Address.prefix - -let () = - let open Data_encoding in - register_error_kind - `Permanent - ~id:"rollup.invalid_smart_contract_rollup_address" - ~title:"Invalid smart contract rollup address" - ~pp:(fun ppf x -> - Format.fprintf ppf "Invalid smart contract rollup address %S" x) - ~description:error_description - (obj1 (req "address" (string Plain))) - (function Invalid_sc_rollup_address loc -> Some loc | _ -> None) - (fun loc -> Invalid_sc_rollup_address loc) - -let of_b58check s = - match Base58.decode s with - | Some (Address.Data hash) -> ok hash - | _ -> Error (Format.sprintf "Invalid_sc_rollup_address %s" s) - let pp = Address.pp let encoding = @@ -145,19 +120,13 @@ let encoding = "rollup_address" ~title:"A smart contract rollup address" ~description - (conv_with_guard Address.to_b58check of_b58check (string Plain)) + Address.encoding let rpc_arg = - let construct = Address.to_b58check in - let destruct hash = - Result.map_error (fun _ -> error_description) (of_b58check hash) - in - RPC_arg.make + RPC_arg.like + Address.rpc_arg ~descr:"A smart contract rollup address." - ~name:"sc_rollup_address" - ~construct - ~destruct - () + "sc_rollup_address" let in_memory_size (_ : t) = let open Cache_memory_helpers in diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - participant of a refutation game are slashed-rewarded.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - participant of a refutation game are slashed-rewarded.out index 7cd74e1aefccc4da228e87ace9dbd97b1169187c..1338c8f12de3c3b1059c1a1675bf2a5f18ac1a72 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - participant of a refutation game are slashed-rewarded.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - participant of a refutation game are slashed-rewarded.out @@ -46,13 +46,13 @@ 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.001044 + Fee to the baker: ꜩ0.001023 Expected counter: 1 Gas limit: 7022 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001044 - payload fees(the block proposer) ....... +ꜩ0.001044 + [PUBLIC_KEY_HASH] ... -ꜩ0.001023 + payload fees(the block proposer) ....... +ꜩ0.001023 Smart contract rollup commitment publishing: Address: [SC_ROLLUP_HASH] Commitment: @@ -82,13 +82,13 @@ 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.001067 + Fee to the baker: ꜩ0.001046 Expected counter: 1 Gas limit: 7252 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001067 - payload fees(the block proposer) ....... +ꜩ0.001067 + [PUBLIC_KEY_HASH] ... -ꜩ0.001046 + payload fees(the block proposer) ....... +ꜩ0.001046 Smart contract rollup commitment publishing: Address: [SC_ROLLUP_HASH] Commitment: @@ -118,13 +118,13 @@ 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.001033 + Fee to the baker: ꜩ0.001012 Expected counter: 2 Gas limit: 7252 Storage limit: 0 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001033 - payload fees(the block proposer) ....... +ꜩ0.001033 + [PUBLIC_KEY_HASH] ... -ꜩ0.001012 + payload fees(the block proposer) ....... +ꜩ0.001012 Smart contract rollup refutation timeout: Address: [SC_ROLLUP_HASH] First staker (Alice): [PUBLIC_KEY_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out index 7b596906defbb61211a67d489bd96dce2f639e68..65b0c87ef0fd918d0968729abb28af69e35a94de 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- external).out @@ -71,13 +71,13 @@ 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.001238 + Fee to the baker: ꜩ0.001217 Expected counter: 2 Gas limit: 5980 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001238 - payload fees(the block proposer) ....... +ꜩ0.001238 + [PUBLIC_KEY_HASH] ... -ꜩ0.001217 + payload fees(the block proposer) ....... +ꜩ0.001217 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out index f262ac7213adcf8d6634b7923570c985c0f59ba4..c5d611771678156f4b2a9a884437d8274d5b112a 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -aux- earliness- 0- internal).out @@ -46,13 +46,13 @@ 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.001238 + Fee to the baker: ꜩ0.001217 Expected counter: 1 Gas limit: 5980 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001238 - payload fees(the block proposer) ....... +ꜩ0.001238 + [PUBLIC_KEY_HASH] ... -ꜩ0.001217 + payload fees(the block proposer) ....... +ꜩ0.001217 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out index 7a6415fa6f31e49d124daa048938ba8a684fae5e..9350536edea431c26eec2ea0de6a3e23378e6b2c 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- external.out @@ -71,13 +71,13 @@ 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.001242 + Fee to the baker: ꜩ0.001221 Expected counter: 2 Gas limit: 5980 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001242 - payload fees(the block proposer) ....... +ꜩ0.001242 + [PUBLIC_KEY_HASH] ... -ꜩ0.001221 + payload fees(the block proposer) ....... +ꜩ0.001221 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out index e1d10e3132a4ae897b59b02fdbe5eea1154741d6..5775c2734495e34b8d74468346dcdd757c144b03 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - trigger exec output (entrypoint- -default- earliness- 0- internal.out @@ -46,13 +46,13 @@ 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.001242 + Fee to the baker: ꜩ0.001221 Expected counter: 1 Gas limit: 5980 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001242 - payload fees(the block proposer) ....... +ꜩ0.001242 + [PUBLIC_KEY_HASH] ... -ꜩ0.001221 + payload fees(the block proposer) ....... +ꜩ0.001221 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out index 1093b1c7e5fb4e65eaf13c7905dc34f9e1cf447d..f8436657219ea8bbfdec0b57cb15573fea36be8d 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- externa.out @@ -71,13 +71,13 @@ 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.001516 + Fee to the baker: ꜩ0.001495 Expected counter: 2 Gas limit: 6027 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001516 - payload fees(the block proposer) ....... +ꜩ0.001516 + [PUBLIC_KEY_HASH] ... -ꜩ0.001495 + payload fees(the block proposer) ....... +ꜩ0.001495 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out index 51c58fefc7756dc11a9f993210cd69aea9afb483..645ee85da28efa6192735c9bc2a2d88f89f83bf2 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -aux- earliness- 0- interna.out @@ -46,13 +46,13 @@ 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.001484 + Fee to the baker: ꜩ0.001463 Expected counter: 1 Gas limit: 6021 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001484 - payload fees(the block proposer) ....... +ꜩ0.001484 + [PUBLIC_KEY_HASH] ... -ꜩ0.001463 + payload fees(the block proposer) ....... +ꜩ0.001463 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out index ca8dfb5a6316ff9ed2acd463401e4eece210e011..13c5aea95d6eafd72c1d12ac315a0a5771feb174 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- ext.out @@ -71,13 +71,13 @@ 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.001524 + Fee to the baker: ꜩ0.001503 Expected counter: 2 Gas limit: 6028 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001524 - payload fees(the block proposer) ....... +ꜩ0.001524 + [PUBLIC_KEY_HASH] ... -ꜩ0.001503 + payload fees(the block proposer) ....... +ꜩ0.001503 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH] diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out index e77ae7c08fb8ee4ca807bf728007f1d2ba09aee2..0bde2ae70bc599e68f4182617960cdf07aea78d6 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - trigger exec output (entrypoint- -default- earliness- 0- int.out @@ -46,13 +46,13 @@ 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.001492 + Fee to the baker: ꜩ0.001471 Expected counter: 1 Gas limit: 6023 Storage limit: 25 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.001492 - payload fees(the block proposer) ....... +ꜩ0.001492 + [PUBLIC_KEY_HASH] ... -ꜩ0.001471 + payload fees(the block proposer) ....... +ꜩ0.001471 Smart contract output message execution: Address: [SC_ROLLUP_HASH] Cemented commitment: [SC_ROLLUP_COMMITMENT_HASH]