From ffb6f296bd33b51110f80f1e641fafd4f9dc7e94 Mon Sep 17 00:00:00 2001 From: Eitan Seri- Levi Date: Wed, 25 Feb 2026 14:56:30 -0800 Subject: [PATCH] temp --- .../execution_pending_envelope.rs | 39 ++----------------- .../payload_envelope_verification/import.rs | 13 ++----- .../src/payload_envelope_verification/mod.rs | 17 ++------ 3 files changed, 11 insertions(+), 58 deletions(-) diff --git a/beacon_node/beacon_chain/src/payload_envelope_verification/execution_pending_envelope.rs b/beacon_node/beacon_chain/src/payload_envelope_verification/execution_pending_envelope.rs index eea50d9fe1..4a2b152703 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/execution_pending_envelope.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/execution_pending_envelope.rs @@ -5,7 +5,7 @@ use state_processing::{ VerifySignatures, envelope_processing::{VerifyStateRoot, process_execution_payload_envelope}, }; -use types::{EthSpec, SignedExecutionPayloadEnvelope}; +use types::EthSpec; use crate::{ BeaconChain, BeaconChainError, BeaconChainTypes, NotifyExecutionLayer, @@ -18,24 +18,14 @@ use crate::{ }, }; -pub trait IntoExecutionPendingEnvelope: Sized { - fn into_execution_pending_envelope( - self, - chain: &Arc>, - notify_execution_layer: NotifyExecutionLayer, - ) -> Result, EnvelopeError>; - - fn envelope(&self) -> &Arc>; -} - pub struct ExecutionPendingEnvelope { pub signed_envelope: MaybeAvailableEnvelope, pub import_data: EnvelopeImportData, pub payload_verification_handle: PayloadVerificationHandle, } -impl IntoExecutionPendingEnvelope for GossipVerifiedEnvelope { - fn into_execution_pending_envelope( +impl GossipVerifiedEnvelope { + pub fn into_execution_pending_envelope( self, chain: &Arc>, notify_execution_layer: NotifyExecutionLayer, @@ -68,8 +58,6 @@ impl IntoExecutionPendingEnvelope for GossipVerifiedEnve let payload_verification_status = payload_notifier.notify_new_payload().await?; Ok(PayloadVerificationOutcome { payload_verification_status, - // This fork is after the merge so it'll never be the merge transition block - is_valid_merge_transition_block: false, }) }; // Spawn the payload verification future as a new task, but don't wait for it to complete. @@ -118,25 +106,4 @@ impl IntoExecutionPendingEnvelope for GossipVerifiedEnve payload_verification_handle, }) } - - fn envelope(&self) -> &Arc> { - &self.signed_envelope - } -} - -impl IntoExecutionPendingEnvelope - for Arc> -{ - fn into_execution_pending_envelope( - self, - chain: &Arc>, - notify_execution_layer: NotifyExecutionLayer, - ) -> Result, EnvelopeError> { - GossipVerifiedEnvelope::new(self, &chain.gossip_verification_context())? - .into_execution_pending_envelope(chain, notify_execution_layer) - } - - fn envelope(&self) -> &Arc> { - self - } } diff --git a/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs b/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs index 05a18a6d18..d34aafce78 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs @@ -10,7 +10,7 @@ use types::{BeaconState, BlockImportSource, Hash256, SignedBeaconBlock, Slot}; use super::{ AvailableEnvelope, AvailableExecutedEnvelope, EnvelopeError, EnvelopeImportData, - ExecutedEnvelope, IntoExecutionPendingEnvelope, + ExecutedEnvelope, gossip_verified_envelope::GossipVerifiedEnvelope, }; use crate::{ AvailabilityProcessingStatus, BeaconChain, BeaconChainError, BeaconChainTypes, @@ -25,25 +25,20 @@ impl BeaconChain { /// Returns `Ok(block_root)` if the given `unverified_envelope` was successfully verified and /// imported into the chain. /// - /// Items that implement `IntoExecutionPendingEnvelope` include: - /// - /// - `GossipVerifiedEnvelope` - /// - TODO(gloas) implement for envelopes recieved over RPC - /// /// ## Errors /// /// Returns an `Err` if the given block was invalid, or an error was encountered during /// verification. #[instrument(skip_all, fields(block_root = ?block_root, block_source = %block_source))] - pub async fn process_execution_payload_envelope>( + pub async fn process_execution_payload_envelope( self: &Arc, block_root: Hash256, - unverified_envelope: P, + unverified_envelope: GossipVerifiedEnvelope, notify_execution_layer: NotifyExecutionLayer, block_source: BlockImportSource, publish_fn: impl FnOnce() -> Result<(), EnvelopeError>, ) -> Result { - let block_slot = unverified_envelope.envelope().slot(); + let block_slot = unverified_envelope.signed_envelope.slot(); // Set observed time if not already set. Usually this should be set by gossip or RPC, // but just in case we set it again here (useful for tests). diff --git a/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs b/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs index b5193f8e8c..97cf952d11 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs @@ -3,27 +3,18 @@ //! types, starting at a `SignedExecutionPayloadEnvelope` and finishing with an `AvailableExecutedEnvelope` (see //! diagram below). //! -//! // TODO(gloas) we might want to update this diagram to include `AvailabelExecutedEnvelope` //! ```ignore -//! START -//! | -//! ▼ //! SignedExecutionPayloadEnvelope //! | -//! |--------------- -//! | | -//! | ▼ -//! | GossipVerifiedEnvelope -//! | | -//! |--------------- +//! ▼ +//! GossipVerifiedEnvelope //! | //! ▼ //! ExecutionPendingEnvelope //! | //! await -//! | //! ▼ -//! END +//! ExecutedEnvelope //! //! ``` @@ -48,7 +39,7 @@ pub mod gossip_verified_envelope; pub mod import; mod payload_notifier; -pub use execution_pending_envelope::{ExecutionPendingEnvelope, IntoExecutionPendingEnvelope}; +pub use execution_pending_envelope::ExecutionPendingEnvelope; #[derive(PartialEq)] pub struct EnvelopeImportData {