-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor all the gas price cli args, fix downstream problems (#2670)
## Linked Issues/PRs <!-- List of related issues/PRs --> #2555 ## Description <!-- List of detailed changes --> There are a lot of gas price args. Now they are all in their own place :) Doesn't change API.
- Loading branch information
1 parent
e41d936
commit 8224289
Showing
10 changed files
with
286 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
use clap::Args; | ||
#[cfg(feature = "production")] | ||
use fuel_core::service::sub_services::DEFAULT_GAS_PRICE_CHANGE_PERCENT; | ||
use url::Url; | ||
|
||
#[derive(Debug, Clone, Args)] | ||
pub struct GasPriceArgs { | ||
/// The starting execution gas price for the network | ||
#[cfg_attr( | ||
feature = "production", | ||
arg(long = "starting-gas-price", default_value = "1000", env) | ||
)] | ||
#[cfg_attr( | ||
not(feature = "production"), | ||
arg(long = "starting-gas-price", default_value = "0", env) | ||
)] | ||
pub starting_gas_price: u64, | ||
|
||
/// The percentage change in gas price per block | ||
#[cfg_attr( | ||
feature = "production", | ||
arg(long = "gas-price-change-percent", default_value_t = DEFAULT_GAS_PRICE_CHANGE_PERCENT, env) | ||
)] | ||
#[cfg_attr( | ||
not(feature = "production"), | ||
arg(long = "gas-price-change-percent", default_value = "0", env) | ||
)] | ||
pub gas_price_change_percent: u16, | ||
|
||
/// The minimum allowed gas price | ||
#[arg(long = "min-gas-price", default_value = "0", env)] | ||
pub min_gas_price: u64, | ||
|
||
/// The percentage threshold for gas price increase | ||
#[arg(long = "gas-price-threshold-percent", default_value = "50", env)] | ||
pub gas_price_threshold_percent: u8, | ||
|
||
/// Minimum DA gas price | ||
#[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 allowed gas price for DA. | ||
#[arg(long = "max-da-gas-price", default_value = "100000", env)] | ||
pub max_da_gas_price: u64, | ||
|
||
/// P component of DA gas price calculation | ||
/// **NOTE**: This is the **inverse** gain of a typical P controller. | ||
/// Increasing this value will reduce gas price fluctuations. | ||
#[arg( | ||
long = "da-gas-price-p-component", | ||
default_value = "799999999999993", | ||
env | ||
)] | ||
pub da_gas_price_p_component: i64, | ||
|
||
/// D component of DA gas price calculation | ||
/// **NOTE**: This is the **inverse** anticipatory control factor of a typical PD controller. | ||
/// Increasing this value will reduce the dampening effect of quick algorithm changes. | ||
#[arg( | ||
long = "da-gas-price-d-component", | ||
default_value = "10000000000000000", | ||
env | ||
)] | ||
pub da_gas_price_d_component: i64, | ||
|
||
/// The URL for the DA Block Committer info | ||
#[arg(long = "da-committer-url", env)] | ||
pub da_committer_url: Option<Url>, | ||
|
||
/// The interval at which the `DaSourceService` polls for new data | ||
#[arg(long = "da-poll-interval", env)] | ||
pub da_poll_interval: Option<humantime::Duration>, | ||
|
||
/// The L2 height the Gas Price Service will assume is already recorded on DA | ||
/// i.e. If you want the Gas Price Service to look for the costs of block 1000, set to 999 | ||
#[arg(long = "da-starting-recorded-height", env)] | ||
pub da_starting_recorded_height: Option<u32>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.