diff --git a/coordinator/internal/logic/verifier/legacy_vk/upgrade_vks.sh b/coordinator/internal/logic/verifier/legacy_vk/upgrade_vks.sh deleted file mode 100755 index c362314f0..000000000 --- a/coordinator/internal/logic/verifier/legacy_vk/upgrade_vks.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -work_dir="$(dirname -- "${BASH_SOURCE[0]}")" -work_dir="$(cd -- "$work_dir" && pwd)" -echo $work_dir - -rm $work_dir/*.vkey - -version=release-v0.12.0 -wget https://circuit-release.s3.us-west-2.amazonaws.com/${version}/vk_chunk.vkey -O $work_dir/vk_chunk.vkey -wget https://circuit-release.s3.us-west-2.amazonaws.com/${version}/vk_batch.vkey -O $work_dir/vk_batch.vkey -wget https://circuit-release.s3.us-west-2.amazonaws.com/${version}/vk_bundle.vkey -O $work_dir/vk_bundle.vkey \ No newline at end of file diff --git a/coordinator/internal/logic/verifier/legacy_vk/vk_batch.vkey b/coordinator/internal/logic/verifier/legacy_vk/vk_batch.vkey deleted file mode 100644 index b3540d0f7..000000000 Binary files a/coordinator/internal/logic/verifier/legacy_vk/vk_batch.vkey and /dev/null differ diff --git a/coordinator/internal/logic/verifier/legacy_vk/vk_bundle.vkey b/coordinator/internal/logic/verifier/legacy_vk/vk_bundle.vkey deleted file mode 100644 index df9ce5840..000000000 Binary files a/coordinator/internal/logic/verifier/legacy_vk/vk_bundle.vkey and /dev/null differ diff --git a/coordinator/internal/logic/verifier/legacy_vk/vk_chunk.vkey b/coordinator/internal/logic/verifier/legacy_vk/vk_chunk.vkey deleted file mode 100644 index 7318195dd..000000000 Binary files a/coordinator/internal/logic/verifier/legacy_vk/vk_chunk.vkey and /dev/null differ diff --git a/coordinator/internal/logic/verifier/verifier.go b/coordinator/internal/logic/verifier/verifier.go index dcc28ded6..e52d31209 100644 --- a/coordinator/internal/logic/verifier/verifier.go +++ b/coordinator/internal/logic/verifier/verifier.go @@ -11,11 +11,9 @@ package verifier import "C" //nolint:typecheck import ( - "embed" "encoding/base64" "encoding/json" "io" - "io/fs" "os" "path" "unsafe" @@ -81,7 +79,7 @@ func NewVerifier(cfg *config.VerifierConfig) (*Verifier, error) { v.BatchVKMap[batchVK] = struct{}{} v.ChunkVKMap[chunkVK] = struct{}{} - if err := v.loadEmbedVK(); err != nil { + if err := v.loadLowVersionVKs(cfg); err != nil { return nil, err } return v, nil @@ -186,31 +184,22 @@ func (v *Verifier) readVK(filePat string) (string, error) { return base64.StdEncoding.EncodeToString(byt), nil } -//go:embed legacy_vk/* -var legacyVKFS embed.FS - -func (v *Verifier) loadEmbedVK() error { - chunkVKBytes, err := fs.ReadFile(legacyVKFS, "legacy_vk/vk_chunk.vkey") +// load low version vks, current is darwin +func (v *Verifier) loadLowVersionVKs(cfg *config.VerifierConfig) error { + bundleVK, err := v.readVK(path.Join(cfg.LowVersionCircuit.AssetsPath, "vk_bundle.vkey")) if err != nil { - log.Error("load embed chunk vk failure", "err", err) return err } - - batchVKBytes, err := fs.ReadFile(legacyVKFS, "legacy_vk/vk_batch.vkey") + batchVK, err := v.readVK(path.Join(cfg.LowVersionCircuit.AssetsPath, "vk_batch.vkey")) if err != nil { - log.Error("load embed batch vk failure", "err", err) return err } - - bundleVKBytes, err := fs.ReadFile(legacyVKFS, "legacy_vk/vk_bundle.vkey") + chunkVK, err := v.readVK(path.Join(cfg.LowVersionCircuit.AssetsPath, "vk_chunk.vkey")) if err != nil { - log.Error("load embed chunk vk failure", "err", err) return err } - - v.ChunkVKMap[base64.StdEncoding.EncodeToString(chunkVKBytes)] = struct{}{} - v.BatchVKMap[base64.StdEncoding.EncodeToString(batchVKBytes)] = struct{}{} - v.BundleVkMap[base64.StdEncoding.EncodeToString(bundleVKBytes)] = struct{}{} - + v.BundleVkMap[bundleVK] = struct{}{} + v.BatchVKMap[batchVK] = struct{}{} + v.ChunkVKMap[chunkVK] = struct{}{} return nil }