mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 03:42:46 +00:00
Deprecate exchangeTransitionConfiguration functionality (#4517)
## Issue Addressed Solves #4442 ## Proposed Changes EL clients log errors if we don't query this endpoint, but they are making releases that remove this error logging. After those are out we can stop calling it, after which point EL teams will remove the endpoint entirely. Refer https://hackmd.io/@n0ble/deprecate-exchgTC
This commit is contained in:
@@ -74,8 +74,6 @@ const EXECUTION_BLOCKS_LRU_CACHE_SIZE: usize = 128;
|
||||
const DEFAULT_SUGGESTED_FEE_RECIPIENT: [u8; 20] =
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
|
||||
|
||||
const CONFIG_POLL_INTERVAL: Duration = Duration::from_secs(60);
|
||||
|
||||
/// A payload alongside some information about where it came from.
|
||||
pub enum ProvenancedPayload<P> {
|
||||
/// A good ol' fashioned farm-to-table payload from your local EE.
|
||||
@@ -502,24 +500,6 @@ impl<T: EthSpec> ExecutionLayer<T> {
|
||||
self.spawn(preparation_cleaner, "exec_preparation_cleanup");
|
||||
}
|
||||
|
||||
/// Spawns a routine that polls the `exchange_transition_configuration` endpoint.
|
||||
pub fn spawn_transition_configuration_poll(&self, spec: ChainSpec) {
|
||||
let routine = |el: ExecutionLayer<T>| async move {
|
||||
loop {
|
||||
if let Err(e) = el.exchange_transition_configuration(&spec).await {
|
||||
error!(
|
||||
el.log(),
|
||||
"Failed to check transition config";
|
||||
"error" => ?e
|
||||
);
|
||||
}
|
||||
sleep(CONFIG_POLL_INTERVAL).await;
|
||||
}
|
||||
};
|
||||
|
||||
self.spawn(routine, "exec_config_poll");
|
||||
}
|
||||
|
||||
/// Returns `true` if the execution engine is synced and reachable.
|
||||
pub async fn is_synced(&self) -> bool {
|
||||
self.engine().is_synced().await
|
||||
@@ -1318,53 +1298,6 @@ impl<T: EthSpec> ExecutionLayer<T> {
|
||||
.map_err(Error::EngineError)
|
||||
}
|
||||
|
||||
pub async fn exchange_transition_configuration(&self, spec: &ChainSpec) -> Result<(), Error> {
|
||||
let local = TransitionConfigurationV1 {
|
||||
terminal_total_difficulty: spec.terminal_total_difficulty,
|
||||
terminal_block_hash: spec.terminal_block_hash,
|
||||
terminal_block_number: 0,
|
||||
};
|
||||
|
||||
let result = self
|
||||
.engine()
|
||||
.request(|engine| engine.api.exchange_transition_configuration_v1(local))
|
||||
.await;
|
||||
|
||||
match result {
|
||||
Ok(remote) => {
|
||||
if local.terminal_total_difficulty != remote.terminal_total_difficulty
|
||||
|| local.terminal_block_hash != remote.terminal_block_hash
|
||||
{
|
||||
error!(
|
||||
self.log(),
|
||||
"Execution client config mismatch";
|
||||
"msg" => "ensure lighthouse and the execution client are up-to-date and \
|
||||
configured consistently",
|
||||
"remote" => ?remote,
|
||||
"local" => ?local,
|
||||
);
|
||||
Err(Error::EngineError(Box::new(EngineError::Api {
|
||||
error: ApiError::TransitionConfigurationMismatch,
|
||||
})))
|
||||
} else {
|
||||
debug!(
|
||||
self.log(),
|
||||
"Execution client config is OK";
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
error!(
|
||||
self.log(),
|
||||
"Unable to get transition config";
|
||||
"error" => ?e,
|
||||
);
|
||||
Err(Error::EngineError(Box::new(e)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the execution engine capabilities resulting from a call to
|
||||
/// engine_exchangeCapabilities. If the capabilities cache is not populated,
|
||||
/// or if it is populated with a cached result of age >= `age_limit`, this
|
||||
|
||||
Reference in New Issue
Block a user