mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-01 05:37:05 +00:00
Gloas spec v1.7.0-alpha.5 and beacon_chain tests (#8998)
Fix database pruning post-Gloas - Fix DB pruning logic (and state summaries DAG) - Get the `beacon_chain` tests running with `FORK_NAME=gloas` 🎉 Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com> Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -107,6 +107,12 @@ pub struct JsonExecutionPayload<E: EthSpec> {
|
||||
#[superstruct(only(Deneb, Electra, Fulu, Gloas))]
|
||||
#[serde(with = "serde_utils::u64_hex_be")]
|
||||
pub excess_blob_gas: u64,
|
||||
#[superstruct(only(Gloas))]
|
||||
#[serde(with = "ssz_types::serde_utils::hex_var_list")]
|
||||
pub block_access_list: VariableList<u8, E::MaxBytesPerTransaction>,
|
||||
#[superstruct(only(Gloas))]
|
||||
#[serde(with = "serde_utils::u64_hex_be")]
|
||||
pub slot_number: u64,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> From<ExecutionPayloadBellatrix<E>> for JsonExecutionPayloadBellatrix<E> {
|
||||
@@ -252,6 +258,8 @@ impl<E: EthSpec> TryFrom<ExecutionPayloadGloas<E>> for JsonExecutionPayloadGloas
|
||||
withdrawals: withdrawals_to_json(payload.withdrawals)?,
|
||||
blob_gas_used: payload.blob_gas_used,
|
||||
excess_blob_gas: payload.excess_blob_gas,
|
||||
block_access_list: payload.block_access_list,
|
||||
slot_number: payload.slot_number.into(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -425,6 +433,8 @@ impl<E: EthSpec> TryFrom<JsonExecutionPayloadGloas<E>> for ExecutionPayloadGloas
|
||||
withdrawals: withdrawals_from_json(payload.withdrawals)?,
|
||||
blob_gas_used: payload.blob_gas_used,
|
||||
excess_blob_gas: payload.excess_blob_gas,
|
||||
block_access_list: payload.block_access_list,
|
||||
slot_number: payload.slot_number.into(),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -716,7 +726,7 @@ impl<'a> From<&'a JsonWithdrawal> for EncodableJsonWithdrawal<'a> {
|
||||
}
|
||||
|
||||
#[superstruct(
|
||||
variants(V1, V2, V3),
|
||||
variants(V1, V2, V3, V4),
|
||||
variant_attributes(
|
||||
derive(Debug, Clone, PartialEq, Serialize, Deserialize),
|
||||
serde(rename_all = "camelCase")
|
||||
@@ -732,10 +742,13 @@ pub struct JsonPayloadAttributes {
|
||||
pub prev_randao: Hash256,
|
||||
#[serde(with = "serde_utils::address_hex")]
|
||||
pub suggested_fee_recipient: Address,
|
||||
#[superstruct(only(V2, V3))]
|
||||
#[superstruct(only(V2, V3, V4))]
|
||||
pub withdrawals: Vec<JsonWithdrawal>,
|
||||
#[superstruct(only(V3))]
|
||||
#[superstruct(only(V3, V4))]
|
||||
pub parent_beacon_block_root: Hash256,
|
||||
#[superstruct(only(V4))]
|
||||
#[serde(with = "serde_utils::u64_hex_be")]
|
||||
pub slot_number: u64,
|
||||
}
|
||||
|
||||
impl From<PayloadAttributes> for JsonPayloadAttributes {
|
||||
@@ -759,6 +772,14 @@ impl From<PayloadAttributes> for JsonPayloadAttributes {
|
||||
withdrawals: pa.withdrawals.into_iter().map(Into::into).collect(),
|
||||
parent_beacon_block_root: pa.parent_beacon_block_root,
|
||||
}),
|
||||
PayloadAttributes::V4(pa) => Self::V4(JsonPayloadAttributesV4 {
|
||||
timestamp: pa.timestamp,
|
||||
prev_randao: pa.prev_randao,
|
||||
suggested_fee_recipient: pa.suggested_fee_recipient,
|
||||
withdrawals: pa.withdrawals.into_iter().map(Into::into).collect(),
|
||||
parent_beacon_block_root: pa.parent_beacon_block_root,
|
||||
slot_number: pa.slot_number,
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -784,6 +805,14 @@ impl From<JsonPayloadAttributes> for PayloadAttributes {
|
||||
withdrawals: jpa.withdrawals.into_iter().map(Into::into).collect(),
|
||||
parent_beacon_block_root: jpa.parent_beacon_block_root,
|
||||
}),
|
||||
JsonPayloadAttributes::V4(jpa) => Self::V4(PayloadAttributesV4 {
|
||||
timestamp: jpa.timestamp,
|
||||
prev_randao: jpa.prev_randao,
|
||||
suggested_fee_recipient: jpa.suggested_fee_recipient,
|
||||
withdrawals: jpa.withdrawals.into_iter().map(Into::into).collect(),
|
||||
parent_beacon_block_root: jpa.parent_beacon_block_root,
|
||||
slot_number: jpa.slot_number,
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user