Skip to content

Commit

Permalink
feat(coordinator): add version check for sdk provers (#1551)
Browse files Browse the repository at this point in the history
Co-authored-by: 0xmountaintop <[email protected]>
  • Loading branch information
0xmountaintop and 0xmountaintop authored Oct 30, 2024
1 parent 2059b49 commit f0e8fbe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions common/version/prover_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (

// CheckScrollProverVersion check the "scroll-prover" version, if it's different from the local one, return false
func CheckScrollProverVersion(proverVersion string) bool {
if strings.HasPrefix(proverVersion, "sdk") {
return CheckProverSDKVersion(proverVersion)
}

// note the version is in fact in the format of "tag-commit-scroll_prover-halo2",
// so split-by-'-' length should be 4
remote := strings.Split(proverVersion, "-")
Expand All @@ -23,8 +27,18 @@ func CheckScrollProverVersion(proverVersion string) bool {
return remote[2] == local[2]
}

// CheckProverSDKVersion check prover sdk version, it simply returns true for now,
// and more checks will be added as we evolve.
func CheckProverSDKVersion(proverVersion string) bool {
return true
}

// CheckScrollRepoVersion checks if the proverVersion is at least the minimum required version.
func CheckScrollRepoVersion(proverVersion, minVersion string) bool {
if strings.HasPrefix(proverVersion, "sdk") {
return CheckProverSDKWithMinVersion(proverVersion, minVersion)
}

c, err := semver.NewConstraint(">= " + minVersion + "-0")
if err != nil {
log.Error("failed to initialize constraint", "minVersion", minVersion, "error", err)
Expand All @@ -39,3 +53,9 @@ func CheckScrollRepoVersion(proverVersion, minVersion string) bool {

return c.Check(v)
}

// CheckProverSDKWithMinVersion check prover sdk version is at least the minimum required version, it simply returns true for now,
// and more checks will be added as we evolve.
func CheckProverSDKWithMinVersion(proverVersion string, minVersion string) bool {
return true
}
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.4.71"
var tag = "v4.4.72"

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

0 comments on commit f0e8fbe

Please sign in to comment.