@@ -250,9 +250,9 @@ impl L1BlockInfo {
250250
251251 fn calculate_tx_l1_cost_galileo (
252252 & self ,
253- tx_size : u32 , // size of the original rlp-encoded transaction
253+ tx_size : usize , // size of the original rlp-encoded transaction
254254 spec_id : ScrollSpecId ,
255- compressed_size : u32 , // size of the compressed rlp-encoded transaction
255+ compressed_size : usize , // size of the compressed rlp-encoded transaction
256256 ) -> U256 {
257257 // Post Galileo rollup fee formula:
258258 // rollup_fee(tx) = fee_per_byte * compressed_size(tx) * (1 + penalty(tx)) / PRECISION
@@ -282,7 +282,7 @@ impl L1BlockInfo {
282282 . unwrap_or_else ( || panic ! ( "missing l1 blob base fee in spec_id={spec_id:?}" ) ) ;
283283
284284 let penalty_factor = match self . penalty_factor {
285- Some ( f) if f == U256 :: from ( 0 ) => U256 :: from ( 1 ) , // sanitize zero penalty factor
285+ Some ( f) if f == U256 :: ZERO => U256 :: ONE , // sanitize zero penalty factor
286286 Some ( f) => f,
287287 None => panic ! ( "missing penalty factor in spec_id={spec_id:?}" ) ,
288288 } ;
@@ -308,7 +308,7 @@ impl L1BlockInfo {
308308 input : & [ u8 ] ,
309309 spec_id : ScrollSpecId ,
310310 compression_ratio : Option < U256 > ,
311- compressed_size : Option < u32 > ,
311+ compressed_size : Option < usize > ,
312312 ) -> U256 {
313313 let l1_cost = if !spec_id. is_enabled_in ( ScrollSpecId :: CURIE ) {
314314 self . calculate_tx_l1_cost_shanghai ( input, spec_id)
@@ -322,7 +322,7 @@ impl L1BlockInfo {
322322 } else {
323323 let compressed_size = compressed_size
324324 . unwrap_or_else ( || panic ! ( "compressed size should be set in spec_id={spec_id:?}" ) ) ;
325- self . calculate_tx_l1_cost_galileo ( input. len ( ) as u32 , spec_id, compressed_size)
325+ self . calculate_tx_l1_cost_galileo ( input. len ( ) , spec_id, compressed_size)
326326 } ;
327327 l1_cost. min ( U64_MAX )
328328 }
0 commit comments