Merge branch 'master' into eth1-deploy

This commit is contained in:
Paul Hauner
2019-11-27 12:49:22 +11:00
25 changed files with 2239 additions and 659 deletions

View File

@@ -221,6 +221,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.help("If present, append a random string to the datadir path. Useful for fast development \
iteration.")
)
.arg(
Arg::with_name("random-propagation")
.long("random-propagation")
.value_name("INTEGER")
.takes_value(true)
.help("Specifies (as a percentage) the likelihood of propagating blocks and attestations. This should only be used for testing networking elements. The value must like in the range 1-100.")
)
.arg(
Arg::with_name("force")
.long("force")

View File

@@ -108,6 +108,16 @@ fn process_testnet_subcommand(
builder.clean_datadir()?;
}
if let Some(propagation_percentage_string) = cli_args.value_of("random-propagation") {
let percentage = propagation_percentage_string
.parse::<u8>()
.map_err(|_| format!("Unable to parse the propagation percentage"))?;
if percentage > 100 {
return Err(format!("Propagation percentage greater than 100"));
}
builder.client_config.network.propagation_percentage = Some(percentage);
}
let is_bootstrap = cli_args.subcommand_name() == Some("bootstrap");
if let Some(path_string) = cli_args.value_of("eth2-config") {