add new fields to execution payload and header

This commit is contained in:
realbigsean
2024-04-25 13:17:07 -04:00
parent 4a48d7b546
commit a80b94c88b
6 changed files with 26 additions and 0 deletions

View File

@@ -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> {

View File

@@ -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(),
}
}
}