Skip to content

Commit 5d5ea6a

Browse files
committed
Disable heze
1 parent a3db0aa commit 5d5ea6a

3 files changed

Lines changed: 26 additions & 154 deletions

File tree

beacon_node/beacon_chain/src/block_production/gloas.rs

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ use tree_hash::TreeHash;
2929
use types::consts::gloas::BUILDER_INDEX_SELF_BUILD;
3030
use types::{
3131
Address, Attestation, AttestationElectra, AttesterSlashing, AttesterSlashingElectra,
32-
BeaconBlock, BeaconBlockBodyGloas, BeaconBlockBodyHeze, BeaconBlockGloas, BeaconBlockHeze,
33-
BeaconState, BeaconStateError, BuilderIndex, ChainSpec, Deposit, Eth1Data, EthSpec,
34-
ExecutionBlockHash, ExecutionPayloadBid, ExecutionPayloadEnvelope, ExecutionPayloadGloas,
35-
ExecutionRequestsGloas, FullPayload, Graffiti, Hash256, PayloadAttestation, ProposerSlashing,
36-
RelativeEpoch, SignedBeaconBlock, SignedBlsToExecutionChange, SignedExecutionPayloadBid,
37-
SignedExecutionPayloadEnvelope, SignedVoluntaryExit, Slot, SyncAggregate, Withdrawal,
38-
Withdrawals,
32+
BeaconBlock, BeaconBlockBodyGloas, BeaconBlockGloas, BeaconState, BeaconStateError,
33+
BuilderIndex, ChainSpec, Deposit, Eth1Data, EthSpec, ExecutionBlockHash, ExecutionPayloadBid,
34+
ExecutionPayloadEnvelope, ExecutionPayloadGloas, ExecutionRequestsGloas, FullPayload, Graffiti,
35+
Hash256, PayloadAttestation, ProposerSlashing, RelativeEpoch, SignedBeaconBlock,
36+
SignedBlsToExecutionChange, SignedExecutionPayloadBid, SignedExecutionPayloadEnvelope,
37+
SignedVoluntaryExit, Slot, SyncAggregate, Withdrawal, Withdrawals,
3938
};
4039

4140
use crate::pending_payload_envelopes::PendingEnvelopeData;
@@ -601,42 +600,13 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
601600
_phantom: PhantomData::<FullPayload<T::EthSpec>>,
602601
},
603602
}),
604-
BeaconState::Heze(_) => BeaconBlock::Heze(BeaconBlockHeze {
605-
slot,
606-
proposer_index,
607-
parent_root,
608-
state_root: Hash256::ZERO,
609-
body: BeaconBlockBodyHeze {
610-
randao_reveal,
611-
eth1_data,
612-
graffiti,
613-
proposer_slashings: proposer_slashings
614-
.try_into()
615-
.map_err(BlockProductionError::SszTypesError)?,
616-
attester_slashings: attester_slashings
617-
.try_into()
618-
.map_err(BlockProductionError::SszTypesError)?,
619-
attestations: attestations
620-
.try_into()
621-
.map_err(BlockProductionError::SszTypesError)?,
622-
deposits: deposits
623-
.try_into()
624-
.map_err(BlockProductionError::SszTypesError)?,
625-
voluntary_exits: voluntary_exits
626-
.try_into()
627-
.map_err(BlockProductionError::SszTypesError)?,
628-
sync_aggregate,
629-
bls_to_execution_changes: bls_to_execution_changes
630-
.try_into()
631-
.map_err(BlockProductionError::SszTypesError)?,
632-
parent_execution_requests,
633-
signed_execution_payload_bid,
634-
payload_attestations: payload_attestations
635-
.try_into()
636-
.map_err(BlockProductionError::SszTypesError)?,
637-
_phantom: PhantomData::<FullPayload<T::EthSpec>>,
638-
},
639-
}),
603+
// TODO(heze): construct a `BeaconBlockHeze` here once Heze block production is
604+
// wired up end-to-end (get_payload, envelope handling, etc).
605+
BeaconState::Heze(_) => {
606+
return Err(BlockProductionError::InvalidBlockVariant(
607+
"Block production disabled for Heze".to_owned(),
608+
));
609+
}
640610
};
641611

642612
let signed_beacon_block = SignedBeaconBlock::from_block(

beacon_node/execution_layer/src/engine_api/http.rs

Lines changed: 11 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -915,34 +915,6 @@ impl HttpJsonRpc {
915915
Ok(response.into())
916916
}
917917

918-
pub async fn new_payload_v5_heze<E: EthSpec>(
919-
&self,
920-
new_payload_request_heze: NewPayloadRequestHeze<'_, E>,
921-
) -> Result<PayloadStatusV1, Error> {
922-
let params = json!([
923-
JsonExecutionPayload::Heze(
924-
new_payload_request_heze
925-
.execution_payload
926-
.clone()
927-
.try_into()?
928-
),
929-
new_payload_request_heze.versioned_hashes,
930-
new_payload_request_heze.parent_beacon_block_root,
931-
types::ExecutionRequestsRef::Gloas(new_payload_request_heze.execution_requests)
932-
.get_execution_requests_list(),
933-
]);
934-
935-
let response: JsonPayloadStatusV1 = self
936-
.rpc_request(
937-
ENGINE_NEW_PAYLOAD_V5,
938-
params,
939-
ENGINE_NEW_PAYLOAD_TIMEOUT * self.execution_timeout_multiplier,
940-
)
941-
.await?;
942-
943-
Ok(response.into())
944-
}
945-
946918
pub async fn get_payload_v1<E: EthSpec>(
947919
&self,
948920
payload_id: PayloadId,
@@ -1106,18 +1078,7 @@ impl HttpJsonRpc {
11061078
.try_into()
11071079
.map_err(Error::BadResponse)
11081080
}
1109-
ForkName::Heze => {
1110-
let response: JsonGetPayloadResponseHeze<E> = self
1111-
.rpc_request(
1112-
ENGINE_GET_PAYLOAD_V6,
1113-
params,
1114-
ENGINE_GET_PAYLOAD_TIMEOUT * self.execution_timeout_multiplier,
1115-
)
1116-
.await?;
1117-
JsonGetPayloadResponse::Heze(response)
1118-
.try_into()
1119-
.map_err(Error::BadResponse)
1120-
}
1081+
// TODO(heze): add a Heze arm once Heze payload retrieval is implemented.
11211082
_ => Err(Error::UnsupportedForkVariant(format!(
11221083
"called get_payload_v6 with {}",
11231084
fork_name
@@ -1441,13 +1402,11 @@ impl HttpJsonRpc {
14411402
Err(Error::RequiredMethodUnsupported("engine_newPayloadV5"))
14421403
}
14431404
}
1444-
NewPayloadRequest::Heze(new_payload_request_heze) => {
1445-
if engine_capabilities.new_payload_v5 {
1446-
self.new_payload_v5_heze(new_payload_request_heze).await
1447-
} else {
1448-
Err(Error::RequiredMethodUnsupported("engine_newPayloadV5"))
1449-
}
1450-
}
1405+
// TODO(heze): implement the Heze newPayload path once the engine API for Heze
1406+
// is specified.
1407+
NewPayloadRequest::Heze(_) => Err(Error::UnsupportedForkVariant(
1408+
"newPayload not implemented for Heze".to_string(),
1409+
)),
14511410
}
14521411
}
14531412

@@ -1497,13 +1456,11 @@ impl HttpJsonRpc {
14971456
Err(Error::RequiredMethodUnsupported("engine_getPayloadV6"))
14981457
}
14991458
}
1500-
ForkName::Heze => {
1501-
if engine_capabilities.get_payload_v6 {
1502-
self.get_payload_v6(fork_name, payload_id).await
1503-
} else {
1504-
Err(Error::RequiredMethodUnsupported("engine_getPayloadV6"))
1505-
}
1506-
}
1459+
// TODO(heze): implement the Heze getPayload path once the engine API for Heze
1460+
// is specified.
1461+
ForkName::Heze => Err(Error::UnsupportedForkVariant(
1462+
"getPayload not implemented for Heze".to_string(),
1463+
)),
15071464
ForkName::Base | ForkName::Altair => Err(Error::UnsupportedForkVariant(format!(
15081465
"called get_payload with {}",
15091466
fork_name

beacon_node/execution_layer/src/lib.rs

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ use tokio::{
4343
use tokio_stream::wrappers::WatchStream;
4444
use tracing::{Instrument, debug, debug_span, error, info, instrument, warn};
4545
use tree_hash::TreeHash;
46-
use types::ExecutionPayloadHeze;
4746
use types::builder::BuilderBid;
4847
use types::execution::BlockProductionVersion;
4948
use types::kzg_ext::KzgCommitments;
@@ -224,25 +223,7 @@ impl<E: EthSpec> From<GetPayloadResponseGloas<E>> for BlockProposalContentsGloas
224223
}
225224
}
226225

227-
pub struct BlockProposalContentsHeze<E: EthSpec> {
228-
pub payload: ExecutionPayloadHeze<E>,
229-
pub payload_value: Uint256,
230-
pub blob_kzg_commitments: KzgCommitments<E>,
231-
pub blobs_and_proofs: (BlobsList<E>, KzgProofs<E>),
232-
pub execution_requests: ExecutionRequestsGloas<E>,
233-
}
234-
235-
impl<E: EthSpec> From<GetPayloadResponseHeze<E>> for BlockProposalContentsHeze<E> {
236-
fn from(response: GetPayloadResponseHeze<E>) -> Self {
237-
Self {
238-
payload: response.execution_payload,
239-
payload_value: response.block_value,
240-
blob_kzg_commitments: response.blobs_bundle.commitments,
241-
blobs_and_proofs: (response.blobs_bundle.blobs, response.blobs_bundle.proofs),
242-
execution_requests: response.requests,
243-
}
244-
}
245-
}
226+
// TODO(heze): add a `BlockProposalContentsHeze` here once Heze block production is wired up.
246227

247228
pub enum BlockProposalContents<E: EthSpec, Payload: AbstractExecPayload<E>> {
248229
Payload {
@@ -962,43 +943,7 @@ impl<E: EthSpec> ExecutionLayer<E> {
962943
Ok(payload_response.into())
963944
}
964945

965-
/// Maps to the `engine_getPayload` JSON-RPC call for post-Heze payload construction.
966-
///
967-
/// However, it will attempt to call `self.prepare_payload` if it cannot find an existing
968-
/// payload id for the given parameters.
969-
///
970-
/// ## Fallback Behavior
971-
///
972-
/// The result will be returned from the first node that returns successfully. No more nodes
973-
/// will be contacted.
974-
#[instrument(level = "debug", skip_all)]
975-
pub async fn get_payload_heze(
976-
&self,
977-
payload_parameters: PayloadParameters<'_>,
978-
) -> Result<BlockProposalContentsHeze<E>, Error> {
979-
let payload_response_type = self.get_full_payload_caching(payload_parameters).await?;
980-
let GetPayloadResponseType::Full(payload_response) = payload_response_type else {
981-
return Err(Error::Unexpected(
982-
"get_payload_heze should never return a blinded payload".to_owned(),
983-
));
984-
};
985-
let GetPayloadResponse::Heze(payload_response) = payload_response else {
986-
return Err(Error::Unexpected(
987-
"get_payload_heze should always return a heze `GetPayloadResponse` variant"
988-
.to_owned(),
989-
));
990-
};
991-
metrics::inc_counter_vec(
992-
&metrics::EXECUTION_LAYER_GET_PAYLOAD_OUTCOME,
993-
&[metrics::SUCCESS],
994-
);
995-
metrics::inc_counter_vec(
996-
&metrics::EXECUTION_LAYER_GET_PAYLOAD_SOURCE,
997-
&[metrics::LOCAL],
998-
);
999-
1000-
Ok(payload_response.into())
1001-
}
946+
// TODO(heze): add a `get_payload_heze` here once Heze block production is wired up.
1002947

1003948
/// Maps to the `engine_getPayload` JSON-RPC call.
1004949
///

0 commit comments

Comments
 (0)