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

opt: add another bytecode circuit to improve super circuit capacity #1368

Merged
merged 108 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
aa199bd
add bytecode_table1 in evm circuit
DreamWuGit Jul 18, 2024
3ff9f7f
update input_exprs
DreamWuGit Jul 18, 2024
711e652
SameContextGadget add is_first_bytecode_table cell
DreamWuGit Jul 18, 2024
8ec42a9
update some opcodes
DreamWuGit Jul 18, 2024
d6e3cd4
modify assign_exec_step
DreamWuGit Jul 19, 2024
54a3168
assign_exec_step with block, call
DreamWuGit Jul 19, 2024
40df3d9
adjust block, call input position
DreamWuGit Jul 19, 2024
5315786
update opcodes
DreamWuGit Jul 19, 2024
59b93d2
update jump for destination lookup
DreamWuGit Jul 19, 2024
f9e1b4f
update jumpi
DreamWuGit Jul 19, 2024
87297de
fix jumpi
DreamWuGit Jul 21, 2024
299dac0
super circuit add bytecode circuit
DreamWuGit Jul 22, 2024
4eecb14
copy event add flag is_first_bytecode_circuit
DreamWuGit Jul 22, 2024
a27e41e
rename copy event/table new field
DreamWuGit Jul 22, 2024
b1fa3cf
modify table_row addr position
DreamWuGit Jul 23, 2024
5807ed0
constrain copy circuit new column
DreamWuGit Jul 23, 2024
ce03dee
conditionally lookup second bytecode table in copy circuit
DreamWuGit Jul 24, 2024
603ed4e
copy circuit refactor two table lookup into one
DreamWuGit Jul 24, 2024
12700e6
sync to develop branch
DreamWuGit Jul 25, 2024
c301908
revert CopyEvent change
DreamWuGit Jul 25, 2024
fb6c9c2
add algorithm find_two_closest_subset, remove old
DreamWuGit Jul 25, 2024
1ee185e
apply find_two_closest_subset for block bytecodes
DreamWuGit Jul 26, 2024
5613f90
modify copy circuit assign with bytecode_map
DreamWuGit Jul 26, 2024
f875411
add one more bytecode_table into evm circuit
DreamWuGit Jul 27, 2024
c1d2f72
supercircuit: get each sub circuit bytecodes and construct
DreamWuGit Jul 27, 2024
cd2b8e1
add feature: dual_bytecode
DreamWuGit Jul 28, 2024
8551505
updates per feature
DreamWuGit Jul 29, 2024
ad82e06
fix feature related
DreamWuGit Jul 29, 2024
ecb3ae8
update param per new feature
DreamWuGit Jul 29, 2024
5194bb2
change program_counter_offset to expression
DreamWuGit Jul 30, 2024
32d000e
fix stop gadget byte lookup
DreamWuGit Jul 30, 2024
51790f7
remove comment
DreamWuGit Jul 30, 2024
ddd4ca7
Merge branch 'develop' into bytecode_refactor
DreamWuGit Jul 30, 2024
8098a48
add feature dual_bytecode to scroll
DreamWuGit Jul 30, 2024
83da72b
Merge branch 'bytecode_refactor' of https://github.com/scroll-tech/zk…
DreamWuGit Jul 30, 2024
db71f72
fix types
DreamWuGit Jul 30, 2024
7f6b2d7
fix copy circuit test
DreamWuGit Jul 31, 2024
e3799b4
fix copytable lookup
DreamWuGit Jul 31, 2024
d2abb7f
add feature control
DreamWuGit Jul 31, 2024
028a273
update err msg
DreamWuGit Jul 31, 2024
d497f60
fix return_revert opcode lookup
DreamWuGit Jul 31, 2024
1e93155
update call lookup per feature
DreamWuGit Jul 31, 2024
03fc234
update common error gadget
DreamWuGit Jul 31, 2024
900c336
add BytecodeLengthGadget handle bytelen lookup
DreamWuGit Aug 1, 2024
e2f4db5
update invalidjumpi
DreamWuGit Aug 1, 2024
f5ef8ca
fix CommonErrorGadget
DreamWuGit Aug 1, 2024
efd85b2
update create/return
DreamWuGit Aug 1, 2024
8dcf14e
misc updates
DreamWuGit Aug 1, 2024
c75e748
temp fix error jump
DreamWuGit Aug 1, 2024
63d0475
mark feature
DreamWuGit Aug 2, 2024
e7f490e
refactor & fix extcodecopy regarding bytelength gadget
DreamWuGit Aug 2, 2024
acac805
fix return_data test
DreamWuGit Aug 2, 2024
cfbfe3c
add missing feature
DreamWuGit Aug 2, 2024
b039eee
update ErrorPrecompileFailed
DreamWuGit Aug 2, 2024
52acac9
fix extcodecopy non existing address
DreamWuGit Aug 3, 2024
caad244
revise lookup_opcode
DreamWuGit Aug 5, 2024
da3ace2
modify copy circuit try to fix
DreamWuGit Aug 5, 2024
73298d4
remove feature on err msg
DreamWuGit Aug 5, 2024
a36461a
clean up debug info
DreamWuGit Aug 7, 2024
e3e937c
extract helpers to get bytecode and map info
DreamWuGit Aug 7, 2024
3e69657
fix type
DreamWuGit Aug 7, 2024
f2a35a2
modify BytecodeCircuit::<Fr>::min_num_rows_block to return max rows
DreamWuGit Aug 7, 2024
5eaf47d
fix default build
DreamWuGit Aug 7, 2024
ce6b463
use BytecodeLengthGadget
DreamWuGit Aug 8, 2024
573b86b
add feature
DreamWuGit Aug 8, 2024
8749437
use lookup_opcode
DreamWuGit Aug 8, 2024
a3a88de
remvoe is_code parameter
DreamWuGit Aug 8, 2024
068a312
remove outdated
DreamWuGit Aug 8, 2024
cdb9221
update comment
DreamWuGit Aug 8, 2024
933df22
refactor lookup_opcode_with_push_rlc helper
DreamWuGit Aug 9, 2024
0619b79
fix some clippy, remaining some
DreamWuGit Aug 9, 2024
fb46b88
fix clippy
DreamWuGit Aug 9, 2024
121a5aa
refactor is_first_bytecode_table
DreamWuGit Aug 9, 2024
e15a29e
update helper names
DreamWuGit Aug 9, 2024
3dbd977
add BytecodeLookupGadget for opcodes that don't use samecontext gadget
DreamWuGit Aug 12, 2024
588420e
create/return use BytecodeLookupGadget
DreamWuGit Aug 12, 2024
1d9bc91
error precompile use BytecodeLookupGadget
DreamWuGit Aug 12, 2024
60fb665
BytecodeLengthGadget adds is_first_bytecode_table cell
DreamWuGit Aug 13, 2024
4fa3e1a
stop use BytecodeLookupGadget
DreamWuGit Aug 13, 2024
d61401a
remove feature for bytecode_map
DreamWuGit Aug 13, 2024
2294656
fix bytecode_map
DreamWuGit Aug 13, 2024
4e0e532
samecontext etc remove feature
DreamWuGit Aug 13, 2024
3508e3e
remove some feature cfg
DreamWuGit Aug 14, 2024
9191c93
byte length gadget assign etc.
DreamWuGit Aug 14, 2024
a2fd554
fix clippy
DreamWuGit Aug 14, 2024
1d67f4a
update bytecode len gadget constraint
DreamWuGit Aug 14, 2024
cb32403
fix fmt
DreamWuGit Aug 14, 2024
1295da5
remove wrong constraint
DreamWuGit Aug 14, 2024
169e6c7
sync upstream & conflict fix
DreamWuGit Aug 19, 2024
09c16c2
fix failures
DreamWuGit Aug 19, 2024
62189ac
remove program_counter_offset and local rand test pass
DreamWuGit Aug 21, 2024
c7aa565
figure out why combination bytecode table not work and remove comment
DreamWuGit Aug 23, 2024
e2312de
add rows_required helper
DreamWuGit Aug 26, 2024
5fefdcd
try use greedy_simple_partition
DreamWuGit Aug 29, 2024
922665b
Merge branch 'develop' into bytecode_refactor
DreamWuGit Aug 29, 2024
ae26cba
tmp remove dual_bytecode from scroll feature list
DreamWuGit Aug 29, 2024
0054cf1
Merge branch 'bytecode_refactor' of https://github.com/scroll-tech/zk…
DreamWuGit Aug 29, 2024
8352d77
restore dual_bytecode in scroll feature list
DreamWuGit Aug 30, 2024
e71abd6
revise comment
DreamWuGit Aug 30, 2024
2ee6d59
greedy_simple_partition with generic type
DreamWuGit Aug 30, 2024
b7a52fe
replace log::error
DreamWuGit Aug 30, 2024
5e840fa
add comment to explain stable sort helper
DreamWuGit Sep 2, 2024
0786aca
rename feature dual-bytecode
DreamWuGit Sep 4, 2024
6d28019
minor updates
DreamWuGit Sep 4, 2024
8d85582
some minor change per review
DreamWuGit Sep 4, 2024
7fd191a
clean up extcodecopy's is_first_bytecode_table
DreamWuGit Sep 4, 2024
9da9b6d
Merge branch 'develop' into bytecode_refactor
roynalnaruto Sep 6, 2024
dc10c1c
clean up
DreamWuGit Sep 6, 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
2 changes: 2 additions & 0 deletions bus-mapping/src/circuit_input_builder/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ pub struct CopyEvent {
pub copy_bytes: CopyBytes,
/// Represents transaction access list
pub access_list: Vec<CopyAccessList>,
/// Represents whether current execution bytecodes belong to first bytecode circuit.
pub is_first_bytecode_table: bool,
DreamWuGit marked this conversation as resolved.
Show resolved Hide resolved
}

pub type CopyEventSteps = Vec<(u8, bool, bool)>;
Expand Down
8 changes: 8 additions & 0 deletions bus-mapping/src/evm/opcodes/begin_end_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ pub fn gen_begin_tx_steps(state: &mut CircuitInputStateRef) -> Result<Vec<ExecSt
rw_counter_start,
copy_bytes: CopyBytes::new(bytes, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);
}
Expand Down Expand Up @@ -465,6 +467,8 @@ pub fn gen_begin_tx_steps(state: &mut CircuitInputStateRef) -> Result<Vec<ExecSt
rw_counter_start,
copy_bytes: CopyBytes::new(copy_steps, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);

Expand Down Expand Up @@ -906,6 +910,8 @@ fn add_access_list_address_copy_event(
copy_bytes,
access_list,
log_id: None,
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
};

state.push_copy(exec_step, copy_event);
Expand Down Expand Up @@ -991,6 +997,8 @@ fn add_access_list_storage_key_copy_event(
copy_bytes,
access_list,
log_id: None,
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
};

state.push_copy(exec_step, copy_event);
Expand Down
4 changes: 4 additions & 0 deletions bus-mapping/src/evm/opcodes/calldatacopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ fn gen_copy_event(
rw_counter_start,
copy_bytes,
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
} else {
let (read_steps, write_steps, prev_bytes) =
Expand All @@ -127,6 +129,8 @@ fn gen_copy_event(
//fetch pre read and write bytes of CopyBytes
copy_bytes: CopyBytes::new(read_steps, Some(write_steps), Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}
}
Expand Down
6 changes: 6 additions & 0 deletions bus-mapping/src/evm/opcodes/callop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ impl<const N_ARGS: usize> Opcode for CallOpcode<N_ARGS> {
rw_counter_start,
copy_bytes: CopyBytes::new(copy_steps, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);
Some(input_bytes)
Expand Down Expand Up @@ -445,6 +447,8 @@ impl<const N_ARGS: usize> Opcode for CallOpcode<N_ARGS> {
rw_counter_start,
copy_bytes: CopyBytes::new(copy_steps, None, Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);
Some(output_bytes)
Expand Down Expand Up @@ -485,6 +489,8 @@ impl<const N_ARGS: usize> Opcode for CallOpcode<N_ARGS> {
Some(prev_bytes),
),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);
Some(returned_bytes)
Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/codecopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ fn gen_copy_event(
//fetch pre write bytes of CopyBytes
copy_bytes: CopyBytes::new(copy_steps, None, Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ fn handle_copy(
log_id: None,
copy_bytes: CopyBytes::new(copy_steps, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/extcodecopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ fn gen_copy_event(
rw_counter_start,
copy_bytes: CopyBytes::new(copy_steps, None, Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ fn gen_copy_event(
rw_counter_start,
copy_bytes: CopyBytes::new(read_steps, Some(write_steps), None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/mcopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ fn gen_copy_event(
// needs both read/write and prev bytes in CopyBytes
copy_bytes: CopyBytes::new(read_steps, Some(write_steps), Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}

Expand Down
4 changes: 4 additions & 0 deletions bus-mapping/src/evm/opcodes/return_revert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ fn handle_copy(
log_id: None,
copy_bytes: CopyBytes::new(read_steps, Some(write_steps), Some(dst_data_prev)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);

Expand Down Expand Up @@ -362,6 +364,8 @@ fn handle_create(
log_id: None,
copy_bytes: CopyBytes::new(copy_steps, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/returndatacopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ fn gen_copy_event(
rw_counter_start,
copy_bytes: CopyBytes::new(read_steps, Some(write_steps), Some(prev_bytes)),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
})
}

Expand Down
2 changes: 2 additions & 0 deletions bus-mapping/src/evm/opcodes/sha3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ impl Opcode for Sha3 {
rw_counter_start,
copy_bytes: CopyBytes::new(copy_steps, None, None),
access_list: vec![],
// default value is true, will set it to correct value in block_convert.
is_first_bytecode_table: true,
},
);

Expand Down
19 changes: 14 additions & 5 deletions zkevm-circuits/src/copy_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ use crate::{

use self::copy_gadgets::{
constrain_address, constrain_bytes_left, constrain_event_rlc_acc, constrain_first_last,
constrain_forward_parameters, constrain_is_memory_copy, constrain_is_pad, constrain_mask,
constrain_masked_value, constrain_must_terminate, constrain_non_pad_non_mask,
constrain_rw_counter, constrain_rw_word_complete, constrain_tag, constrain_value_rlc,
constrain_word_index, constrain_word_rlc,
constrain_forward_parameters, constrain_is_first_bytecode_table, constrain_is_memory_copy,
constrain_is_pad, constrain_mask, constrain_masked_value, constrain_must_terminate,
constrain_non_pad_non_mask, constrain_rw_counter, constrain_rw_word_complete, constrain_tag,
constrain_value_rlc, constrain_word_index, constrain_word_rlc,
};

/// The current row.
Expand Down Expand Up @@ -139,6 +139,8 @@ pub struct CopyCircuitConfigArgs<F: Field> {
pub rw_table: RwTable,
/// BytecodeTable
pub bytecode_table: BytecodeTable,
/// BytecodeTable1
pub bytecode_table1: BytecodeTable,
/// CopyTable
pub copy_table: CopyTable,
/// q_enable
Expand All @@ -158,6 +160,7 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
tx_table,
rw_table,
bytecode_table,
bytecode_table1,
copy_table,
q_enable,
challenges,
Expand All @@ -176,6 +179,7 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
let [is_pad, is_tx_calldata, is_bytecode, is_memory, is_memory_copy, is_tx_log, is_access_list_address, is_access_list_storage_key] =
array_init(|_| meta.advice_column());
let is_first = copy_table.is_first;
let is_first_bytecode_table = copy_table.is_first_bytecode_table;
let id = copy_table.id;
let addr = copy_table.addr;
let src_addr_end = copy_table.src_addr_end;
Expand All @@ -193,6 +197,8 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
tx_table.annotate_columns(meta);
rw_table.annotate_columns(meta);
bytecode_table.annotate_columns(meta);
bytecode_table1.annotate_columns(meta);

copy_table.annotate_columns(meta);

let is_id_unchange = IsEqualChip::configure_with_value_inv(
Expand Down Expand Up @@ -384,6 +390,8 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
is_memory_copy,
);
constrain_rw_word_complete(cb, is_last_step, is_rw_word_type.expr(), is_word_end);

constrain_is_first_bytecode_table(cb, meta, is_first_bytecode_table, is_last_col);
}

cb.gate(meta.query_fixed(q_enable, CURRENT))
Expand Down Expand Up @@ -448,6 +456,7 @@ impl<F: Field> SubCircuitConfig<F> for CopyCircuitConfig<F> {
let cond = meta.query_fixed(q_enable, CURRENT)
* meta.query_advice(is_bytecode, CURRENT)
* meta.query_advice(non_pad_non_mask, CURRENT);
//* meta.query_advice(is_first_bytecode_table, CURRENT);

vec![
1.expr(),
Expand Down Expand Up @@ -687,7 +696,7 @@ impl<F: Field> CopyCircuitConfig<F> {

// lt chip
if is_read {
let addr = table_row[2].0;
let addr = table_row[3].0;
is_src_end_chip.assign(
region,
*offset,
Expand Down
25 changes: 25 additions & 0 deletions zkevm-circuits/src/copy_circuit/copy_gadgets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,28 @@ pub fn constrain_rw_word_complete<F: Field>(
]),
);
}

/// Ensure the 'is_first_bytecode_table' column is bool and not changed in one copy event.
pub fn constrain_is_first_bytecode_table<F: Field>(
cb: &mut BaseConstraintBuilder<F>,
meta: &mut VirtualCells<'_, F>,
is_first_bytecode_col: Column<Advice>,
is_last_col: Column<Advice>,
) {
let is_first_bytecode_table = meta.query_advice(is_first_bytecode_col, CURRENT);
let is_first_bytecode_table_next = meta.query_advice(is_first_bytecode_col, NEXT_ROW);

cb.require_boolean(
"is_first_bytecode_table is bool type",
is_first_bytecode_table.clone(),
);

let is_next_last_step = meta.query_advice(is_last_col, NEXT_ROW);
cb.condition(not::expr(is_next_last_step), |cb| {
cb.require_equal(
"is_first_bytecode_table doesn't change in one copy event ",
is_first_bytecode_table,
is_first_bytecode_table_next,
);
});
}
3 changes: 3 additions & 0 deletions zkevm-circuits/src/copy_circuit/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ impl<F: Field> Circuit<F> for CopyCircuit<F> {
let tx_table = TxTable::construct(meta);
let rw_table = RwTable::construct(meta);
let bytecode_table = BytecodeTable::construct(meta);
let bytecode_table1 = BytecodeTable::construct(meta);

let q_enable = meta.fixed_column();
let copy_table = CopyTable::construct(meta, q_enable);
let challenges = Challenges::construct(meta);
Expand All @@ -36,6 +38,7 @@ impl<F: Field> Circuit<F> for CopyCircuit<F> {
tx_table,
rw_table,
bytecode_table,
bytecode_table1,
copy_table,
q_enable,
challenges: challenge_exprs,
Expand Down
6 changes: 6 additions & 0 deletions zkevm-circuits/src/evm_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ pub struct EvmCircuitConfigArgs<F: Field> {
pub rw_table: RwTable,
/// BytecodeTable
pub bytecode_table: BytecodeTable,
/// BytecodeTable
pub bytecode_table1: BytecodeTable,
/// BlockTable
pub block_table: BlockTable,
/// CopyTable
Expand Down Expand Up @@ -105,6 +107,7 @@ impl<F: Field> SubCircuitConfig<F> for EvmCircuitConfig<F> {
tx_table,
rw_table,
bytecode_table,
bytecode_table1,
block_table,
copy_table,
keccak_table,
Expand All @@ -126,6 +129,7 @@ impl<F: Field> SubCircuitConfig<F> for EvmCircuitConfig<F> {
&tx_table,
&rw_table,
&bytecode_table,
&bytecode_table1,
&block_table,
&copy_table,
&keccak_table,
Expand Down Expand Up @@ -452,6 +456,7 @@ impl<F: Field> Circuit<F> for EvmCircuit<F> {
let rw_table = RwTable::construct(meta);
let tx_table = TxTable::construct(meta);
let bytecode_table = BytecodeTable::construct(meta);
let bytecode_table1 = BytecodeTable::construct(meta);
let block_table = BlockTable::construct(meta);
let q_copy_table = meta.fixed_column();
let copy_table = CopyTable::construct(meta, q_copy_table);
Expand All @@ -470,6 +475,7 @@ impl<F: Field> Circuit<F> for EvmCircuit<F> {
tx_table,
rw_table,
bytecode_table,
bytecode_table1,
block_table,
copy_table,
keccak_table,
Expand Down
4 changes: 4 additions & 0 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ impl<F: Field> ExecutionConfig<F> {
tx_table: &dyn LookupTable<F>,
rw_table: &dyn LookupTable<F>,
bytecode_table: &dyn LookupTable<F>,
bytecode_table1: &dyn LookupTable<F>,
block_table: &dyn LookupTable<F>,
copy_table: &dyn LookupTable<F>,
keccak_table: &dyn LookupTable<F>,
Expand Down Expand Up @@ -687,6 +688,7 @@ impl<F: Field> ExecutionConfig<F> {
tx_table,
rw_table,
bytecode_table,
bytecode_table1,
block_table,
copy_table,
keccak_table,
Expand Down Expand Up @@ -956,6 +958,7 @@ impl<F: Field> ExecutionConfig<F> {
tx_table: &dyn LookupTable<F>,
rw_table: &dyn LookupTable<F>,
bytecode_table: &dyn LookupTable<F>,
bytecode_table1: &dyn LookupTable<F>,
block_table: &dyn LookupTable<F>,
copy_table: &dyn LookupTable<F>,
keccak_table: &dyn LookupTable<F>,
Expand All @@ -977,6 +980,7 @@ impl<F: Field> ExecutionConfig<F> {
Table::Tx => tx_table,
Table::Rw => rw_table,
Table::Bytecode => bytecode_table,
Table::Bytecode1 => bytecode_table1,
Table::Block => block_table,
Table::Copy => copy_table,
Table::Keccak => keccak_table,
Expand Down
5 changes: 3 additions & 2 deletions zkevm-circuits/src/evm_circuit/execution/add_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ impl<F: Field> ExecutionGadget<F> for AddSubGadget<F> {
offset: usize,
block: &Block,
_: &Transaction,
_: &Call,
call: &Call,
step: &ExecStep,
) -> Result<(), Error> {
self.same_context.assign_exec_step(region, offset, step)?;
self.same_context
.assign_exec_step(region, offset, block, call, step)?;

let opcode = step.opcode.unwrap();
let indices = if opcode == OpcodeId::SUB {
Expand Down
5 changes: 3 additions & 2 deletions zkevm-circuits/src/evm_circuit/execution/addmod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ impl<F: Field> ExecutionGadget<F> for AddModGadget<F> {
offset: usize,
block: &Block,
_: &Transaction,
_: &Call,
call: &Call,
step: &ExecStep,
) -> Result<(), Error> {
self.same_context.assign_exec_step(region, offset, step)?;
self.same_context
.assign_exec_step(region, offset, block, call, step)?;

// get stack values
let [mut r, n, b, a] = [3, 2, 1, 0]
Expand Down
Loading
Loading