Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 56b22a6

Browse files
committed
cleanup comments
1 parent 453ff8a commit 56b22a6

File tree

19 files changed

+17
-156
lines changed

19 files changed

+17
-156
lines changed

zkevm-circuits/src/evm_circuit/execution/logs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ impl<F: Field> ExecutionGadget<F> for LogGadget<F> {
207207
let [memory_start, msize] =
208208
[step.rw_indices[0], step.rw_indices[1]].map(|idx| block.rws[idx].stack_value());
209209

210-
//self.mstart_word.assign(region, offset, memory_start)?;
211-
212210
let memory_address = self
213211
.memory_address
214212
.assign(region, offset, memory_start, msize)?;

zkevm-circuits/src/evm_circuit/execution/precompiles/ecrecover.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ impl<F: Field> ExecutionGadget<F> for EcrecoverGadget<F> {
172172
.expect("sig_v is 32 bytes"),
173173
),
174174
);
175-
// cb.require_equal(
176-
// "Secp256k1::Fq modulus assigned correctly",
177-
// fq_modulus.expr(),
178-
// cb.word_rlc::<N_BYTES_WORD>(FQ_MODULUS.to_le_bytes().map(|b| b.expr())),
179-
// );
175+
180176
cb.require_equal(
181177
"Secp256k1::Fq modulus assigned correctly",
182178
cb.word_rlc::<N_BYTES_WORD>(fq_modulus.clone().limbs.map(|cell| cell.expr())),

zkevm-circuits/src/evm_circuit/execution/return_revert.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ impl<F: Field> ExecutionGadget<F> for ReturnRevertGadget<F> {
413413
self.keccak_code_hash.assign_u256(
414414
region,
415415
offset,
416-
//region.word_rlc(U256::from_big_endian(&keccak_code_hash)),
417-
//TODO: from_little_endiam
418416
U256::from_big_endian(&keccak_code_hash),
419417
)?;
420418

zkevm-circuits/src/evm_circuit/execution/swap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ impl<F: Field> ExecutionGadget<F> for SwapGadget<F> {
3232
fn configure(cb: &mut EVMConstraintBuilder<F>) -> Self {
3333
let opcode = cb.query_cell();
3434

35-
//let phase2_values = [cb.query_cell_phase2(), cb.query_cell_phase2()];
3635
let values = [cb.query_word_unchecked(), cb.query_word_unchecked()];
3736

3837
// The stack index we have to peek, deduced from the 'x' value of

zkevm-circuits/src/evm_circuit/step.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ pub enum ExecutionState {
8484
BLOCKCTXU64, // TIMESTAMP, NUMBER, GASLIMIT
8585
BLOCKCTXU160, // COINBASE
8686
BLOCKCTXU256, // BASEFEE, DIFFICULTY (for non-scroll)
87-
/// TIMESTAMP, NUMBER, GASLIMIT, COINBASE, DIFFICULTY, BASEFEE
88-
// BLOCKCTX,
8987
#[cfg(feature = "scroll")]
9088
DIFFICULTY, // DIFFICULTY
9189
CHAINID,
@@ -282,26 +280,6 @@ impl ExecutionState {
282280
vec![OpcodeId::DIFFICULTY, OpcodeId::BASEFEE]
283281
}
284282
}
285-
// Self::BLOCKCTX => {
286-
// if cfg!(feature = "scroll") {
287-
// vec![
288-
// OpcodeId::TIMESTAMP,
289-
// OpcodeId::NUMBER,
290-
// OpcodeId::GASLIMIT,
291-
// OpcodeId::COINBASE,
292-
// OpcodeId::DIFFICULTY,
293-
// ]
294-
// } else {
295-
// vec![
296-
// OpcodeId::TIMESTAMP,
297-
// OpcodeId::NUMBER,
298-
// OpcodeId::GASLIMIT,
299-
// OpcodeId::COINBASE,
300-
// OpcodeId::DIFFICULTY,
301-
// OpcodeId::BASEFEE,
302-
// ]
303-
// }
304-
// }
305283
#[cfg(feature = "scroll")]
306284
Self::DIFFICULTY => vec![OpcodeId::DIFFICULTY],
307285
Self::CHAINID => vec![OpcodeId::CHAINID],

zkevm-circuits/src/evm_circuit/table.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub(crate) enum Lookup<F> {
229229
/// field_tag is Calldata, otherwise should be set to 0.
230230
index: Expression<F>,
231231
/// Value of the field.
232-
// value: Word<Expression<F>>,
232+
// value: Word<Expression<F>>, change to word in stage2
233233
value: Expression<F>,
234234
},
235235
/// Lookup to read-write table, which contains read-write access records of
@@ -457,6 +457,7 @@ impl<F: Field> Lookup<F> {
457457
number,
458458
value,
459459
} => {
460+
// used in stage2 after block table to word
460461
//vec![field_tag.clone(), number.clone(), value.lo(), value.hi()]
461462
vec![field_tag.clone(), number.clone(), value.clone()]
462463
}

zkevm-circuits/src/evm_circuit/util/common_gadget.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ pub(crate) struct CommonCallGadget<F, MemAddrGadget, const IS_SUCCESS_CALL: bool
10641064
// phase2_callee_code_hash
10651065
pub callee_code_hash: WordCell<F>,
10661066
pub is_empty_code_hash: IsEqualWordGadget<F, WordCell<F>, Word<Expression<F>>>,
1067-
//pub is_empty_code_hash: IsEqualGadget<F>,
10681067

10691068
//pub callee_not_exists: IsZeroGadget<F>,
10701069
pub callee_not_exists: IsZeroWordGadget<F, WordCell<F>>,
@@ -1496,7 +1495,6 @@ impl<F: Field> CommonErrorGadget<F> {
14961495
) -> Self {
14971496
cb.opcode_lookup_rlc(opcode.expr(), push_rlc);
14981497

1499-
//let rw_counter_end_of_reversion = cb.query_cell();
15001498
// rw_counter_end_of_reversion just used for read lookup, therefore skip range check
15011499
let rw_counter_end_of_reversion = cb.query_word_unchecked();
15021500

@@ -1640,9 +1638,7 @@ impl<F: Field, const VALID_BYTES: usize> WordByteCapGadget<F, VALID_BYTES> {
16401638
self.lt_cap.expr()
16411639
}
16421640

1643-
// pub(crate) fn original_ref(&self) -> &Word<F> {
1644-
// self.word.original.clone()
1645-
// }
1641+
// orginal ref of word limbs
16461642
pub(crate) fn original_ref(&self) -> &Word32Cell<F> {
16471643
self.word.original_ref()
16481644
}

zkevm-circuits/src/evm_circuit/util/constraint_builder.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ impl<'a, F: Field> EVMConstraintBuilder<'a, F> {
566566
// poseidon codehash if enalbe scroll or poseidon-codehash, else keccak_hash.
567567
pub(crate) fn empty_code_hash(&self) -> Word<Expression<F>> {
568568
if cfg!(feature = "poseidon-codehash") {
569-
//let codehash = POSEIDON_CODE_HASH_EMPTY.to_word().to_scalar().unwrap();
570569
Word32::new(
571570
POSEIDON_CODE_HASH_EMPTY
572571
.to_word()
@@ -575,7 +574,6 @@ impl<'a, F: Field> EVMConstraintBuilder<'a, F> {
575574
)
576575
.to_word()
577576
} else {
578-
//self.word_rlc((*EMPTY_CODE_HASH_LE).map(|byte| byte.expr()))
579577
Word32::new(EMPTY_CODE_HASH_LE.map(|byte| byte.expr())).to_word()
580578
}
581579
}
@@ -834,7 +832,7 @@ impl<'a, F: Field> EVMConstraintBuilder<'a, F> {
834832
id: Expression<F>,
835833
field_tag: TxContextFieldTag,
836834
index: Option<Expression<F>>,
837-
//value: Word<Expression<F>>,
835+
//value: Word<Expression<F>>, used in stage2 for tx table to word
838836
value: Expression<F>,
839837
) {
840838
self.add_lookup(

zkevm-circuits/src/evm_circuit/util/math_gadget/modulo.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,8 @@ impl<F: Field> ModGadget<F> {
8585

8686
self.k.assign_u256(region, offset, k)?;
8787
self.a_or_zero.assign_u256(region, offset, a_or_zero)?;
88-
//let n_sum = (0..32).fold(0, |acc, idx| acc + n.byte(idx) as u64);
89-
//let a_or_zero_sum = (0..32).fold(0, |acc, idx| acc + a_or_zero.byte(idx) as u64);
90-
//self.n_is_zero.assign(region, offset, F::from(n_sum))?;
88+
9189
self.n_is_zero.assign(region, offset, word::Word::from(n))?;
92-
// self.a_or_is_zero
93-
// .assign(region, offset, F::from(a_or_zero_sum))?;
9490
self.a_or_is_zero
9591
.assign(region, offset, word::Word::from(a_or_zero))?;
9692
self.mul_add_words

zkevm-circuits/src/evm_circuit/util/math_gadget/rlp.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ impl<F: Field, const IS_CREATE2: bool> ContractCreateGadget<F, IS_CREATE2> {
411411
+ (self.caller_address_rlc(cb) * challenge_power_64)
412412
+ (self.salt_keccak_rlc(cb) * challenge_power_32)
413413
+ self.keccak_code_hash_keccak_rlc(cb)
414-
//+ self.code_hash_rlc.expr()
415414
} else {
416415
// RLC(RLP([caller_address, caller_nonce]))
417416
let challenge_power_21 = challenges[20].clone();

0 commit comments

Comments
 (0)