Skip to content

Commit

Permalink
Update zkevm circuits (including new hash scheme) and traces (#189)
Browse files Browse the repository at this point in the history
* Update zkevm-circuits (include new hash scheme) and traces.

* minor fix

---------

Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
  • Loading branch information
silathdiir and lispc authored Aug 2, 2023
1 parent a9381d6 commit 09f24c5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ target/
.idea
.vscode

# macos
.DS_store

# for local config
.cargo

Expand Down
71 changes: 54 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion prover/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn parse_trace_path_from_mode(mode: &str) -> &'static str {
"greeter" => "./tests/traces/greeter/setValue.json",
"single" => "./tests/traces/erc20/1_transfer.json",
"multiple" => "./tests/traces/erc20/10_transfer.json",
"multiswap" => "./tests/extra_traces/12_swap.json",
"multiswap" => "./tests/traces/multi_uniswapv2/router-swapExactTokensForTokens_34.json",
"native" => "./tests/traces/native/transfer.json",
"dao" => "./tests/traces/dao/dao-propose.json",
"nft" => "./tests/traces/nft/mint.json",
Expand Down
5 changes: 3 additions & 2 deletions prover/src/zkevm/circuit/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ use zkevm_circuits::{
witness::WithdrawProof,
};

pub const SUB_CIRCUIT_NAMES: [&str; 11] = [
"evm", "state", "bytecode", "copy", "keccak", "tx", "rlp", "exp", "pi", "poseidon", "mpt",
pub const SUB_CIRCUIT_NAMES: [&str; 14] = [
"evm", "state", "bytecode", "copy", "keccak", "tx", "rlp", "exp", "modexp", "pi", "poseidon",
"sig", "ecc", "mpt",
];

// TODO: optimize it later
Expand Down
2 changes: 2 additions & 0 deletions prover/tests/aggregation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ fn test_agg_prove_verify() {
.map(|i| format!("./tests/traces/bridge/{i:02}.json"))
.collect();

let trace_paths = vec!["./tests/traces/erc20/10_transfer.json".to_string()];

let chunk_hashes_proofs = gen_chunk_hashes_and_proofs(&output_dir, trace_paths.as_slice());
log::info!("Generated chunk hashes and proofs");

Expand Down
2 changes: 1 addition & 1 deletion prover/tests/traces
Submodule traces updated 48 files
+4,254 −0 bridge/approveERC20.json
+0 −3 bridge/approveUSDC.json
+117,269 −0 bridge/depositERC20.json
+50,314 −1 bridge/depositETH.json
+0 −3 bridge/depositUSDC.json
+82,265 −0 bridge/withdrawERC20.json
+88,786 −1 bridge/withdrawETH.json
+0 −3 bridge/withdrawUSDC.json
+45,849 −45,733 dao/dao-cancel.json
+103,203 −103,095 dao/dao-propose.json
+17,692 −17,613 dao/deploy-dao.json
+6,642 −6,429 dao/deploy-votes.json
+68,934 −68,750 erc20/10_transfer.json
+8,020 −7,955 erc20/1_transfer.json
+13,342 −13,379 erc20/deploy.json
+6,434 −6,465 erc20/mint.json
+1,954 −1,765 greeter/deploy.json
+2,055 −1,868 greeter/setValue.json
+14,013 −0 multi_uniswapv2/deploy-btc.json
+2,039 −0 multi_uniswapv2/deploy-factory.json
+3,805 −0 multi_uniswapv2/deploy-router.json
+4,898 −0 multi_uniswapv2/deploy-weth9.json
+17,874 −0 multi_uniswapv2/factory-createPair.json
+182,174 −0 multi_uniswapv2/router-AddLiquidity.json
+1,582,938 −0 multi_uniswapv2/router-swapExactTokensForTokens_34.json
+15,119 −0 multi_uniswapv2/token-initBalance.json
+1,306 −858 native/transfer.json
+7,384 −6,859 nft/burn.json
+13,769 −13,443 nft/deploy.json
+5,581 −5,270 nft/mint.json
+12,697 −12,266 nft/transferFrom.json
+6,524 −6,358 sushi/chef-add.json
+37,963 −37,663 sushi/chef-deposit.json
+11,817 −11,647 sushi/chef-set.json
+78,676 −78,266 sushi/chef-withdraw.json
+4,395 −4,221 sushi/deploy-chef.json
+5,992 −5,870 sushi/deploy-sushi.json
+4,347 −4,199 sushi/sushi-approve.json
+6,847 −6,733 sushi/sushi-mint.json
+3,528 −3,412 sushi/sushi-transferOwnership.json
+13,644 −13,593 uniswapv2/deploy-btc.json
+1,900 −1,845 uniswapv2/deploy-factory.json
+3,752 −3,749 uniswapv2/deploy-router.json
+4,586 −4,617 uniswapv2/deploy-weth9.json
+17,101 −16,875 uniswapv2/factory-createPair.json
+180,398 −180,335 uniswapv2/router-AddLiquidity.json
+140,650 −140,895 uniswapv2/router-swapExactTokensForTokens.json
+14,345 −14,386 uniswapv2/token-initBalance.json

0 comments on commit 09f24c5

Please sign in to comment.