diff --git a/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml b/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml index 70410cca39ce9cef30da048f6d45dbf1c91d0c09..0bcd057ff003a25469dcf79e69230e31f39c5b39 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/dummy_zk_rollup.ml @@ -233,7 +233,15 @@ module Types = struct {op_code; price; l1_dst; rollup_id}) (obj4_encoding (op_code_encoding ~safety) - (ticket_balance_encoding ~safety) + (* We use an Unsafe Bounded scalar encoding here to be able to + detect that an out-of-range value has been passed. + This encoding is unsafe in the sense that such value will cause + a failure in proving, instead of a circuit that can prove that + the argument is out-of-range. + This is enough for Protocol testing purposes, while keeping + the dummy circuit small. + *) + (ticket_balance_encoding ~safety:Unsafe) tezos_pkh_encoding tezos_pkh_encoding) @@ -370,7 +378,7 @@ end = struct let srs = let open Bls12_381_polynomial.Polynomial in - (Srs.generate_insecure 8 1, Srs.generate_insecure 1 1) + (Srs.generate_insecure 9 1, Srs.generate_insecure 1 1) let dummy_l1_dst = Hex.to_bytes_exn (`Hex "0002298c03ed7d454a101eb7022bc95f7e5f41ac78") diff --git a/src/proto_alpha/lib_protocol/zk_rollup_operation_repr.ml b/src/proto_alpha/lib_protocol/zk_rollup_operation_repr.ml index bed1b50e6c63a926d1c91c69cb3e51105dcf0f38..b7a13d345f340a8fe2cfb484764b6f9f9cf5ff18 100644 --- a/src/proto_alpha/lib_protocol/zk_rollup_operation_repr.ml +++ b/src/proto_alpha/lib_protocol/zk_rollup_operation_repr.ml @@ -49,7 +49,7 @@ let to_scalar_array {op_code; price; l1_dst; rollup_id; payload} = [| int_to_scalar op_code; ticket_hash_to_scalar price.id; - Zk_rollup_scalar.of_z price.amount; + Zk_rollup_scalar.of_z @@ Z.abs price.amount; pkh_to_scalar l1_dst; Zk_rollup_repr.to_scalar rollup_id; |];