@@ -269,6 +269,7 @@ func (bp *BatchProverTask) formatProverTask(ctx context.Context, task *orm.Prove
269269 InitialBlockNumber : proof .MetaData .ChunkInfo .InitialBlockNumber ,
270270 BlockCtxs : proof .MetaData .ChunkInfo .BlockCtxs ,
271271 TxDataLength : proof .MetaData .ChunkInfo .TxDataLength ,
272+ EncryptionKey : proof .MetaData .ChunkInfo .EncryptionKey ,
272273 }
273274 chunkInfos = append (chunkInfos , & chunkInfo )
274275 }
@@ -278,15 +279,15 @@ func (bp *BatchProverTask) formatProverTask(ctx context.Context, task *orm.Prove
278279 return nil , fmt .Errorf ("failed to get batch task detail, taskID:%s err:%w" , task .TaskID , err )
279280 }
280281
281- chunkProofsBytes , err := json .Marshal (taskDetail )
282+ taskBytesWithchunkProofs , err := json .Marshal (taskDetail )
282283 if err != nil {
283284 return nil , fmt .Errorf ("failed to marshal chunk proofs, taskID:%s err:%w" , task .TaskID , err )
284285 }
285286
286287 taskMsg := & coordinatorType.GetTaskSchema {
287288 TaskID : task .TaskID ,
288289 TaskType : int (message .ProofTypeBatch ),
289- TaskData : string (chunkProofsBytes ),
290+ TaskData : string (taskBytesWithchunkProofs ),
290291 HardForkName : hardForkName ,
291292 }
292293
@@ -333,13 +334,15 @@ func (bp *BatchProverTask) getBatchTaskDetail(dbBatch *orm.Batch, chunkInfos []*
333334 }
334335 taskDetail .BatchHeader = batchHeader
335336 taskDetail .BlobBytes = dbBatch .BlobBytes
336- taskDetail .ChallengeDigest = common .HexToHash (dbBatch .ChallengeDigest )
337- // Memory layout of `BlobDataProof`: used in Codec.BlobDataProofForPointEvaluation()
338- // | z | y | kzg_commitment | kzg_proof |
339- // |---------|---------|----------------|-----------|
340- // | bytes32 | bytes32 | bytes48 | bytes48 |
341- taskDetail .KzgProof = message.Byte48 {Big : hexutil .Big (* new (big.Int ).SetBytes (dbBatch .BlobDataProof [112 :160 ]))}
342- taskDetail .KzgCommitment = message.Byte48 {Big : hexutil .Big (* new (big.Int ).SetBytes (dbBatch .BlobDataProof [64 :112 ]))}
337+ if ! bp .validiumMode () {
338+ taskDetail .ChallengeDigest = common .HexToHash (dbBatch .ChallengeDigest )
339+ // Memory layout of `BlobDataProof`: used in Codec.BlobDataProofForPointEvaluation()
340+ // | z | y | kzg_commitment | kzg_proof |
341+ // |---------|---------|----------------|-----------|
342+ // | bytes32 | bytes32 | bytes48 | bytes48 |
343+ taskDetail .KzgProof = & message.Byte48 {Big : hexutil .Big (* new (big.Int ).SetBytes (dbBatch .BlobDataProof [112 :160 ]))}
344+ taskDetail .KzgCommitment = & message.Byte48 {Big : hexutil .Big (* new (big.Int ).SetBytes (dbBatch .BlobDataProof [64 :112 ]))}
345+ }
343346
344347 return taskDetail , nil
345348}
0 commit comments