mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
mark block as avail as soon as call to el succeeds
This commit is contained in:
@@ -58,7 +58,8 @@ use crate::observed_data_sidecars::ObservedDataSidecars;
|
|||||||
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
|
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
|
||||||
use crate::observed_slashable::ObservedSlashable;
|
use crate::observed_slashable::ObservedSlashable;
|
||||||
use crate::payload_envelope_verification::{
|
use crate::payload_envelope_verification::{
|
||||||
EnvelopeError, ExecutedEnvelope, ExecutionPendingEnvelope,
|
AvailableEnvelope, EnvelopeError, ExecutedEnvelope, ExecutionPendingEnvelope,
|
||||||
|
MaybeAvailableEnvelope,
|
||||||
};
|
};
|
||||||
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
|
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
|
||||||
use crate::persisted_beacon_chain::PersistedBeaconChain;
|
use crate::persisted_beacon_chain::PersistedBeaconChain;
|
||||||
@@ -3577,6 +3578,21 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.map_err(BeaconChainError::TokioJoin)?
|
.map_err(BeaconChainError::TokioJoin)?
|
||||||
.ok_or(BeaconChainError::RuntimeShutdown)??;
|
.ok_or(BeaconChainError::RuntimeShutdown)??;
|
||||||
|
|
||||||
|
// TODO(gloas): implement data column availability checking.
|
||||||
|
// For now, treat all envelopes as available after EL verification with empty columns.
|
||||||
|
let signed_envelope = match signed_envelope {
|
||||||
|
available @ MaybeAvailableEnvelope::Available(_) => available,
|
||||||
|
MaybeAvailableEnvelope::AvailabilityPending { block_hash, envelope } => {
|
||||||
|
MaybeAvailableEnvelope::Available(AvailableEnvelope::new(
|
||||||
|
block_hash,
|
||||||
|
envelope,
|
||||||
|
vec![],
|
||||||
|
None,
|
||||||
|
self.spec.clone(),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Ok(ExecutedEnvelope::new(
|
Ok(ExecutedEnvelope::new(
|
||||||
signed_envelope,
|
signed_envelope,
|
||||||
import_data,
|
import_data,
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use educe::Educe;
|
use educe::Educe;
|
||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
use state_processing::{VerifySignatures, envelope_processing::process_execution_payload_envelope};
|
use state_processing::{
|
||||||
|
VerifySignatures,
|
||||||
|
envelope_processing::{VerifyStateRoot, process_execution_payload_envelope},
|
||||||
|
};
|
||||||
use tracing::{Span, debug};
|
use tracing::{Span, debug};
|
||||||
use types::{
|
use types::{
|
||||||
EthSpec, SignedBeaconBlock, SignedExecutionPayloadEnvelope,
|
EthSpec, SignedBeaconBlock, SignedExecutionPayloadEnvelope,
|
||||||
@@ -236,6 +239,7 @@ impl<T: BeaconChainTypes> IntoExecutionPendingEnvelope<T> for GossipVerifiedEnve
|
|||||||
&signed_envelope,
|
&signed_envelope,
|
||||||
// verify signature already done for GossipVerifiedEnvelope
|
// verify signature already done for GossipVerifiedEnvelope
|
||||||
VerifySignatures::False,
|
VerifySignatures::False,
|
||||||
|
VerifyStateRoot::True,
|
||||||
&chain.spec,
|
&chain.spec,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,22 @@ pub struct AvailableEnvelope<E: EthSpec> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<E: EthSpec> AvailableEnvelope<E> {
|
impl<E: EthSpec> AvailableEnvelope<E> {
|
||||||
|
pub fn new(
|
||||||
|
execution_block_hash: ExecutionBlockHash,
|
||||||
|
envelope: Arc<SignedExecutionPayloadEnvelope<E>>,
|
||||||
|
columns: DataColumnSidecarList<E>,
|
||||||
|
columns_available_timestamp: Option<std::time::Duration>,
|
||||||
|
spec: Arc<ChainSpec>,
|
||||||
|
) -> Self {
|
||||||
|
Self {
|
||||||
|
execution_block_hash,
|
||||||
|
envelope,
|
||||||
|
columns,
|
||||||
|
columns_available_timestamp,
|
||||||
|
spec,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn message(&self) -> &ExecutionPayloadEnvelope<E> {
|
pub fn message(&self) -> &ExecutionPayloadEnvelope<E> {
|
||||||
&self.envelope.message
|
&self.envelope.message
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user