Remove fallback support from eth1 service (#3594)

## Issue Addressed

N/A

## Proposed Changes

With https://github.com/sigp/lighthouse/pull/3214 we made it such that you can either have 1 auth endpoint or multiple non auth endpoints. Now that we are post merge on all networks (testnets and mainnet), we cannot progress a chain without a dedicated auth execution layer connection so there is no point in having a non-auth eth1-endpoint for syncing deposit cache. 

This code removes all fallback related code in the eth1 service. We still keep the single non-auth endpoint since it's useful for testing.

## Additional Info

This removes all eth1 fallback related metrics that were relevant for the monitoring service, so we might need to change the api upstream.
This commit is contained in:
Pawan Dhananjay
2022-10-04 08:33:39 +00:00
parent 58bd2f76d0
commit 8728c40102
22 changed files with 228 additions and 802 deletions

View File

@@ -372,9 +372,9 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
.long("eth1-endpoints")
.value_name("HTTP-ENDPOINTS")
.conflicts_with("eth1-endpoint")
.help("One or more comma-delimited server endpoints for web3 connection. \
If multiple endpoints are given the endpoints are used as fallback in the \
given order. Also enables the --eth1 flag. \
.help("One http endpoint for a web3 connection to an execution node. \
Note: This flag is now only useful for testing, use `--execution-endpoint` \
flag to connect to an execution node on mainnet and testnets.
Defaults to http://127.0.0.1:8545.")
.takes_value(true)
)

View File

@@ -230,17 +230,14 @@ pub fn get_config<E: EthSpec>(
);
client_config.sync_eth1_chain = true;
let endpoints = vec![SensitiveUrl::parse(endpoint)
.map_err(|e| format!("eth1-endpoint was an invalid URL: {:?}", e))?];
client_config.eth1.endpoints = Eth1Endpoint::NoAuth(endpoints);
} else if let Some(endpoints) = cli_args.value_of("eth1-endpoints") {
let endpoint = SensitiveUrl::parse(endpoint)
.map_err(|e| format!("eth1-endpoint was an invalid URL: {:?}", e))?;
client_config.eth1.endpoint = Eth1Endpoint::NoAuth(endpoint);
} else if let Some(endpoint) = cli_args.value_of("eth1-endpoints") {
client_config.sync_eth1_chain = true;
let endpoints = endpoints
.split(',')
.map(SensitiveUrl::parse)
.collect::<Result<_, _>>()
let endpoint = SensitiveUrl::parse(endpoint)
.map_err(|e| format!("eth1-endpoints contains an invalid URL {:?}", e))?;
client_config.eth1.endpoints = Eth1Endpoint::NoAuth(endpoints);
client_config.eth1.endpoint = Eth1Endpoint::NoAuth(endpoint);
}
if let Some(val) = cli_args.value_of("eth1-blocks-per-log-query") {
@@ -326,7 +323,7 @@ pub fn get_config<E: EthSpec>(
--eth1-endpoints has been deprecated for post-merge configurations"
);
}
client_config.eth1.endpoints = Eth1Endpoint::Auth {
client_config.eth1.endpoint = Eth1Endpoint::Auth {
endpoint: execution_endpoint,
jwt_path: secret_file,
jwt_id: el_config.jwt_id.clone(),

View File

@@ -117,7 +117,7 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
info!(
log,
"Block production enabled";
"endpoints" => format!("{:?}", &client_config.eth1.endpoints),
"endpoint" => format!("{:?}", &client_config.eth1.endpoint),
"method" => "json rpc via http"
);
builder