@@ -73,7 +73,7 @@ impl BatchHeaderV {
7373#[ derive( Clone , serde:: Deserialize , serde:: Serialize ) ]
7474pub struct BatchProvingTask {
7575 /// The version of the chunks in the batch, as per [`Version`].
76- pub version : Version ,
76+ pub version : u8 ,
7777 /// Chunk proofs for the contiguous list of chunks within the batch.
7878 pub chunk_proofs : Vec < ChunkProof > ,
7979 /// The [`BatchHeaderV6/V7`], as computed on-chain for this batch.
@@ -106,7 +106,7 @@ impl TryFrom<BatchProvingTask> for ProvingTask {
106106
107107 Ok ( ProvingTask {
108108 identifier : value. batch_header . batch_hash ( ) . to_string ( ) ,
109- fork_name : value. version . fork . to_string ( ) ,
109+ fork_name : value. fork_name ,
110110 aggregated_proofs : value
111111 . chunk_proofs
112112 . into_iter ( )
@@ -120,7 +120,9 @@ impl TryFrom<BatchProvingTask> for ProvingTask {
120120
121121impl BatchProvingTask {
122122 fn build_guest_input ( & self ) -> BatchWitness {
123- let point_eval_witness = if !self . version . is_validium ( ) {
123+ let version = Version :: from ( self . version ) ;
124+
125+ let point_eval_witness = if !version. is_validium ( ) {
124126 // sanity check: calculate point eval needed and compare with task input
125127 let ( kzg_commitment, kzg_proof, challenge_digest) = {
126128 let blob = point_eval:: to_blob ( & self . blob_bytes ) ;
@@ -129,10 +131,10 @@ impl BatchProvingTask {
129131 let challenge_digest = match & self . batch_header {
130132 BatchHeaderV :: V6 ( _) => {
131133 assert_eq ! (
132- self . version. fork,
134+ version. fork,
133135 ForkName :: EuclidV1 ,
134136 "hardfork mismatch for da-codec@v6 header: found={:?}, expected={:?}" ,
135- self . version. fork,
137+ version. fork,
136138 ForkName :: EuclidV1 ,
137139 ) ;
138140 EnvelopeV6 :: from_slice ( self . blob_bytes . as_slice ( ) )
@@ -145,7 +147,7 @@ impl BatchProvingTask {
145147 padded_blob_bytes
146148 } ;
147149
148- match self . version . fork {
150+ match version. fork {
149151 ForkName :: EuclidV2 => {
150152 <EnvelopeV7 as Envelope >:: from_slice ( padded_blob_bytes. as_slice ( ) )
151153 . challenge_digest ( versioned_hash)
@@ -198,7 +200,7 @@ impl BatchProvingTask {
198200 None
199201 } ;
200202
201- let reference_header = match ( self . version . domain , self . version . stf_version ) {
203+ let reference_header = match ( version. domain , version. stf_version ) {
202204 ( Domain :: Scroll , STFVersion :: V6 ) => {
203205 ReferenceHeader :: V6 ( * self . batch_header . must_v6_header ( ) )
204206 }
@@ -217,8 +219,8 @@ impl BatchProvingTask {
217219 } ;
218220
219221 BatchWitness {
220- version : self . version . as_version_byte ( ) ,
221- fork_name : self . version . fork ,
222+ version : version. as_version_byte ( ) ,
223+ fork_name : version. fork ,
222224 chunk_proofs : self . chunk_proofs . iter ( ) . map ( |proof| proof. into ( ) ) . collect ( ) ,
223225 chunk_infos : self
224226 . chunk_proofs
@@ -237,7 +239,7 @@ impl BatchProvingTask {
237239 // 2. validate every adjacent proof pair
238240 let witness = self . build_guest_input ( ) ;
239241 let metadata = BatchInfo :: from ( & witness) ;
240- super :: check_aggregation_proofs ( self . chunk_proofs . as_slice ( ) , self . version ) ?;
242+ super :: check_aggregation_proofs ( self . chunk_proofs . as_slice ( ) , Version :: from ( self . version ) ) ?;
241243
242244 Ok ( metadata)
243245 }
0 commit comments