Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
Merged
Changes from all 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
13 changes: 9 additions & 4 deletions zkevm-circuits/src/tx_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,7 @@ impl<F: Field> TxCircuit<F> {
let mut is_padding_tx;
let mut num_all_txs_acc = 0;
let mut total_l1_popped_before = start_l1_queue_index;
let mut total_l1_popped_after = start_l1_queue_index;
// Empty entry
config.assign_row(
&mut region,
Expand Down Expand Up @@ -2312,9 +2313,10 @@ impl<F: Field> TxCircuit<F> {
if tx.tx_type.is_l1_msg() {
let queue_index = tx.nonce;
num_all_txs_acc = queue_index - total_l1_popped_before + 1;
total_l1_popped_before = queue_index + 1;
total_l1_popped_after = queue_index + 1;
} else {
// total_l1_popped_before do not change
// next tx's total_l1_popped_before do not change
total_l1_popped_after = total_l1_popped_before;
num_all_txs_acc = 1;
}
};
Expand All @@ -2326,9 +2328,10 @@ impl<F: Field> TxCircuit<F> {
if tx.tx_type.is_l1_msg() {
let queue_index = tx.nonce;
num_all_txs_acc += queue_index - total_l1_popped_before + 1;
total_l1_popped_before = queue_index + 1;
total_l1_popped_after = queue_index + 1;
} else {
// total_l1_popped_before do not change
// next tx's total_l1_popped_before do not change
total_l1_popped_after = total_l1_popped_before;
num_all_txs_acc += 1;
}
}
Expand Down Expand Up @@ -2627,6 +2630,8 @@ impl<F: Field> TxCircuit<F> {
|| Value::known(sv_address),
)?;
}
// set next tx's total_l1_popped_before
total_l1_popped_before = total_l1_popped_after;
}

log::debug!("assigning calldata, offset {}", offset);
Expand Down