mark block as avail as soon as call to el succeeds

This commit is contained in:
Eitan Seri-Levi
2026-02-17 21:27:44 -08:00
parent b057cae302
commit 0b58cbf2d2
3 changed files with 38 additions and 2 deletions

View File

@@ -58,7 +58,8 @@ use crate::observed_data_sidecars::ObservedDataSidecars;
use crate::observed_operations::{ObservationOutcome, ObservedOperations};
use crate::observed_slashable::ObservedSlashable;
use crate::payload_envelope_verification::{
EnvelopeError, ExecutedEnvelope, ExecutionPendingEnvelope,
AvailableEnvelope, EnvelopeError, ExecutedEnvelope, ExecutionPendingEnvelope,
MaybeAvailableEnvelope,
};
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
use crate::persisted_beacon_chain::PersistedBeaconChain;
@@ -3577,6 +3578,21 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.map_err(BeaconChainError::TokioJoin)?
.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(
signed_envelope,
import_data,

View File

@@ -2,7 +2,10 @@ use std::sync::Arc;
use educe::Educe;
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 types::{
EthSpec, SignedBeaconBlock, SignedExecutionPayloadEnvelope,
@@ -236,6 +239,7 @@ impl<T: BeaconChainTypes> IntoExecutionPendingEnvelope<T> for GossipVerifiedEnve
&signed_envelope,
// verify signature already done for GossipVerifiedEnvelope
VerifySignatures::False,
VerifyStateRoot::True,
&chain.spec,
)?;

View File

@@ -84,6 +84,22 @@ pub struct AvailableEnvelope<E: EthSpec> {
}
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> {
&self.envelope.message
}