fix(libzkp): upgrade to use prover v0.9.0 (#513)

This commit is contained in:
Steven 2023-09-14 19:28:24 +08:00 committed by GitHub
parent 530830a01c
commit 2b22bf9138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 537 additions and 792 deletions

View file

@ -24,7 +24,7 @@ import (
const (
VersionMajor = 4 // Major version component of the current release
VersionMinor = 4 // Minor version component of the current release
VersionPatch = 7 // Patch version component of the current release
VersionPatch = 8 // Patch version component of the current release
VersionMeta = "sepolia" // Version metadata to append to the version string
)

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@ edition = "2021"
crate-type = ["cdylib"]
[patch.crates-io]
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v0.17.0" }
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" }
[patch."https://github.com/privacy-scaling-explorations/halo2.git"]
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" }
[patch."https://github.com/privacy-scaling-explorations/poseidon.git"]
@ -20,7 +20,7 @@ maingate = { git = "https://github.com/scroll-tech/halo2wrong", branch = "halo2-
halo2curves = { git = "https://github.com/scroll-tech/halo2curves.git", branch = "0.3.1-derive-serde" }
[dependencies]
prover = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.8.2" }
prover = { git = "https://github.com/scroll-tech/zkevm-circuits.git", tag = "v0.9.0", default-features = false, features = ["parallel_syn", "scroll", "shanghai"] }
anyhow = "1.0"
log = "0.4"

View file

@ -2,11 +2,11 @@
pub mod checker {
use crate::utils::{c_char_to_str, c_char_to_vec, vec_to_c_char};
use anyhow::{anyhow, Error};
use anyhow::{anyhow, bail, Error};
use libc::c_char;
use prover::{
types::eth::BlockTrace,
zkevm::{CircuitCapacityChecker, RowUsage},
BlockTrace,
};
use serde_derive::{Deserialize, Serialize};
use std::cell::OnceCell;
@ -97,13 +97,13 @@ pub mod checker {
let traces = serde_json::from_slice::<BlockTrace>(&tx_traces_vec)?;
if traces.transactions.len() != 1 {
return Err(anyhow!("traces.transactions.len() != 1"));
bail!("traces.transactions.len() != 1");
}
if traces.execution_results.len() != 1 {
return Err(anyhow!("traces.execution_results.len() != 1"));
bail!("traces.execution_results.len() != 1");
}
if traces.tx_storage_trace.len() != 1 {
return Err(anyhow!("traces.tx_storage_trace.len() != 1"));
bail!("traces.tx_storage_trace.len() != 1");
}
let r = panic::catch_unwind(|| {
@ -120,10 +120,8 @@ pub mod checker {
});
match r {
Ok(result) => result,
Err(_) => {
return Err(anyhow!(
"estimate_circuit_capacity (id: {id:?}) error in apply_tx"
))
Err(e) => {
bail!("estimate_circuit_capacity (id: {id:?}) error in apply_tx, error: {e:?}")
}
}
}
@ -175,10 +173,8 @@ pub mod checker {
});
match r {
Ok(result) => result,
Err(_) => {
return Err(anyhow!(
"estimate_circuit_capacity (id: {id:?}) error in apply_block"
))
Err(e) => {
bail!("estimate_circuit_capacity (id: {id:?}) error in apply_block, error: {e:?}")
}
}
}
@ -218,11 +214,7 @@ pub mod checker {
.get_tx_num() as u64)
})
.map_or_else(
|e| {
Err(anyhow!(
"circuit capacity checker (id: {id}) error in get_tx_num: {e:?}"
))
},
|e| bail!("circuit capacity checker (id: {id}) error in get_tx_num: {e:?}"),
|result| result,
)
}