backports to beta (#7434)
* Merge pull request #7368 from paritytech/td-future-blocks Wait for future blocks in AuRa * Fix tracing failed calls. * Problem: sending any Whisper message fails The error is "PoW too low to compete with other messages" This has been previously reported in #7144 Solution: prevent the move semantics The source of the error is in PoolHandle.relay implementation for NetPoolHandle. Because of the move semantics, `res` variable is in fact copied (as it implements Copy) into the closure and for that reason, the returned result is always `false. * Merge pull request #7433 from paritytech/td-strict-config Strict config parsing * Problem: AuRa's unsafeties around step duration (#7282) Firstly, `Step.duration_remaining` casts it to u32, unnecesarily limiting it to 2^32. While theoretically this is "good enough" (at 3 seconds steps it provides room for a little over 400 years), it is still a lossy way to calculate the remaining time until the next step. Secondly, step duration might be zero, triggering division by zero in `Step.calibrate` Solution: rework the code around the fact that duration is typically in single digits and never grows, hence, it can be represented by a much narrower range (u16) and this highlights the fact that multiplying u64 by u16 will only result in an overflow in even further future, at which point we should panic informatively (if anybody's still around) Similarly, panic when it is detected that incrementing the step counter wrapped around on the overflow of usize. As for the division by zero, prevent it by making zero an invalid value for step duration. This will make AuRa log the constraint mismatch and panic (after all, what purpose would zero step duration serve? it makes no sense within the definition of the protocol, as finality can only be achieved as per the specification if messages are received within the step duration, which would violate the speed of light and other physical laws in this case). * Merge pull request #7437 from paritytech/a5-chains-expanse Remove expanse chain * Expanse Byzantium update w/ correct metropolis difficulty increment divisor (#7463) * Byzantium Update for Expanse Here the changes go. Hope I didnt miss anything. * expip2 changes - update duration limit * Fix missing EXPIP-2 fields * Format numbers as hex * Fix compilation errors * Group expanse chain spec fields together * Set metropolisDifficultyIncrementDivisor for Expanse * Revert #7437 * Add Expanse block 900_000 hash checkpoint * Advance AuRa step as far as we can and prevent invalid blocks. (#7451) * Advance AuRa step as far as we can. * Wait for future blocks. * fixed panic when io is not available for export block, closes #7486 (#7495) * Update Parity Mainnet Bootnodes (#7476) * Update Parity Mainnet Bootnodes * Replace the Azure HDD bootnodes with the new ones :) * Use https connection (#7503) Use https when connecting to etherscan.io API for price-info * Expose default gas price percentile configuration in CLI (#7497) * Expose gas price percentile. * Fix light eth_call. * fix gas_price in light client
This commit is contained in:
committed by
Afri Schoedon
parent
c3727266e1
commit
a257827f27
@@ -342,6 +342,7 @@ usage! {
|
||||
ARG arg_password: (Vec<String>) = Vec::new(), or |c: &Config| otry!(c.account).password.clone(),
|
||||
"--password=[FILE]...",
|
||||
"Provide a file containing a password for unlocking an account. Leading and trailing whitespace is trimmed.",
|
||||
|
||||
["UI options"]
|
||||
FLAG flag_force_ui: (bool) = false, or |c: &Config| otry!(c.ui).force.clone(),
|
||||
"--force-ui",
|
||||
@@ -684,6 +685,10 @@ usage! {
|
||||
"--min-gas-price=[STRING]",
|
||||
"Minimum amount of Wei per GAS to be paid for a transaction to be accepted for mining. Overrides --basic-tx-usd.",
|
||||
|
||||
ARG arg_gas_price_percentile: (usize) = 50usize, or |c: &Config| otry!(c.mining).gas_price_percentile,
|
||||
"--gas-price-percentile=[PCT]",
|
||||
"Set PCT percentile gas price value from last 100 blocks as default gas price when sending transactions.",
|
||||
|
||||
ARG arg_author: (Option<String>) = None, or |c: &Config| otry!(c.mining).author.clone(),
|
||||
"--author=[ADDRESS]",
|
||||
"Specify the block author (aka \"coinbase\") address for sending block rewards from sealed blocks. NOTE: MINING WILL NOT WORK WITHOUT THIS OPTION.", // Sealing/Mining Option
|
||||
@@ -982,6 +987,7 @@ struct Config {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Operating {
|
||||
mode: Option<String>,
|
||||
mode_timeout: Option<u64>,
|
||||
@@ -1001,6 +1007,7 @@ struct Operating {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Account {
|
||||
unlock: Option<Vec<String>>,
|
||||
password: Option<Vec<String>>,
|
||||
@@ -1010,6 +1017,7 @@ struct Account {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Ui {
|
||||
force: Option<bool>,
|
||||
disable: Option<bool>,
|
||||
@@ -1020,6 +1028,7 @@ struct Ui {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Network {
|
||||
warp: Option<bool>,
|
||||
port: Option<u16>,
|
||||
@@ -1039,6 +1048,7 @@ struct Network {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Rpc {
|
||||
disable: Option<bool>,
|
||||
port: Option<u16>,
|
||||
@@ -1051,6 +1061,7 @@ struct Rpc {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Ws {
|
||||
disable: Option<bool>,
|
||||
port: Option<u16>,
|
||||
@@ -1061,6 +1072,7 @@ struct Ws {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Ipc {
|
||||
disable: Option<bool>,
|
||||
path: Option<String>,
|
||||
@@ -1068,6 +1080,7 @@ struct Ipc {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Dapps {
|
||||
disable: Option<bool>,
|
||||
port: Option<u16>,
|
||||
@@ -1080,6 +1093,7 @@ struct Dapps {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct SecretStore {
|
||||
disable: Option<bool>,
|
||||
disable_http: Option<bool>,
|
||||
@@ -1095,6 +1109,7 @@ struct SecretStore {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Ipfs {
|
||||
enable: Option<bool>,
|
||||
port: Option<u16>,
|
||||
@@ -1104,6 +1119,7 @@ struct Ipfs {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Mining {
|
||||
author: Option<String>,
|
||||
engine_signer: Option<String>,
|
||||
@@ -1117,6 +1133,7 @@ struct Mining {
|
||||
tx_time_limit: Option<u64>,
|
||||
relay_set: Option<String>,
|
||||
min_gas_price: Option<u64>,
|
||||
gas_price_percentile: Option<usize>,
|
||||
usd_per_tx: Option<String>,
|
||||
usd_per_eth: Option<String>,
|
||||
price_update_period: Option<String>,
|
||||
@@ -1135,6 +1152,7 @@ struct Mining {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Stratum {
|
||||
interface: Option<String>,
|
||||
port: Option<u16>,
|
||||
@@ -1142,6 +1160,7 @@ struct Stratum {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Footprint {
|
||||
tracing: Option<String>,
|
||||
pruning: Option<String>,
|
||||
@@ -1160,16 +1179,19 @@ struct Footprint {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Snapshots {
|
||||
disable_periodic: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct VM {
|
||||
jit: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Misc {
|
||||
ntp_servers: Option<Vec<String>>,
|
||||
logging: Option<String>,
|
||||
@@ -1180,6 +1202,7 @@ struct Misc {
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, PartialEq, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
struct Whisper {
|
||||
enabled: Option<bool>,
|
||||
pool_size: Option<usize>,
|
||||
@@ -1512,6 +1535,7 @@ mod tests {
|
||||
arg_tx_time_limit: Some(100u64),
|
||||
arg_relay_set: "cheap".into(),
|
||||
arg_min_gas_price: Some(0u64),
|
||||
arg_gas_price_percentile: 50usize,
|
||||
arg_usd_per_tx: "0.0025".into(),
|
||||
arg_usd_per_eth: "auto".into(),
|
||||
arg_price_update_period: "hourly".into(),
|
||||
@@ -1624,11 +1648,17 @@ mod tests {
|
||||
let config1 = Args::parse_config(include_str!("./tests/config.invalid1.toml"));
|
||||
let config2 = Args::parse_config(include_str!("./tests/config.invalid2.toml"));
|
||||
let config3 = Args::parse_config(include_str!("./tests/config.invalid3.toml"));
|
||||
let config4 = Args::parse_config(include_str!("./tests/config.invalid4.toml"));
|
||||
|
||||
match (config1, config2, config3) {
|
||||
(Err(ArgsError::Decode(_)), Err(ArgsError::Decode(_)), Err(ArgsError::Decode(_))) => {},
|
||||
(a, b, c) => {
|
||||
assert!(false, "Got invalid error types: {:?}, {:?}, {:?}", a, b, c);
|
||||
match (config1, config2, config3, config4) {
|
||||
(
|
||||
Err(ArgsError::Decode(_)),
|
||||
Err(ArgsError::Decode(_)),
|
||||
Err(ArgsError::Decode(_)),
|
||||
Err(ArgsError::Decode(_)),
|
||||
) => {},
|
||||
(a, b, c, d) => {
|
||||
assert!(false, "Got invalid error types: {:?}, {:?}, {:?}, {:?}", a, b, c, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1751,6 +1781,7 @@ mod tests {
|
||||
work_queue_size: None,
|
||||
relay_set: None,
|
||||
min_gas_price: None,
|
||||
gas_price_percentile: None,
|
||||
usd_per_tx: None,
|
||||
usd_per_eth: None,
|
||||
price_update_period: Some("hourly".into()),
|
||||
|
||||
2
parity/cli/tests/config.invalid4.toml
Normal file
2
parity/cli/tests/config.invalid4.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[account]
|
||||
invalid = 5
|
||||
Reference in New Issue
Block a user