[frontport] CLI to specify queue ordering strategy (#2494) (#2623)

* CLI to specify queue ordering strategy (#2494)

* Alter gas priorities to include gas_price also

* CLI options and tests

* Adding ordering by gas

* whitespace

Conflicts:
	ethcore/src/miner/miner.rs
	ethcore/src/miner/mod.rs
	ethcore/src/miner/transaction_queue.rs
	parity/cli/usage.txt
	parity/configuration.rs

* fix build
This commit is contained in:
Tomasz Drwięga
2016-10-15 14:46:33 +02:00
committed by Gav Wood
parent 03c1559ead
commit cceca916a1
11 changed files with 288 additions and 103 deletions

View File

@@ -67,8 +67,9 @@ usd_per_eth = "auto"
price_update_period = "hourly"
gas_floor_target = "4700000"
gas_cap = "6283184"
tx_queue_size = 2048
tx_queue_size = 1024
tx_queue_gas = "auto"
tx_queue_strategy = "gas_factor"
tx_gas_limit = "6283184"
extra_data = "Parity"
remove_solved = false

View File

@@ -40,7 +40,7 @@ force_sealing = true
reseal_on_txs = "all"
reseal_min_period = 4000
price_update_period = "hourly"
tx_queue_size = 2048
tx_queue_size = 1024
tx_queue_gas = "auto"
[footprint]

View File

@@ -193,10 +193,12 @@ 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 = 2048usize,
flag_tx_queue_size: usize = 1024usize,
or |c: &Config| otry!(c.mining).tx_queue_size.clone(),
flag_tx_queue_gas: String = "auto",
or |c: &Config| otry!(c.mining).tx_queue_gas.clone(),
flag_tx_queue_strategy: String = "gas_factor",
or |c: &Config| otry!(c.mining).tx_queue_strategy.clone(),
flag_remove_solved: bool = false,
or |c: &Config| otry!(c.mining).remove_solved.clone(),
flag_notify_work: Option<String> = None,
@@ -355,6 +357,7 @@ struct Mining {
extra_data: Option<String>,
tx_queue_size: Option<usize>,
tx_queue_gas: Option<String>,
tx_queue_strategy: Option<String>,
remove_solved: Option<bool>,
notify_work: Option<Vec<String>>,
}
@@ -531,8 +534,9 @@ mod tests {
flag_gas_floor_target: "4700000".into(),
flag_gas_cap: "6283184".into(),
flag_extra_data: Some("Parity".into()),
flag_tx_queue_size: 2048usize,
flag_tx_queue_size: 1024usize,
flag_tx_queue_gas: "auto".into(),
flag_tx_queue_strategy: "gas_factor".into(),
flag_remove_solved: false,
flag_notify_work: Some("http://localhost:3001".into()),
@@ -684,8 +688,9 @@ mod tests {
price_update_period: Some("hourly".into()),
gas_floor_target: None,
gas_cap: None,
tx_queue_size: Some(2048),
tx_queue_size: Some(1024),
tx_queue_gas: Some("auto".into()),
tx_queue_strategy: None,
tx_gas_limit: None,
extra_data: None,
remove_solved: None,

View File

@@ -188,6 +188,12 @@ Sealing/Mining Options:
the queue. LIMIT can be either an amount of gas or
'auto' or 'off'. 'auto' sets the limit to be 20x
the current block gas limit. (default: {flag_tx_queue_gas}).
--tx-queue-strategy S Prioritization strategy used to order transactions
in the queue. S may be:
gas - Prioritize txs with low gas limit;
gas_price - Prioritize txs with high gas price;
gas_factor - Prioritize txs using gas price
and gas limit ratio (default: {flag_tx_queue_strategy}).
--remove-solved Move solved blocks from the work package queue
instead of cloning them. This gives a slightly
faster import speed, but means that extra solutions