Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit 8996f37

Browse files
committed
fix(zkevm-circuits/begin_tx): minor refactor & todo comment
1 parent 1ab9f99 commit 8996f37

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,14 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
190190
tx.caller_address.to_word(),
191191
create.caller_address(),
192192
);
193+
194+
cb.require_equal(
195+
"tx nonce equivalence",
196+
tx.nonce.expr(),
197+
create.caller_nonce(),
198+
);
199+
200+
// 1. Handle contract creation transaction.
193201
cb.condition(tx.is_create.expr(), |cb| {
194202
cb.require_equal_word(
195203
"call callee address equivalence",
@@ -202,21 +210,14 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
202210
)
203211
.to_word(),
204212
);
205-
});
206-
cb.require_equal(
207-
"tx nonce equivalence",
208-
tx.nonce.expr(),
209-
create.caller_nonce(),
210-
);
211-
212-
// 1. Handle contract creation transaction.
213-
cb.condition(tx.is_create.expr(), |cb| {
214213
cb.keccak_table_lookup(
215214
create.input_rlc(cb),
216215
create.input_length(),
217216
caller_nonce_hash_bytes.to_word(),
218217
);
219218

219+
// cb.keccak_table_lookup(input_rlc, input_len, output);
220+
220221
cb.account_write(
221222
call_callee_address.to_word(),
222223
AccountFieldTag::Nonce,

0 commit comments

Comments
 (0)