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

Fix finding 3 #575

Merged
merged 1 commit into from
Jun 29, 2023
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
21 changes: 20 additions & 1 deletion zkevm-circuits/src/rlp_circuit_fsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,9 @@ impl<F: Field> RlpCircuitConfig<F> {
},
);

// if (tx_id' == tx_id and format' != format) or (tx_id' != tx_id and tx_id' != 0)
// These two cases are not the very last non-padding RLP instance.
// 1. (tx_id' == tx_id and format' != format)
// 2. (tx_id' != tx_id and tx_id' != 0)
cb.condition(
sum::expr([
// case 1
Expand Down Expand Up @@ -572,6 +574,23 @@ impl<F: Field> RlpCircuitConfig<F> {
},
);

// For the very last non-padding RLP instance, we have
// tx_id' != tx_id && tx_id' == 0
cb.condition(
and::expr([
is_padding_in_dt.expr(Rotation::next())(meta),
not::expr(tx_id_check_in_dt.is_equal_expression.expr()),
]),
|cb| {
// byte_rev_idx == 1
cb.require_equal(
"byte_rev_idx is 1 at the last index",
meta.query_advice(data_table.byte_rev_idx, Rotation::cur()),
1.expr(),
);
},
);

cb.gate(meta.query_fixed(q_enabled, Rotation::cur()))
});

Expand Down