Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
lispc committed Aug 26, 2024
1 parent acd6d4f commit cd6a663
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
24 changes: 12 additions & 12 deletions common/libzkp/impl/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ mod darwin;
mod darwin_v2;

use anyhow::{bail, Result};
// use darwin::DarwinVerifier;
use darwin::DarwinVerifier;
use darwin_v2::DarwinV2Verifier;
use halo2_proofs::{halo2curves::bn256::Bn256, poly::kzg::commitment::ParamsKZG};
use prover_v4::utils::load_params;
Expand Down Expand Up @@ -38,11 +38,11 @@ type HardForkName = String;
struct VerifierPair(HardForkName, Rc<Box<dyn ProofVerifier>>);

static mut VERIFIER_HIGH: OnceCell<VerifierPair> = OnceCell::new();
// static mut VERIFIER_LOW: OnceCell<VerifierPair> = OnceCell::new();
static mut VERIFIER_LOW: OnceCell<VerifierPair> = OnceCell::new();
static mut PARAMS_MAP: OnceCell<BTreeMap<u32, ParamsKZG<Bn256>>> = OnceCell::new();

pub fn init(config: VerifierConfig) {
// let low_conf = config.low_version_circuit;
let low_conf = config.low_version_circuit;

// params should be shared between low and high
let mut params_map = BTreeMap::new();
Expand All @@ -68,14 +68,14 @@ pub fn init(config: VerifierConfig) {

let verifier = DarwinVerifier::new(unsafe { PARAMS_MAP.get().unwrap() }, &low_conf.assets_path);

// unsafe {
// VERIFIER_LOW
// .set(VerifierPair(
// low_conf.fork_name,
// Rc::new(Box::new(verifier)),
// ))
// .unwrap_unchecked();
// }
unsafe {
VERIFIER_LOW
.set(VerifierPair(
low_conf.fork_name,
Rc::new(Box::new(verifier)),
))
.unwrap_unchecked();
}
let high_conf = config.high_version_circuit;
let verifier =
DarwinV2Verifier::new(unsafe { PARAMS_MAP.get().unwrap() }, &high_conf.assets_path);
Expand All @@ -91,7 +91,7 @@ pub fn init(config: VerifierConfig) {

pub fn get_verifier(fork_name: &str) -> Result<Rc<Box<dyn ProofVerifier>>> {
unsafe {
if let Some(verifier) = VERIFIER_HIGH.get() {
if let Some(verifier) = VERIFIER_LOW.get() {
if verifier.0 == fork_name {
return Ok(verifier.1.clone());
}
Expand Down
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.48"
var tag = "v4.4.47"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
2 changes: 2 additions & 0 deletions coordinator/internal/logic/verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ func NewVerifier(cfg *config.VerifierConfig) (*Verifier, error) {
}

configStr := C.CString(string(configBytes))
assetsPathHiStr := C.CString(cfg.HighVersionCircuit.AssetsPath)
defer func() {
C.free(unsafe.Pointer(configStr))
C.free(unsafe.Pointer(assetsPathHiStr))
}()

C.init(configStr)
Expand Down

0 comments on commit cd6a663

Please sign in to comment.