@@ -14,7 +14,6 @@ const (
1414 EuclidFork = "euclid"
1515 EuclidV2Fork = "euclidV2"
1616
17- EuclidForkNameForProver = "euclidv1"
1817 EuclidV2ForkNameForProver = "euclidv2"
1918)
2019
@@ -99,22 +98,22 @@ func (e *Byte48) UnmarshalJSON(input []byte) error {
9998// BatchTaskDetail is a type containing BatchTask detail.
10099type BatchTaskDetail struct {
101100 // use one of the string of EuclidFork / EuclidV2Fork
102- ForkName string `json:"fork_name"`
103- ChunkInfos []* ChunkInfo `json:"chunk_infos"`
104- ChunkProofs []ChunkProof `json:"chunk_proofs"`
105- BatchHeader interface {} `json:"batch_header"`
106- BlobBytes []byte `json:"blob_bytes"`
107- KzgProof Byte48 `json:"kzg_proof,omitempty"`
108- KzgCommitment Byte48 `json:"kzg_commitment,omitempty"`
109- ChallengeDigest common.Hash `json:"challenge_digest,omitempty"`
101+ ForkName string `json:"fork_name"`
102+ ChunkInfos []* ChunkInfo `json:"chunk_infos"`
103+ ChunkProofs []* OpenVMChunkProof `json:"chunk_proofs"`
104+ BatchHeader interface {} `json:"batch_header"`
105+ BlobBytes []byte `json:"blob_bytes"`
106+ KzgProof Byte48 `json:"kzg_proof,omitempty"`
107+ KzgCommitment Byte48 `json:"kzg_commitment,omitempty"`
108+ ChallengeDigest common.Hash `json:"challenge_digest,omitempty"`
110109}
111110
112111// BundleTaskDetail consists of all the information required to describe the task to generate a proof for a bundle of batches.
113112type BundleTaskDetail struct {
114113 // use one of the string of EuclidFork / EuclidV2Fork
115- ForkName string `json:"fork_name"`
116- BatchProofs []BatchProof `json:"batch_proofs"`
117- BundleInfo * OpenVMBundleInfo `json:"bundle_info,omitempty"`
114+ ForkName string `json:"fork_name"`
115+ BatchProofs []* OpenVMBatchProof `json:"batch_proofs"`
116+ BundleInfo * OpenVMBundleInfo `json:"bundle_info,omitempty"`
118117}
119118
120119// ChunkInfo is for calculating pi_hash for chunk
@@ -143,157 +142,6 @@ type BlockContextV2 struct {
143142 NumL1Msgs uint16 `json:"num_l1_msgs"`
144143}
145144
146- // SubCircuitRowUsage tracing info added in v0.11.0rc8
147- type SubCircuitRowUsage struct {
148- Name string `json:"name"`
149- RowNumber uint64 `json:"row_number"`
150- }
151-
152- // ChunkProof
153- type ChunkProof interface {
154- Proof () []byte
155- }
156-
157- // NewChunkProof creates a new ChunkProof instance.
158- func NewChunkProof (hardForkName string ) ChunkProof {
159- switch hardForkName {
160- case EuclidFork , EuclidV2Fork :
161- return & OpenVMChunkProof {}
162- default :
163- return & Halo2ChunkProof {}
164- }
165- }
166-
167- // Halo2ChunkProof includes the proof info that are required for chunk verification and rollup.
168- type Halo2ChunkProof struct {
169- StorageTrace []byte `json:"storage_trace,omitempty"`
170- Protocol []byte `json:"protocol"`
171- RawProof []byte `json:"proof"`
172- Instances []byte `json:"instances"`
173- Vk []byte `json:"vk"`
174- // cross-reference between cooridinator computation and prover compution
175- ChunkInfo * ChunkInfo `json:"chunk_info,omitempty"`
176- GitVersion string `json:"git_version,omitempty"`
177- RowUsages []SubCircuitRowUsage `json:"row_usages,omitempty"`
178- }
179-
180- // Proof returns the proof bytes of a ChunkProof
181- func (ap * Halo2ChunkProof ) Proof () []byte {
182- return ap .RawProof
183- }
184-
185- // BatchProof
186- type BatchProof interface {
187- SanityCheck () error
188- Proof () []byte
189- }
190-
191- // NewBatchProof creates a new BatchProof instance.
192- func NewBatchProof (hardForkName string ) BatchProof {
193- switch hardForkName {
194- case EuclidFork , EuclidV2Fork :
195- return & OpenVMBatchProof {}
196- default :
197- return & Halo2BatchProof {}
198- }
199- }
200-
201- // Halo2BatchProof includes the proof info that are required for batch verification and rollup.
202- type Halo2BatchProof struct {
203- Protocol []byte `json:"protocol"`
204- RawProof []byte `json:"proof"`
205- Instances []byte `json:"instances"`
206- Vk []byte `json:"vk"`
207- // cross-reference between cooridinator computation and prover compution
208- BatchHash common.Hash `json:"batch_hash"`
209- GitVersion string `json:"git_version,omitempty"`
210- }
211-
212- // Proof returns the proof bytes of a BatchProof
213- func (ap * Halo2BatchProof ) Proof () []byte {
214- return ap .RawProof
215- }
216-
217- // SanityCheck checks whether a BatchProof is in a legal format
218- func (ap * Halo2BatchProof ) SanityCheck () error {
219- if ap == nil {
220- return errors .New ("agg_proof is nil" )
221- }
222-
223- if len (ap .RawProof ) == 0 {
224- return errors .New ("proof not ready" )
225- }
226-
227- if len (ap .RawProof )% 32 != 0 {
228- return fmt .Errorf ("proof buffer length must be a multiple of 32, got: %d" , len (ap .RawProof ))
229- }
230-
231- if len (ap .Instances ) == 0 {
232- return errors .New ("instance not ready" )
233- }
234-
235- if len (ap .Vk ) == 0 {
236- return errors .New ("vk not ready" )
237- }
238-
239- return nil
240- }
241-
242- // BundleProof
243- type BundleProof interface {
244- SanityCheck () error
245- Proof () []byte
246- }
247-
248- // NewBundleProof creates a new BundleProof instance.
249- func NewBundleProof (hardForkName string ) BundleProof {
250- switch hardForkName {
251- case EuclidFork , EuclidV2Fork :
252- return & OpenVMBundleProof {}
253- default :
254- return & Halo2BundleProof {}
255- }
256- }
257-
258- // BundleProof includes the proof info that are required for verification of a bundle of batch proofs.
259- type Halo2BundleProof struct {
260- RawProof []byte `json:"proof"`
261- Instances []byte `json:"instances"`
262- Vk []byte `json:"vk"`
263- // cross-reference between cooridinator computation and prover compution
264- GitVersion string `json:"git_version,omitempty"`
265- }
266-
267- // Proof returns the proof bytes of a BundleProof
268- func (ap * Halo2BundleProof ) Proof () []byte {
269- return ap .RawProof
270- }
271-
272- // SanityCheck checks whether a BundleProof is in a legal format
273- func (ap * Halo2BundleProof ) SanityCheck () error {
274- if ap == nil {
275- return errors .New ("agg_proof is nil" )
276- }
277-
278- if len (ap .RawProof ) == 0 {
279- return errors .New ("proof not ready" )
280- }
281-
282- if len (ap .RawProof )% 32 != 0 {
283- return fmt .Errorf ("proof buffer length must be a multiple of 32, got: %d" , len (ap .RawProof ))
284- }
285-
286- if len (ap .Instances ) == 0 {
287- return errors .New ("instance not ready" )
288- }
289-
290- if len (ap .Vk ) == 0 {
291- return errors .New ("vk not ready" )
292- }
293-
294- return nil
295- }
296-
297145// Proof for flatten VM proof
298146type OpenVMProof struct {
299147 Proof []byte `json:"proofs"`
0 commit comments