Skip to content

Commit

Permalink
Merge branch 'chore/add-tests-for-v1-gas-service' into rafal/lock_fre…
Browse files Browse the repository at this point in the history
…e_gas_price_service
  • Loading branch information
MitchTurner authored Jan 14, 2025
2 parents e79b14c + 40b28d7 commit e389563
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions bin/fuel-core/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,17 @@ pub struct Command {
pub gas_price_threshold_percent: u8,

/// Minimum DA gas price
#[arg(long = "min-da-gas-price", default_value = "1000", env)]
#[cfg_attr(
feature = "production",
arg(long = "min-da-gas-price", default_value = "1000", env)
)]
#[cfg_attr(
not(feature = "production"),
arg(long = "min-da-gas-price", default_value = "0", env)
)]
pub min_da_gas_price: u64,

/// Maximum DA gas price
// DEV: ensure that the max_da_gas_price default is > then the min_da_gas_price default
/// Maximum allowed gas price for DA.
#[arg(long = "max-da-gas-price", default_value = "100000", env)]
pub max_da_gas_price: u64,

Expand Down Expand Up @@ -402,6 +408,12 @@ impl Command {
info!("All metrics are disabled");
}

if max_da_gas_price < min_da_gas_price {
anyhow::bail!(
"The maximum DA gas price must be greater than or equal to the minimum DA gas price"
);
}

let addr = net::SocketAddr::new(graphql.ip, graphql.port);

let snapshot_reader = match snapshot.as_ref() {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/gas_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async fn produce_block__dont_raises_gas_price_with_default_parameters() {
];
let driver = FuelCoreDriver::spawn(&args).await.unwrap();

let expected_default_da_gas_price = 10000000;
let expected_default_da_gas_price = 0;

let expected_gas_price = expected_default_da_gas_price;

Expand Down

0 comments on commit e389563

Please sign in to comment.