@@ -311,24 +311,34 @@ impl NodeArgs {
311311 fn dev_config ( & self ) -> DevConfig {
312312 let mut fixed_gas_prices = None ;
313313
314- if let Some ( eth_gas_price ) = self . gpo . l1_eth_gas_price {
314+ if let Some ( eth ) = self . gpo . l2_eth_gas_price {
315315 let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
316- prices. gas_price . eth = eth_gas_price ;
316+ prices. l2_gas_prices . eth = eth ;
317317 }
318318
319- if let Some ( strk_gas_price ) = self . gpo . l1_strk_gas_price {
319+ if let Some ( strk ) = self . gpo . l2_strk_gas_price {
320320 let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
321- prices. gas_price . strk = strk_gas_price ;
321+ prices. l2_gas_prices . strk = strk ;
322322 }
323323
324- if let Some ( eth_data_gas_price ) = self . gpo . l1_eth_data_gas_price {
324+ if let Some ( eth ) = self . gpo . l1_eth_gas_price {
325325 let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
326- prices. data_gas_price . eth = eth_data_gas_price ;
326+ prices. l1_gas_prices . eth = eth ;
327327 }
328328
329- if let Some ( strk_data_gas_price ) = self . gpo . l1_strk_data_gas_price {
329+ if let Some ( strk ) = self . gpo . l1_strk_gas_price {
330330 let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
331- prices. data_gas_price . strk = strk_data_gas_price;
331+ prices. l1_gas_prices . strk = strk;
332+ }
333+
334+ if let Some ( eth) = self . gpo . l1_eth_data_gas_price {
335+ let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
336+ prices. l1_data_gas_prices . eth = eth;
337+ }
338+
339+ if let Some ( strk) = self . gpo . l1_strk_data_gas_price {
340+ let prices = fixed_gas_prices. get_or_insert ( FixedL1GasPriceConfig :: default ( ) ) ;
341+ prices. l1_data_gas_prices . strk = strk;
332342 }
333343
334344 DevConfig {
@@ -461,9 +471,9 @@ mod test {
461471 use std:: str:: FromStr ;
462472
463473 use assert_matches:: assert_matches;
464- use katana_core :: constants :: {
465- DEFAULT_ETH_L1_DATA_GAS_PRICE , DEFAULT_ETH_L1_GAS_PRICE , DEFAULT_STRK_L1_DATA_GAS_PRICE ,
466- DEFAULT_STRK_L1_GAS_PRICE ,
474+ use katana_gas_oracle :: {
475+ DEFAULT_ETH_L1_DATA_GAS_PRICE , DEFAULT_ETH_L1_GAS_PRICE , DEFAULT_ETH_L2_GAS_PRICE ,
476+ DEFAULT_STRK_L1_DATA_GAS_PRICE , DEFAULT_STRK_L1_GAS_PRICE ,
467477 } ;
468478 use katana_node:: config:: execution:: {
469479 DEFAULT_INVOCATION_MAX_STEPS , DEFAULT_VALIDATION_MAX_STEPS ,
@@ -524,37 +534,37 @@ mod test {
524534 let config =
525535 NodeArgs :: parse_from ( [ "katana" , "--gpo.l1-eth-gas-price" , "10" ] ) . config ( ) . unwrap ( ) ;
526536 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
527- assert_eq!( prices. gas_price . eth. get( ) , 10 ) ;
528- assert_eq!( prices. gas_price . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
529- assert_eq!( prices. data_gas_price . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
530- assert_eq!( prices. data_gas_price . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
537+ assert_eq!( prices. l1_gas_prices . eth. get( ) , 10 ) ;
538+ assert_eq!( prices. l1_gas_prices . strk, DEFAULT_ETH_L2_GAS_PRICE ) ;
539+ assert_eq!( prices. l1_data_gas_prices . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
540+ assert_eq!( prices. l1_data_gas_prices . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
531541 } ) ;
532542
533543 let config =
534544 NodeArgs :: parse_from ( [ "katana" , "--gpo.l1-strk-gas-price" , "20" ] ) . config ( ) . unwrap ( ) ;
535545 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
536- assert_eq!( prices. gas_price . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
537- assert_eq!( prices. gas_price . strk. get( ) , 20 ) ;
538- assert_eq!( prices. data_gas_price . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
539- assert_eq!( prices. data_gas_price . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
546+ assert_eq!( prices. l1_gas_prices . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
547+ assert_eq!( prices. l1_gas_prices . strk. get( ) , 20 ) ;
548+ assert_eq!( prices. l1_data_gas_prices . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
549+ assert_eq!( prices. l1_data_gas_prices . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
540550 } ) ;
541551
542552 let config =
543553 NodeArgs :: parse_from ( [ "katana" , "--gpo.l1-eth-data-gas-price" , "2" ] ) . config ( ) . unwrap ( ) ;
544554 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
545- assert_eq!( prices. gas_price . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
546- assert_eq!( prices. gas_price . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
547- assert_eq!( prices. data_gas_price . eth. get( ) , 2 ) ;
548- assert_eq!( prices. data_gas_price . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
555+ assert_eq!( prices. l1_gas_prices . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
556+ assert_eq!( prices. l1_gas_prices . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
557+ assert_eq!( prices. l1_data_gas_prices . eth. get( ) , 2 ) ;
558+ assert_eq!( prices. l1_data_gas_prices . strk, DEFAULT_STRK_L1_DATA_GAS_PRICE ) ;
549559 } ) ;
550560
551561 let config =
552562 NodeArgs :: parse_from ( [ "katana" , "--gpo.l1-strk-data-gas-price" , "2" ] ) . config ( ) . unwrap ( ) ;
553563 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
554- assert_eq!( prices. gas_price . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
555- assert_eq!( prices. gas_price . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
556- assert_eq!( prices. data_gas_price . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
557- assert_eq!( prices. data_gas_price . strk. get( ) , 2 ) ;
564+ assert_eq!( prices. l1_gas_prices . eth, DEFAULT_ETH_L1_GAS_PRICE ) ;
565+ assert_eq!( prices. l1_gas_prices . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
566+ assert_eq!( prices. l1_data_gas_prices . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
567+ assert_eq!( prices. l1_data_gas_prices . strk. get( ) , 2 ) ;
558568 } ) ;
559569
560570 let config = NodeArgs :: parse_from ( [
@@ -568,10 +578,10 @@ mod test {
568578 . unwrap ( ) ;
569579
570580 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
571- assert_eq!( prices. gas_price . eth. get( ) , 10 ) ;
572- assert_eq!( prices. gas_price . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
573- assert_eq!( prices. data_gas_price . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
574- assert_eq!( prices. data_gas_price . strk. get( ) , 2 ) ;
581+ assert_eq!( prices. l1_gas_prices . eth. get( ) , 10 ) ;
582+ assert_eq!( prices. l1_gas_prices . strk, DEFAULT_STRK_L1_GAS_PRICE ) ;
583+ assert_eq!( prices. l1_data_gas_prices . eth, DEFAULT_ETH_L1_DATA_GAS_PRICE ) ;
584+ assert_eq!( prices. l1_data_gas_prices . strk. get( ) , 2 ) ;
575585 } ) ;
576586
577587 // Set all the gas prices options
@@ -591,10 +601,10 @@ mod test {
591601 . unwrap ( ) ;
592602
593603 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
594- assert_eq!( prices. gas_price . eth. get( ) , 10 ) ;
595- assert_eq!( prices. gas_price . strk. get( ) , 20 ) ;
596- assert_eq!( prices. data_gas_price . eth. get( ) , 1 ) ;
597- assert_eq!( prices. data_gas_price . strk. get( ) , 2 ) ;
604+ assert_eq!( prices. l1_gas_prices . eth. get( ) , 10 ) ;
605+ assert_eq!( prices. l1_gas_prices . strk. get( ) , 20 ) ;
606+ assert_eq!( prices. l1_data_gas_prices . eth. get( ) , 1 ) ;
607+ assert_eq!( prices. l1_data_gas_prices . strk. get( ) , 2 ) ;
598608 } )
599609 }
600610
@@ -624,10 +634,10 @@ mod test {
624634 assert_eq ! ( config. chain. genesis( ) . gas_prices. eth. get( ) , 9999 ) ;
625635 assert_eq ! ( config. chain. genesis( ) . gas_prices. strk. get( ) , 8888 ) ;
626636 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
627- assert_eq!( prices. gas_price . eth. get( ) , 100 ) ;
628- assert_eq!( prices. gas_price . strk. get( ) , 200 ) ;
629- assert_eq!( prices. data_gas_price . eth. get( ) , 111 ) ;
630- assert_eq!( prices. data_gas_price . strk. get( ) , 222 ) ;
637+ assert_eq!( prices. l1_gas_prices . eth. get( ) , 100 ) ;
638+ assert_eq!( prices. l1_gas_prices . strk. get( ) , 200 ) ;
639+ assert_eq!( prices. l1_data_gas_prices . eth. get( ) , 111 ) ;
640+ assert_eq!( prices. l1_data_gas_prices . strk. get( ) , 222 ) ;
631641 } )
632642 }
633643
@@ -675,10 +685,10 @@ chain_id.Named = "Mainnet"
675685 assert_eq ! ( config. execution. invocation_max_steps, 9988 ) ;
676686 assert ! ( !config. dev. fee) ;
677687 assert_matches ! ( config. dev. fixed_gas_prices, Some ( prices) => {
678- assert_eq!( prices. gas_price . eth. get( ) , 254 ) ;
679- assert_eq!( prices. gas_price . strk. get( ) , 200 ) ;
680- assert_eq!( prices. data_gas_price . eth. get( ) , 111 ) ;
681- assert_eq!( prices. data_gas_price . strk. get( ) , 222 ) ;
688+ assert_eq!( prices. l1_gas_prices . eth. get( ) , 254 ) ;
689+ assert_eq!( prices. l1_gas_prices . strk. get( ) , 200 ) ;
690+ assert_eq!( prices. l1_data_gas_prices . eth. get( ) , 111 ) ;
691+ assert_eq!( prices. l1_data_gas_prices . strk. get( ) , 222 ) ;
682692 } ) ;
683693 assert_eq ! ( config. chain. genesis( ) . number, 0 ) ;
684694 assert_eq ! ( config. chain. genesis( ) . parent_hash, felt!( "0x999" ) ) ;
0 commit comments