mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-16 19:32:55 +00:00
Merge branch 'master' into eth1-deploy
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user