From 3ea8476315bf8745dacabe59dbca1f7179328490 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 25 Feb 2024 14:53:04 +0200 Subject: [PATCH 1/9] default vc to block v3 endpoint and deprecate block-v3 flag --- book/src/help_vc.md | 4 +- lighthouse/tests/validator_client.rs | 14 - validator_client/src/block_service.rs | 280 ++----------------- validator_client/src/cli.rs | 5 +- validator_client/src/config.rs | 7 - validator_client/src/http_metrics/metrics.rs | 1 - validator_client/src/validator_store.rs | 6 - 7 files changed, 29 insertions(+), 288 deletions(-) diff --git a/book/src/help_vc.md b/book/src/help_vc.md index 3d2519aac57..45a8f008335 100644 --- a/book/src/help_vc.md +++ b/book/src/help_vc.md @@ -68,9 +68,7 @@ FLAGS: If this flag is set, Lighthouse will always prefer blocks constructed by builders, regardless of payload value. --produce-block-v3 - Enable block production via the block v3 endpoint for this validator client. This should only be enabled - when paired with a beacon node that has this endpoint implemented. This flag will be enabled by default in - future. + This flag is deprecated and no longer in use. --unencrypted-http-transport This is a safety flag to ensure that the user is aware that the http transport is unencrypted and using a custom HTTP address is unsafe. diff --git a/lighthouse/tests/validator_client.rs b/lighthouse/tests/validator_client.rs index 764fd87ccdf..65ffc4f005f 100644 --- a/lighthouse/tests/validator_client.rs +++ b/lighthouse/tests/validator_client.rs @@ -421,20 +421,6 @@ fn no_doppelganger_protection_flag() { .run() .with_config(|config| assert!(!config.enable_doppelganger_protection)); } -#[test] -fn produce_block_v3_flag() { - CommandLineTest::new() - .flag("produce-block-v3", None) - .run() - .with_config(|config| assert!(config.produce_block_v3)); -} - -#[test] -fn no_produce_block_v3_flag() { - CommandLineTest::new() - .run() - .with_config(|config| assert!(!config.produce_block_v3)); -} #[test] fn no_gas_limit_flag() { diff --git a/validator_client/src/block_service.rs b/validator_client/src/block_service.rs index 445d4f1a5d9..0d49f966ae0 100644 --- a/validator_client/src/block_service.rs +++ b/validator_client/src/block_service.rs @@ -323,105 +323,32 @@ impl BlockService { ) } - if self.validator_store.produce_block_v3() { - for validator_pubkey in proposers { - let builder_boost_factor = self.get_builder_boost_factor(&validator_pubkey); - let service = self.clone(); - let log = log.clone(); - self.inner.context.executor.spawn( - async move { - let result = service - .publish_block_v3(slot, validator_pubkey, builder_boost_factor) - .await; - - match result { - Ok(_) => {} - Err(BlockError::Recoverable(e)) | Err(BlockError::Irrecoverable(e)) => { - error!( - log, - "Error whilst producing block"; - "error" => ?e, - "block_slot" => ?slot, - "info" => "block v3 proposal failed, this error may or may not result in a missed block" - ); - } + for validator_pubkey in proposers { + let builder_boost_factor = self.get_builder_boost_factor(&validator_pubkey); + let service = self.clone(); + let log = log.clone(); + self.inner.context.executor.spawn( + async move { + let result = service + .publish_block(slot, validator_pubkey, builder_boost_factor) + .await; + + match result { + Ok(_) => {} + Err(BlockError::Recoverable(e)) | Err(BlockError::Irrecoverable(e)) => { + error!( + log, + "Error whilst producing block"; + "error" => ?e, + "block_slot" => ?slot, + "info" => "block v3 proposal failed, this error may or may not result in a missed block" + ); } - }, - "block service", - ) - } - } else { - for validator_pubkey in proposers { - let builder_proposals = self - .validator_store - .get_builder_proposals(&validator_pubkey); - let service = self.clone(); - let log = log.clone(); - self.inner.context.executor.spawn( - async move { - if builder_proposals { - let result = service - .publish_block(slot, validator_pubkey, true) - .await; - - match result { - Err(BlockError::Recoverable(e)) => { - error!( - log, - "Error whilst producing block"; - "error" => ?e, - "block_slot" => ?slot, - "info" => "blinded proposal failed, attempting full block" - ); - if let Err(e) = service - .publish_block(slot, validator_pubkey, false) - .await - { - // Log a `crit` since a full block - // (non-builder) proposal failed. - crit!( - log, - "Error whilst producing block"; - "error" => ?e, - "block_slot" => ?slot, - "info" => "full block attempted after a blinded failure", - ); - } - } - Err(BlockError::Irrecoverable(e)) => { - // Only log an `error` since it's common for - // builders to timeout on their response, only - // to publish the block successfully themselves. - error!( - log, - "Error whilst producing block"; - "error" => ?e, - "block_slot" => ?slot, - "info" => "this error may or may not result in a missed block", - ) - } - Ok(_) => {} - }; - } else if let Err(e) = service - .publish_block(slot, validator_pubkey, false) - .await - { - // Log a `crit` since a full block (non-builder) - // proposal failed. - crit!( - log, - "Error whilst producing block"; - "message" => ?e, - "block_slot" => ?slot, - "info" => "proposal did not use a builder", - ); - } - }, - "block service", - ) - } + } + }, + "block service", + ) } - Ok(()) } @@ -513,7 +440,7 @@ impl BlockService { Ok(()) } - async fn publish_block_v3( + async fn publish_block( self, slot: Slot, validator_pubkey: PublicKeyBytes, @@ -584,7 +511,7 @@ impl BlockService { &metrics::BLOCK_SERVICE_TIMES, &[metrics::BEACON_BLOCK_HTTP_GET], ); - let block_response = Self::get_validator_block_v3( + let block_response = Self::get_validator_block( beacon_node, slot, randao_reveal_ref, @@ -619,100 +546,6 @@ impl BlockService { Ok(()) } - /// Produce a block at the given slot for validator_pubkey - async fn publish_block( - &self, - slot: Slot, - validator_pubkey: PublicKeyBytes, - builder_proposal: bool, - ) -> Result<(), BlockError> { - let log = self.context.log(); - let _timer = - metrics::start_timer_vec(&metrics::BLOCK_SERVICE_TIMES, &[metrics::BEACON_BLOCK]); - - let randao_reveal = match self - .validator_store - .randao_reveal(validator_pubkey, slot.epoch(E::slots_per_epoch())) - .await - { - Ok(signature) => signature.into(), - Err(ValidatorStoreError::UnknownPubkey(pubkey)) => { - // A pubkey can be missing when a validator was recently removed - // via the API. - warn!( - log, - "Missing pubkey for block"; - "info" => "a validator may have recently been removed from this VC", - "pubkey" => ?pubkey, - "slot" => ?slot - ); - return Ok(()); - } - Err(e) => { - return Err(BlockError::Recoverable(format!( - "Unable to sign block: {:?}", - e - ))) - } - }; - - let graffiti = determine_graffiti( - &validator_pubkey, - log, - self.graffiti_file.clone(), - self.validator_store.graffiti(&validator_pubkey), - self.graffiti, - ); - - let randao_reveal_ref = &randao_reveal; - let self_ref = &self; - let proposer_index = self.validator_store.validator_index(&validator_pubkey); - let proposer_fallback = ProposerFallback { - beacon_nodes: self.beacon_nodes.clone(), - proposer_nodes: self.proposer_nodes.clone(), - }; - - info!( - log, - "Requesting unsigned block"; - "slot" => slot.as_u64(), - ); - - // Request block from first responsive beacon node. - // - // Try the proposer nodes last, since it's likely that they don't have a - // great view of attestations on the network. - let unsigned_block = proposer_fallback - .request_proposers_last( - RequireSynced::No, - OfflineOnFailure::Yes, - move |beacon_node| { - Self::get_validator_block( - beacon_node, - slot, - randao_reveal_ref, - graffiti, - proposer_index, - builder_proposal, - log, - ) - }, - ) - .await?; - - self_ref - .sign_and_publish_block( - proposer_fallback, - slot, - graffiti, - &validator_pubkey, - unsigned_block, - ) - .await?; - - Ok(()) - } - async fn publish_signed_block_contents( &self, signed_block: &SignedBlock, @@ -745,7 +578,7 @@ impl BlockService { Ok::<_, BlockError>(()) } - async fn get_validator_block_v3( + async fn get_validator_block( beacon_node: &BeaconNodeHttpClient, slot: Slot, randao_reveal_ref: &SignatureBytes, @@ -788,65 +621,6 @@ impl BlockService { Ok::<_, BlockError>(unsigned_block) } - async fn get_validator_block( - beacon_node: &BeaconNodeHttpClient, - slot: Slot, - randao_reveal_ref: &SignatureBytes, - graffiti: Option, - proposer_index: Option, - builder_proposal: bool, - log: &Logger, - ) -> Result, BlockError> { - let unsigned_block = if !builder_proposal { - let _get_timer = metrics::start_timer_vec( - &metrics::BLOCK_SERVICE_TIMES, - &[metrics::BEACON_BLOCK_HTTP_GET], - ); - UnsignedBlock::Full( - beacon_node - .get_validator_blocks::(slot, randao_reveal_ref, graffiti.as_ref()) - .await - .map_err(|e| { - BlockError::Recoverable(format!( - "Error from beacon node when producing block: {:?}", - e - )) - })? - .data, - ) - } else { - let _get_timer = metrics::start_timer_vec( - &metrics::BLOCK_SERVICE_TIMES, - &[metrics::BLINDED_BEACON_BLOCK_HTTP_GET], - ); - UnsignedBlock::Blinded( - beacon_node - .get_validator_blinded_blocks::(slot, randao_reveal_ref, graffiti.as_ref()) - .await - .map_err(|e| { - BlockError::Recoverable(format!( - "Error from beacon node when producing block: {:?}", - e - )) - })? - .data, - ) - }; - - info!( - log, - "Received unsigned block"; - "slot" => slot.as_u64(), - ); - if proposer_index != Some(unsigned_block.proposer_index()) { - return Err(BlockError::Recoverable( - "Proposer index does not match block proposer. Beacon chain re-orged".to_string(), - )); - } - - Ok::<_, BlockError>(unsigned_block) - } - /// Returns the builder boost factor of the given public key. /// The priority order for fetching this value is: /// diff --git a/validator_client/src/cli.rs b/validator_client/src/cli.rs index 16a265212e5..982db381db0 100644 --- a/validator_client/src/cli.rs +++ b/validator_client/src/cli.rs @@ -139,10 +139,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> { .arg( Arg::with_name("produce-block-v3") .long("produce-block-v3") - .help("Enable block production via the block v3 endpoint for this validator client. \ - This should only be enabled when paired with a beacon node \ - that has this endpoint implemented. This flag will be enabled by default in \ - future.") + .help("This flag is deprecated and is no longer in use.") .takes_value(false) ) .arg( diff --git a/validator_client/src/config.rs b/validator_client/src/config.rs index ae59829a3e6..68244513d04 100644 --- a/validator_client/src/config.rs +++ b/validator_client/src/config.rs @@ -78,8 +78,6 @@ pub struct Config { pub validator_registration_batch_size: usize, /// Enable slashing protection even while using web3signer keys. pub enable_web3signer_slashing_protection: bool, - /// Enables block production via the block v3 endpoint. This configuration option can be removed post deneb. - pub produce_block_v3: bool, /// Specifies the boost factor, a percentage multiplier to apply to the builder's payload value. pub builder_boost_factor: Option, /// If true, Lighthouse will prefer builder proposals, if available. @@ -129,7 +127,6 @@ impl Default for Config { enable_latency_measurement_service: true, validator_registration_batch_size: 500, enable_web3signer_slashing_protection: true, - produce_block_v3: false, builder_boost_factor: None, prefer_builder_proposals: false, distributed: false, @@ -379,10 +376,6 @@ impl Config { config.builder_proposals = true; } - if cli_args.is_present("produce-block-v3") { - config.produce_block_v3 = true; - } - if cli_args.is_present("prefer-builder-proposals") { config.prefer_builder_proposals = true; } diff --git a/validator_client/src/http_metrics/metrics.rs b/validator_client/src/http_metrics/metrics.rs index 52b52126bd6..234c242fdf0 100644 --- a/validator_client/src/http_metrics/metrics.rs +++ b/validator_client/src/http_metrics/metrics.rs @@ -11,7 +11,6 @@ pub const UNREGISTERED: &str = "unregistered"; pub const FULL_UPDATE: &str = "full_update"; pub const BEACON_BLOCK: &str = "beacon_block"; pub const BEACON_BLOCK_HTTP_GET: &str = "beacon_block_http_get"; -pub const BLINDED_BEACON_BLOCK_HTTP_GET: &str = "blinded_beacon_block_http_get"; pub const BEACON_BLOCK_HTTP_POST: &str = "beacon_block_http_post"; pub const BLINDED_BEACON_BLOCK_HTTP_POST: &str = "blinded_beacon_block_http_post"; pub const ATTESTATIONS: &str = "attestations"; diff --git a/validator_client/src/validator_store.rs b/validator_client/src/validator_store.rs index b8c11a79bc0..006633e9d94 100644 --- a/validator_client/src/validator_store.rs +++ b/validator_client/src/validator_store.rs @@ -98,7 +98,6 @@ pub struct ValidatorStore { gas_limit: Option, builder_proposals: bool, enable_web3signer_slashing_protection: bool, - produce_block_v3: bool, prefer_builder_proposals: bool, builder_boost_factor: Option, task_executor: TaskExecutor, @@ -133,7 +132,6 @@ impl ValidatorStore { gas_limit: config.gas_limit, builder_proposals: config.builder_proposals, enable_web3signer_slashing_protection: config.enable_web3signer_slashing_protection, - produce_block_v3: config.produce_block_v3, prefer_builder_proposals: config.prefer_builder_proposals, builder_boost_factor: config.builder_boost_factor, task_executor, @@ -348,10 +346,6 @@ impl ValidatorStore { self.spec.fork_at_epoch(epoch) } - pub fn produce_block_v3(&self) -> bool { - self.produce_block_v3 - } - /// Returns a `SigningMethod` for `validator_pubkey` *only if* that validator is considered safe /// by doppelganger protection. fn doppelganger_checked_signing_method( From 15b4ff70e3a2f36ea3aa06357d2dd3599f426dbd Mon Sep 17 00:00:00 2001 From: realbigsean Date: Thu, 4 Apr 2024 11:20:59 -0400 Subject: [PATCH 2/9] kick off ci From 82d697649bf413ca07136837cc5a1607191ff7be Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 29 Apr 2024 15:07:27 -0400 Subject: [PATCH 3/9] fix formatting in cli docs --- book/src/help_vc.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/book/src/help_vc.md b/book/src/help_vc.md index ee2af3aab8f..670893c272e 100644 --- a/book/src/help_vc.md +++ b/book/src/help_vc.md @@ -67,8 +67,7 @@ FLAGS: --prefer-builder-proposals If this flag is set, Lighthouse will always prefer blocks constructed by builders, regardless of payload value. - --produce-block-v3 - This flag is deprecated and no longer in use. + --produce-block-v3 This flag is deprecated and is no longer in use. --unencrypted-http-transport This is a safety flag to ensure that the user is aware that the http transport is unencrypted and using a custom HTTP address is unsafe. From 43344adf13db386fd8d7588004a0ebe887b47eb6 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Wed, 17 Jul 2024 00:00:04 +0100 Subject: [PATCH 4/9] resolve conflicts --- book/src/help_vc.md | 198 +----------------------------------- validator_client/src/cli.rs | 8 -- 2 files changed, 1 insertion(+), 205 deletions(-) diff --git a/book/src/help_vc.md b/book/src/help_vc.md index bdcf7b60e20..e205f4c3454 100644 --- a/book/src/help_vc.md +++ b/book/src/help_vc.md @@ -176,198 +176,6 @@ Options: Maximum number of idle connections to maintain per web3signer host. Default is unlimited. -<<<<<<< HEAD - --enable-doppelganger-protection - If this flag is set, Lighthouse will delay startup for three epochs and monitor for messages on the network - by any of the validators managed by this client. This will result in three (possibly four) epochs worth of - missed attestations. If an attestation is detected during this period, it means it is very likely that you - are running a second validator client with the same keys. This validator client will immediately shutdown if - this is detected in order to avoid potentially committing a slashable offense. Use this flag in order to - ENABLE this functionality, without this flag Lighthouse will begin attesting immediately. - --enable-high-validator-count-metrics - Enable per validator metrics for > 64 validators. Note: This flag is automatically enabled for <= 64 - validators. Enabling this metric for higher validator counts will lead to higher volume of prometheus - metrics being collected. - -h, --help Prints help information - --http Enable the RESTful HTTP API server. Disabled by default. - --http-allow-keystore-export - If present, allow access to the DELETE /lighthouse/keystores HTTP API method, which allows exporting - keystores and passwords to HTTP API consumers who have access to the API token. This method is useful for - exporting validators, however it should be used with caution since it exposes private key data to authorized - users. - --http-store-passwords-in-secrets-dir - If present, any validators created via the HTTP will have keystore passwords stored in the secrets-dir - rather than the validator definitions file. - --init-slashing-protection - If present, do not require the slashing protection database to exist before running. You SHOULD NOT use this - flag unless you're certain that a new slashing protection database is required. Usually, your database will - have been initialized when you imported your validator keys. If you misplace your database and then run with - this flag you risk being slashed. - --log-color Force outputting colors when emitting logs to the terminal. - --logfile-compress - If present, compress old log files. This can help reduce the space needed to store old logs. - - --logfile-no-restricted-perms - If present, log files will be generated as world-readable meaning they can be read by any user on the - machine. Note that logs can often contain sensitive information about your validator and so this flag should - be used with caution. For Windows users, the log file permissions will be inherited from the parent folder. - --metrics Enable the Prometheus metrics HTTP server. Disabled by default. - --prefer-builder-proposals - If this flag is set, Lighthouse will always prefer blocks constructed by builders, regardless of payload - value. - --produce-block-v3 This flag is deprecated and is no longer in use. - --unencrypted-http-transport - This is a safety flag to ensure that the user is aware that the http transport is unencrypted and using a - custom HTTP address is unsafe. - --use-long-timeouts - If present, the validator client will use longer timeouts for requests made to the beacon node. This flag is - generally not recommended, longer timeouts can cause missed duties when fallbacks are used. - -V, --version Prints version information - -OPTIONS: - --beacon-nodes - Comma-separated addresses to one or more beacon node HTTP APIs. Default is http://localhost:5052. - - --beacon-nodes-tls-certs - Comma-separated paths to custom TLS certificates to use when connecting to a beacon node (and/or proposer - node). These certificates must be in PEM format and are used in addition to the OS trust store. Commas must - only be used as a delimiter, and must not be part of the certificate path. - --broadcast - Comma-separated list of beacon API topics to broadcast to all beacon nodes. Possible values are: none, - attestations, blocks, subscriptions, sync-committee. Default (when flag is omitted) is to broadcast - subscriptions only. - --builder-boost-factor - Defines the boost factor, a percentage multiplier to apply to the builder's payload value when choosing - between a builder payload header and payload from the local execution node. - --builder-registration-timestamp-override - This flag takes a unix timestamp value that will be used to override the timestamp used in the builder api - registration - -d, --datadir - Used to specify a custom root data directory for lighthouse keys and databases. Defaults to - $HOME/.lighthouse/{network} where network is the value of the `network` flag Note: Users should specify - separate custom datadirs for different networks. - --debug-level - Specifies the verbosity level used when emitting logs to the terminal. [default: info] [possible values: - info, debug, trace, warn, error, crit] - --gas-limit - The gas limit to be used in all builder proposals for all validators managed by this validator client. Note - this will not necessarily be used if the gas limit set here moves too far from the previous block's gas - limit. [default: 30,000,000] - --genesis-state-url - A URL of a beacon-API compatible server from which to download the genesis state. Checkpoint sync server - URLs can generally be used with this flag. If not supplied, a default URL or the --checkpoint-sync-url may - be used. If the genesis state is already included in this binary then this value will be ignored. - --genesis-state-url-timeout - The timeout in seconds for the request to --genesis-state-url. [default: 180] - - --graffiti - Specify your custom graffiti to be included in blocks. - - --graffiti-file - Specify a graffiti file to load validator graffitis from. - - --http-address
- Set the address for the HTTP address. The HTTP server is not encrypted and therefore it is unsafe to publish - on a public network. When this flag is used, it additionally requires the explicit use of the - `--unencrypted-http-transport` flag to ensure the user is aware of the risks involved. For access via the - Internet, users should apply transport-layer security like a HTTPS reverse-proxy or SSH tunnelling. - --http-allow-origin - Set the value of the Access-Control-Allow-Origin response HTTP header. Use * to allow any origin (not - recommended in production). If no value is supplied, the CORS allowed origin is set to the listen address of - this server (e.g., http://localhost:5062). - --http-port - Set the listen TCP port for the RESTful HTTP API server. - - --latency-measurement-service - Set to 'true' to enable a service that periodically attempts to measure latency to BNs. Set to 'false' to - disable. [default: true] - --log-format - Specifies the log format used when emitting logs to the terminal. [possible values: JSON] - - --logfile - File path where the log file will be stored. Once it grows to the value specified in `--logfile-max-size` a - new log file is generated where future logs are stored. Once the number of log files exceeds the value - specified in `--logfile-max-number` the oldest log file will be overwritten. - --logfile-debug-level - The verbosity level used when emitting logs to the log file. [default: debug] [possible values: info, - debug, trace, warn, error, crit] - --logfile-format - Specifies the log format used when emitting logs to the logfile. [possible values: DEFAULT, JSON] - - --logfile-max-number - The maximum number of log files that will be stored. If set to 0, background file logging is disabled. - [default: 5] - --logfile-max-size - The maximum size (in MB) each log file can grow to before rotating. If set to 0, background file logging is - disabled. [default: 200] - --metrics-address
- Set the listen address for the Prometheus metrics HTTP server. - - --metrics-allow-origin - Set the value of the Access-Control-Allow-Origin response HTTP header. Use * to allow any origin (not - recommended in production). If no value is supplied, the CORS allowed origin is set to the listen address of - this server (e.g., http://localhost:5064). - --metrics-port - Set the listen TCP port for the Prometheus metrics HTTP server. - - --monitoring-endpoint
- Enables the monitoring service for sending system metrics to a remote endpoint. This can be used to monitor - your setup on certain services (e.g. beaconcha.in). This flag sets the endpoint where the beacon node - metrics will be sent. Note: This will send information to a remote sever which may identify and associate - your validators, IP address and other personal information. Always use a HTTPS connection and never provide - an untrusted URL. - --monitoring-endpoint-period - Defines how many seconds to wait between each message sent to the monitoring-endpoint. Default: 60s - - --network - Name of the Eth2 chain Lighthouse will sync and follow. [possible values: mainnet, prater, goerli, gnosis, - chiado, sepolia, holesky] - --proposer-nodes - Comma-separated addresses to one or more beacon node HTTP APIs. These specify nodes that are used to send - beacon block proposals. A failure will revert back to the standard beacon nodes specified in --beacon-nodes. - --safe-slots-to-import-optimistically - Used to coordinate manual overrides of the SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY parameter. This flag should - only be used if the user has a clear understanding that the broad Ethereum community has elected to override - this parameter in the event of an attack at the PoS transition block. Incorrect use of this flag can cause - your node to possibly accept an invalid chain or sync more slowly. Be extremely careful with this flag. - --secrets-dir - The directory which contains the password to unlock the validator voting keypairs. Each password should be - contained in a file where the name is the 0x-prefixed hex representation of the validators voting public - key. Defaults to ~/.lighthouse/{network}/secrets. - --suggested-fee-recipient - Once the merge has happened, this address will receive transaction fees from blocks proposed by this - validator client. If a fee recipient is configured in the validator definitions it takes priority over this - value. - --terminal-block-hash-epoch-override - Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH parameter. This flag should - only be used if the user has a clear understanding that the broad Ethereum community has elected to override - the terminal PoW block. Incorrect use of this flag will cause your node to experience a consensus failure. - Be extremely careful with this flag. - --terminal-block-hash-override - Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH parameter. This flag should only be used if - the user has a clear understanding that the broad Ethereum community has elected to override the terminal - PoW block. Incorrect use of this flag will cause your node to experience a consensus failure. Be extremely - careful with this flag. - --terminal-total-difficulty-override - Used to coordinate manual overrides to the TERMINAL_TOTAL_DIFFICULTY parameter. Accepts a 256-bit decimal - integer (not a hex value). This flag should only be used if the user has a clear understanding that the - broad Ethereum community has elected to override the terminal difficulty. Incorrect use of this flag will - cause your node to experience a consensus failure. Be extremely careful with this flag. - -t, --testnet-dir - Path to directory containing eth2_testnet specs. Defaults to a hard-coded Lighthouse testnet. Only effective - if there is no existing database. - --validator-registration-batch-size - Defines the number of validators per validator/register_validator request sent to the BN. This value can be - reduced to avoid timeouts from builders. [default: 500] - --validators-dir - The directory which contains the validator keystores, deposit data for each validator along with the common - slashing protection database and the validator_definitions.yml - --web3-signer-keep-alive-timeout - Keep-alive timeout for each web3signer connection. Set to 'null' to never timeout [default: 20000] - - --web3-signer-max-idle-connections - Maximum number of idle connections to maintain per web3signer host. Default is unlimited. -======= Flags: --builder-proposals If this flag is set, Lighthouse will query the Beacon Node for only @@ -457,10 +265,7 @@ Flags: If this flag is set, Lighthouse will always prefer blocks constructed by builders, regardless of payload value. --produce-block-v3 - Enable block production via the block v3 endpoint for this validator - client. This should only be enabled when paired with a beacon node - that has this endpoint implemented. This flag will be enabled by - default in future. + This flag is deprecated and is no longer in use. --unencrypted-http-transport This is a safety flag to ensure that the user is aware that the http transport is unencrypted and using a custom HTTP address is unsafe. @@ -468,7 +273,6 @@ Flags: If present, the validator client will use longer timeouts for requests made to the beacon node. This flag is generally not recommended, longer timeouts can cause missed duties when fallbacks are used. ->>>>>>> 8a32df756ddaa8831182c016311f25a3c26cf36f ``` diff --git a/validator_client/src/cli.rs b/validator_client/src/cli.rs index 36927e4f337..f84260a9243 100644 --- a/validator_client/src/cli.rs +++ b/validator_client/src/cli.rs @@ -170,18 +170,10 @@ pub fn cli_app() -> Command { .arg( Arg::new("produce-block-v3") .long("produce-block-v3") -<<<<<<< HEAD .help("This flag is deprecated and is no longer in use.") - .takes_value(false) -======= - .help("Enable block production via the block v3 endpoint for this validator client. \ - This should only be enabled when paired with a beacon node \ - that has this endpoint implemented. This flag will be enabled by default in \ - future.") .action(ArgAction::SetTrue) .help_heading(FLAG_HEADER) .display_order(0) ->>>>>>> 8a32df756ddaa8831182c016311f25a3c26cf36f ) .arg( Arg::new("distributed") From c62e7cf1da30efaa68c004ea3f2cd2ce2646a990 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 21 Jul 2024 21:22:32 -0700 Subject: [PATCH 5/9] merge --- lighthouse/tests/validator_client.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lighthouse/tests/validator_client.rs b/lighthouse/tests/validator_client.rs index 85b5feb72d7..cb16ca4792c 100644 --- a/lighthouse/tests/validator_client.rs +++ b/lighthouse/tests/validator_client.rs @@ -424,6 +424,13 @@ fn no_doppelganger_protection_flag() { .with_config(|config| assert!(!config.enable_doppelganger_protection)); } +#[test] +fn produce_block_v3_flag() { + // The flag is DEPRECATED but providing it should not trigger an error. + // We can delete this test when deleting the flag entirely. + CommandLineTest::new().flag("produce-block-v3", None).run(); +} + #[test] fn no_gas_limit_flag() { CommandLineTest::new() From 87ee4e738f068e1e008dfd11d539de8fc8ac994d Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 21 Jul 2024 21:22:55 -0700 Subject: [PATCH 6/9] revert --- validator_client/src/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/validator_client/src/config.rs b/validator_client/src/config.rs index 54892e432e6..204c5b8b6cc 100644 --- a/validator_client/src/config.rs +++ b/validator_client/src/config.rs @@ -381,6 +381,14 @@ impl Config { config.prefer_builder_proposals = true; } + if cli_args.get_flag("produce-block-v3") { + warn!( + log, + "produce-block-v3 flag"; + "note" => "deprecated flag has no effect and should be removed" + ); + } + config.gas_limit = cli_args .get_one::("gas-limit") .map(|gas_limit| { From b2b987f7cb154e0c4480a0089c6532517fb4e45a Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Sun, 21 Jul 2024 22:20:59 -0700 Subject: [PATCH 7/9] retry --- validator_client/src/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/validator_client/src/config.rs b/validator_client/src/config.rs index 204c5b8b6cc..b1ddb3cb81d 100644 --- a/validator_client/src/config.rs +++ b/validator_client/src/config.rs @@ -388,6 +388,7 @@ impl Config { "note" => "deprecated flag has no effect and should be removed" ); } + config.gas_limit = cli_args .get_one::("gas-limit") From 394fd54b742ad6f64bd3de35c782f19120f0b5ff Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 22 Jul 2024 09:09:23 -0700 Subject: [PATCH 8/9] fix --- validator_client/src/config.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/validator_client/src/config.rs b/validator_client/src/config.rs index b1ddb3cb81d..204c5b8b6cc 100644 --- a/validator_client/src/config.rs +++ b/validator_client/src/config.rs @@ -388,7 +388,6 @@ impl Config { "note" => "deprecated flag has no effect and should be removed" ); } - config.gas_limit = cli_args .get_one::("gas-limit") From 357d257c903ce9648ac02e51ead7ee09a866fb78 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 25 Jul 2024 17:41:49 -0700 Subject: [PATCH 9/9] fix issues w/ fallback sim --- testing/simulator/src/cli.rs | 1 - validator_client/src/block_service.rs | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/testing/simulator/src/cli.rs b/testing/simulator/src/cli.rs index a82c8b85775..3d61dcde74a 100644 --- a/testing/simulator/src/cli.rs +++ b/testing/simulator/src/cli.rs @@ -77,7 +77,6 @@ pub fn cli_app() -> Command { ) .arg( Arg::new("vc-count") - .short('c') .long("vc-count") .action(ArgAction::Set) .default_value("3") diff --git a/validator_client/src/block_service.rs b/validator_client/src/block_service.rs index da4bcd1fc52..af11d82eb53 100644 --- a/validator_client/src/block_service.rs +++ b/validator_client/src/block_service.rs @@ -511,7 +511,7 @@ impl BlockService { &metrics::BLOCK_SERVICE_TIMES, &[metrics::BEACON_BLOCK_HTTP_GET], ); - let block_response = Self::get_validator_block( + Self::get_validator_block( beacon_node, slot, randao_reveal_ref, @@ -526,12 +526,10 @@ impl BlockService { "Error from beacon node when producing block: {:?}", e )) - }); - - Ok::<_, BlockError>(block_response) + }) }, ) - .await??; + .await?; self_ref .sign_and_publish_block(