Skip to content

Commit 6b1b822

Browse files
colinlyguoyiweichi
andauthored
fix(coordinator): set v4.4.56 as minimum prover version (#1641)
Co-authored-by: Morty <[email protected]>
1 parent a34c01d commit 6b1b822

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

common/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"runtime/debug"
66
)
77

8-
var tag = "v4.5.1"
8+
var tag = "v4.5.2"
99

1010
var commit = func() string {
1111
if info, ok := debug.ReadBuildInfo(); ok {

coordinator/cmd/api/app/mock_app.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ func (c *CoordinatorApp) MockConfig(store bool) error {
9595
ParamsPath: "",
9696
AssetsPath: "",
9797
ForkName: "darwin",
98-
MinProverVersion: "v4.2.0",
98+
MinProverVersion: "v4.4.57",
9999
},
100100
HighVersionCircuit: &coordinatorConfig.CircuitConfig{
101101
ParamsPath: "",
102102
AssetsPath: "",
103103
ForkName: "darwinV2",
104-
MinProverVersion: "v4.3.0",
104+
MinProverVersion: "v4.4.89",
105105
},
106106
},
107107
BatchCollectionTimeSec: 60,

coordinator/internal/logic/auth/login.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ func (l *LoginLogic) Check(login *types.LoginParameter) error {
7575
return errors.New("auth message verify failure")
7676
}
7777

78-
if !version.CheckScrollRepoVersion(login.Message.ProverVersion, l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion) {
78+
// FIXME: for backward compatibility, set prover version as darwin prover version,
79+
// change v4.4.56 to l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion after Euclid upgrade, including the log.
80+
// hardcode the prover version because l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion is used in another check and should be set as v4.4.89 for darwinV2 provers.
81+
if !version.CheckScrollRepoVersion(login.Message.ProverVersion, "v4.4.56") {
7982
return fmt.Errorf("incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s",
80-
l.cfg.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, login.Message.ProverVersion)
83+
"v4.4.56", login.Message.ProverVersion)
8184
}
8285

8386
if len(login.Message.ProverTypes) > 0 {

coordinator/internal/logic/provertask/prover_task.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (b *BaseProverTask) hardForkSanityCheck(ctx *gin.Context, taskCtx *proverTa
122122
}
123123

124124
// for backward compatibility, darwin chunk prover can still prove darwinV2 chunk tasks
125-
if taskCtx.taskType == message.ProofTypeChunk && hardForkName == "darwinV2" && taskCtx.ProverVersion == "v4.4.56" {
125+
if taskCtx.taskType == message.ProofTypeChunk && hardForkName == "darwinV2" && strings.HasPrefix(taskCtx.ProverVersion, "v4.4.56") {
126126
return hardForkName, nil
127127
}
128128

coordinator/test/api_test.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri
8989
ParamsPath: "",
9090
AssetsPath: "",
9191
ForkName: "homestead",
92-
MinProverVersion: "v4.2.0",
92+
MinProverVersion: "v4.4.57",
9393
},
9494
HighVersionCircuit: &config.CircuitConfig{
9595
ParamsPath: "",
9696
AssetsPath: "",
9797
ForkName: "bernoulli",
98-
MinProverVersion: "v4.3.0",
98+
MinProverVersion: "v4.4.89",
9999
},
100100
},
101101
BatchCollectionTimeSec: 10,
@@ -142,7 +142,7 @@ func setupCoordinator(t *testing.T, proversPerSession uint8, coordinatorURL stri
142142
func setEnv(t *testing.T) {
143143
var err error
144144

145-
version.Version = "v4.2.0"
145+
version.Version = "v4.4.57"
146146

147147
glogger := log.NewGlogHandler(log.StreamHandler(os.Stderr, log.LogfmtFormat()))
148148
glogger.Verbosity(log.LvlInfo)
@@ -285,14 +285,12 @@ func testOutdatedProverVersion(t *testing.T) {
285285
batchProver := newMockProver(t, "prover_batch_test", coordinatorURL, message.ProofTypeBatch, "v1.999.999")
286286
assert.True(t, chunkProver.healthCheckSuccess(t))
287287

288-
expectedErr := fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s",
289-
conf.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, chunkProver.proverVersion)
288+
expectedErr := fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: v4.4.56, actual version: %s", chunkProver.proverVersion)
290289
code, errMsg := chunkProver.tryGetProverTask(t, message.ProofTypeChunk)
291290
assert.Equal(t, types.ErrJWTCommonErr, code)
292291
assert.Equal(t, expectedErr, errors.New(errMsg))
293292

294-
expectedErr = fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: %s, actual version: %s",
295-
conf.ProverManager.Verifier.LowVersionCircuit.MinProverVersion, batchProver.proverVersion)
293+
expectedErr = fmt.Errorf("check the login parameter failure: incompatible prover version. please upgrade your prover, minimum allowed version: v4.4.56, actual version: %s", batchProver.proverVersion)
296294
code, errMsg = batchProver.tryGetProverTask(t, message.ProofTypeBatch)
297295
assert.Equal(t, types.ErrJWTCommonErr, code)
298296
assert.Equal(t, expectedErr, errors.New(errMsg))

0 commit comments

Comments
 (0)