From 38665a4cbb6cafe3afe37ede90221a123551af41 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Fri, 13 Oct 2023 16:16:15 +0100 Subject: [PATCH 1/5] Fixup Pickles.verify for chunked proofs --- src/lib/pickles/compile.ml | 22 ++++++++++++-- src/lib/pickles/compile.mli | 6 +++- src/lib/pickles/pickles.ml | 5 ++- src/lib/pickles/pickles_intf.mli | 6 +++- src/lib/pickles/verify.ml | 52 +++++++++++++++++++++++++------- src/lib/pickles/verify.mli | 6 +++- 6 files changed, 80 insertions(+), 17 deletions(-) diff --git a/src/lib/pickles/compile.ml b/src/lib/pickles/compile.ml index bcd37a4fbe6..e092d4cf531 100644 --- a/src/lib/pickles/compile.ml +++ b/src/lib/pickles/compile.ml @@ -25,6 +25,9 @@ open Kimchi_backend module Proof_ = P.Base module Proof = P +type chunking_data = Verify.Instance.chunking_data = + { num_chunks : int; domain_size : int } + let pad_messages_for_next_wrap_proof (type local_max_proofs_verifieds max_local_max_proofs_verifieds max_proofs_verified ) @@ -926,7 +929,7 @@ module Side_loaded = struct { constraints = 0 } } in - Verify.Instance.T (max_proofs_verified, m, vk, x, p) ) + Verify.Instance.T (max_proofs_verified, m, None, vk, x, p) ) |> Verify.verify_heterogenous ) let verify ~typ ts = verify_promise ~typ ts |> Promise.to_deferred @@ -1090,6 +1093,21 @@ let compile_with_wrap_main_override_promise : let (Typ typ) = typ in fun x -> fst (typ.value_to_fields x) end in + let chunking_data = + match num_chunks with + | None -> + None + | Some num_chunks -> + let { h = Pow_2_roots_of_unity domain_size } = + (Types_map.lookup_compiled self.id).step_domains + |> Vector.reduce_exn + ~f:(fun + { h = Pow_2_roots_of_unity d1 } + { h = Pow_2_roots_of_unity d2 } + -> { h = Pow_2_roots_of_unity (Int.max d1 d2) } ) + in + Some { Verify.Instance.num_chunks; domain_size } + in let module P = struct type statement = value @@ -1109,7 +1127,7 @@ let compile_with_wrap_main_override_promise : let verification_key = wrap_vk let verify_promise ts = - verify_promise + verify_promise ?chunking_data ( module struct include Max_proofs_verified end ) diff --git a/src/lib/pickles/compile.mli b/src/lib/pickles/compile.mli index bcad6f7ec29..4b1ae306741 100644 --- a/src/lib/pickles/compile.mli +++ b/src/lib/pickles/compile.mli @@ -44,8 +44,12 @@ module type Proof_intf = sig val verify_promise : (statement * t) list -> unit Or_error.t Promise.t end +type chunking_data = Verify.Instance.chunking_data = + { num_chunks : int; domain_size : int } + val verify_promise : - (module Nat.Intf with type n = 'n) + ?chunking_data:chunking_data + -> (module Nat.Intf with type n = 'n) -> (module Statement_value_intf with type t = 'a) -> Verification_key.t -> ('a * ('n, 'n) Proof.t) list diff --git a/src/lib/pickles/pickles.ml b/src/lib/pickles/pickles.ml index 3908debfe33..8515da14604 100644 --- a/src/lib/pickles/pickles.ml +++ b/src/lib/pickles/pickles.ml @@ -47,6 +47,9 @@ module Make_str (_ : Wire_types.Concrete) = struct exception Return_digest = Compile.Return_digest + type chunking_data = Verify.Instance.chunking_data = + { num_chunks : int; domain_size : int } + let verify_promise = Verify.verify let verify max_proofs_verified statement key proofs = @@ -291,7 +294,7 @@ module Make_str (_ : Wire_types.Concrete) = struct { constraints = 0 } } in - Verify.Instance.T (max_proofs_verified, m, vk, x, p) ) + Verify.Instance.T (max_proofs_verified, m, None, vk, x, p) ) |> Verify.verify_heterogenous ) let verify ~typ ts = verify_promise ~typ ts |> Promise.to_deferred diff --git a/src/lib/pickles/pickles_intf.mli b/src/lib/pickles/pickles_intf.mli index be47f9282d1..cea3421e992 100644 --- a/src/lib/pickles/pickles_intf.mli +++ b/src/lib/pickles/pickles_intf.mli @@ -238,8 +238,12 @@ module type S = sig } end + type chunking_data = Verify.Instance.chunking_data = + { num_chunks : int; domain_size : int } + val verify_promise : - (module Nat.Intf with type n = 'n) + ?chunking_data:chunking_data + -> (module Nat.Intf with type n = 'n) -> (module Statement_value_intf with type t = 'a) -> Verification_key.t -> ('a * ('n, 'n) Proof.t) list diff --git a/src/lib/pickles/verify.ml b/src/lib/pickles/verify.ml index a0637e1ea06..cb0fab771bd 100644 --- a/src/lib/pickles/verify.ml +++ b/src/lib/pickles/verify.ml @@ -4,10 +4,13 @@ open Common open Import module Instance = struct + type chunking_data = { num_chunks : int; domain_size : int } + type t = | T : (module Nat.Intf with type n = 'n) * (module Intf.Statement_value with type t = 'a) + * chunking_data option * Verification_key.t * 'a * ('n, 'n) Proof.t @@ -41,6 +44,7 @@ let verify_heterogenous (ts : Instance.t list) = (T ( _max_proofs_verified , _statement + , chunking_data , key , _app_state , T @@ -54,22 +58,30 @@ let verify_heterogenous (ts : Instance.t list) = } ) ) -> Timer.start __LOC__ ; - let non_chunking = + let non_chunking, expected_num_chunks = + let expected_num_chunks = + Option.value_map ~default:1 chunking_data ~f:(fun x -> + x.Instance.num_chunks ) + in let exception Is_chunked in match Pickles_types.Plonk_types.Evals.map evals.evals.evals ~f:(fun (x, y) -> - if Array.length x > 1 || Array.length y > 1 then - raise Is_chunked ) + if + Array.length x > expected_num_chunks + || Array.length y > expected_num_chunks + then raise Is_chunked ) with | exception Is_chunked -> - false + (false, expected_num_chunks) | _unit_evals -> (* we do not care about _unit_evals, if we reached this point, we know all evals have length 1 for they cannot have length 0 *) - true + (true, expected_num_chunks) in - check (lazy "only uses single chunks", non_chunking) ; + check + ( lazy (sprintf "only uses %i chunks" expected_num_chunks) + , non_chunking ) ; check ( lazy "feature flags are consistent with evaluations" , Pickles_types.Plonk_types.Evals.validate_feature_flags @@ -80,9 +92,16 @@ let verify_heterogenous (ts : Instance.t list) = let step_domain = Branch_data.domain proof_state.deferred_values.branch_data in + let expected_domain_size = + match chunking_data with + | None -> + Nat.to_int Backend.Tick.Rounds.n + | Some { domain_size; _ } -> + domain_size + in check ( lazy "domain size is small enough" - , Domain.log2_size step_domain <= Nat.to_int Backend.Tick.Rounds.n ) ; + , Domain.log2_size step_domain <= expected_domain_size ) ; let sc = SC.to_field_constant tick_field ~endo:Endo.Wrap_inner_curve.scalar in @@ -97,7 +116,15 @@ let verify_heterogenous (ts : Instance.t list) = in Timer.clock __LOC__ ; let deferred_values = - Wrap_deferred_values.expand_deferred ~evals ~zk_rows:3 + let zk_rows = + match chunking_data with + | None -> + 3 + | Some { num_chunks; _ } -> + let permuts = 7 in + ((2 * (permuts + 1) * num_chunks) - 1 + permuts) / permuts + in + Wrap_deferred_values.expand_deferred ~evals ~zk_rows ~old_bulletproof_challenges ~proof_state in Timer.clock __LOC__ ; @@ -130,7 +157,7 @@ let verify_heterogenous (ts : Instance.t list) = [%log internal] "Accumulator_check" ; let%bind accumulator_check = Ipa.Step.accumulator_check - (List.map ts ~f:(fun (T (_, _, _, _, T t)) -> + (List.map ts ~f:(fun (T (_, _, _, _, _, T t)) -> ( t.statement.proof_state.messages_for_next_wrap_proof .challenge_polynomial_commitment , Ipa.Step.compute_challenges @@ -147,6 +174,7 @@ let verify_heterogenous (ts : Instance.t list) = (T ( (module Max_proofs_verified) , (module A_value) + , _chunking_data , key , app_state , T t ) ) @@ -217,9 +245,11 @@ let verify_heterogenous (ts : Instance.t list) = Common.time "dlog_check" (fun () -> check (lazy "dlog_check", dlog_check)) ; result () -let verify (type a n) (max_proofs_verified : (module Nat.Intf with type n = n)) +let verify (type a n) ?chunking_data + (max_proofs_verified : (module Nat.Intf with type n = n)) (a_value : (module Intf.Statement_value with type t = a)) (key : Verification_key.t) (ts : (a * (n, n) Proof.t) list) = verify_heterogenous (List.map ts ~f:(fun (x, p) -> - Instance.T (max_proofs_verified, a_value, key, x, p) ) ) + Instance.T (max_proofs_verified, a_value, chunking_data, key, x, p) ) + ) diff --git a/src/lib/pickles/verify.mli b/src/lib/pickles/verify.mli index bc90518b955..81ea69c1e3c 100644 --- a/src/lib/pickles/verify.mli +++ b/src/lib/pickles/verify.mli @@ -1,10 +1,13 @@ open Core_kernel module Instance : sig + type chunking_data = { num_chunks : int; domain_size : int } + type t = | T : (module Pickles_types.Nat.Intf with type n = 'n) * (module Intf.Statement_value with type t = 'a) + * chunking_data option * Verification_key.t * 'a * ('n, 'n) Proof.t @@ -12,7 +15,8 @@ module Instance : sig end val verify : - (module Pickles_types.Nat.Intf with type n = 'n) + ?chunking_data:Instance.chunking_data + -> (module Pickles_types.Nat.Intf with type n = 'n) -> (module Intf.Statement_value with type t = 'a) -> Verification_key.t -> ('a * ('n, 'n) Proof.t) list From 6e884aacdab71f73807d08c1a380616185e9d3d8 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sat, 14 Oct 2023 17:39:37 +0100 Subject: [PATCH 2/5] Fix recursion over chunked proofs --- src/lib/pickles/compile.ml | 27 ++++++++++++---- src/lib/pickles/compile.mli | 2 +- src/lib/pickles/per_proof_witness.ml | 4 +-- src/lib/pickles/per_proof_witness.mli | 1 + src/lib/pickles/pickles.ml | 11 ++++--- src/lib/pickles/pickles_intf.mli | 2 +- src/lib/pickles/step.ml | 6 ++-- src/lib/pickles/step.mli | 1 - src/lib/pickles/step_branch_data.ml | 10 +++++- src/lib/pickles/step_branch_data.mli | 1 + src/lib/pickles/step_main.ml | 36 +++++++++++++-------- src/lib/pickles/step_verifier.ml | 3 +- src/lib/pickles/step_verifier.mli | 1 + src/lib/pickles/types_map.ml | 46 +++++++++++++++++++++++++-- src/lib/pickles/types_map.mli | 12 +++++++ src/lib/pickles/verify.ml | 10 ++---- src/lib/pickles/verify.mli | 2 +- src/lib/pickles/wrap.ml | 6 ++-- src/lib/pickles/wrap_main.ml | 4 ++- src/lib/pickles_types/plonk_types.ml | 7 ++-- src/lib/pickles_types/plonk_types.mli | 1 + 21 files changed, 142 insertions(+), 51 deletions(-) diff --git a/src/lib/pickles/compile.ml b/src/lib/pickles/compile.ml index e092d4cf531..b3210ef5974 100644 --- a/src/lib/pickles/compile.ml +++ b/src/lib/pickles/compile.ml @@ -26,7 +26,7 @@ module Proof_ = P.Base module Proof = P type chunking_data = Verify.Instance.chunking_data = - { num_chunks : int; domain_size : int } + { num_chunks : int; domain_size : int; zk_rows : int } let pad_messages_for_next_wrap_proof (type local_max_proofs_verifieds max_local_max_proofs_verifieds @@ -509,7 +509,7 @@ struct Timer.clock __LOC__ ; let res = Common.time "make step data" (fun () -> - Step_branch_data.create ~index:!i ~feature_flags + Step_branch_data.create ~index:!i ~feature_flags ~num_chunks ~actual_feature_flags:rule.feature_flags ~max_proofs_verified:Max_proofs_verified.n ~branches:Branches.n ~self ~public_input ~auxiliary_typ @@ -748,9 +748,7 @@ struct , return_value , auxiliary_value , actual_wrap_domains ) = - step ~zk_rows:step_vk.zk_rows ~proof_cache handler - ~maxes:(module Maxes) - next_state + step ~proof_cache handler ~maxes:(module Maxes) next_state in let proof = { proof with @@ -842,6 +840,14 @@ struct ; wrap_domains ; step_domains ; feature_flags + ; num_chunks + ; zk_rows = + ( match num_chunks with + | 1 -> + 3 + | num_chunks -> + let permuts = 7 in + ((2 * (permuts + 1) * num_chunks) - 1 + permuts) / permuts ) } in Timer.clock __LOC__ ; @@ -887,6 +893,8 @@ module Side_loaded = struct ; branches = Verification_key.Max_branches.n ; feature_flags = Plonk_types.Features.to_full ~or_:Opt.Flag.( ||| ) feature_flags + ; num_chunks = 1 + ; zk_rows = 3 } module Proof = struct @@ -1098,15 +1106,20 @@ let compile_with_wrap_main_override_promise : | None -> None | Some num_chunks -> + let compiled = Types_map.lookup_compiled self.id in let { h = Pow_2_roots_of_unity domain_size } = - (Types_map.lookup_compiled self.id).step_domains + compiled.step_domains |> Vector.reduce_exn ~f:(fun { h = Pow_2_roots_of_unity d1 } { h = Pow_2_roots_of_unity d2 } -> { h = Pow_2_roots_of_unity (Int.max d1 d2) } ) in - Some { Verify.Instance.num_chunks; domain_size } + Some + { Verify.Instance.num_chunks + ; domain_size + ; zk_rows = compiled.zk_rows + } in let module P = struct type statement = value diff --git a/src/lib/pickles/compile.mli b/src/lib/pickles/compile.mli index 4b1ae306741..ea098dd3c00 100644 --- a/src/lib/pickles/compile.mli +++ b/src/lib/pickles/compile.mli @@ -45,7 +45,7 @@ module type Proof_intf = sig end type chunking_data = Verify.Instance.chunking_data = - { num_chunks : int; domain_size : int } + { num_chunks : int; domain_size : int; zk_rows : int } val verify_promise : ?chunking_data:chunking_data diff --git a/src/lib/pickles/per_proof_witness.ml b/src/lib/pickles/per_proof_witness.ml index 0d5c456cab6..b69f7bcf590 100644 --- a/src/lib/pickles/per_proof_witness.ml +++ b/src/lib/pickles/per_proof_witness.ml @@ -134,7 +134,7 @@ module Constant = struct end end -let typ (type n avar aval) ~feature_flags +let typ (type n avar aval) ~feature_flags ~num_chunks (statement : (avar, aval) Impls.Step.Typ.t) (max_proofs_verified : n Nat.t) = let module Sc = Scalar_challenge in @@ -156,7 +156,7 @@ let typ (type n avar aval) ~feature_flags (Branch_data.typ (module Impl) ~assert_16_bits:(Step_verifier.assert_n_bits ~n:16) ) - ; Plonk_types.All_evals.typ + ; Plonk_types.All_evals.typ ~num_chunks (module Impl) (* Assume we have lookup iff we have runtime tables *) feature_flags diff --git a/src/lib/pickles/per_proof_witness.mli b/src/lib/pickles/per_proof_witness.mli index 82390f6a388..61ec4cdeb05 100644 --- a/src/lib/pickles/per_proof_witness.mli +++ b/src/lib/pickles/per_proof_witness.mli @@ -113,6 +113,7 @@ end val typ : feature_flags:Opt.Flag.t Plonk_types.Features.Full.t + -> num_chunks:int -> ('avar, 'aval) Impl.Typ.t -> 'n Pickles_types.Nat.t -> (('avar, 'n, _) t, ('aval, 'n) Constant.t) Impl.Typ.t diff --git a/src/lib/pickles/pickles.ml b/src/lib/pickles/pickles.ml index 8515da14604..eb2f01d2b97 100644 --- a/src/lib/pickles/pickles.ml +++ b/src/lib/pickles/pickles.ml @@ -48,7 +48,7 @@ module Make_str (_ : Wire_types.Concrete) = struct exception Return_digest = Compile.Return_digest type chunking_data = Verify.Instance.chunking_data = - { num_chunks : int; domain_size : int } + { num_chunks : int; domain_size : int; zk_rows : int } let verify_promise = Verify.verify @@ -251,6 +251,8 @@ module Make_str (_ : Wire_types.Concrete) = struct ; branches = Verification_key.Max_branches.n ; feature_flags = Plonk_types.(Features.to_full ~or_:Opt.Flag.( ||| ) feature_flags) + ; num_chunks = 1 + ; zk_rows = 3 } module Proof = struct @@ -1149,7 +1151,7 @@ module Make_str (_ : Wire_types.Concrete) = struct end in let proofs_verifieds = Vector.singleton 2 in let (T inner_step_data as step_data) = - Step_branch_data.create ~index:0 ~feature_flags + Step_branch_data.create ~index:0 ~feature_flags ~num_chunks:1 ~actual_feature_flags ~max_proofs_verified:Max_proofs_verified.n ~branches:Branches.n ~self ~public_input:(Input typ) ~auxiliary_typ:typ A.to_field_elements A_value.to_field_elements @@ -1308,8 +1310,7 @@ module Make_str (_ : Wire_types.Concrete) = struct let wrap = let wrap_vk = Lazy.force wrap_vk in let%bind.Promise proof, (), (), _ = - step ~zk_rows:pairing_vk.zk_rows ~proof_cache:None - ~maxes:(module Maxes) + step ~proof_cache:None ~maxes:(module Maxes) in let proof = { proof with @@ -1830,6 +1831,8 @@ module Make_str (_ : Wire_types.Concrete) = struct ; wrap_vk = Lazy.map wrap_vk ~f:Verification_key.index ; wrap_domains ; step_domains + ; num_chunks = 1 + ; zk_rows = 3 } in Types_map.add_exn self data ; diff --git a/src/lib/pickles/pickles_intf.mli b/src/lib/pickles/pickles_intf.mli index cea3421e992..eaf5f57c7b0 100644 --- a/src/lib/pickles/pickles_intf.mli +++ b/src/lib/pickles/pickles_intf.mli @@ -239,7 +239,7 @@ module type S = sig end type chunking_data = Verify.Instance.chunking_data = - { num_chunks : int; domain_size : int } + { num_chunks : int; domain_size : int; zk_rows : int } val verify_promise : ?chunking_data:chunking_data diff --git a/src/lib/pickles/step.ml b/src/lib/pickles/step.ml index 118a148ee83..a5489e42b2c 100644 --- a/src/lib/pickles/step.ml +++ b/src/lib/pickles/step.ml @@ -59,7 +59,7 @@ struct with type length = Max_proofs_verified.n and type ns = max_local_max_proof_verifieds ) ~(prevs_length : (prev_vars, prevs_length) Length.t) ~self ~step_domains - ~zk_rows ~feature_flags ~self_dlog_plonk_index + ~feature_flags ~self_dlog_plonk_index ~(public_input : ( var , value @@ -204,7 +204,7 @@ struct Plonk_checks.scalars_env (module Env_bool) (module Env_field) - ~srs_length_log2:Common.Max_degree.step_log2 ~zk_rows:3 + ~srs_length_log2:Common.Max_degree.step_log2 ~zk_rows:data.zk_rows ~endo:Endo.Step_inner_curve.base ~mds:Tick_field_sponge.params.mds ~field_of_hex:(fun s -> Kimchi_pasta.Pasta.Bigint256.of_hex_string s @@ -237,7 +237,7 @@ struct Wrap_deferred_values.expand_deferred ~evals:t.prev_evals ~old_bulletproof_challenges: statement.messages_for_next_step_proof.old_bulletproof_challenges - ~zk_rows ~proof_state:statement.proof_state + ~zk_rows:data.zk_rows ~proof_state:statement.proof_state in let prev_statement_with_hashes : ( _ diff --git a/src/lib/pickles/step.mli b/src/lib/pickles/step.mli index b99f5d89cba..54a2271ed40 100644 --- a/src/lib/pickles/step.mli +++ b/src/lib/pickles/step.mli @@ -31,7 +31,6 @@ module Make -> prevs_length:('prev_vars, 'prevs_length) Pickles_types.Hlist.Length.t -> self:('a, 'b, 'c, 'd) Tag.t -> step_domains:(Import.Domains.t, 'self_branches) Pickles_types.Vector.t - -> zk_rows:int -> feature_flags:Opt.Flag.t Plonk_types.Features.Full.t -> self_dlog_plonk_index: Backend.Tick.Inner_curve.Affine.t array diff --git a/src/lib/pickles/step_branch_data.ml b/src/lib/pickles/step_branch_data.ml index d06021a365d..44d88f75546 100644 --- a/src/lib/pickles/step_branch_data.ml +++ b/src/lib/pickles/step_branch_data.ml @@ -73,7 +73,7 @@ let create (type branches max_proofs_verified var value a_var a_value ret_var ret_value) ~index ~(self : (var, value, max_proofs_verified, branches) Tag.t) ~wrap_domains ~(feature_flags : Opt.Flag.t Plonk_types.Features.Full.t) - ~(actual_feature_flags : bool Plonk_types.Features.t) + ~num_chunks ~(actual_feature_flags : bool Plonk_types.Features.t) ~(max_proofs_verified : max_proofs_verified Nat.t) ~(proofs_verifieds : (int, branches) Vector.t) ~(branches : branches Nat.t) ~(public_input : @@ -141,6 +141,14 @@ let create ; wrap_domains ; step_domains ; feature_flags + ; num_chunks + ; zk_rows = + ( match num_chunks with + | 1 -> + 3 + | num_chunks -> + let permuts = 7 in + ((2 * (permuts + 1) * num_chunks) - 1 + permuts) / permuts ) } ~public_input ~auxiliary_typ ~self_branches:branches ~proofs_verified ~local_signature:widths ~local_signature_length ~local_branches:heights diff --git a/src/lib/pickles/step_branch_data.mli b/src/lib/pickles/step_branch_data.mli index 8fef1b7a732..3daf177a299 100644 --- a/src/lib/pickles/step_branch_data.mli +++ b/src/lib/pickles/step_branch_data.mli @@ -84,6 +84,7 @@ val create : -> self:('var, 'value, 'max_proofs_verified, 'branches) Tag.t -> wrap_domains:Import.Domains.t -> feature_flags:Opt.Flag.t Plonk_types.Features.Full.t + -> num_chunks:int -> actual_feature_flags:bool Plonk_types.Features.t -> max_proofs_verified:'max_proofs_verified Pickles_types.Nat.t -> proofs_verifieds:(int, 'branches) Pickles_types.Vector.t diff --git a/src/lib/pickles/step_main.ml b/src/lib/pickles/step_main.ml index d5313005dca..d3901b1597f 100644 --- a/src/lib/pickles/step_main.ml +++ b/src/lib/pickles/step_main.ml @@ -42,6 +42,7 @@ let verify_one ~srs in (* TODO: Refactor args into an "unfinalized proof" struct *) finalize_other_proof d.max_proofs_verified ~step_domains:d.step_domains + ~zk_rows:d.zk_rows ~sponge ~prev_challenges deferred_values prev_proof_evals ) in let branch_data = deferred_values.branch_data in @@ -193,22 +194,23 @@ let step_main : Per_proof_witness.Constant.No_app_state.t ) Typ.t end in - let feature_flags (d : _ Tag.t) = - if Type_equal.Id.same self.id d.id then basic.feature_flags - else Types_map.feature_flags d + let feature_flags_and_num_chunks (d : _ Tag.t) = + if Type_equal.Id.same self.id d.id then + (basic.feature_flags, basic.num_chunks) + else (Types_map.feature_flags d, Types_map.num_chunks d) in - let feature_flags = + let feature_flags_and_num_chunks = let rec go : type pvars pvals ns1 ns2 br. (pvars, pvals, ns1, ns2) H4.T(Tag).t -> (pvars, br) Length.t - -> (Opt.Flag.t Plonk_types.Features.Full.t, br) Vector.t = + -> (Opt.Flag.t Plonk_types.Features.Full.t * int, br) Vector.t = fun ds ld -> match[@warning "-4"] (ds, ld) with | [], Z -> [] | d :: ds, S ld -> - feature_flags d :: go ds ld + feature_flags_and_num_chunks d :: go ds ld | [], _ -> . | _ :: _, _ -> @@ -225,10 +227,12 @@ let step_main : -> (pvars, br) Length.t -> (ns1, br) Length.t -> (ns2, br) Length.t - -> (Opt.Flag.t Plonk_types.Features.Full.t, br) Vector.t + -> (Opt.Flag.t Plonk_types.Features.Full.t * int, br) Vector.t -> (pvars, pvals, ns1, ns2) H4.T(Typ_with_max_proofs_verified).t = - fun ds ns1 ns2 ld ln1 ln2 feature_flagss -> - match[@warning "-4"] (ds, ns1, ns2, ld, ln1, ln2, feature_flagss) with + fun ds ns1 ns2 ld ln1 ln2 feature_flags_and_num_chunkss -> + match[@warning "-4"] + (ds, ns1, ns2, ld, ln1, ln2, feature_flags_and_num_chunkss) + with | [], [], [], Z, Z, Z, [] -> [] | ( _d :: ds @@ -237,16 +241,18 @@ let step_main : , S ld , S ln1 , S ln2 - , feature_flags :: feature_flagss ) -> - let t = Per_proof_witness.typ Typ.unit n1 ~feature_flags in - t :: join ds ns1 ns2 ld ln1 ln2 feature_flagss + , (feature_flags, num_chunks) :: feature_flags_and_num_chunkss ) -> + let t = + Per_proof_witness.typ Typ.unit n1 ~feature_flags ~num_chunks + in + t :: join ds ns1 ns2 ld ln1 ln2 feature_flags_and_num_chunkss | [], _, _, _, _, _, _ -> . | _ :: _, _, _, _, _, _, _ -> . in join rule.prevs local_signature local_branches proofs_verified - local_signature_length local_branches_length feature_flags + local_signature_length local_branches_length feature_flags_and_num_chunks in let module Prev_typ = H4.Typ (Impls.Step) (Typ_with_max_proofs_verified) @@ -353,7 +359,7 @@ let step_main : (Vector.map ~f:(fun _feature_flags -> Unfinalized.typ ~wrap_rounds:Backend.Tock.Rounds.n ) - feature_flags ) ) + feature_flags_and_num_chunks ) ) ~request:(fun () -> Req.Unfinalized_proofs) and messages_for_next_wrap_proof = exists (Vector.typ Digest.typ Max_proofs_verified.n) @@ -485,6 +491,8 @@ let step_main : ; step_domains = `Known basic.step_domains ; wrap_key = dlog_plonk_index ; feature_flags = basic.feature_flags + ; num_chunks = basic.num_chunks + ; zk_rows = basic.zk_rows } in let module M = diff --git a/src/lib/pickles/step_verifier.ml b/src/lib/pickles/step_verifier.ml index f086d1f055a..04a1aebe391 100644 --- a/src/lib/pickles/step_verifier.ml +++ b/src/lib/pickles/step_verifier.ml @@ -855,6 +855,7 @@ struct (module Proofs_verified : Nat.Add.Intf with type n = b) ~(step_domains : [ `Known of (Domains.t, branches) Vector.t | `Side_loaded ] ) + ~zk_rows ~(* TODO: Add "actual proofs verified" so that proofs don't carry around dummy "old bulletproof challenges" *) sponge ~(prev_challenges : (_, b) Vector.t) @@ -1016,7 +1017,7 @@ struct Plonk_checks.scalars_env (module Env_bool) (module Env_field) - ~srs_length_log2:Common.Max_degree.step_log2 ~zk_rows:(* TODO *) 3 + ~srs_length_log2:Common.Max_degree.step_log2 ~zk_rows ~endo:(Impl.Field.constant Endo.Step_inner_curve.base) ~mds:sponge_params.mds ~field_of_hex:(fun s -> diff --git a/src/lib/pickles/step_verifier.mli b/src/lib/pickles/step_verifier.mli index 1bbc74d88b1..b4fbb485204 100644 --- a/src/lib/pickles/step_verifier.mli +++ b/src/lib/pickles/step_verifier.mli @@ -41,6 +41,7 @@ val finalize_other_proof : -> step_domains: [ `Known of (Import.Domains.t, 'branches) Pickles_types.Vector.t | `Side_loaded ] + -> zk_rows:int -> sponge:Step_main_inputs.Sponge.t -> prev_challenges: ( (Step_main_inputs.Impl.Field.t, 'a) Pickles_types.Vector.t diff --git a/src/lib/pickles/types_map.ml b/src/lib/pickles/types_map.ml index 3496edd08f3..0edc83927ab 100644 --- a/src/lib/pickles/types_map.ml +++ b/src/lib/pickles/types_map.ml @@ -19,6 +19,8 @@ module Basic = struct ; wrap_key : Tick.Inner_curve.Affine.t array Plonk_verification_key_evals.t ; wrap_vk : Impls.Wrap.Verification_key.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } end @@ -40,6 +42,8 @@ module Side_loaded = struct ; public_input : ('var, 'value) Impls.Step.Typ.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t ; branches : 'n2 Nat.t + ; num_chunks : int + ; zk_rows : int } end @@ -53,7 +57,13 @@ module Side_loaded = struct let to_basic { permanent = - { max_proofs_verified; public_input; branches; feature_flags } + { max_proofs_verified + ; public_input + ; branches + ; feature_flags + ; num_chunks + ; zk_rows + } ; ephemeral } = let wrap_key, wrap_vk = @@ -75,6 +85,8 @@ module Side_loaded = struct ; wrap_domains = Common.wrap_domains ~proofs_verified ; wrap_key ; feature_flags + ; num_chunks + ; zk_rows } end @@ -86,6 +98,8 @@ module Compiled = struct ; wrap_domains : Domains.t ; step_domains : (Domains.t, 'branches) Vector.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } (* This is the data associated to an inductive proof system with statement type @@ -104,6 +118,8 @@ module Compiled = struct ; wrap_domains : Domains.t ; step_domains : (Domains.t, 'branches) Vector.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } type packed = @@ -119,6 +135,8 @@ module Compiled = struct ; step_domains ; wrap_key ; feature_flags + ; num_chunks + ; zk_rows } = { Basic.max_proofs_verified ; wrap_domains @@ -127,6 +145,8 @@ module Compiled = struct ; wrap_key = Lazy.force wrap_key ; wrap_vk = Lazy.force wrap_vk ; feature_flags + ; num_chunks + ; zk_rows } end @@ -145,12 +165,20 @@ module For_step = struct Impls.Step.field Pickles_base.Proofs_verified.One_hot.Checked.t ] ; step_domains : [ `Known of (Domains.t, 'branches) Vector.t | `Side_loaded ] ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } let of_side_loaded (type a b c d) ({ ephemeral ; permanent = - { branches; max_proofs_verified; public_input; feature_flags } + { branches + ; max_proofs_verified + ; public_input + ; feature_flags + ; num_chunks + ; zk_rows + } } : (a, b, c, d) Side_loaded.t ) : (a, b, c, d) t = let index = @@ -172,6 +200,8 @@ module For_step = struct ; wrap_domain = `Side_loaded index.actual_wrap_domain_size ; step_domains = `Side_loaded ; feature_flags + ; num_chunks + ; zk_rows } let of_compiled @@ -184,6 +214,8 @@ module For_step = struct ; step_domains ; feature_flags ; wrap_vk = _ + ; num_chunks + ; zk_rows } : _ Compiled.t ) = { branches @@ -197,6 +229,8 @@ module For_step = struct ; wrap_domain = `Known wrap_domains.h ; step_domains = `Known step_domains ; feature_flags + ; num_chunks + ; zk_rows } end @@ -266,6 +300,14 @@ let feature_flags : | Side_loaded -> (lookup_side_loaded tag.id).permanent.feature_flags +let num_chunks : type var value. (var, value, _, _) Tag.t -> int = + fun tag -> + match tag.kind with + | Compiled -> + (lookup_compiled tag.id).num_chunks + | Side_loaded -> + (lookup_side_loaded tag.id).permanent.num_chunks + let _value_to_field_elements : type a. (_, a, _, _) Tag.t -> a -> Backend.Tick.Field.t array = fun t -> diff --git a/src/lib/pickles/types_map.mli b/src/lib/pickles/types_map.mli index 7377fce3206..cd862007eb6 100644 --- a/src/lib/pickles/types_map.mli +++ b/src/lib/pickles/types_map.mli @@ -15,6 +15,8 @@ module Basic : sig Pickles_types.Plonk_verification_key_evals.t ; wrap_vk : Impls.Wrap.Verification_key.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } end @@ -37,6 +39,8 @@ module Side_loaded : sig ; public_input : ('var, 'value) Impls.Step.Typ.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t ; branches : 'n2 Pickles_types.Nat.t + ; num_chunks : int + ; zk_rows : int } end @@ -59,6 +63,8 @@ module Compiled : sig ; wrap_domains : Import.Domains.t ; step_domains : (Import.Domains.t, 'branches) Pickles_types.Vector.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } type ('a_var, 'a_value, 'max_proofs_verified, 'branches) t = @@ -76,6 +82,8 @@ module Compiled : sig ; wrap_domains : Import.Domains.t ; step_domains : (Import.Domains.t, 'branches) Pickles_types.Vector.t ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } end @@ -98,6 +106,8 @@ module For_step : sig [ `Known of (Import.Domains.t, 'branches) Pickles_types.Vector.t | `Side_loaded ] ; feature_flags : Opt.Flag.t Plonk_types.Features.Full.t + ; num_chunks : int + ; zk_rows : int } val of_side_loaded : ('a, 'b, 'c, 'd) Side_loaded.t -> ('a, 'b, 'c, 'd) t @@ -129,6 +139,8 @@ val max_proofs_verified : val feature_flags : _ Tag.t -> Opt.Flag.t Plonk_types.Features.Full.t +val num_chunks : _ Tag.t -> int + val add_exn : ('var, 'value, 'c, 'd) Tag.t -> ('var, 'value, 'c, 'd) Compiled.t -> unit diff --git a/src/lib/pickles/verify.ml b/src/lib/pickles/verify.ml index cb0fab771bd..7905dbeae4d 100644 --- a/src/lib/pickles/verify.ml +++ b/src/lib/pickles/verify.ml @@ -4,7 +4,7 @@ open Common open Import module Instance = struct - type chunking_data = { num_chunks : int; domain_size : int } + type chunking_data = { num_chunks : int; domain_size : int; zk_rows : int } type t = | T : @@ -117,12 +117,8 @@ let verify_heterogenous (ts : Instance.t list) = Timer.clock __LOC__ ; let deferred_values = let zk_rows = - match chunking_data with - | None -> - 3 - | Some { num_chunks; _ } -> - let permuts = 7 in - ((2 * (permuts + 1) * num_chunks) - 1 + permuts) / permuts + Option.value_map ~default:3 chunking_data ~f:(fun x -> + x.Instance.zk_rows ) in Wrap_deferred_values.expand_deferred ~evals ~zk_rows ~old_bulletproof_challenges ~proof_state diff --git a/src/lib/pickles/verify.mli b/src/lib/pickles/verify.mli index 81ea69c1e3c..bf9fd17a973 100644 --- a/src/lib/pickles/verify.mli +++ b/src/lib/pickles/verify.mli @@ -1,7 +1,7 @@ open Core_kernel module Instance : sig - type chunking_data = { num_chunks : int; domain_size : int } + type chunking_data = { num_chunks : int; domain_size : int; zk_rows : int } type t = | T : diff --git a/src/lib/pickles/wrap.ml b/src/lib/pickles/wrap.ml index 5b6b95ed3d7..f971f446a67 100644 --- a/src/lib/pickles/wrap.ml +++ b/src/lib/pickles/wrap.ml @@ -420,7 +420,9 @@ let%test_module "gate finalization" = for use in the circuit *) and evals = constant - (Plonk_types.All_evals.typ (module Impls.Step) full_features) + (Plonk_types.All_evals.typ ~num_chunks:1 + (module Impls.Step) + full_features ) { evals = { public_input = x_hat_evals; evals = proof.proof.openings.evals } ; ft_eval1 = proof.proof.openings.ft_eval1 @@ -453,7 +455,7 @@ let%test_module "gate finalization" = (`Known [ { h = Pow_2_roots_of_unity vk.domain.log_size_of_group } ] ) - ~sponge ~prev_challenges:[] deferred_values evals + ~zk_rows:3 ~sponge ~prev_challenges:[] deferred_values evals in (* Read the boolean result from the circuit and make it available diff --git a/src/lib/pickles/wrap_main.ml b/src/lib/pickles/wrap_main.ml index 692585387e6..967a4eafaf1 100644 --- a/src/lib/pickles/wrap_main.ml +++ b/src/lib/pickles/wrap_main.ml @@ -262,7 +262,9 @@ let wrap_main let evals = let ty = let ty = - Plonk_types.All_evals.typ (module Impl) feature_flags + Plonk_types.All_evals.typ + (module Impl) + ~num_chunks:1 feature_flags in Vector.typ ty Max_proofs_verified.n in diff --git a/src/lib/pickles_types/plonk_types.ml b/src/lib/pickles_types/plonk_types.ml index 66f8cbdf150..34e01c5c859 100644 --- a/src/lib/pickles_types/plonk_types.ml +++ b/src/lib/pickles_types/plonk_types.ml @@ -1230,14 +1230,15 @@ module All_evals = struct let typ (type f) (module Impl : Snarky_backendless.Snark_intf.Run with type field = f) - feature_flags = + ~num_chunks feature_flags = let open Impl.Typ in - let single = array ~length:1 field in + let single = array ~length:num_chunks field in + let dummy = Array.init num_chunks ~f:(fun _ -> Impl.Field.Constant.zero) in let evals = With_public_input.typ (module Impl) feature_flags (tuple2 single single) (tuple2 single single) - ~dummy:Impl.Field.Constant.([| zero |], [| zero |]) + ~dummy:(dummy, dummy) in of_hlistable [ evals; Impl.Field.typ ] ~var_to_hlist:In_circuit.to_hlist ~var_of_hlist:In_circuit.of_hlist ~value_to_hlist:to_hlist diff --git a/src/lib/pickles_types/plonk_types.mli b/src/lib/pickles_types/plonk_types.mli index 90a32b32f43..ddb9551d515 100644 --- a/src/lib/pickles_types/plonk_types.mli +++ b/src/lib/pickles_types/plonk_types.mli @@ -414,6 +414,7 @@ module All_evals : sig val typ : (module Snarky_backendless.Snark_intf.Run with type field = 'f) + -> num_chunks:int -> Opt.Flag.t Features.Full.t -> ( ( 'f Snarky_backendless.Cvar.t , 'f Snarky_backendless.Cvar.t array From 66893df21d35b68a428d87e0d22a935e84fede66 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sat, 14 Oct 2023 18:36:36 +0100 Subject: [PATCH 3/5] Bump proof-systems --- src/lib/crypto/proof-systems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/crypto/proof-systems b/src/lib/crypto/proof-systems index a2e577cd98a..09ba6e26cb6 160000 --- a/src/lib/crypto/proof-systems +++ b/src/lib/crypto/proof-systems @@ -1 +1 @@ -Subproject commit a2e577cd98ae4b7b54d0945f46e45a240b510426 +Subproject commit 09ba6e26cb614adb437a30213d45f055ffeb58ce From 3106debb9748e79fce0a93483b44eefe885c6d60 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sat, 14 Oct 2023 18:42:12 +0100 Subject: [PATCH 4/5] Add a test for chunking --- src/lib/pickles/test/chunked_circuits/dune | 64 ++++++++ .../chunked_circuits/test_chunked_circuits.ml | 145 ++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 src/lib/pickles/test/chunked_circuits/dune create mode 100644 src/lib/pickles/test/chunked_circuits/test_chunked_circuits.ml diff --git a/src/lib/pickles/test/chunked_circuits/dune b/src/lib/pickles/test/chunked_circuits/dune new file mode 100644 index 00000000000..41049782a9a --- /dev/null +++ b/src/lib/pickles/test/chunked_circuits/dune @@ -0,0 +1,64 @@ +(tests + (names test_chunked_circuits) + (libraries + ;; opam libraries + alcotest + stdio + integers + result + base.caml + bignum.bigint + core_kernel + base64 + digestif + ppx_inline_test.config + sexplib0 + base + async_kernel + bin_prot.shape + async + async_unix + ;; local libraries + mina_wire_types + kimchi_bindings + kimchi_types + pasta_bindings + kimchi_backend.pasta + kimchi_backend.pasta.basic + kimchi_backend.pasta.constraint_system + bitstring_lib + snarky.intf + pickles.backend + pickles_types + snarky.backendless + snarky_group_map + sponge + pickles + pickles.pseudo + composition_types + pickles.limb_vector + pickles_base + kimchi_backend + mina_version + base58_check + codable + random_oracle_input + pickles.composition_types + pickles.plonk_checks + pickles.one_hot_vector + snarky_log + group_map + snarky_curve + key_cache + snark_keys_header + tuple_lib + promise + kimchi_backend.common + logger + internal_tracing.context_logger + ppx_version.runtime + error_json) + (instrumentation + (backend bisect_ppx)) + (preprocess + (pps ppx_version))) diff --git a/src/lib/pickles/test/chunked_circuits/test_chunked_circuits.ml b/src/lib/pickles/test/chunked_circuits/test_chunked_circuits.ml new file mode 100644 index 00000000000..ed266173f17 --- /dev/null +++ b/src/lib/pickles/test/chunked_circuits/test_chunked_circuits.ml @@ -0,0 +1,145 @@ +open Core_kernel +open Pickles_types +open Pickles.Impls.Step + +let () = Pickles.Backend.Tick.Keypair.set_urs_info [] + +let () = Pickles.Backend.Tock.Keypair.set_urs_info [] + +let constraint_constants = + { Snark_keys_header.Constraint_constants.sub_windows_per_window = 0 + ; ledger_depth = 0 + ; work_delay = 0 + ; block_window_duration_ms = 0 + ; transaction_capacity = Log_2 0 + ; pending_coinbase_depth = 0 + ; coinbase_amount = Unsigned.UInt64.of_int 0 + ; supercharged_coinbase_factor = 0 + ; account_creation_fee = Unsigned.UInt64.of_int 0 + ; fork = None + } + +let test () = + let tag, _cache_handle, proof, Pickles.Provers.[ prove ] = + Pickles.compile ~public_input:(Pickles.Inductive_rule.Input Typ.unit) + ~auxiliary_typ:Typ.unit + ~branches:(module Nat.N1) + ~max_proofs_verified:(module Nat.N0) + ~num_chunks:2 ~override_wrap_domain:N1 ~name:"chunked_circuits" + ~constraint_constants (* TODO(mrmr1993): This was misguided.. Delete. *) + ~choices:(fun ~self:_ -> + [ { identifier = "2^17" + ; prevs = [] + ; main = + (fun _ -> + let fresh_zero () = + exists Field.typ ~compute:(fun _ -> Field.Constant.zero) + in + (* Remember that each of these counts for *half* a row, so we + need 2^17 of them to fill 2^16 columns. + *) + for _ = 0 to 1 lsl 17 do + ignore (Field.mul (fresh_zero ()) (fresh_zero ()) : Field.t) + done ; + (* We must now appease the permutation argument gods, to ensure + that the 7th permuted column has polynomial degree larger + than 2^16, and thus that its high chunks are non-zero. + Suckiness of linearization strikes again! + *) + let fresh_zero = fresh_zero () in + Impl.assert_ + { basic = + Kimchi_backend_common.Plonk_constraint_system + .Plonk_constraint + .T + (Raw + { kind = Generic + ; values = + [| fresh_zero + ; fresh_zero + ; fresh_zero + ; fresh_zero + ; fresh_zero + ; fresh_zero + ; fresh_zero + |] + ; coeffs = [||] + } ) + ; annotation = Some __LOC__ + } ; + { previous_proof_statements = [] + ; public_output = () + ; auxiliary_output = () + } ) + ; feature_flags = Pickles_types.Plonk_types.Features.none_bool + } + ] ) + () + in + let module Requests = struct + type _ Snarky_backendless.Request.t += + | Proof : + (Nat.N0.n, Nat.N0.n) Pickles.Proof.t Snarky_backendless.Request.t + + let handler (proof : _ Pickles.Proof.t) + (Snarky_backendless.Request.With { request; respond }) = + match request with + | Proof -> + respond (Provide proof) + | _ -> + respond Unhandled + end in + let _tag, _cache_handle, recursive_proof, Pickles.Provers.[ recursive_prove ] + = + Pickles.compile ~public_input:(Pickles.Inductive_rule.Input Typ.unit) + ~auxiliary_typ:Typ.unit + ~branches:(module Nat.N1) + ~max_proofs_verified:(module Nat.N1) + ~name:"recursion over chunks" + ~constraint_constants (* TODO(mrmr1993): This was misguided.. Delete. *) + ~choices:(fun ~self:_ -> + [ { identifier = "recurse over 2^17" + ; prevs = [ tag ] + ; main = + (fun _ -> + let proof = + exists (Typ.Internal.ref ()) ~request:(fun () -> + Requests.Proof ) + in + { previous_proof_statements = + [ { public_input = () + ; proof + ; proof_must_verify = Boolean.true_ + } + ] + ; public_output = () + ; auxiliary_output = () + } ) + ; feature_flags = Pickles_types.Plonk_types.Features.none_bool + } + ] ) + () + in + let module Proof = (val proof) in + let module Recursive_proof = (val recursive_proof) in + let test_prove () = + let public_input, (), proof = + Async.Thread_safe.block_on_async_exn (fun () -> prove ()) + in + Or_error.ok_exn + (Async.Thread_safe.block_on_async_exn (fun () -> + Proof.verify [ (public_input, proof) ] ) ) ; + let public_input, (), proof = + Async.Thread_safe.block_on_async_exn (fun () -> + recursive_prove ~handler:(Requests.handler proof) () ) + in + Or_error.ok_exn + (Async.Thread_safe.block_on_async_exn (fun () -> + Recursive_proof.verify [ (public_input, proof) ] ) ) + in + test_prove () + +let () = + test () ; + Alcotest.run "Chunked circuit" + [ ("2^16", [ ("prove and verify", `Quick, test) ]) ] From 780342e4c04c650735e1caf093c00ec4fafa36e3 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 17 Oct 2023 09:24:45 +0100 Subject: [PATCH 5/5] Reformat --- src/lib/pickles/step_main.ml | 4 ++-- src/lib/pickles/step_verifier.ml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/pickles/step_main.ml b/src/lib/pickles/step_main.ml index d3901b1597f..ce41460aabe 100644 --- a/src/lib/pickles/step_main.ml +++ b/src/lib/pickles/step_main.ml @@ -42,8 +42,8 @@ let verify_one ~srs in (* TODO: Refactor args into an "unfinalized proof" struct *) finalize_other_proof d.max_proofs_verified ~step_domains:d.step_domains - ~zk_rows:d.zk_rows - ~sponge ~prev_challenges deferred_values prev_proof_evals ) + ~zk_rows:d.zk_rows ~sponge ~prev_challenges deferred_values + prev_proof_evals ) in let branch_data = deferred_values.branch_data in let sponge_after_index, hash_messages_for_next_step_proof = diff --git a/src/lib/pickles/step_verifier.ml b/src/lib/pickles/step_verifier.ml index 04a1aebe391..bc6ee20b67d 100644 --- a/src/lib/pickles/step_verifier.ml +++ b/src/lib/pickles/step_verifier.ml @@ -854,8 +854,7 @@ struct let finalize_other_proof (type b branches) (module Proofs_verified : Nat.Add.Intf with type n = b) ~(step_domains : - [ `Known of (Domains.t, branches) Vector.t | `Side_loaded ] ) - ~zk_rows + [ `Known of (Domains.t, branches) Vector.t | `Side_loaded ] ) ~zk_rows ~(* TODO: Add "actual proofs verified" so that proofs don't carry around dummy "old bulletproof challenges" *) sponge ~(prev_challenges : (_, b) Vector.t)