Skip to content

Commit d503d4a

Browse files
committed
fix: base64 encode VKs
1 parent ac17696 commit d503d4a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

common/libzkp/impl/src/verifier.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ pub enum TaskType {
2020

2121
#[derive(Debug, Serialize, Deserialize)]
2222
pub struct VKDump {
23-
pub chunk_vk: Vec<u8>,
24-
pub batch_vk: Vec<u8>,
25-
pub bundle_vk: Vec<u8>,
23+
pub chunk_vk: String,
24+
pub batch_vk: String,
25+
pub bundle_vk: String,
2626
}
2727

2828
pub trait ProofVerifier {

common/libzkp/impl/src/verifier/euclid.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ impl ProofVerifier for EuclidVerifier {
6464
let f = File::create(file).expect("Failed to open file to dump VK");
6565

6666
let dump = VKDump {
67-
chunk_vk: self.chunk_verifier.get_app_vk(),
68-
batch_vk: self.batch_verifier.get_app_vk(),
69-
bundle_vk: self.bundle_verifier.get_app_vk(),
67+
chunk_vk: base64::encode(self.chunk_verifier.get_app_vk()),
68+
batch_vk: base64::encode(self.batch_verifier.get_app_vk()),
69+
bundle_vk: base64::encode(self.bundle_verifier.get_app_vk()),
7070
};
7171
serde_json::to_writer(f, &dump).expect("Failed to dump VK");
7272
}

coordinator/internal/logic/verifier/verifier.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ func newRustVerifierConfig(cfg *config.VerifierConfig) *rustVerifierConfig {
5858
}
5959

6060
type rustVkDump struct {
61-
Chunk []byte `json:"chunk_vk"`
62-
Batch []byte `json:"batch_vk"`
63-
Bundle []byte `json:"bundle_vk"`
61+
Chunk string `json:"chunk_vk"`
62+
Batch string `json:"batch_vk"`
63+
Bundle string `json:"bundle_vk"`
6464
}
6565

6666
// NewVerifier Sets up a rust ffi to call verify.
@@ -257,8 +257,8 @@ func (v *Verifier) loadOpenVMVks(forkName string) error {
257257
if err := json.Unmarshal(byt, &dump); err != nil {
258258
return err
259259
}
260-
v.OpenVMVkMap[string(dump.Chunk)] = struct{}{}
261-
v.OpenVMVkMap[string(dump.Batch)] = struct{}{}
262-
v.OpenVMVkMap[string(dump.Bundle)] = struct{}{}
260+
v.OpenVMVkMap[dump.Chunk] = struct{}{}
261+
v.OpenVMVkMap[dump.Batch] = struct{}{}
262+
v.OpenVMVkMap[dump.Bundle] = struct{}{}
263263
return nil
264264
}

0 commit comments

Comments
 (0)