This repository was archived by the owner on Apr 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +9
-13
lines changed Expand file tree Collapse file tree 6 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -558,7 +558,7 @@ impl<'a> CircuitInputBuilder {
558
558
let mut tx = self . new_tx ( eth_tx, !geth_trace. failed ) ?;
559
559
560
560
// Sanity check for transaction L1 fee.
561
- let tx_l1_fee = if tx. tx_type . is_l1_msg ( ) {
561
+ let tx_l1_fee = if tx. tx_type . is_l1_msg ( ) || tx . tx_type . is_l1_block_hashes ( ) {
562
562
0
563
563
} else {
564
564
tx. l1_fee ( )
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ impl Transaction {
369
369
) ;
370
370
371
371
let tx_type = TxType :: get_tx_type ( eth_tx) ;
372
- let ( l1_fee, l1_fee_committed) = if tx_type. is_l1_msg ( ) {
372
+ let ( l1_fee, l1_fee_committed) = if tx_type. is_l1_msg ( ) || tx_type . is_l1_block_hashes ( ) {
373
373
Default :: default ( )
374
374
} else {
375
375
(
Original file line number Diff line number Diff line change @@ -181,10 +181,7 @@ impl<F: Field> ExecutionGadget<F> for BeginTxGadget<F> {
181
181
let tx_caller_address_is_zero = IsZeroGadget :: construct ( cb, tx_caller_address. expr ( ) ) ;
182
182
cb. require_equal (
183
183
"CallerAddress != 0 (not a padding tx)" ,
184
- and:: expr ( [
185
- not:: expr ( tx_l1_block_hashes. is_l1_block_hashes ( ) ) ,
186
- tx_caller_address_is_zero. expr ( ) ,
187
- ] ) ,
184
+ tx_caller_address_is_zero. expr ( ) ,
188
185
false . expr ( ) ,
189
186
) ;
190
187
let tx_callee_address_is_zero = IsZeroGadget :: construct ( cb, tx_callee_address. expr ( ) ) ;
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ impl<F: Field> ExecutionGadget<F> for EndTxGadget<F> {
140
140
let effective_fee = cb. query_word_rlc ( ) ;
141
141
142
142
cb. condition ( tx_l1_custom_tx. expr ( ) , |cb| {
143
- cb. require_zero ( "l1fee is 0 for l1msg" , tx_l1_fee. expr ( ) ) ;
143
+ cb. require_zero ( "l1fee is 0 for l1msg and l1 block hashesg " , tx_l1_fee. expr ( ) ) ;
144
144
} ) ;
145
145
cb. require_equal (
146
146
"tx_fee == l1_fee + l2_fee" ,
@@ -405,7 +405,7 @@ impl<F: Field> ExecutionGadget<F> for EndTxGadget<F> {
405
405
) ?;
406
406
407
407
let tx_l1_fee = if tx. tx_type . is_l1_custom_tx ( ) {
408
- log:: trace!( "tx is l1msg and l1 fee is 0" ) ;
408
+ log:: trace!( "tx is l1msg or l1 block hashes and l1 fee is 0" ) ;
409
409
0
410
410
} else {
411
411
tx. l1_fee . tx_l1_fee ( tx. tx_data_gas_cost ) . 0
Original file line number Diff line number Diff line change @@ -105,7 +105,6 @@ fn test_super_circuit<
105
105
) ;
106
106
107
107
block. txs [ 0 ] . tx_type = TxType :: L1BlockHashes ;
108
- block. txs [ 0 ] . caller_address = address ! ( "0x0000000000000000000000000000000000000000" ) ;
109
108
110
109
let active_row_num =SuperCircuit :: <
111
110
Fr ,
Original file line number Diff line number Diff line change @@ -1180,14 +1180,14 @@ impl<F: Field> SubCircuitConfig<F> for TxCircuitConfig<F> {
1180
1180
} ) ;
1181
1181
1182
1182
meta. lookup_any ( "l1 block hashes calldata in block table" , |meta| {
1183
- let is_tag_block_num = meta. query_advice ( is_tag_block_num , Rotation :: cur ( ) ) ;
1184
- let block_num = meta. query_advice ( tx_table. value , Rotation :: cur ( ) ) ;
1185
- let calldata_rlc = meta. query_advice ( calldata_rlc , Rotation :: cur ( ) ) ;
1183
+ let is_tag_good = meta. query_advice ( is_calldata , Rotation :: cur ( ) ) ;
1184
+ let block_num = meta. query_advice ( tx_table. value , Rotation ( 16 ) ) ;
1185
+ let calldata_rlc = meta. query_advice ( tx_table . value , Rotation :: cur ( ) ) ;
1186
1186
1187
1187
let input_expr = vec ! [ L1BlockHashesCalldata . expr( ) , block_num, calldata_rlc] ;
1188
1188
let table_expr = block_table. table_exprs ( meta) ;
1189
1189
let condition = and:: expr ( [
1190
- is_tag_block_num ,
1190
+ is_tag_good ,
1191
1191
meta. query_advice ( is_l1_block_hashes, Rotation :: cur ( ) ) ,
1192
1192
meta. query_fixed ( q_enable, Rotation :: cur ( ) ) ,
1193
1193
] ) ;
You can’t perform that action at this time.
0 commit comments