Skip to content

Commit

Permalink
Merge pull request #16116 from MinaProtocol/feature/more-versioned-pi…
Browse files Browse the repository at this point in the history
…ckles_types

Add more of `Pickles_types` to `Mina_wire_types`
  • Loading branch information
mrmr1993 authored Sep 24, 2024
2 parents 3b579f3 + 99110b1 commit e1b6064
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 17 deletions.
71 changes: 57 additions & 14 deletions src/lib/mina_wire_types/pickles_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ module Plonk_types = struct
end
end

module Openings = struct
module Bulletproof = struct
module V1 = struct
type ('g, 'fq) t =
{ lr : ('g * 'g) array
; z_1 : 'fq
; z_2 : 'fq
; delta : 'g
; challenge_polynomial_commitment : 'g
}
end
end
end

module Evals = struct
module V2 = struct
type 'a t =
Expand Down Expand Up @@ -114,6 +100,63 @@ module Plonk_types = struct
}
end
end

module Openings = struct
module Bulletproof = struct
module V1 = struct
type ('g, 'fq) t =
{ lr : ('g * 'g) array
; z_1 : 'fq
; z_2 : 'fq
; delta : 'g
; challenge_polynomial_commitment : 'g
}
end
end

module V2 = struct
type ('g, 'fq, 'fqv) t =
{ proof : ('g, 'fq) Bulletproof.V1.t
; evals : ('fqv * 'fqv) Evals.V2.t
; ft_eval1 : 'fq
}
end
end

module Poly_comm = struct
module Without_degree_bound = struct
module V1 = struct
type 'g t = 'g array
end
end
end

module Messages = struct
module Lookup = struct
module V1 = struct
type 'g t = { sorted : 'g array; aggreg : 'g; runtime : 'g option }
end
end

module V2 = struct
type 'g t =
{ w_comm :
('g Poly_comm.Without_degree_bound.V1.t, Nat.fifteen) Vector.t
; z_comm : 'g Poly_comm.Without_degree_bound.V1.t
; t_comm : 'g Poly_comm.Without_degree_bound.V1.t
; lookup : 'g Poly_comm.Without_degree_bound.V1.t Lookup.V1.t option
}
end
end

module Proof = struct
module V2 = struct
type ('g, 'fq, 'fqv) t =
{ messages : 'g Messages.V2.t
; openings : ('g, 'fq, 'fqv) Openings.V2.t
}
end
end
end

module Plonk_verification_key_evals = struct
Expand Down
8 changes: 7 additions & 1 deletion src/lib/pickles_types/plonk_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,10 @@ module Openings = struct
module Stable = struct
module V2 = struct
type ('g, 'fq, 'fqv) t =
( 'g
, 'fq
, 'fqv )
Mina_wire_types.Pickles_types.Plonk_types.Openings.V2.t =
{ proof : ('g, 'fq) Bulletproof.Stable.V1.t
; evals : ('fqv * 'fqv) Evals.Stable.V2.t
; ft_eval1 : 'fq
Expand Down Expand Up @@ -1431,6 +1435,7 @@ module Messages = struct

module V1 = struct
type 'g t =
'g Mina_wire_types.Pickles_types.Plonk_types.Messages.Lookup.V1.t =
{ sorted : 'g Bounded_types.ArrayN16.Stable.V1.t
; aggreg : 'g
; runtime : 'g option
Expand Down Expand Up @@ -1486,7 +1491,7 @@ module Messages = struct
[@@@no_toplevel_latest_type]

module V2 = struct
type 'g t =
type 'g t = 'g Mina_wire_types.Pickles_types.Plonk_types.Messages.V2.t =
{ w_comm : 'g Without_degree_bound.Stable.V1.t Columns_vec.Stable.V1.t
; z_comm : 'g Without_degree_bound.Stable.V1.t
; t_comm : 'g Without_degree_bound.Stable.V1.t
Expand Down Expand Up @@ -1548,6 +1553,7 @@ module Proof = struct

module V2 = struct
type ('g, 'fq, 'fqv) t =
('g, 'fq, 'fqv) Mina_wire_types.Pickles_types.Plonk_types.Proof.V2.t =
{ messages : 'g Messages.Stable.V2.t
; openings : ('g, 'fq, 'fqv) Openings.Stable.V2.t
}
Expand Down
11 changes: 9 additions & 2 deletions src/lib/pickles_types/plonk_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ module Messages : sig
module Lookup : sig
module Stable : sig
module V1 : sig
type 'g t = { sorted : 'g array; aggreg : 'g; runtime : 'g option }
type 'g t =
'g Mina_wire_types.Pickles_types.Plonk_types.Messages.Lookup.V1.t =
{ sorted : 'g array; aggreg : 'g; runtime : 'g option }
[@@deriving fields, sexp, compare, yojson, hash, equal, hlist]
end
end
Expand Down Expand Up @@ -171,7 +173,7 @@ module Messages : sig
- [lookup] contains the commitments to the polynomials involved the
lookup arguments.
*)
type 'g t =
type 'g t = 'g Mina_wire_types.Pickles_types.Plonk_types.Messages.V2.t =
{ w_comm : 'g Poly_comm.Without_degree_bound.t Columns_vec.t
; z_comm : 'g Poly_comm.Without_degree_bound.t
; t_comm : 'g Poly_comm.Without_degree_bound.t
Expand Down Expand Up @@ -352,6 +354,10 @@ module Openings : sig
module Stable : sig
module V2 : sig
type ('g, 'fq, 'fqv) t =
( 'g
, 'fq
, 'fqv )
Mina_wire_types.Pickles_types.Plonk_types.Openings.V2.t =
{ proof : ('g, 'fq) Bulletproof.t
; evals : ('fqv * 'fqv) Evals.t
; ft_eval1 : 'fq
Expand All @@ -366,6 +372,7 @@ module Proof : sig
module Stable : sig
module V2 : sig
type ('g, 'fq, 'fqv) t =
('g, 'fq, 'fqv) Mina_wire_types.Pickles_types.Plonk_types.Proof.V2.t =
{ messages : 'g Messages.Stable.V2.t
; openings : ('g, 'fq, 'fqv) Openings.t
}
Expand Down

0 comments on commit e1b6064

Please sign in to comment.