Skip to content

Commit cb87c7a

Browse files
author
colinlyguo
committed
another type fix
1 parent 3a3db5f commit cb87c7a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

common/types/message/message.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ type BatchTaskDetail struct {
5959
ChunkProofs []ChunkProof `json:"chunk_proofs"`
6060
BatchHeader interface{} `json:"batch_header"`
6161
BlobBytes []byte `json:"blob_bytes"`
62-
KzgProof []byte `json:"kzg_proof"`
63-
KzgCommitment []byte `json:"kzg_commitment"`
64-
Challenge common.Hash `json:"challenge"`
62+
KzgProof [48]byte `json:"kzg_proof"`
63+
KzgCommitment [48]byte `json:"kzg_commitment"`
64+
Challenge hexutil.Big `json:"challenge"`
6565
}
6666

6767
// BundleTaskDetail consists of all the information required to describe the task to generate a proof for a bundle of batches.

coordinator/internal/logic/provertask/batch_prover_task.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"math/big"
78
"time"
89

910
"github.com/gin-gonic/gin"
1011
"github.com/prometheus/client_golang/prometheus"
1112
"github.com/prometheus/client_golang/prometheus/promauto"
1213
"github.com/scroll-tech/da-codec/encoding"
1314
"github.com/scroll-tech/go-ethereum/common"
15+
"github.com/scroll-tech/go-ethereum/common/hexutil"
1416
"github.com/scroll-tech/go-ethereum/log"
1517
"github.com/scroll-tech/go-ethereum/params"
1618
"gorm.io/gorm"
@@ -289,8 +291,8 @@ func (bp *BatchProverTask) getBatchTaskDetail(dbBatch *orm.Batch, chunkInfos []*
289291
// | z | y | kzg_commitment | kzg_proof |
290292
// |---------|---------|----------------|-----------|
291293
// | bytes32 | bytes32 | bytes48 | bytes48 |
292-
taskDetail.KzgProof = dbBatch.BlobDataProof[112:160]
293-
taskDetail.KzgCommitment = dbBatch.BlobDataProof[64:112]
294-
taskDetail.Challenge = common.Hash(dbBatch.BlobDataProof[0:32])
294+
copy(taskDetail.KzgProof[:], dbBatch.BlobDataProof[112:160])
295+
copy(taskDetail.KzgCommitment[:], dbBatch.BlobDataProof[64:112])
296+
taskDetail.Challenge = hexutil.Big(*new(big.Int).SetBytes(dbBatch.BlobDataProof[0:32]))
295297
return taskDetail, nil
296298
}

0 commit comments

Comments
 (0)