More miner options.
- Optional limit for the amount of gas transactions may have; - option to restruct transactions returned/queried to only those which have been executed.
This commit is contained in:
@@ -139,6 +139,11 @@ Sealing/Mining Options:
|
||||
own - reseal only on a new local transaction;
|
||||
ext - reseal only on a new external transaction;
|
||||
all - reseal on all new transactions [default: all].
|
||||
--max-tx-gas GAS Apply a limit of GAS as the maximum amount of gas
|
||||
a single transaction may have for it to be mined.
|
||||
--relay-validity REQ Requirements for relaying. REQ may be:
|
||||
cheap - Relay only after cheap checks;
|
||||
strict - Relay only once executed [default: cheap].
|
||||
--usd-per-tx USD Amount of USD to be paid for a basic transaction
|
||||
[default: 0.005]. The minimum gas price is set
|
||||
accordingly.
|
||||
@@ -152,8 +157,8 @@ Sealing/Mining Options:
|
||||
block due to transaction volume [default: 3141592].
|
||||
--extra-data STRING Specify a custom extra-data for authored blocks, no
|
||||
more than 32 characters.
|
||||
--tx-limit LIMIT Limit of transactions kept in the queue (waiting to
|
||||
be included in next block) [default: 1024].
|
||||
--tx-queue-size LIMIT Maxmimum amount of transactions in the queue (waiting
|
||||
to be included in next block) [default: 1024].
|
||||
|
||||
Footprint Options:
|
||||
--tracing BOOL Indicates if full transaction tracing should be
|
||||
@@ -290,13 +295,15 @@ pub struct Args {
|
||||
pub flag_no_token: bool,
|
||||
pub flag_force_sealing: bool,
|
||||
pub flag_reseal_on_txs: String,
|
||||
pub flag_max_tx_gas: Option<String>,
|
||||
pub flag_relay_validity: String,
|
||||
pub flag_author: Option<String>,
|
||||
pub flag_usd_per_tx: String,
|
||||
pub flag_usd_per_eth: String,
|
||||
pub flag_gas_floor_target: String,
|
||||
pub flag_gas_cap: String,
|
||||
pub flag_extra_data: Option<String>,
|
||||
pub flag_tx_limit: usize,
|
||||
pub flag_tx_queue_size: usize,
|
||||
pub flag_logging: Option<String>,
|
||||
pub flag_version: bool,
|
||||
pub flag_from: String,
|
||||
|
||||
@@ -68,6 +68,14 @@ impl Configuration {
|
||||
self.args.flag_maxpeers.unwrap_or(self.args.flag_peers) as u32
|
||||
}
|
||||
|
||||
fn decode_u256(d: &str, argument: &str) -> U256 {
|
||||
U256::from_dec_str(d).unwrap_or_else(|_|
|
||||
U256::from_str(clean_0x(d)).unwrap_or_else(|_|
|
||||
die!("{}: Invalid numeric value for {}. Must be either a decimal or a hex number.", d, argument)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
pub fn miner_options(&self) -> MinerOptions {
|
||||
let (own, ext) = match self.args.flag_reseal_on_txs.as_str() {
|
||||
"none" => (false, false),
|
||||
@@ -80,6 +88,12 @@ impl Configuration {
|
||||
force_sealing: self.args.flag_force_sealing,
|
||||
reseal_on_external_tx: ext,
|
||||
reseal_on_own_tx: own,
|
||||
max_tx_gas: self.args.flag_max_tx_gas.as_ref().map(|d| Self::decode_u256(d, "--max-tx-gas")),
|
||||
strict_valid_pending: match self.args.flag_relay_validity.as_str() {
|
||||
"cheap" => false,
|
||||
"strict" => true,
|
||||
x => die!("{}: Invalid value for --relay-validity option. Use --help for more information.", x)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ fn execute_client(conf: Configuration, spec: Spec, client_config: ClientConfig)
|
||||
miner.set_gas_ceil_target(conf.gas_ceil_target());
|
||||
miner.set_extra_data(conf.extra_data());
|
||||
miner.set_minimal_gas_price(conf.gas_price());
|
||||
miner.set_transactions_limit(conf.args.flag_tx_limit);
|
||||
miner.set_transactions_limit(conf.args.flag_tx_queue_size);
|
||||
|
||||
// Build client
|
||||
let mut service = ClientService::start(
|
||||
|
||||
Reference in New Issue
Block a user