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

Memory opt with word look up #466

Merged
merged 134 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
484b066
add MemoryWordAddress gadget and todos
DreamWuGit Apr 13, 2023
5a28d4d
update buss mapping MemoryOp with word type value
DreamWuGit Apr 14, 2023
d559e4e
update mload/mstore with memory word
DreamWuGit Apr 17, 2023
097b843
fix mload buss mapping test
DreamWuGit Apr 17, 2023
67b0208
add evm circuit with new memory word type and fix mstore circuit test…
DreamWuGit Apr 17, 2023
41b9bf9
fix mload&mstor8 circuit
DreamWuGit Apr 17, 2023
ce2e6c9
udpate error invalid creation code circuit
DreamWuGit Apr 18, 2023
e022f88
update calldataload buss mapping
DreamWuGit Apr 18, 2023
103ee05
fix calldataload buss map test
DreamWuGit Apr 18, 2023
0e346d9
update calldataload circuit&test pass
DreamWuGit Apr 19, 2023
4fb963e
update log* sha3 calldatacopy buss mapping tests
DreamWuGit Apr 19, 2023
0765b97
add state circuit constraint for memory word tag
DreamWuGit Apr 19, 2023
f83a4bf
copy circuit buss mapping add mask field into copy event
DreamWuGit Apr 21, 2023
ba676df
copy circuit add value_wrod_rlc
DreamWuGit Apr 23, 2023
fe2adfa
add word_index into copy table and align calldata to word
DreamWuGit Apr 24, 2023
b8013f0
merging
DreamWuGit Apr 24, 2023
e973c0a
fix word_index lt gate issue and move some columns
DreamWuGit Apr 26, 2023
6853367
fix memor word lookup & rw counter
DreamWuGit Apr 27, 2023
2feb995
calldatacopy fix evm circuit root test
DreamWuGit May 2, 2023
c28f030
fix calldatacopy evm circuit internal test, memory offset overflow fail
DreamWuGit May 3, 2023
da083e9
fix codecopy bussmapping and copy circuit test pass
DreamWuGit May 4, 2023
6a69416
update codecopy evm circuit
DreamWuGit May 4, 2023
6a7a745
update exrcodecopy and gen_copy_steps_for_log
DreamWuGit May 5, 2023
dc3f5c2
try log with byte lookup and refactor
DreamWuGit May 8, 2023
ea76c6e
update log* with log byte to word and disable rows[0].addr + 1 == row…
DreamWuGit May 9, 2023
3146962
update sha3 copy circuit & evm circuit
DreamWuGit May 9, 2023
f997e5b
Fix test case `test_precompiled_call` in CALL OP. (#485)
silathdiir May 9, 2023
2b69717
fix log with non zero start slot and comment multi buss mapping tests
DreamWuGit May 10, 2023
7f086bc
add create/return test into copy circuit
DreamWuGit May 12, 2023
f381072
update return non root non create to generate diff r/w bytes
DreamWuGit May 25, 2023
b881f21
reading with writing word one by one
DreamWuGit May 25, 2023
b900b84
[feat] returndatacopy implemented (#506)
lightsing Jun 1, 2023
1bea293
some fix
DreamWuGit Jun 1, 2023
ffef4e2
enable and remove state circuit tods
DreamWuGit Jun 2, 2023
2add141
recover test for MemoryWordOp
lightsing Jun 5, 2023
6b8608d
recover test for TxLogOp
lightsing Jun 5, 2023
9118de3
mask is boolean
lightsing Jun 7, 2023
e9ada94
word_index [0--32] increase by 1
lightsing Jun 7, 2023
84d2a70
fix copy circuit degree increase issue
DreamWuGit Jun 7, 2023
c0ec655
update constraint for read=write vaule for non memory to memory
DreamWuGit Jun 9, 2023
ed4d3e4
enable addr change of copy circuit and rename is_word_continue
DreamWuGit Jun 10, 2023
91129f7
Apply suggestions from code review
DreamWuGit Jun 12, 2023
0cff5d2
merging & todo: update callop
DreamWuGit Jun 13, 2023
eed0fa7
Merge branch 'memory_opt' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jun 13, 2023
1224c0f
fix not enough row
DreamWuGit Jun 14, 2023
dfc787e
memory_opt_opcodes: constraints for MLOAD/MSTORE/MSTORE8/CALLDATALOAD…
naure Jun 15, 2023
8a19276
fix codecopy & log test failures
DreamWuGit Jun 17, 2023
3c6cedb
fix return/create test failures
DreamWuGit Jun 19, 2023
c95b4ce
fix returndatacopy& insufficient balance in create
DreamWuGit Jun 20, 2023
bf295fb
fix calldatacopy and some clippy
DreamWuGit Jun 21, 2023
d8d2380
add constraint for rw counter (#532)
lightsing Jun 21, 2023
92b5a22
restore addr contraint
DreamWuGit Jun 21, 2023
9be2bb2
Fix/callop memory (#555)
lightsing Jun 26, 2023
2045888
fix degree issue
DreamWuGit Jun 26, 2023
399049a
sync & resolve conflict
DreamWuGit Jun 26, 2023
2cc3672
using real length in copy table lookup (#565)
lightsing Jun 28, 2023
d815dd0
fix clippy
lightsing Jun 28, 2023
7a7fb5b
replace print to trace
lightsing Jun 28, 2023
de4cedc
do not need to suppress theses
lightsing Jun 28, 2023
a896165
Merge remote-tracking branch 'origin/develop' into memory_opt
lightsing Jun 28, 2023
33c2b63
fix import
lightsing Jun 28, 2023
e55d0b0
fix other crates
lightsing Jun 28, 2023
60fc7b6
fix incomplete comment
lightsing Jun 28, 2023
9ddc105
Merge remote-tracking branch 'scroll/develop' into memory_opt
lispc Jun 28, 2023
85fd6fb
Merge branch 'memory_opt' of github.com:scroll-tech/zkevm-circuits in…
lispc Jun 28, 2023
4a358f2
Add condition for input, output and return bytes for precompile (as b…
silathdiir Jun 28, 2023
5a69b35
Fix to calculate copy length as the minimum value (as bus-mapping). (…
silathdiir Jun 29, 2023
0361459
remove Memory related codes (#574)
lightsing Jun 30, 2023
28d3592
Memory opt update (#541)
naure Jul 4, 2023
bcaf2bc
Merge branch 'develop' into memory_opt
DreamWuGit Jul 4, 2023
7340a21
refactor memory_write_word_prev_bytes to memory_write_word
DreamWuGit Jul 5, 2023
2d6b12f
fix clippy
lightsing Jul 5, 2023
1960f12
misc updates
DreamWuGit Jul 5, 2023
c021d67
fix constraint
lightsing Jul 5, 2023
e9cfffa
Merge remote-tracking branch 'origin/develop' into memory_opt
lightsing Jul 5, 2023
8e9dfb9
fix merge
lightsing Jul 5, 2023
33db3b5
fix fmt & remove unused comment
DreamWuGit Jul 5, 2023
9788372
codecopy buss mapping memory word test
DreamWuGit Jul 5, 2023
7cd0389
update sha3 test and mark get_addr_shift_slot deprecated
lightsing Jul 5, 2023
fdd3bb3
better to use usize in addresses
lightsing Jul 5, 2023
9ae1adf
refactor to use Memory::align_range
DreamWuGit Jul 5, 2023
498b473
Merge branch 'memory_opt' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jul 5, 2023
700c757
fix clippy
lightsing Jul 5, 2023
b483bce
use Memory::align_range for return_revert
lightsing Jul 5, 2023
fc85ecf
remove unnecessary cast
lightsing Jul 5, 2023
0580f74
add a cfg
lightsing Jul 5, 2023
85036c1
rename MemoryWord back to Memory
lispc Jul 5, 2023
5dd5650
rename MemoryWord back to Memory
lispc Jul 5, 2023
78a9716
disable memory tracing by default
lispc Jul 5, 2023
0d24090
fix some typos
lispc Jul 5, 2023
980b747
use &memory_updated
DreamWuGit Jul 6, 2023
eff06e3
include copy_rwc_inc in rw_offset
lispc Jul 6, 2023
4e6c292
Merge branch 'memory_opt' of github.com:scroll-tech/zkevm-circuits in…
lispc Jul 6, 2023
93278b9
refactor helper get_copy_bytes
DreamWuGit Jul 6, 2023
cc61825
Merge branch 'memory_opt' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jul 6, 2023
8029f28
not a soundness problem anymore
lightsing Jul 6, 2023
fb72d3d
apply review
lightsing Jul 6, 2023
ba6a42c
refactor write_chunks&write_chunk_for_copy_step
DreamWuGit Jul 6, 2023
33fffd4
Merge branch 'memory_opt' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jul 6, 2023
cfc73c8
Merge branch 'develop' into memory_opt
DreamWuGit Jul 7, 2023
b6e2f51
Merge branch 'develop' into memory_opt
DreamWuGit Jul 10, 2023
0c246f8
Memory opt refactor (#603)
lightsing Jul 10, 2023
c0fb76d
refactor for all copy bytes using rlc_acc equality (#604)
DreamWuGit Jul 10, 2023
a38e944
resolve conflicts
DreamWuGit Jul 11, 2023
5ef6c95
fix return_revert
DreamWuGit Jul 11, 2023
5431861
copy_simplify_addr: always increment the address (#609)
naure Jul 11, 2023
702eceb
merge and resolve conflict
DreamWuGit Jul 12, 2023
d4aa0ad
Merge branch 'memory_opt' of https://github.com/scroll-tech/zkevm-cir…
DreamWuGit Jul 12, 2023
3b251b2
fix begin_tx copy event
DreamWuGit Jul 12, 2023
dff3bf5
fix clippy
DreamWuGit Jul 12, 2023
b466fb8
fix scroll feature test failure
DreamWuGit Jul 12, 2023
b1fd90c
Copy: fix conditions (#616)
naure Jul 12, 2023
7f0043f
memory_opt_word_end: replace broken LtChip with IsEqualChip (#617)
naure Jul 12, 2023
7d03da0
memory_opt_pad: replace LtChip with a simple column (#620)
naure Jul 12, 2023
108f8b6
memory_opt: Ensure that the word operation completes.
Jul 13, 2023
bb00e36
memory_opt_rlc: simplify rlc_acc check (#621)
naure Jul 13, 2023
830312d
word_rlc: introduce value_prev in copy circuit (#626)
naure Jul 13, 2023
8122338
memory_opt_length: constrain length and mask (#628)
naure Jul 13, 2023
212e12d
memory_opt_rwc: fix and simplify RW counter logic (#631)
naure Jul 13, 2023
9e559e5
memory_opt: Prevent an event from spilling into the disabled rows.
Jul 13, 2023
7e9ed9a
Delete `memory.clone` in invalid-creation-code error. (#632)
silathdiir Jul 14, 2023
5c5995e
memory_opt: value column is in the first phase
Jul 13, 2023
600fda3
Merge branch 'develop' into memory_opt
lispc Jul 14, 2023
61902a0
memory_opt_check_align: require aligned memory addresses in State (#634)
naure Jul 14, 2023
4eecece
Copy: remove LtChip (#635)
naure Jul 14, 2023
cfbeb7f
memory_opt_readability: give a name to Rotations (#636)
naure Jul 14, 2023
3963a69
memory_opt: organize variables and comments
Jul 14, 2023
72eaa1c
Copy Gadgets (#637)
naure Jul 15, 2023
9474a74
memory_opt: remove unnecessary is_event column
Jul 15, 2023
33c0ccb
memory_opt: remove duplicate code in CopyTable::assignments (#638)
naure Jul 16, 2023
1738239
memory_opt: hide details of extend_at_least
Jul 15, 2023
ad02341
Avoid whole memory clone when generating copy steps (#629)
silathdiir Jul 16, 2023
9c8470b
Merge branch 'memory_opt' of github.com:scroll-tech/zkevm-circuits in…
Jul 15, 2023
958e85b
Fix failed testool cases for memory-copy. (#642)
silathdiir Jul 17, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ jobs:
with:
name: Clippy
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings -Aunused_variables -Aclippy::format_in_format_args -Aclippy::uninlined_format_args -Aclippy::unnecessary_cast
args: --all-features --all-targets -- -D warnings
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions aggregator/src/compression/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ impl CompressionConfig {
pub fn configure(meta: &mut ConstraintSystem<Fr>, params: ConfigParams) -> Self {
assert!(
params.limb_bits == BITS && params.num_limbs == LIMBS,
"For now we fix limb_bits = {}, otherwise change code",
BITS
"For now we fix limb_bits = {BITS}, otherwise change code",
);
let base_field_config = FpConfig::configure(
meta,
Expand Down
7 changes: 4 additions & 3 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ use ethers_core::{
};
use ethers_providers::JsonRpcClient;
pub use execution::{
CopyDataType, CopyEvent, CopyStep, ExecState, ExecStep, ExpEvent, ExpStep, NumberOrHash,
CopyBytes, CopyDataType, CopyEvent, CopyEventStepsBuilder, CopyStep, ExecState, ExecStep,
ExpEvent, ExpStep, NumberOrHash,
};
use hex::decode_to_slice;

Expand Down Expand Up @@ -330,7 +331,7 @@ impl<'a> CircuitInputBuilder {
.rev()
{
log::debug!(
"op {:?}, count {}, mem rw {}(avg {:.2}), stack rw {}(avg {:.2})",
"op {:?}, count {}, memory_word rw {}(avg {:.2}), stack rw {}(avg {:.2})",
op,
count,
mem,
Expand All @@ -339,7 +340,7 @@ impl<'a> CircuitInputBuilder {
*stack as f32 / *count as f32
);
}
log::debug!("memory num: {}", self.block.container.memory.len());
log::debug!("memory_word num: {}", self.block.container.memory.len());
log::debug!("stack num: {}", self.block.container.stack.len());
log::debug!("storage num: {}", self.block.container.storage.len());
log::debug!(
Expand Down
6 changes: 4 additions & 2 deletions bus-mapping/src/circuit_input_builder/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ pub struct Call {
pub call_id: usize,
/// Caller's id.
pub caller_id: usize,
/// Last Callee's id.
pub last_callee_id: usize,
/// Type of call
pub kind: CallKind,
/// This call is being executed without write access (STATIC)
Expand Down Expand Up @@ -91,10 +89,14 @@ pub struct Call {
pub return_data_offset: u64,
/// Return data length
pub return_data_length: u64,
/// Last Callee's id.
pub last_callee_id: usize,
/// last callee's return data offset
pub last_callee_return_data_offset: u64,
/// last callee's return data length
pub last_callee_return_data_length: u64,
/// last callee's memory
pub last_callee_memory: Memory,
DreamWuGit marked this conversation as resolved.
Show resolved Hide resolved
}

impl Call {
Expand Down
Loading
Loading