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

refactor(evm_circuit): minor fix in end_tx (#1725) #1739

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 zkevm-circuits/src/evm_circuit/execution/end_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<F: Field> ExecutionGadget<F> for EndTxGadget<F> {
tx_id.expr(),
is_persistent.expr(),
gas_used,
10.expr() + coinbase_reward.rw_delta(),
9.expr() + coinbase_reward.rw_delta(),
);

Self {
Expand Down
6 changes: 2 additions & 4 deletions zkevm-circuits/src/evm_circuit/util/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ impl<F: Field> EndTxHelperGadget<F> {
// tx_id has been lookup and range_check above
Word::from_lo_unchecked(tx_id.expr() + 1.expr()),
);
// minus 1.expr() because `call_context_lookup_write_with_counter` do not bump
// rwc
cb.require_step_state_transition(StepStateTransition {
rw_counter: Delta(rw_counter_offset.clone() - 1.expr()),
rw_counter: Delta(rw_counter_offset.clone()),
..StepStateTransition::any()
});
},
Expand All @@ -145,7 +143,7 @@ impl<F: Field> EndTxHelperGadget<F> {
cb.next.execution_state_selector([ExecutionState::EndBlock]),
|cb| {
cb.require_step_state_transition(StepStateTransition {
rw_counter: Delta(rw_counter_offset.expr() - 1.expr()),
rw_counter: Delta(rw_counter_offset.expr()),
// We propagate call_id so that EndBlock can get the last tx_id
// in order to count processed txs.
call_id: Same,
Expand Down
Loading