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

Commit cfcb073

Browse files
authored
constrain tx_l1_fee gadget (#1151)
1 parent ce4ff37 commit cfcb073

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
153153
});
154154
cb.condition(tx_l1_msg.is_l1_msg(), |cb| {
155155
cb.require_zero("l1fee is 0 for l1msg", tx_data_gas_cost.expr());
156+
// also constrain fee value of tx_l1_fee gadget is zero, such other gadgets can use it
157+
// with certain value for l1 type.
158+
cb.require_zero(
159+
"l1fee is 0 for tx_l1_fee gadget",
160+
tx_l1_fee.tx_l1_fee_word().expr(),
161+
);
156162
});
157163
// the rw delta caused by l1 related handling
158164
let l1_rw_delta = select::expr(

0 commit comments

Comments
 (0)