diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index efedfdae5..c243d50cb 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -3384,13 +3384,15 @@ impl BeaconChain { // // Wait for the execution layer to return an execution payload (if one is required). let prepare_payload_handle = partial_beacon_block.prepare_payload_handle.take(); - let execution_payload = if let Some(prepare_payload_handle) = prepare_payload_handle { - prepare_payload_handle - .await - .map_err(BlockProductionError::TokioJoin)? - .ok_or(BlockProductionError::ShuttingDown)?? + let block_contents = if let Some(prepare_payload_handle) = prepare_payload_handle { + Some( + prepare_payload_handle + .await + .map_err(BlockProductionError::TokioJoin)? + .ok_or(BlockProductionError::ShuttingDown)??, + ) } else { - return Err(BlockProductionError::MissingExecutionPayload); + None }; //FIXME(sean) waiting for the BN<>EE api for this to stabilize @@ -3405,7 +3407,7 @@ impl BeaconChain { move || { chain.complete_partial_beacon_block( partial_beacon_block, - execution_payload, + block_contents, kzg_commitments, verification, ) @@ -3657,7 +3659,7 @@ impl BeaconChain { fn complete_partial_beacon_block>( &self, partial_beacon_block: PartialBeaconBlock, - block_contents: BlockProposalContents, + block_contents: Option>, kzg_commitments: Vec, verification: ProduceBlockVerification, ) -> Result, BlockProductionError> { @@ -3737,6 +3739,7 @@ impl BeaconChain { sync_aggregate: sync_aggregate .ok_or(BlockProductionError::MissingSyncAggregate)?, execution_payload: block_contents + .ok_or(BlockProductionError::MissingExecutionPayload)? .to_payload() .try_into() .map_err(|_| BlockProductionError::InvalidPayloadFork)?, @@ -3759,6 +3762,7 @@ impl BeaconChain { sync_aggregate: sync_aggregate .ok_or(BlockProductionError::MissingSyncAggregate)?, execution_payload: block_contents + .ok_or(BlockProductionError::MissingExecutionPayload)? .to_payload() .try_into() .map_err(|_| BlockProductionError::InvalidPayloadFork)?, @@ -3783,6 +3787,7 @@ impl BeaconChain { sync_aggregate: sync_aggregate .ok_or(BlockProductionError::MissingSyncAggregate)?, execution_payload: block_contents + .ok_or(BlockProductionError::MissingExecutionPayload)? .to_payload() .try_into() .map_err(|_| BlockProductionError::InvalidPayloadFork)?, diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index 2a19c4165..0cdce4f12 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -959,20 +959,22 @@ impl ExecutionLayer { }; let blob_fut = async { - //FIXME(sean) do a fork check here and return None otherwise - // ^ - // well now we have the fork in this function so - // it should be easier to do that now - // - Mark - debug!( - self.log(), - "Issuing engine_getBlobsBundle"; - "suggested_fee_recipient" => ?suggested_fee_recipient, - "prev_randao" => ?prev_randao, - "timestamp" => timestamp, - "parent_hash" => ?parent_hash, - ); - Some(engine.api.get_blobs_bundle_v1::(payload_id).await) + match current_fork { + ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => { + None + } + ForkName::Eip4844 => { + debug!( + self.log(), + "Issuing engine_getBlobsBundle"; + "suggested_fee_recipient" => ?suggested_fee_recipient, + "prev_randao" => ?prev_randao, + "timestamp" => timestamp, + "parent_hash" => ?parent_hash, + ); + Some(engine.api.get_blobs_bundle_v1::(payload_id).await) + } + } }; let payload_fut = async { debug!(