Don't use the builder network if the head is optimistic (#3412)

## Issue Addressed

Resolves https://github.com/sigp/lighthouse/issues/3394

Adds a check in `is_healthy` about whether the head is optimistic when choosing whether to use the builder network. 



Co-authored-by: realbigsean <sean@sigmaprime.io>
This commit is contained in:
realbigsean
2022-08-09 06:05:16 +00:00
parent 5bb4aada92
commit 6f13727fbe
3 changed files with 74 additions and 2 deletions

View File

@@ -114,6 +114,7 @@ pub struct BuilderParams {
pub enum ChainHealth {
Healthy,
Unhealthy(FailedCondition),
Optimistic,
PreMerge,
}
@@ -695,6 +696,9 @@ impl<T: EthSpec> ExecutionLayer<T> {
}
// Intentional no-op, so we never attempt builder API proposals pre-merge.
ChainHealth::PreMerge => (),
ChainHealth::Optimistic => info!(self.log(), "The local execution engine is syncing \
so the builder network cannot safely be used. Attempting \
to build a block with the local execution engine"),
}
}
self.get_full_payload_caching(