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 7f66f77ff8..00806f0e17 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/import.rs @@ -173,6 +173,14 @@ impl BeaconChain { .map_err(BeaconChainError::TokioJoin)? .ok_or(BeaconChainError::RuntimeShutdown)??; + // TODO(gloas): optimistic sync is not supported for Gloas, maybe we could re-add it + if payload_verification_outcome + .payload_verification_status + .is_optimistic() + { + return Err(EnvelopeError::OptimisticSyncNotSupported { block_root }); + } + Ok(AvailabilityPendingExecutedEnvelope::new( signed_envelope, block_root, @@ -222,14 +230,6 @@ impl BeaconChain { block_root: Hash256, payload_verification_status: PayloadVerificationStatus, ) -> Result { - // TODO(gloas): optimistic sync is not supported for Gloas. Proto-array only tracks - // `payload_received` as a bool, so an optimistically-imported payload would be treated as - // valid with no way to invalidate it if the EL later rejects it. Reject here (covering both - // the gossip and range-sync paths) until fork choice can track optimistic payload status. - if payload_verification_status.is_optimistic() { - return Err(EnvelopeError::OptimisticSyncNotSupported { block_root }); - } - // Everything in this initial section is on the hot path for processing the envelope. // Take an upgradable read lock on fork choice so we can check if this block has already // been imported. We don't want to repeat work importing a block that is already imported. 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 870969c107..95209cad4d 100644 --- a/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs +++ b/beacon_node/beacon_chain/src/payload_envelope_verification/mod.rs @@ -168,11 +168,6 @@ pub enum EnvelopeError { /// Error verifying the execution payload ExecutionPayloadError(ExecutionPayloadError), /// Optimistic sync is not supported for Gloas payload envelopes. - /// - /// Proto-array only tracks `payload_received` as a bool, so it cannot represent an - /// optimistically-imported payload that the EL may later invalidate. Until fork choice can - /// track optimistic payload status, we reject optimistic envelopes rather than treat them as - /// valid. OptimisticSyncNotSupported { block_root: Hash256 }, /// The envelope's beacon block was not present in fork choice at import time. /// diff --git a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs index 8b9db8f04c..98c143eaeb 100644 --- a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs @@ -3715,6 +3715,7 @@ impl NetworkBeaconProcessor { | EnvelopeError::BeaconStateError(_) // The following variants are produced during envelope import, not gossip // verification, so they cannot be reached here. Ignore them to be safe. + | EnvelopeError::OptimisticSyncNotSupported { .. } | EnvelopeError::BlockRootNotInForkChoice(_) | EnvelopeError::InternalError(_) => { self.propagate_validation_result(