mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 22:04:44 +00:00
add new fields to execution payload and header
This commit is contained in:
@@ -89,6 +89,11 @@ pub struct ExecutionPayload<E: EthSpec> {
|
||||
#[superstruct(only(Deneb, Electra), partial_getter(copy))]
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub excess_blob_gas: u64,
|
||||
#[superstruct(only(Electra))]
|
||||
pub deposit_receipts: VariableList<DepositReceipt, E::MaxDepositReceiptsPerPayload>,
|
||||
#[superstruct(only(Electra))]
|
||||
pub withdrawal_requests:
|
||||
VariableList<ExecutionLayerWithdrawalRequest, E::MaxWithdrawalRequestsPerPayload>,
|
||||
}
|
||||
|
||||
impl<'a, E: EthSpec> ExecutionPayloadRef<'a, E> {
|
||||
|
||||
@@ -88,6 +88,10 @@ pub struct ExecutionPayloadHeader<E: EthSpec> {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[superstruct(getter(copy))]
|
||||
pub excess_blob_gas: u64,
|
||||
#[superstruct(only(Electra), partial_getter(copy))]
|
||||
pub deposit_receipts_root: Hash256,
|
||||
#[superstruct(only(Electra), partial_getter(copy))]
|
||||
pub withdrawal_requests_root: Hash256,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> ExecutionPayloadHeader<E> {
|
||||
@@ -204,6 +208,8 @@ impl<E: EthSpec> ExecutionPayloadHeaderDeneb<E> {
|
||||
withdrawals_root: self.withdrawals_root,
|
||||
blob_gas_used: self.blob_gas_used,
|
||||
excess_blob_gas: self.excess_blob_gas,
|
||||
deposit_receipts_root: Hash256::zero(),
|
||||
withdrawal_requests_root: Hash256::zero(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,6 +301,8 @@ impl<'a, E: EthSpec> From<&'a ExecutionPayloadElectra<E>> for ExecutionPayloadHe
|
||||
withdrawals_root: payload.withdrawals.tree_hash_root(),
|
||||
blob_gas_used: payload.blob_gas_used,
|
||||
excess_blob_gas: payload.excess_blob_gas,
|
||||
deposit_receipts_root: payload.deposit_receipts.tree_hash_root(),
|
||||
withdrawal_requests_root: payload.withdrawal_requests.tree_hash_root(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user