mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 21:27:12 +00:00
remove duplicate fn impl
This commit is contained in:
@@ -3453,7 +3453,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
&merge_result.full_columns,
|
&merge_result.full_columns,
|
||||||
)
|
)
|
||||||
.map_err(BlockError::from)?;
|
.map_err(BlockError::from)?;
|
||||||
self.process_payload_availability(slot, availability, || Ok(()))
|
self.process_payload_envelope_availability(slot, availability, || Ok(()))
|
||||||
.await?
|
.await?
|
||||||
} else {
|
} else {
|
||||||
let availability = self
|
let availability = self
|
||||||
@@ -3702,7 +3702,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Ok(self
|
Ok(self
|
||||||
.process_payload_availability(slot, availability, || Ok(()))
|
.process_payload_envelope_availability(slot, availability, || Ok(()))
|
||||||
.await
|
.await
|
||||||
.map(|status| Some((status, data_columns_to_publish)))?)
|
.map(|status| Some((status, data_columns_to_publish)))?)
|
||||||
}
|
}
|
||||||
@@ -4011,7 +4011,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.pending_payload_cache
|
.pending_payload_cache
|
||||||
.put_gossip_verified_data_columns(block_root, bid, data_columns)?;
|
.put_gossip_verified_data_columns(block_root, bid, data_columns)?;
|
||||||
Ok(self
|
Ok(self
|
||||||
.process_payload_availability(slot, availability, publish_fn)
|
.process_payload_envelope_availability(slot, availability, publish_fn)
|
||||||
.await?)
|
.await?)
|
||||||
} else {
|
} else {
|
||||||
let availability = self
|
let availability = self
|
||||||
@@ -4118,7 +4118,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.put_kzg_verified_custody_data_columns(block_root, bid, &data_columns)
|
.put_kzg_verified_custody_data_columns(block_root, bid, &data_columns)
|
||||||
.map_err(BlockError::from)?;
|
.map_err(BlockError::from)?;
|
||||||
Ok(self
|
Ok(self
|
||||||
.process_payload_availability(slot, availability, || Ok(()))
|
.process_payload_envelope_availability(slot, availability, || Ok(()))
|
||||||
.await?)
|
.await?)
|
||||||
} else {
|
} else {
|
||||||
let availability = self
|
let availability = self
|
||||||
@@ -4162,7 +4162,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.put_rpc_custody_columns(block_root, bid, custody_columns)
|
.put_rpc_custody_columns(block_root, bid, custody_columns)
|
||||||
.map_err(BlockError::from)?;
|
.map_err(BlockError::from)?;
|
||||||
Ok(self
|
Ok(self
|
||||||
.process_payload_availability(slot, availability, || Ok(()))
|
.process_payload_envelope_availability(slot, availability, || Ok(()))
|
||||||
.await?)
|
.await?)
|
||||||
} else {
|
} else {
|
||||||
let availability = self
|
let availability = self
|
||||||
@@ -4229,7 +4229,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn process_payload_availability(
|
pub(crate) async fn process_payload_envelope_availability(
|
||||||
self: &Arc<Self>,
|
self: &Arc<Self>,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
availability: PayloadAvailability<T::EthSpec>,
|
availability: PayloadAvailability<T::EthSpec>,
|
||||||
|
|||||||
@@ -6,14 +6,13 @@ use fork_choice::PayloadVerificationStatus;
|
|||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
use store::StoreOp;
|
use store::StoreOp;
|
||||||
use tracing::{debug, error, info, info_span, instrument, warn};
|
use tracing::{debug, error, info, info_span, instrument, warn};
|
||||||
use types::{BlockImportSource, Hash256, SignedExecutionPayloadEnvelope, Slot};
|
use types::{BlockImportSource, Hash256, SignedExecutionPayloadEnvelope};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
AvailableEnvelope, AvailableExecutedEnvelope, EnvelopeError,
|
AvailableEnvelope, AvailableExecutedEnvelope, EnvelopeError,
|
||||||
gossip_verified_envelope::GossipVerifiedEnvelope,
|
gossip_verified_envelope::GossipVerifiedEnvelope,
|
||||||
};
|
};
|
||||||
use crate::data_column_verification::load_gloas_payload_bid;
|
use crate::data_column_verification::load_gloas_payload_bid;
|
||||||
use crate::pending_payload_cache::Availability as PayloadAvailability;
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AvailabilityProcessingStatus, BeaconChain, BeaconChainError, BeaconChainTypes, BlockError,
|
AvailabilityProcessingStatus, BeaconChain, BeaconChainError, BeaconChainTypes, BlockError,
|
||||||
NotifyExecutionLayer,
|
NotifyExecutionLayer,
|
||||||
@@ -156,28 +155,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Imports a fully available payload envelope. Otherwise, returns `AvailabilityProcessingStatus::MissingComponents`
|
|
||||||
///
|
|
||||||
/// An error is returned if the enveope was unable to be imported. It may be partially imported
|
|
||||||
/// (i.e., this function is not atomic).
|
|
||||||
async fn process_payload_envelope_availability(
|
|
||||||
self: &Arc<Self>,
|
|
||||||
slot: Slot,
|
|
||||||
availability: PayloadAvailability<T::EthSpec>,
|
|
||||||
publish_fn: impl FnOnce() -> Result<(), BlockError>,
|
|
||||||
) -> Result<AvailabilityProcessingStatus, BlockError> {
|
|
||||||
match availability {
|
|
||||||
PayloadAvailability::Available(available_envelope) => {
|
|
||||||
publish_fn()?;
|
|
||||||
self.import_available_execution_payload_envelope(available_envelope)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
PayloadAvailability::MissingComponents(block_root) => Ok(
|
|
||||||
AvailabilityProcessingStatus::MissingComponents(slot, block_root),
|
|
||||||
),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[instrument(skip_all)]
|
#[instrument(skip_all)]
|
||||||
async fn check_envelope_availability_and_import(
|
async fn check_envelope_availability_and_import(
|
||||||
self: &Arc<Self>,
|
self: &Arc<Self>,
|
||||||
|
|||||||
Reference in New Issue
Block a user