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

Commit a331143

Browse files
author
Mason Liang
committed
Fix off by 1 error for number of call data rows needed
1 parent c0848d9 commit a331143

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zkevm-circuits/src/tx_circuit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,9 +2655,9 @@ impl<F: Field> TxCircuit<F> {
26552655
// set next tx's total_l1_popped_before
26562656
total_l1_popped_before = total_l1_popped_after;
26572657
}
2658-
assert_eq!(offset, self.max_txs * TX_LEN + 1);
2659-
26602658
let calldata_first_row = self.max_txs * TX_LEN + 1;
2659+
assert_eq!(offset, calldata_first_row);
2660+
26612661
let calldata_last_row = calldata_first_row + self.max_calldata;
26622662
// 3. Assign call data of txs
26632663
// 3.1 padding txs have no calldata bytes
@@ -2675,7 +2675,7 @@ impl<F: Field> TxCircuit<F> {
26752675
challenges,
26762676
)?;
26772677
}
2678-
assert!(offset <= calldata_last_row, "{offset}, {calldata_last_row}");
2678+
assert!(offset < calldata_last_row, "{offset}, {calldata_last_row}");
26792679
// 3.2 pad calldata with zeros
26802680
config.assign_calldata_zeros(
26812681
&mut region,

0 commit comments

Comments
 (0)