Limit transaction queue memory & limit future queue (#6038)
* Remove confusing gas_limit in the pool. * Change defaults * Limit transaction queue by memory usage. * Change defaults to something lower. * Fix rpc test. * Fix js issues. * Renamed block_gas_limit
This commit is contained in:
committed by
Arkadiy Paronyan
parent
58307479ad
commit
1aaafa2d11
@@ -106,8 +106,8 @@ usd_per_eth = "auto"
|
||||
price_update_period = "hourly"
|
||||
gas_floor_target = "4700000"
|
||||
gas_cap = "6283184"
|
||||
tx_queue_size = 1024
|
||||
tx_queue_gas = "auto"
|
||||
tx_queue_size = 8192
|
||||
tx_queue_gas = "off"
|
||||
tx_queue_strategy = "gas_factor"
|
||||
tx_queue_ban_count = 1
|
||||
tx_queue_ban_time = 180 #s
|
||||
|
||||
@@ -56,8 +56,8 @@ reseal_on_txs = "all"
|
||||
reseal_min_period = 4000
|
||||
reseal_max_period = 60000
|
||||
price_update_period = "hourly"
|
||||
tx_queue_size = 1024
|
||||
tx_queue_gas = "auto"
|
||||
tx_queue_size = 8192
|
||||
tx_queue_gas = "off"
|
||||
|
||||
[footprint]
|
||||
tracing = "on"
|
||||
|
||||
@@ -278,9 +278,11 @@ usage! {
|
||||
or |c: &Config| otry!(c.mining).gas_cap.clone(),
|
||||
flag_extra_data: Option<String> = None,
|
||||
or |c: &Config| otry!(c.mining).extra_data.clone().map(Some),
|
||||
flag_tx_queue_size: usize = 1024usize,
|
||||
flag_tx_queue_size: usize = 8192usize,
|
||||
or |c: &Config| otry!(c.mining).tx_queue_size.clone(),
|
||||
flag_tx_queue_gas: String = "auto",
|
||||
flag_tx_queue_mem_limit: u32 = 2u32,
|
||||
or |c: &Config| otry!(c.mining).tx_queue_mem_limit.clone(),
|
||||
flag_tx_queue_gas: String = "off",
|
||||
or |c: &Config| otry!(c.mining).tx_queue_gas.clone(),
|
||||
flag_tx_queue_strategy: String = "gas_price",
|
||||
or |c: &Config| otry!(c.mining).tx_queue_strategy.clone(),
|
||||
@@ -546,6 +548,7 @@ struct Mining {
|
||||
gas_cap: Option<String>,
|
||||
extra_data: Option<String>,
|
||||
tx_queue_size: Option<usize>,
|
||||
tx_queue_mem_limit: Option<u32>,
|
||||
tx_queue_gas: Option<String>,
|
||||
tx_queue_strategy: Option<String>,
|
||||
tx_queue_ban_count: Option<u16>,
|
||||
@@ -809,8 +812,9 @@ mod tests {
|
||||
flag_gas_floor_target: "4700000".into(),
|
||||
flag_gas_cap: "6283184".into(),
|
||||
flag_extra_data: Some("Parity".into()),
|
||||
flag_tx_queue_size: 1024usize,
|
||||
flag_tx_queue_gas: "auto".into(),
|
||||
flag_tx_queue_size: 8192usize,
|
||||
flag_tx_queue_mem_limit: 2u32,
|
||||
flag_tx_queue_gas: "off".into(),
|
||||
flag_tx_queue_strategy: "gas_factor".into(),
|
||||
flag_tx_queue_ban_count: 1u16,
|
||||
flag_tx_queue_ban_time: 180u16,
|
||||
@@ -1035,8 +1039,9 @@ mod tests {
|
||||
price_update_period: Some("hourly".into()),
|
||||
gas_floor_target: None,
|
||||
gas_cap: None,
|
||||
tx_queue_size: Some(1024),
|
||||
tx_queue_gas: Some("auto".into()),
|
||||
tx_queue_size: Some(8192),
|
||||
tx_queue_mem_limit: None,
|
||||
tx_queue_gas: Some("off".into()),
|
||||
tx_queue_strategy: None,
|
||||
tx_queue_ban_count: None,
|
||||
tx_queue_ban_time: None,
|
||||
|
||||
@@ -311,6 +311,9 @@ Sealing/Mining Options:
|
||||
block due to transaction volume (default: {flag_gas_cap}).
|
||||
--extra-data STRING Specify a custom extra-data for authored blocks, no
|
||||
more than 32 characters. (default: {flag_extra_data:?})
|
||||
--tx-queue-mem-limit MB Maximum amount of memory that can be used by the
|
||||
transaction queue. Setting this parameter to 0
|
||||
disables limiting (default: {flag_tx_queue_mem_limit}).
|
||||
--tx-queue-size LIMIT Maximum amount of transactions in the queue (waiting
|
||||
to be included in next block) (default: {flag_tx_queue_size}).
|
||||
--tx-queue-gas LIMIT Maximum amount of total gas for external transactions in
|
||||
|
||||
@@ -407,7 +407,6 @@ impl Configuration {
|
||||
extra_data: self.extra_data()?,
|
||||
gas_floor_target: to_u256(&self.args.flag_gas_floor_target)?,
|
||||
gas_ceil_target: to_u256(&self.args.flag_gas_cap)?,
|
||||
transactions_limit: self.args.flag_tx_queue_size,
|
||||
engine_signer: self.engine_signer()?,
|
||||
};
|
||||
|
||||
@@ -532,6 +531,9 @@ impl Configuration {
|
||||
None => U256::max_value(),
|
||||
},
|
||||
tx_queue_size: self.args.flag_tx_queue_size,
|
||||
tx_queue_memory_limit: if self.args.flag_tx_queue_mem_limit > 0 {
|
||||
Some(self.args.flag_tx_queue_mem_limit as usize * 1024 * 1024)
|
||||
} else { None },
|
||||
tx_queue_gas_limit: to_gas_limit(&self.args.flag_tx_queue_gas)?,
|
||||
tx_queue_strategy: to_queue_strategy(&self.args.flag_tx_queue_strategy)?,
|
||||
pending_set: to_pending_set(&self.args.flag_relay_set)?,
|
||||
|
||||
@@ -246,7 +246,6 @@ pub struct MinerExtras {
|
||||
pub extra_data: Vec<u8>,
|
||||
pub gas_floor_target: U256,
|
||||
pub gas_ceil_target: U256,
|
||||
pub transactions_limit: usize,
|
||||
pub engine_signer: Address,
|
||||
}
|
||||
|
||||
@@ -257,7 +256,6 @@ impl Default for MinerExtras {
|
||||
extra_data: version_data(),
|
||||
gas_floor_target: U256::from(4_700_000),
|
||||
gas_ceil_target: U256::from(6_283_184),
|
||||
transactions_limit: 1024,
|
||||
engine_signer: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,7 +473,6 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
|
||||
miner.set_gas_floor_target(cmd.miner_extras.gas_floor_target);
|
||||
miner.set_gas_ceil_target(cmd.miner_extras.gas_ceil_target);
|
||||
miner.set_extra_data(cmd.miner_extras.extra_data);
|
||||
miner.set_transactions_limit(cmd.miner_extras.transactions_limit);
|
||||
miner.set_minimal_gas_price(initial_min_gas_price);
|
||||
miner.recalibrate_minimal_gas_price();
|
||||
let engine_signer = cmd.miner_extras.engine_signer;
|
||||
|
||||
Reference in New Issue
Block a user