Skip to content

Commit

Permalink
Update libzkp.
Browse files Browse the repository at this point in the history
  • Loading branch information
silathdiir committed Aug 22, 2023
1 parent bd8c71e commit dcd79f6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
30 changes: 15 additions & 15 deletions rollup/circuitcapacitychecker/libzkp/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rollup/circuitcapacitychecker/libzkp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ 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.6.5-fix-row-estimation" }
types = { git = "https://github.com/scroll-tech/scroll-prover", tag = "v0.6.5-fix-row-estimation" }
prover = { git = "https://github.com/scroll-tech/scroll-prover", branch = "test/testnet" }
types = { git = "https://github.com/scroll-tech/scroll-prover", branch = "test/testnet" }

log = "0.4"
env_logger = "0.9.0"
Expand Down
27 changes: 14 additions & 13 deletions rollup/circuitcapacitychecker/libzkp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub mod checker {
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct RowUsageResult {
pub acc_row_usage: Option<RowUsage>,
pub tx_row_usage: Option<RowUsage>,
pub error: Option<String>,
}

Expand Down Expand Up @@ -59,7 +58,11 @@ pub mod checker {
#[no_mangle]
pub unsafe extern "C" fn apply_tx(id: u64, tx_traces: *const c_char) -> *const c_char {
let result = panic::catch_unwind(|| {
log::debug!("ccc apply_tx raw input, id: {:?}, tx_traces: {:?}", id, c_char_to_str(tx_traces));
log::debug!(
"ccc apply_tx raw input, id: {:?}, tx_traces: {:?}",
id,
c_char_to_str(tx_traces)
);
let tx_traces_vec = c_char_to_vec(tx_traces);
let traces = serde_json::from_slice::<BlockTrace>(&tx_traces_vec)
.unwrap_or_else(|_| panic!("id: {id:?}, fail to deserialize tx_traces"));
Expand Down Expand Up @@ -88,22 +91,19 @@ pub mod checker {
})
});
let r = match result {
Ok((acc_row_usage, tx_row_usage)) => {
Ok(acc_row_usage) => {
log::debug!(
"id: {:?}, acc_row_usage: {:?}, tx_row_usage: {:?}",
"id: {:?}, acc_row_usage: {:?}",
id,
acc_row_usage.row_number,
tx_row_usage.row_number
);
RowUsageResult {
acc_row_usage: Some(acc_row_usage),
tx_row_usage: Some(tx_row_usage),
error: None,
}
}
Err(e) => RowUsageResult {
acc_row_usage: None,
tx_row_usage: None,
error: Some(format!("{e:?}")),
},
};
Expand All @@ -114,7 +114,11 @@ pub mod checker {
#[no_mangle]
pub unsafe extern "C" fn apply_block(id: u64, block_trace: *const c_char) -> *const c_char {
let result = panic::catch_unwind(|| {
log::debug!("ccc apply_block raw input, id: {:?}, block_trace: {:?}", id, c_char_to_str(block_trace));
log::debug!(
"ccc apply_block raw input, id: {:?}, block_trace: {:?}",
id,
c_char_to_str(block_trace)
);
let block_trace = c_char_to_vec(block_trace);
let traces = serde_json::from_slice::<BlockTrace>(&block_trace)
.unwrap_or_else(|_| panic!("id: {id:?}, fail to deserialize block_trace"));
Expand All @@ -136,22 +140,19 @@ pub mod checker {
})
});
let r = match result {
Ok((acc_row_usage, tx_row_usage)) => {
Ok(acc_row_usage) => {
log::debug!(
"id: {:?}, acc_row_usage: {:?}, tx_row_usage: {:?}",
"id: {:?}, acc_row_usage: {:?}",
id,
acc_row_usage.row_number,
tx_row_usage.row_number
);
RowUsageResult {
acc_row_usage: Some(acc_row_usage),
tx_row_usage: Some(tx_row_usage),
error: None,
}
}
Err(e) => RowUsageResult {
acc_row_usage: None,
tx_row_usage: None,
error: Some(format!("{e:?}")),
},
};
Expand Down
1 change: 0 additions & 1 deletion rollup/circuitcapacitychecker/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ var (

type WrappedRowUsage struct {
AccRowUsage *types.RowUsage `json:"acc_row_usage,omitempty"`
TxRowUsage *types.RowUsage `json:"tx_row_usage,omitempty"`
Error string `json:"error,omitempty"`
}

0 comments on commit dcd79f6

Please sign in to comment.