mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Disallow genesis sync outside blob pruning window (#5038)
* Disallow Syncing From Genesis By Default * Fix CLI Tests * Perform checks in the `ClientBuilder` * Tidy, fix tests * Return an error based on the Deneb fork * Fix typos * Fix failing test * Add missing CLI flag * Fix CLI flags * Add suggestion from Sean * Fix conflict with blob sidecars epochs --------- Co-authored-by: Mark Mackey <mark@sigmaprime.io>
This commit is contained in:
@@ -955,6 +955,16 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.takes_value(true)
|
||||
.default_value("180")
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("allow-insecure-genesis-sync")
|
||||
.long("allow-insecure-genesis-sync")
|
||||
.help("Enable syncing from genesis, which is generally insecure and incompatible with data availability checks. \
|
||||
Checkpoint syncing is the preferred method for syncing a node. \
|
||||
Only use this flag when testing. DO NOT use on mainnet!")
|
||||
.conflicts_with("checkpoint-sync-url")
|
||||
.conflicts_with("checkpoint-state")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("reconstruct-historic-states")
|
||||
.long("reconstruct-historic-states")
|
||||
|
||||
@@ -497,6 +497,8 @@ pub fn get_config<E: EthSpec>(
|
||||
None
|
||||
};
|
||||
|
||||
client_config.allow_insecure_genesis_sync = cli_args.is_present("allow-insecure-genesis-sync");
|
||||
|
||||
client_config.genesis = if eth2_network_config.genesis_state_is_known() {
|
||||
// Set up weak subjectivity sync, or start from the hardcoded genesis state.
|
||||
if let (Some(initial_state_path), Some(initial_block_path)) = (
|
||||
|
||||
Reference in New Issue
Block a user