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

Commit 6c33c7f

Browse files
authored
refactor(evm_circuit): minor fix in end_tx (#1725) (#1739)
### Description This PR is aimed to do minor style refactor/fix of #1719 ### Issue Link #1725 ### Type of change - [X] Bug fix (non-breaking change which fixes an issue) ### Content This PR addresses issue #1725 to do a minor style fix, that @lispc mentioned [here](#1719 (comment))
1 parent a631c09 commit 6c33c7f

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<F: Field> ExecutionGadget<F> for EndTxGadget<F> {
119119
tx_id.expr(),
120120
is_persistent.expr(),
121121
gas_used,
122-
10.expr() + coinbase_reward.rw_delta(),
122+
9.expr() + coinbase_reward.rw_delta(),
123123
);
124124

125125
Self {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<F: Field> ExecutionGadget<F> for InvalidTxGadget<F> {
7676
begin_tx.tx_id.expr(),
7777
false.expr(),
7878
0.expr(),
79-
8.expr(),
79+
7.expr(),
8080
);
8181

8282
Self {

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ impl<F: Field> EndTxHelperGadget<F> {
133133
// tx_id has been lookup and range_check above
134134
Word::from_lo_unchecked(tx_id.expr() + 1.expr()),
135135
);
136-
// minus 1.expr() because `call_context_lookup_write_with_counter` do not bump
137-
// rwc
138136
cb.require_step_state_transition(StepStateTransition {
139-
rw_counter: Delta(rw_counter_offset.clone() - 1.expr()),
137+
rw_counter: Delta(rw_counter_offset.clone()),
140138
..StepStateTransition::any()
141139
});
142140
},
@@ -145,7 +143,7 @@ impl<F: Field> EndTxHelperGadget<F> {
145143
cb.next.execution_state_selector([ExecutionState::EndBlock]),
146144
|cb| {
147145
cb.require_step_state_transition(StepStateTransition {
148-
rw_counter: Delta(rw_counter_offset.expr() - 1.expr()),
146+
rw_counter: Delta(rw_counter_offset.expr()),
149147
// We propagate call_id so that EndBlock can get the last tx_id
150148
// in order to count processed txs.
151149
call_id: Same,

0 commit comments

Comments
 (0)