mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
Merge branch 'remove-into-gossip-verified-block' of https://github.com/realbigsean/lighthouse into merge-unstable-deneb-june-6th
This commit is contained in:
@@ -2664,6 +2664,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
signature_verified_block.block_root(),
|
||||
signature_verified_block,
|
||||
notify_execution_layer,
|
||||
|| Ok(()),
|
||||
)
|
||||
.await
|
||||
{
|
||||
@@ -2783,6 +2784,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
block_root: Hash256,
|
||||
unverified_block: B,
|
||||
notify_execution_layer: NotifyExecutionLayer,
|
||||
publish_fn: impl FnOnce() -> Result<(), BlockError<T::EthSpec>> + Send + 'static,
|
||||
) -> Result<AvailabilityProcessingStatus, BlockError<T::EthSpec>> {
|
||||
// Start the Prometheus timer.
|
||||
let _full_timer = metrics::start_timer(&metrics::BLOCK_PROCESSING_TIMES);
|
||||
@@ -2798,6 +2800,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
notify_execution_layer,
|
||||
)?;
|
||||
|
||||
//TODO(sean) error handling?
|
||||
publish_fn()?;
|
||||
|
||||
let executed_block = self
|
||||
.clone()
|
||||
.into_executed_block(execution_pending)
|
||||
@@ -3073,7 +3078,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
block_delay,
|
||||
&state,
|
||||
payload_verification_status,
|
||||
self.config.progressive_balances_mode,
|
||||
&self.spec,
|
||||
&self.log,
|
||||
)
|
||||
.map_err(|e| BlockError::BeaconChainError(e.into()))?;
|
||||
}
|
||||
@@ -6012,13 +6019,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
/// Since we are likely calling this during the slot we are going to propose in, don't take into
|
||||
/// account the current slot when accounting for skips.
|
||||
pub fn is_healthy(&self, parent_root: &Hash256) -> Result<ChainHealth, Error> {
|
||||
let cached_head = self.canonical_head.cached_head();
|
||||
// Check if the merge has been finalized.
|
||||
if let Some(finalized_hash) = self
|
||||
.canonical_head
|
||||
.cached_head()
|
||||
.forkchoice_update_parameters()
|
||||
.finalized_hash
|
||||
{
|
||||
if let Some(finalized_hash) = cached_head.forkchoice_update_parameters().finalized_hash {
|
||||
if ExecutionBlockHash::zero() == finalized_hash {
|
||||
return Ok(ChainHealth::PreMerge);
|
||||
}
|
||||
@@ -6045,17 +6048,13 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
|
||||
// Check slots at the head of the chain.
|
||||
let prev_slot = current_slot.saturating_sub(Slot::new(1));
|
||||
let head_skips = prev_slot.saturating_sub(self.canonical_head.cached_head().head_slot());
|
||||
let head_skips = prev_slot.saturating_sub(cached_head.head_slot());
|
||||
let head_skips_check = head_skips.as_usize() <= self.config.builder_fallback_skips;
|
||||
|
||||
// Check if finalization is advancing.
|
||||
let current_epoch = current_slot.epoch(T::EthSpec::slots_per_epoch());
|
||||
let epochs_since_finalization = current_epoch.saturating_sub(
|
||||
self.canonical_head
|
||||
.cached_head()
|
||||
.finalized_checkpoint()
|
||||
.epoch,
|
||||
);
|
||||
let epochs_since_finalization =
|
||||
current_epoch.saturating_sub(cached_head.finalized_checkpoint().epoch);
|
||||
let finalization_check = epochs_since_finalization.as_usize()
|
||||
<= self.config.builder_fallback_epochs_since_finalization;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user