Skip to content

Commit 87e1235

Browse files
author
colinlyguo
committed
fix
1 parent 86e6555 commit 87e1235

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

common/types/message/message.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
)
1111

1212
const (
13-
euclidFork = "euclid"
14-
euclidV2Fork = "euclidV2"
13+
EuclidFork = "euclid"
14+
EuclidV2Fork = "euclidV2"
1515
)
1616

1717
// ProofType represents the type of task.
@@ -95,9 +95,9 @@ type ChunkProof interface {
9595

9696
// NewChunkProof creates a new ChunkProof instance.
9797
func NewChunkProof(hardForkName string) ChunkProof {
98-
log.Info("NewChunkProof", "hardForkName", hardForkName, "euclidForkName", euclidFork, "euclidV2ForkName", euclidV2Fork)
98+
log.Info("NewChunkProof", "hardForkName", hardForkName, "euclidForkName", EuclidFork, "euclidV2ForkName", EuclidV2Fork)
9999
switch hardForkName {
100-
case euclidFork, euclidV2Fork:
100+
case EuclidFork, EuclidV2Fork:
101101
return &OpenVMChunkProof{}
102102
default:
103103
return &Halo2ChunkProof{}
@@ -130,9 +130,9 @@ type BatchProof interface {
130130

131131
// NewBatchProof creates a new BatchProof instance.
132132
func NewBatchProof(hardForkName string) BatchProof {
133-
log.Info("NewBatchProof", "hardForkName", hardForkName, "euclidForkName", euclidFork, "euclidV2ForkName", euclidV2Fork)
133+
log.Info("NewBatchProof", "hardForkName", hardForkName, "euclidForkName", EuclidFork, "euclidV2ForkName", EuclidV2Fork)
134134
switch hardForkName {
135-
case euclidFork, euclidV2Fork:
135+
case EuclidFork, EuclidV2Fork:
136136
return &OpenVMBatchProof{}
137137
default:
138138
return &Halo2BatchProof{}
@@ -188,9 +188,9 @@ type BundleProof interface {
188188

189189
// NewBundleProof creates a new BundleProof instance.
190190
func NewBundleProof(hardForkName string) BundleProof {
191-
log.Info("NewBundleProof", "hardForkName", hardForkName, "euclidForkName", euclidFork, "euclidV2ForkName", euclidV2Fork)
191+
log.Info("NewBundleProof", "hardForkName", hardForkName, "euclidForkName", EuclidFork, "euclidV2ForkName", EuclidV2Fork)
192192
switch hardForkName {
193-
case euclidFork, euclidV2Fork:
193+
case EuclidFork, EuclidV2Fork:
194194
return &OpenVMBundleProof{}
195195
default:
196196
return &Halo2BundleProof{}

coordinator/internal/logic/provertask/chunk_prover_task.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/gin-gonic/gin"
1010
"github.com/prometheus/client_golang/prometheus"
1111
"github.com/prometheus/client_golang/prometheus/promauto"
12-
"github.com/scroll-tech/da-codec/encoding"
1312
"github.com/scroll-tech/go-ethereum/common"
1413
"github.com/scroll-tech/go-ethereum/log"
1514
"github.com/scroll-tech/go-ethereum/params"
@@ -181,15 +180,6 @@ func (cp *ChunkProverTask) Assign(ctx *gin.Context, getTaskParameter *coordinato
181180
return taskMsg, nil
182181
}
183182

184-
func (cp *ChunkProverTask) hardForkName(ctx *gin.Context, chunkTask *orm.Chunk) (string, error) {
185-
l2Block, getBlockErr := cp.blockOrm.GetL2BlockByNumber(ctx.Copy(), chunkTask.StartBlockNumber)
186-
if getBlockErr != nil {
187-
return "", getBlockErr
188-
}
189-
hardForkName := encoding.GetHardforkName(cp.chainCfg, l2Block.Number, l2Block.BlockTimestamp)
190-
return hardForkName, nil
191-
}
192-
193183
func (cp *ChunkProverTask) formatProverTask(ctx context.Context, task *orm.ProverTask, chunk *orm.Chunk, hardForkName string) (*coordinatorType.GetTaskSchema, error) {
194184
// Get block hashes.
195185
blockHashes, dbErr := cp.blockOrm.GetL2BlockHashesByChunkHash(ctx, task.TaskID)
@@ -198,7 +188,7 @@ func (cp *ChunkProverTask) formatProverTask(ctx context.Context, task *orm.Prove
198188
}
199189

200190
var taskDetailBytes []byte
201-
if hardForkName == "euclidV2" {
191+
if hardForkName == message.EuclidV2Fork {
202192
taskDetail := message.EuclidV2ChunkTaskDetail{
203193
BlockHashes: blockHashes,
204194
PrevMsgQueueHash: common.HexToHash(chunk.PrevL1MessageQueueHash),

0 commit comments

Comments
 (0)