mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
EIP-7732 Boiler Plate
This commit is contained in:
@@ -882,9 +882,14 @@ impl HttpJsonRpc {
|
||||
.try_into()
|
||||
.map_err(Error::BadResponse)
|
||||
}
|
||||
ForkName::Base | ForkName::Altair | ForkName::Deneb | ForkName::Electra => Err(
|
||||
Error::UnsupportedForkVariant(format!("called get_payload_v2 with {}", fork_name)),
|
||||
),
|
||||
ForkName::Base
|
||||
| ForkName::Altair
|
||||
| ForkName::Deneb
|
||||
| ForkName::Electra
|
||||
| ForkName::EIP7732 => Err(Error::UnsupportedForkVariant(format!(
|
||||
"called get_payload_v2 with {}",
|
||||
fork_name
|
||||
))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -912,7 +917,8 @@ impl HttpJsonRpc {
|
||||
| ForkName::Altair
|
||||
| ForkName::Bellatrix
|
||||
| ForkName::Capella
|
||||
| ForkName::Electra => Err(Error::UnsupportedForkVariant(format!(
|
||||
| ForkName::Electra
|
||||
| ForkName::EIP7732 => Err(Error::UnsupportedForkVariant(format!(
|
||||
"called get_payload_v3 with {}",
|
||||
fork_name
|
||||
))),
|
||||
@@ -943,7 +949,8 @@ impl HttpJsonRpc {
|
||||
| ForkName::Altair
|
||||
| ForkName::Bellatrix
|
||||
| ForkName::Capella
|
||||
| ForkName::Deneb => Err(Error::UnsupportedForkVariant(format!(
|
||||
| ForkName::Deneb
|
||||
| ForkName::EIP7732 => Err(Error::UnsupportedForkVariant(format!(
|
||||
"called get_payload_v4 with {}",
|
||||
fork_name
|
||||
))),
|
||||
@@ -1249,6 +1256,7 @@ impl HttpJsonRpc {
|
||||
Err(Error::RequiredMethodUnsupported("engine_getPayloadv4"))
|
||||
}
|
||||
}
|
||||
ForkName::EIP7732 => todo!("EIP-7732 Engine API get_payload"),
|
||||
ForkName::Base | ForkName::Altair => Err(Error::UnsupportedForkVariant(format!(
|
||||
"called get_payload with {}",
|
||||
fork_name
|
||||
|
||||
@@ -219,6 +219,9 @@ impl<E: EthSpec> From<ExecutionPayload<E>> for JsonExecutionPayload<E> {
|
||||
ExecutionPayload::Capella(payload) => JsonExecutionPayload::V2(payload.into()),
|
||||
ExecutionPayload::Deneb(payload) => JsonExecutionPayload::V3(payload.into()),
|
||||
ExecutionPayload::Electra(payload) => JsonExecutionPayload::V4(payload.into()),
|
||||
ExecutionPayload::EIP7732(_payload) => {
|
||||
todo!("EIP-7732 Engine API: JsonExecutionPayload conversion")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +187,8 @@ impl<'a, E: EthSpec> TryFrom<BeaconBlockRef<'a, E>> for NewPayloadRequest<'a, E>
|
||||
parent_beacon_block_root: block_ref.parent_root,
|
||||
execution_requests_list: &block_ref.body.execution_requests,
|
||||
})),
|
||||
//TODO(EIP7732): Need new method of constructing NewPayloadRequest
|
||||
BeaconBlockRef::EIP7732(_) => Err(Self::Error::IncorrectStateVariant),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,6 +208,8 @@ impl<'a, E: EthSpec> TryFrom<ExecutionPayloadRef<'a, E>> for NewPayloadRequest<'
|
||||
})),
|
||||
ExecutionPayloadRef::Deneb(_) => Err(Self::Error::IncorrectStateVariant),
|
||||
ExecutionPayloadRef::Electra(_) => Err(Self::Error::IncorrectStateVariant),
|
||||
//TODO(EIP7732): Probably time to just get rid of this
|
||||
ExecutionPayloadRef::EIP7732(_) => Err(Self::Error::IncorrectStateVariant),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +49,12 @@ use types::builder_bid::BuilderBid;
|
||||
use types::non_zero_usize::new_non_zero_usize;
|
||||
use types::payload::BlockProductionVersion;
|
||||
use types::{
|
||||
AbstractExecPayload, BlobsList, ExecutionPayloadDeneb, ExecutionRequests, KzgProofs,
|
||||
SignedBlindedBeaconBlock,
|
||||
AbstractExecPayload, BlobsList, ExecutionRequests, KzgProofs, SignedBlindedBeaconBlock,
|
||||
};
|
||||
use types::{
|
||||
BeaconStateError, BlindedPayload, ChainSpec, Epoch, ExecPayload, ExecutionPayloadBellatrix,
|
||||
ExecutionPayloadCapella, ExecutionPayloadElectra, FullPayload, ProposerPreparationData,
|
||||
PublicKeyBytes, Signature, Slot,
|
||||
ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadElectra, FullPayload,
|
||||
ProposerPreparationData, PublicKeyBytes, Signature, Slot,
|
||||
};
|
||||
|
||||
mod block_hash;
|
||||
@@ -1833,6 +1832,9 @@ impl<E: EthSpec> ExecutionLayer<E> {
|
||||
ForkName::Base | ForkName::Altair => {
|
||||
return Err(Error::InvalidForkForPayload);
|
||||
}
|
||||
ForkName::EIP7732 => {
|
||||
return Err(Error::InvalidForkForPayload);
|
||||
}
|
||||
};
|
||||
return Ok(Some(payload));
|
||||
}
|
||||
|
||||
@@ -800,6 +800,8 @@ pub fn generate_genesis_header<E: EthSpec>(
|
||||
*header.transactions_root_mut() = empty_transactions_root;
|
||||
Some(header)
|
||||
}
|
||||
// TODO(EIP-7732): need to look into this
|
||||
ForkName::EIP7732 => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -348,6 +348,9 @@ pub fn serve<E: EthSpec>(
|
||||
SignedBlindedBeaconBlock::Electra(block) => {
|
||||
block.message.body.execution_payload.tree_hash_root()
|
||||
}
|
||||
SignedBlindedBeaconBlock::EIP7732(_) => {
|
||||
return Err(reject("invalid fork EIP7732"));
|
||||
}
|
||||
};
|
||||
let payload = builder
|
||||
.el
|
||||
@@ -498,6 +501,9 @@ pub fn serve<E: EthSpec>(
|
||||
// first to avoid polluting the execution block generator with invalid payload attributes
|
||||
// NOTE: this was part of an effort to add payload attribute uniqueness checks,
|
||||
// which was abandoned because it broke too many tests in subtle ways.
|
||||
ForkName::EIP7732 => {
|
||||
return Err(reject("invalid fork"));
|
||||
}
|
||||
ForkName::Bellatrix | ForkName::Capella => PayloadAttributes::new(
|
||||
timestamp,
|
||||
*prev_randao,
|
||||
@@ -551,6 +557,9 @@ pub fn serve<E: EthSpec>(
|
||||
) = payload_response.into();
|
||||
|
||||
match fork {
|
||||
ForkName::EIP7732 => {
|
||||
return Err(reject("invalid fork"));
|
||||
}
|
||||
ForkName::Electra => BuilderBid::Electra(BuilderBidElectra {
|
||||
header: payload
|
||||
.as_electra()
|
||||
@@ -603,6 +612,9 @@ pub fn serve<E: EthSpec>(
|
||||
Option<ExecutionRequests<E>>,
|
||||
) = payload_response.into();
|
||||
match fork {
|
||||
ForkName::EIP7732 => {
|
||||
return Err(reject("invalid fork"));
|
||||
}
|
||||
ForkName::Electra => BuilderBid::Electra(BuilderBidElectra {
|
||||
header: payload
|
||||
.as_electra()
|
||||
|
||||
Reference in New Issue
Block a user