Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat word hi-lo refactor #963

Open
wants to merge 106 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
bd6cc37
add fundamental utils
DreamWuGit Sep 20, 2023
ca5c41e
update some math gadgets & cb helpers
DreamWuGit Sep 21, 2023
36753ed
update common gadgets
DreamWuGit Sep 24, 2023
f323b2a
update most opcodes
DreamWuGit Sep 25, 2023
da72879
update memory gadgets etc.
DreamWuGit Sep 27, 2023
99f6178
update create,returndatacopy etc.
DreamWuGit Sep 28, 2023
7fb9278
update begin_tx callop etc.
DreamWuGit Oct 7, 2023
86a5362
update query_word_rlc
DreamWuGit Oct 7, 2023
763fdd9
update blockctx, logs etc
DreamWuGit Oct 8, 2023
616da92
Word hi low precompiles (#994)
darth-cy Oct 9, 2023
5805934
udpate l1fee, rlp, selfbalance etc
DreamWuGit Oct 10, 2023
052d45b
update end_block gasprice & some error cases
DreamWuGit Oct 11, 2023
da07f2b
fix some build errors
DreamWuGit Oct 12, 2023
6632d78
fix word assign issues
DreamWuGit Oct 12, 2023
b4bedc6
udpate rw table etc.
DreamWuGit Oct 16, 2023
c8511c9
update state circuit constrain builder& dev
DreamWuGit Oct 18, 2023
2274ca1
update state circuit: mpi, lookups etc
DreamWuGit Oct 19, 2023
b0ff99d
state circuit udpate assign, state roots export
DreamWuGit Oct 23, 2023
3ad2e7c
some update for MptUpdateRow
DreamWuGit Oct 24, 2023
ea38209
update creating and merge develop
DreamWuGit Oct 25, 2023
2db1dfb
fix some issue
DreamWuGit Oct 25, 2023
ac2ce70
update keccak circuit, bytecode circuit
DreamWuGit Oct 26, 2023
f28ac6e
update copy circuit
DreamWuGit Oct 27, 2023
ba56761
keep old output_rlc
DreamWuGit Oct 31, 2023
0439eba
fix mpt related
DreamWuGit Nov 1, 2023
2a47e89
temp disable exports word equal checking and fix issues
DreamWuGit Nov 2, 2023
7be0753
update mpt table & disable test
DreamWuGit Nov 3, 2023
608275b
fix Ltword issue
DreamWuGit Nov 6, 2023
1796e71
Use hi-lo PR (#1016)
z2trillion Nov 7, 2023
734f9a6
fix state circuit test failures, degree increase by 1
DreamWuGit Nov 8, 2023
bb129bf
fix some evm circuit issues
DreamWuGit Nov 9, 2023
83984a3
fix copytable load etc. issue
DreamWuGit Nov 9, 2023
4e4fb70
fix memory copy lookup
DreamWuGit Nov 10, 2023
b39e084
fix copy constrain_id and part of keccak lookup
DreamWuGit Nov 10, 2023
a7ab6a7
fix returndatacopy, disable keccak looup begin_tx
DreamWuGit Nov 10, 2023
37228fb
fix create keccak lookup
DreamWuGit Nov 13, 2023
7c56acf
fix calldataload value assign
DreamWuGit Nov 13, 2023
2d4438d
fix bytecode empty_word
DreamWuGit Nov 14, 2023
5dfc55e
fix codehash in test
DreamWuGit Nov 15, 2023
afbced7
fix state circuit degree
DreamWuGit Nov 15, 2023
efcdd04
fix scroll feature related
DreamWuGit Nov 17, 2023
ad70e3f
add poseidon_code_hash column and lookup poseidon table
DreamWuGit Nov 17, 2023
2a32527
fix poseidoncode hash assign and related
DreamWuGit Nov 19, 2023
df89ad7
fix blockhash, endtx, excodehash in poseidon feature
DreamWuGit Nov 20, 2023
9e7ff97
fix create posedion hash
DreamWuGit Nov 20, 2023
35ee2c6
disable pi circuit keccak lookup, do it in stage2
DreamWuGit Nov 20, 2023
a8d447d
fix precompiles lookup error
DreamWuGit Nov 22, 2023
08e9640
remove unused imports
DreamWuGit Nov 25, 2023
0b4112b
ajust MAX_STEP_HEIGHT to avoid end_block occupy > 1 row
DreamWuGit Nov 27, 2023
0f26886
fix PrecompileFailedGadget callee_address
DreamWuGit Nov 27, 2023
4ccce98
merge to main&resolve conflicts
DreamWuGit Nov 28, 2023
930cdf5
pick mpt test fixes by mason
DreamWuGit Nov 28, 2023
3be910e
fix ecrecover recovered_addr_keccak rebasing
DreamWuGit Nov 28, 2023
7281f12
fix most clippy issues
DreamWuGit Nov 29, 2023
8763727
Fix mpt circuit lookups (#1046)
z2trillion Nov 29, 2023
04c5113
update blcokctx after rebase
DreamWuGit Nov 29, 2023
cffde0a
sycn latest develop and update cell assign
DreamWuGit Nov 30, 2023
3c2d787
fix clippys
DreamWuGit Nov 30, 2023
f233f7f
update word cell assign option
DreamWuGit Dec 1, 2023
2ae3542
Merge commit '17351c6290b8efb88ae39c04c5bd2ffe2fa161c9' into word_hi_lo
silathdiir Dec 1, 2023
2f578b1
Merge commit '07cf6bd31df5a06cd6b19bf66880973e985a5b41' into word_hi_lo
silathdiir Dec 1, 2023
e36007d
Merge commit '7fa17b18f669f9a13a860b239cbe4bbbe1706c22' into word_hi_lo
silathdiir Dec 1, 2023
b7d74e3
Merge branch 'develop' into word_hi_lo
silathdiir Dec 4, 2023
88f2d72
Increase `STEP_WIDTH` to fix CI of scroll feature.
silathdiir Dec 4, 2023
41f5d0d
Fix to not `unwrap` for `AssignedCell` when calling function `assign`…
silathdiir Dec 4, 2023
8d64e46
Try to enable all tests in super-circuit.
silathdiir Dec 4, 2023
bb76423
Comment out `serial_test_super_circuit_1tx_deploy_2max_tx`.
silathdiir Dec 4, 2023
2cc777d
some cleanup
DreamWuGit Dec 6, 2023
f827019
Merge branch 'develop' into word_hi_lo
lightsing Dec 6, 2023
5651173
Update bytecode_unroller.rs
lispc Dec 6, 2023
24385b5
use v0.8 mpt-circuits
lightsing Dec 7, 2023
a619084
Merge remote-tracking branch 'origin/develop' into word_hi_lo
silathdiir Dec 11, 2023
5b39183
Fix access-list to hi-lo in copy-circuit.
silathdiir Dec 11, 2023
453ff8a
renable missing constraint of create & some clean up
DreamWuGit Dec 12, 2023
56b22a6
cleanup comments
DreamWuGit Dec 12, 2023
d6066da
Merge branch 'develop' into word_hi_lo
DreamWuGit Dec 12, 2023
30f821e
bug: fix callee address of hi-lo in CALL OP (for testool cases) (#1055)
silathdiir Dec 13, 2023
9a02431
fix test tool assign overflow of create (#1062)
DreamWuGit Dec 14, 2023
d566e26
use unwrap_or_default
DreamWuGit Dec 14, 2023
52426de
Merge branch 'word_hi_lo' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Dec 14, 2023
727c20f
feat: word hi lo refactor stage2 (#1069)
DreamWuGit Jan 23, 2024
146ae5d
merge to main, will fix left merging build error
DreamWuGit Jan 25, 2024
577bc07
update access list, eip1559 gadgets to word type
DreamWuGit Jan 25, 2024
501949a
fix state circuit merging error
DreamWuGit Jan 25, 2024
6d85bde
try update tx circuit access list lookup
DreamWuGit Jan 25, 2024
c4d1d60
enlarge STEP_WIDTH
DreamWuGit Jan 26, 2024
9c22c46
fix eip1559 tx lookup
DreamWuGit Jan 29, 2024
40fe794
scroll feature needs more STEP_WIDTH
DreamWuGit Jan 29, 2024
6e2d12a
remove some todos comments
DreamWuGit Jan 29, 2024
8084fc0
update require_equal_unaligned_word
DreamWuGit Jan 30, 2024
15e6872
fix clippy
DreamWuGit Jan 30, 2024
28bf326
Merge branch 'develop' into word_hi_lo
DreamWuGit Jan 30, 2024
b197de7
fix address too big for balance gadget found by test tool
DreamWuGit Jan 31, 2024
0482fee
Merge branch 'word_hi_lo' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jan 31, 2024
57b988c
Merge branch 'develop' into word_hi_lo
DreamWuGit Jan 31, 2024
b42d763
Merge branch 'develop' into word_hi_lo
DreamWuGit Jan 31, 2024
2979f63
enable missing serial_test_super_circuit_1tx_deploy_2max_tx
DreamWuGit Jan 31, 2024
1f9b601
revise & cleanup comments for tx circuit related
DreamWuGit Feb 1, 2024
d321c9e
minor update for sig& super circuit
DreamWuGit Feb 1, 2024
ef1fd70
rename rpi_rlc_acc_word
DreamWuGit Feb 2, 2024
5864288
remove some outdated todos
DreamWuGit Feb 2, 2024
5756d65
merge cancun2 change(tload, tstore, mcopy) into word hi-lo (#1104)
DreamWuGit Feb 2, 2024
cc89aa0
fix build error by merge cancun changes
DreamWuGit Feb 2, 2024
4265368
fix merge conflicts
DreamWuGit Feb 18, 2024
1a1a38a
update merging affair
DreamWuGit Feb 18, 2024
82d1066
Merge branch 'develop' into word_hi_lo
lispc Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix ecrecover recovered_addr_keccak rebasing
DreamWuGit committed Nov 28, 2023
commit 3be910ea9d87e4a4c22609e9deb18c58e494577d
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/callvalue.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ use crate::{
util::{
common_gadget::SameContextGadget,
constraint_builder::{EVMConstraintBuilder, StepStateTransition, Transition::Delta},
CachedRegion, Cell,
CachedRegion,
},
witness::{Block, Call, ExecStep, Transaction},
},
3 changes: 1 addition & 2 deletions zkevm-circuits/src/evm_circuit/execution/chainid.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ use crate::{
util::{
common_gadget::SameContextGadget,
constraint_builder::{EVMConstraintBuilder, StepStateTransition, Transition::Delta},
from_bytes, CachedRegion,
CachedRegion,
},
witness::{Block, Call, ExecStep, Transaction},
},
@@ -18,7 +18,6 @@ use crate::{
use bus_mapping::evm::OpcodeId;
use eth_types::Field;
use halo2_proofs::plonk::Error;
use itertools::chain;

#[derive(Clone, Debug)]
pub(crate) struct ChainIdGadget<F> {
Original file line number Diff line number Diff line change
@@ -174,8 +174,11 @@ impl<F: Field> ExecutionGadget<F> for ErrorPrecompileFailedGadget<F> {
F::from(opcode.as_u64()) - F::from(OpcodeId::STATICCALL.as_u64()),
)?;
self.gas.assign_u256(region, offset, gas)?;
self.callee_address
.assign(region, offset, Value::known(F::from(callee_address.as_u64())))?;
self.callee_address.assign(
region,
offset,
Value::known(F::from(callee_address.as_u64())),
)?;
self.value.assign_u256(region, offset, value)?;
self.cd_address
.assign(region, offset, cd_offset, cd_length)?;
1 change: 0 additions & 1 deletion zkevm-circuits/src/evm_circuit/execution/gas.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
evm_circuit::{
execution::ExecutionGadget,
param::N_BYTES_GAS,
step::ExecutionState,
util::{
common_gadget::SameContextGadget,
1 change: 0 additions & 1 deletion zkevm-circuits/src/evm_circuit/execution/mul_div_mod.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ use crate::{
execution::ExecutionGadget,
step::ExecutionState,
util::{
self,
common_gadget::SameContextGadget,
constraint_builder::{
ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition,
1 change: 0 additions & 1 deletion zkevm-circuits/src/evm_circuit/execution/mulmod.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ use crate::{
execution::ExecutionGadget,
step::ExecutionState,
util::{
self,
common_gadget::SameContextGadget,
constraint_builder::{
ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition,
Original file line number Diff line number Diff line change
@@ -282,7 +282,7 @@ impl<F: Field> ExecutionGadget<F> for EcrecoverGadget<F> {
cb.require_equal(
"output bytes (RLC) = recovered address",
output_bytes_rlc.expr(),
cb.word_rlc::<N_BYTES_ACCOUNT_ADDRESS>(
cb.keccak_rlc::<N_BYTES_ACCOUNT_ADDRESS>(
recovered_addr_keccak.clone().limbs.map(|cell| cell.expr()),
),
);
1 change: 0 additions & 1 deletion zkevm-circuits/src/evm_circuit/execution/shl_shr.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ use crate::{
step::ExecutionState,
table::{FixedTableTag, Lookup},
util::{
self,
common_gadget::SameContextGadget,
constraint_builder::{
ConstrainBuilderCommon, EVMConstraintBuilder, StepStateTransition,
3 changes: 1 addition & 2 deletions zkevm-circuits/src/evm_circuit/param.rs
Original file line number Diff line number Diff line change
@@ -7,10 +7,9 @@ use halo2_proofs::{
use std::collections::HashMap;

// Step dimension
pub(crate) const STEP_WIDTH: usize = 150;
pub(crate) const STEP_WIDTH: usize = 143;
/// Step height
pub const MAX_STEP_HEIGHT: usize = 22;
//pub const MAX_STEP_HEIGHT: usize = 19;

/// The height of the state of a step, used by gates that connect two
/// consecutive steps. We target 1, which is also convenient for padding with
4 changes: 2 additions & 2 deletions zkevm-circuits/src/evm_circuit/step.rs
Original file line number Diff line number Diff line change
@@ -292,8 +292,8 @@ impl ExecutionState {
]
}
}
#[cfg(feature = "scroll")]
Self::DIFFICULTY => vec![OpcodeId::DIFFICULTY],
// #[cfg(feature = "scroll")]
// Self::DIFFICULTY => vec![OpcodeId::DIFFICULTY],
Self::CHAINID => vec![OpcodeId::CHAINID],
Self::SELFBALANCE => vec![OpcodeId::SELFBALANCE],
Self::POP => vec![OpcodeId::POP],
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use crate::{
},
},
util::{
word::{Word, Word32, Word32Cell, WordCell, WordExpr},
word::{Word, Word32, Word32Cell, WordExpr},
Expr,
},
};
3 changes: 1 addition & 2 deletions zkevm-circuits/src/evm_circuit/util/math_gadget/cmp_words.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{
evm_circuit::util::{
self, constraint_builder::EVMConstraintBuilder, from_bytes, math_gadget::*, select,
CachedRegion,
constraint_builder::EVMConstraintBuilder, from_bytes, math_gadget::*, select, CachedRegion,
},
util::{
word::{Word32Cell, WordExpr},
2 changes: 1 addition & 1 deletion zkevm-circuits/src/state_circuit.rs
Original file line number Diff line number Diff line change
@@ -1108,7 +1108,7 @@ fn queries<F: Field>(meta: &mut VirtualCells<'_, F>, c: &StateCircuitConfig<F>)
+ meta.query_advice(first_different_limb.bits[4], Rotation::cur());

let mpt_update_table_expressions = c.mpt_table.table_exprs(meta);
assert_eq!(mpt_update_table_expressions.len(), 12);
assert_eq!(mpt_update_table_expressions.len(), 13);

let meta_query_word =
|metap: &mut VirtualCells<'_, F>, word_column: word::Word<Column<Advice>>, at: Rotation| {