This repository was archived by the owner on Apr 18, 2025. It is now read-only.
forked from privacy-ethereum/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 385
[Feat] Optimize zktrieState with flatten proofs #1388
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3c5a5b1
induce "query" mode for building sdb
noel2004 a2656fb
switch zktrie dep
noel2004 fe94845
induce flatten proof and integration test
noel2004 7677396
update zk_dep
noel2004 fffc7c3
fix test issue
noel2004 dd22a37
update zktrie dep
noel2004 69527c4
induce mpt state updating
noel2004 6488353
fix issue in chunk building
noel2004 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #![feature(lazy_cell)] | ||
| #![cfg(feature = "scroll")] | ||
|
|
||
| use bus_mapping::{ | ||
| circuit_input_builder::{CircuitInputBuilder, CircuitsParams}, | ||
| util::read_env_var, | ||
| }; | ||
| use eth_types::l2_types::BlockTrace; | ||
| use integration_tests::log_init; | ||
| use std::fs::File; | ||
| use zkevm_circuits::witness; | ||
|
|
||
| fn test_circuit_input_builder_l2block(block_trace: BlockTrace) { | ||
| let params = CircuitsParams { | ||
| max_rws: 4_000_000, | ||
| max_copy_rows: 0, // dynamic | ||
| max_txs: read_env_var("MAX_TXS", 128), | ||
| max_calldata: 2_000_000, | ||
| max_inner_blocks: 64, | ||
| max_bytecode: 3_000_000, | ||
| max_mpt_rows: 2_000_000, | ||
| max_poseidon_rows: 4_000_000, | ||
| max_keccak_rows: 0, | ||
| max_exp_steps: 100_000, | ||
| max_evm_rows: 0, | ||
| max_rlp_rows: 2_070_000, | ||
| ..Default::default() | ||
| }; | ||
|
|
||
| let mut builder = CircuitInputBuilder::new_from_l2_trace(params, block_trace, false) | ||
| .expect("could not handle block tx"); | ||
|
|
||
| builder | ||
| .finalize_building() | ||
| .expect("could not finalize building block"); | ||
|
|
||
| log::trace!("CircuitInputBuilder: {:#?}", builder); | ||
|
|
||
| let mut block = witness::block_convert(&builder.block, &builder.code_db).unwrap(); | ||
| block.apply_mpt_updates(&builder.mpt_init_state.unwrap()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn local_l2_trace() { | ||
| log_init(); | ||
| let file_path = read_env_var("TRACE_FILE", "dump.json".to_string()); | ||
| let fd = File::open(file_path).unwrap(); | ||
| let trace: BlockTrace = serde_json::from_reader(fd).unwrap(); | ||
|
|
||
| test_circuit_input_builder_l2block(trace); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.