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:
Tomasz Drwięga
2017-07-13 15:12:25 +02:00
committed by Arkadiy Paronyan
parent 58307479ad
commit 1aaafa2d11
11 changed files with 140 additions and 57 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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,

View File

@@ -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