Remove withdrawals-processing feature (#3864)

* Use spec to Determine Supported Engine APIs

* Remove `withdrawals-processing` feature

* Fixed Tests

* Missed Some Spots

* Fixed Another Test

* Stupid Clippy
This commit is contained in:
ethDreamer
2023-01-11 22:15:08 -06:00
committed by GitHub
parent 98b11bbd3f
commit 52c1055fdc
21 changed files with 113 additions and 92 deletions

View File

@@ -122,7 +122,7 @@ impl SszEth1Cache {
cache: self.deposit_cache.to_deposit_cache()?,
last_processed_block: self.last_processed_block,
}),
endpoint: endpoint_from_config(&config)
endpoint: endpoint_from_config(&config, &spec)
.map_err(|e| format!("Failed to create endpoint: {:?}", e))?,
to_finalize: RwLock::new(None),
// Set the remote head_block zero when creating a new instance. We only care about

View File

@@ -363,7 +363,7 @@ impl Default for Config {
}
}
pub fn endpoint_from_config(config: &Config) -> Result<HttpJsonRpc, String> {
pub fn endpoint_from_config(config: &Config, spec: &ChainSpec) -> Result<HttpJsonRpc, String> {
match config.endpoint.clone() {
Eth1Endpoint::Auth {
endpoint,
@@ -373,11 +373,16 @@ pub fn endpoint_from_config(config: &Config) -> Result<HttpJsonRpc, String> {
} => {
let auth = Auth::new_with_path(jwt_path, jwt_id, jwt_version)
.map_err(|e| format!("Failed to initialize jwt auth: {:?}", e))?;
HttpJsonRpc::new_with_auth(endpoint, auth, Some(config.execution_timeout_multiplier))
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
HttpJsonRpc::new_with_auth(
endpoint,
auth,
Some(config.execution_timeout_multiplier),
spec,
)
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
}
Eth1Endpoint::NoAuth(endpoint) => {
HttpJsonRpc::new(endpoint, Some(config.execution_timeout_multiplier))
HttpJsonRpc::new(endpoint, Some(config.execution_timeout_multiplier), spec)
.map_err(|e| format!("Failed to create eth1 json rpc client: {:?}", e))
}
}
@@ -404,7 +409,7 @@ impl Service {
deposit_cache: RwLock::new(DepositUpdater::new(
config.deposit_contract_deploy_block,
)),
endpoint: endpoint_from_config(&config)?,
endpoint: endpoint_from_config(&config, &spec)?,
to_finalize: RwLock::new(None),
remote_head_block: RwLock::new(None),
config: RwLock::new(config),
@@ -433,7 +438,7 @@ impl Service {
inner: Arc::new(Inner {
block_cache: <_>::default(),
deposit_cache: RwLock::new(deposit_cache),
endpoint: endpoint_from_config(&config)
endpoint: endpoint_from_config(&config, &spec)
.map_err(Error::FailedToInitializeFromSnapshot)?,
to_finalize: RwLock::new(None),
remote_head_block: RwLock::new(None),