This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 854
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
State Circuit: Refactor word_rlc into word lo/hi (#1423)
### Description State Circuit: Refactor word_rlc into word lo/hi ### Issue Link - #1382 ### Contents - As expected, changing rlc encoded values into `word::Word`, as defined in [`rw_table` specs](https://github.com/privacy-scaling-explorations/zkevm-specs/blob/master/specs/tables.md#rw_table) - Add helper methods to `ConstraintBuilder` (like `require_word_zero` ) - Make MPI able to manage multi-field values (to be able to use U256's) - Remove `random_linear_combination.rs` because Word uses MPI instead rlc - Removed test focused on test rlc - Removed unused field `aux1` and renamed `aux2` to `init_val` - Added helper methods to `word::Word` - Also updated `mpt` witness to pass the state tests ### Rationale The lexicographic ordering, used word_rlc randomness for [another use](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/e3e6034a11349cb07dd08e88026e3ca40d771a66/zkevm-circuits/src/state_circuit/lexicographic_ordering.rs#L312). Since this randomess is going to be removed, we have three options here: - Use another method to build the constraints that does not uses rlc at all - Create another challenge value - Use another existing randomness In order to change only the code concerning hi/lo refactor, the choice is to use the [keccak randomness](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/e3e6034a11349cb07dd08e88026e3ca40d771a66/zkevm-circuits/src/state_circuit.rs#L97) instead
- Loading branch information
Showing
16 changed files
with
615 additions
and
728 deletions.
There are no files selected for viewing
This file contains 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 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
262 changes: 151 additions & 111 deletions
262
zkevm-circuits/src/state_circuit/constraint_builder.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub(super) const N_LIMBS_RW_COUNTER: usize = 2; | ||
pub(super) const N_LIMBS_ACCOUNT_ADDRESS: usize = 10; | ||
pub(super) const N_LIMBS_ID: usize = 2; | ||
pub(super) const N_LIMBS_WORD: usize = 16; |
Oops, something went wrong.