fuel_txpool/
config.rs

1use fuel_chain_config::ChainConfig;
2
3#[derive(Debug, Clone)]
4pub struct Config {
5    /// Maximum number of transactions inside the pool
6    pub max_tx: usize,
7    /// max depth of connected UTXO excluding contracts
8    pub max_depth: usize,
9    /// The minimum allowed gas price
10    pub min_gas_price: u64,
11    /// Flag to disable utxo existence and signature checks
12    pub utxo_validation: bool,
13    /// chain config
14    pub chain_config: ChainConfig,
15    /// Enables prometheus metrics for this fuel-service
16    pub metrics: bool,
17}
18
19impl Default for Config {
20    fn default() -> Self {
21        let min_gas_price = 0;
22        let utxo_validation = true;
23        Self::new(ChainConfig::default(), min_gas_price, utxo_validation)
24    }
25}
26
27impl Config {
28    pub fn new(
29        chain_config: ChainConfig,
30        min_gas_price: u64,
31        utxo_validation: bool,
32    ) -> Self {
33        // # Dev-note: If you add a new field, be sure that this field is propagated correctly
34        //  in all places where `new` is used.
35        Self {
36            max_tx: 4064,
37            max_depth: 10,
38            min_gas_price,
39            utxo_validation,
40            chain_config,
41            metrics: false,
42        }
43    }
44}