Conversation
…_stored and balance_stored values
…e account in trie)
### Description New descriptors are used which have `Vec<Node>` structure and thus the conversion in `witness_row.rs` from `[][]byte` to `Vec<Node>` was removed. Note that `keccak_data` is now part of the `Node` struct - each node holds the byte streams that need to be hashed. Additionally, an MPT benchmark was added (some structs needed to be made public). ### Type of change - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] This change requires a documentation update ### Contents - All tests updated. - `prepare_witness` function removed from `witness_row.rs`. - MPT test updated to not use `prepare_witness`. - Benchmark added.
### Description Just merges the MPT branch with the master, without fixing any issues (and so breaks the code). The actual merge is done in #1531, the only purpose of this PR is to have a nicer diff for the other PR without breaking the code in the current `mpt2` branch. ### Issue Link [_link issue here_] ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [X] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Contents - [_item_] ### Rationale [_design decisions and extended information_] ### How Has This Been Tested?
# Conflicts: # .github/workflows/test-features.yml # Cargo.lock # bus-mapping/src/circuit_input_builder.rs # bus-mapping/src/evm/opcodes.rs # bus-mapping/src/evm/opcodes/create.rs # integration-tests/Cargo.toml # integration-tests/src/bin/gen_blockchain_data.rs # testool/Cargo.toml # zkevm-circuits/src/bytecode_circuit/circuit.rs # zkevm-circuits/src/bytecode_circuit/test.rs # zkevm-circuits/src/copy_circuit/dev.rs # zkevm-circuits/src/evm_circuit.rs # zkevm-circuits/src/evm_circuit/execution.rs # zkevm-circuits/src/evm_circuit/execution/error_invalid_jump.rs # zkevm-circuits/src/evm_circuit/execution/error_write_protection.rs # zkevm-circuits/src/evm_circuit/execution/push.rs # zkevm-circuits/src/evm_circuit/execution/stop.rs # zkevm-circuits/src/keccak_circuit.rs # zkevm-circuits/src/keccak_circuit/cell_manager.rs # zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs # zkevm-circuits/src/state_circuit.rs # zkevm-circuits/src/table.rs # zkevm-circuits/src/table/bytecode_table.rs # zkevm-circuits/src/table/mpt_table.rs # zkevm-circuits/src/util.rs # zkevm-circuits/src/util/cell_manager.rs # zkevm-circuits/src/witness/block.rs # zkevm-circuits/src/witness/bytecode.rs # zkevm-circuits/src/witness/mpt.rs
ChihChengLiang
left a comment
There was a problem hiding this comment.
I see the PR is getting closer to being merged.
@miha-stopar @Brechtpd @CeciliaZ030 Epic work on MPT!
Question for any of you: Is there anything you think the reviewers can focus on reviewing it? Otherwise, we can approve directly and unblock the merge.
Currently, I only quickly checked the files to see if any leftover files that shouldn't be included. The PR looks great for this part.
|
I think the most important thing is that the non-MPT specific changes are all good to go. If that's okay I think should be okay to merge in so it's easier to keep in sync/improve on/integrate better with the other code afterwards. For a bit deeper review, I think also good to take a quick look at the main circuit implementation files ( I think the other files don't need much looking into for now unless to check how something works a bit more deeply. They are used only in the MPT circuit and the code there should be shared better with the other circuits once this PR is merged in (quite a bit of duplication there now to prevent merge conflicts and keep the diff clean). |
ChihChengLiang
left a comment
There was a problem hiding this comment.
LGTM!
@Brechtpd Thanks for the reviewing guide!
This PR aims to provide the first version of Merkle Patricia Trie circuit. The witnesses are currently generated here. Lookups in the Keccak circuit are simulated using internal lookup table.
This branch replaces https://github.com/appliedzkp/zkevm-circuits/commits/merkle-patricia-trie (didn't rebase as it seems cleaner this way, will leave the old branch for a while before deleting it).