From 71564d5735ded4ac5c3f31e71525a058d1914982 Mon Sep 17 00:00:00 2001 From: Yann Regis-Gianas Date: Mon, 19 Sep 2022 20:23:01 +0200 Subject: [PATCH 1/2] Proto,SCORU: Fix invalid parsing of contract destination Signed-off-by: Yann Regis-Gianas --- .../lib_protocol/sc_rollup_arith.ml | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml index 55dbf2452606..8f59dddc9749 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_arith.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_arith.ml @@ -1058,15 +1058,14 @@ module Make (Context : P) : let identifies_target_contract x = let open Option_syntax in - match Contract_hash.of_b58check_opt x with - | None -> - if Compare.String.(x = "out") then - return (Contract_hash.zero, Entrypoint_repr.default) - else fail - | Some _ -> ( - match String.split_on_char '%' x with - | destination :: entrypoint -> - let* destination = Contract_hash.of_b58check_opt destination in + match String.split_on_char '%' x with + | destination :: entrypoint -> ( + match Contract_hash.of_b58check_opt destination with + | None -> + if Compare.String.(x = "out") then + return (Contract_hash.zero, Entrypoint_repr.default) + else fail + | Some destination -> let* entrypoint = match entrypoint with | [] -> return Entrypoint_repr.default @@ -1079,8 +1078,8 @@ module Make (Context : P) : in return entrypoint in - return (destination, entrypoint) - | [] -> fail) + return (destination, entrypoint)) + | [] -> fail let evaluate = let open Monad.Syntax in -- GitLab From bf272250751395ebcfc5177e637a671fc09afcad Mon Sep 17 00:00:00 2001 From: Valentin Chaboche Date: Tue, 20 Sep 2022 12:55:39 +0200 Subject: [PATCH 2/2] Tezt: update regression trace --- ... arith - an outbox message should be executable (_0).out | 6 +++--- ... arith - an outbox message should be executable (_5).out | 6 +++--- ...ith - an outbox message should be executable (aux_0).out | 6 +++--- ...ith - an outbox message should be executable (aux_5).out | 6 +++--- ..._2_0_0 - an outbox message should be executable (_0).out | 6 +++--- ..._2_0_0 - an outbox message should be executable (_5).out | 6 +++--- ...0_0 - an outbox message should be executable (aux_0).out | 6 +++--- ...0_0 - an outbox message should be executable (aux_5).out | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out index 276b7ecf55ed..ffd935c23cb0 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_0).out @@ -12,13 +12,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.000671 + Fee to the baker: ꜩ0.00067 Expected counter: 1 Gas limit: 3211 Storage limit: 6675 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000671 - payload fees(the block proposer) ....... +ꜩ0.000671 + [PUBLIC_KEY_HASH] ... -ꜩ0.00067 + payload fees(the block proposer) ....... +ꜩ0.00067 Smart contract rollup origination: Kind: arith Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out index 276b7ecf55ed..ffd935c23cb0 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (_5).out @@ -12,13 +12,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.000671 + Fee to the baker: ꜩ0.00067 Expected counter: 1 Gas limit: 3211 Storage limit: 6675 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000671 - payload fees(the block proposer) ....... +ꜩ0.000671 + [PUBLIC_KEY_HASH] ... -ꜩ0.00067 + payload fees(the block proposer) ....... +ꜩ0.00067 Smart contract rollup origination: Kind: arith Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out index aa61e69130ca..2fb08900cb9e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_0).out @@ -12,13 +12,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.000671 + Fee to the baker: ꜩ0.00067 Expected counter: 1 Gas limit: 3211 Storage limit: 6675 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000671 - payload fees(the block proposer) ....... +ꜩ0.000671 + [PUBLIC_KEY_HASH] ... -ꜩ0.00067 + payload fees(the block proposer) ....... +ꜩ0.00067 Smart contract rollup origination: Kind: arith Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out index aa61e69130ca..2fb08900cb9e 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- arith - an outbox message should be executable (aux_5).out @@ -12,13 +12,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.000671 + Fee to the baker: ꜩ0.00067 Expected counter: 1 Gas limit: 3211 Storage limit: 6675 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.000671 - payload fees(the block proposer) ....... +ꜩ0.000671 + [PUBLIC_KEY_HASH] ... -ꜩ0.00067 + payload fees(the block proposer) ....... +ꜩ0.00067 Smart contract rollup origination: Kind: arith Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out index b3b89b562766..678c98281d03 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_0).out @@ -12,13 +12,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.004714 + Fee to the baker: ꜩ0.004713 Expected counter: 1 Gas limit: 3227 Storage limit: 10711 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.004714 - payload fees(the block proposer) ....... +ꜩ0.004714 + [PUBLIC_KEY_HASH] ... -ꜩ0.004713 + payload fees(the block proposer) ....... +ꜩ0.004713 Smart contract rollup origination: Kind: wasm_2_0_0 Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out index b3b89b562766..678c98281d03 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (_5).out @@ -12,13 +12,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.004714 + Fee to the baker: ꜩ0.004713 Expected counter: 1 Gas limit: 3227 Storage limit: 10711 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.004714 - payload fees(the block proposer) ....... +ꜩ0.004714 + [PUBLIC_KEY_HASH] ... -ꜩ0.004713 + payload fees(the block proposer) ....... +ꜩ0.004713 Smart contract rollup origination: Kind: wasm_2_0_0 Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out index b3b89b562766..678c98281d03 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_0).out @@ -12,13 +12,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.004714 + Fee to the baker: ꜩ0.004713 Expected counter: 1 Gas limit: 3227 Storage limit: 10711 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.004714 - payload fees(the block proposer) ....... +ꜩ0.004714 + [PUBLIC_KEY_HASH] ... -ꜩ0.004713 + payload fees(the block proposer) ....... +ꜩ0.004713 Smart contract rollup origination: Kind: wasm_2_0_0 Parameter type: string diff --git a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out index b3b89b562766..678c98281d03 100644 --- a/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out +++ b/tezt/tests/expected/sc_rollup.ml/Alpha- wasm_2_0_0 - an outbox message should be executable (aux_5).out @@ -12,13 +12,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.004714 + Fee to the baker: ꜩ0.004713 Expected counter: 1 Gas limit: 3227 Storage limit: 10711 bytes Balance updates: - [PUBLIC_KEY_HASH] ... -ꜩ0.004714 - payload fees(the block proposer) ....... +ꜩ0.004714 + [PUBLIC_KEY_HASH] ... -ꜩ0.004713 + payload fees(the block proposer) ....... +ꜩ0.004713 Smart contract rollup origination: Kind: wasm_2_0_0 Parameter type: string -- GitLab