mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
merge with upstream
This commit is contained in:
@@ -633,7 +633,7 @@ impl ChainSpec {
|
||||
* Capella hard fork params
|
||||
*/
|
||||
capella_fork_version: [0x03, 00, 00, 00],
|
||||
capella_fork_epoch: Some(Epoch::new(18446744073709551615)),
|
||||
capella_fork_epoch: None,
|
||||
|
||||
/*
|
||||
* Eip4844 hard fork params
|
||||
@@ -970,6 +970,7 @@ pub struct Config {
|
||||
#[serde(default = "default_eip4844_fork_version")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
eip4844_fork_version: [u8; 4],
|
||||
#[serde(default)]
|
||||
#[serde(serialize_with = "serialize_fork_epoch")]
|
||||
#[serde(deserialize_with = "deserialize_fork_epoch")]
|
||||
pub eip4844_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||
|
||||
@@ -38,8 +38,7 @@ pub type Withdrawals<T> = VariableList<Withdrawal, <T as EthSpec>::MaxWithdrawal
|
||||
)]
|
||||
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
|
||||
#[derivative(PartialEq, Hash(bound = "T: EthSpec"))]
|
||||
#[serde(untagged)]
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
#[serde(bound = "T: EthSpec", untagged)]
|
||||
#[ssz(enum_behaviour = "transparent")]
|
||||
#[tree_hash(enum_behaviour = "transparent")]
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
|
||||
@@ -33,7 +33,7 @@ use BeaconStateError;
|
||||
)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
|
||||
#[derivative(PartialEq, Hash(bound = "T: EthSpec"))]
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
#[serde(bound = "T: EthSpec", untagged)]
|
||||
#[tree_hash(enum_behaviour = "transparent")]
|
||||
#[ssz(enum_behaviour = "transparent")]
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
|
||||
@@ -199,7 +199,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn previous_and_next_fork_consistent() {
|
||||
assert_eq!(ForkName::Merge.next_fork(), None);
|
||||
assert_eq!(ForkName::Eip4844.next_fork(), None);
|
||||
assert_eq!(ForkName::Base.previous_fork(), None);
|
||||
|
||||
for (prev_fork, fork) in ForkName::list_all().into_iter().tuple_windows() {
|
||||
|
||||
@@ -166,11 +166,10 @@ impl<'a, T: EthSpec> From<FullPayloadRef<'a, T>> for ExecutionPayload<T> {
|
||||
// FIXME: can this be implemented as Deref or Clone somehow?
|
||||
impl<'a, T: EthSpec> From<FullPayloadRef<'a, T>> for FullPayload<T> {
|
||||
fn from(full_payload_ref: FullPayloadRef<'a, T>) -> Self {
|
||||
match full_payload_ref {
|
||||
FullPayloadRef::Merge(payload_ref) => FullPayload::Merge(payload_ref.clone()),
|
||||
FullPayloadRef::Capella(payload_ref) => FullPayload::Capella(payload_ref.clone()),
|
||||
FullPayloadRef::Eip4844(payload_ref) => FullPayload::Eip4844(payload_ref.clone()),
|
||||
}
|
||||
map_full_payload_ref!(&'a _, full_payload_ref, move |payload, cons| {
|
||||
cons(payload);
|
||||
payload.clone().into()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,6 +450,15 @@ pub struct BlindedPayload<T: EthSpec> {
|
||||
pub execution_payload_header: ExecutionPayloadHeaderEip4844<T>,
|
||||
}
|
||||
|
||||
impl<'a, T: EthSpec> From<BlindedPayloadRef<'a, T>> for BlindedPayload<T> {
|
||||
fn from(blinded_payload_ref: BlindedPayloadRef<'a, T>) -> Self {
|
||||
map_blinded_payload_ref!(&'a _, blinded_payload_ref, move |payload, cons| {
|
||||
cons(payload);
|
||||
payload.clone().into()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: EthSpec> ExecPayload<T> for BlindedPayload<T> {
|
||||
fn block_type() -> BlockType {
|
||||
BlockType::Blinded
|
||||
|
||||
Reference in New Issue
Block a user