mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 21:34:36 +00:00
Address some more review comments
This commit is contained in:
@@ -64,7 +64,6 @@ pub enum Error {
|
||||
ExecutionHeadBlockNotFound,
|
||||
ParentHashEqualsBlockHash(ExecutionBlockHash),
|
||||
PayloadIdUnavailable,
|
||||
TransitionConfigurationMismatch,
|
||||
SszError(ssz_types::Error),
|
||||
DeserializeWithdrawals(ssz_types::Error),
|
||||
DeserializeDepositRequests(ssz_types::Error),
|
||||
@@ -635,17 +634,14 @@ impl<E: EthSpec> ExecutionPayloadBodyV1<E> {
|
||||
}
|
||||
}
|
||||
ExecutionPayloadHeader::Electra(header) => {
|
||||
let (Some(withdrawals), Some(deposit_requests), Some(withdrawal_requests)) = (
|
||||
let withdrawals_exist = self.withdrawals.is_some();
|
||||
let deposit_requests_exist = self.deposit_requests.is_some();
|
||||
let withdrawal_requests_exist = self.withdrawal_requests.is_some();
|
||||
if let (Some(withdrawals), Some(deposit_requests), Some(withdrawal_requests)) = (
|
||||
self.withdrawals,
|
||||
self.deposit_requests,
|
||||
self.withdrawal_requests,
|
||||
) else {
|
||||
return Err(format!(
|
||||
"block {} is post-electra but payload body doesn't have withdrawals/deposit_requests/withdrawal_requests \
|
||||
Check that ELs are returning receipts and withdrawal_requests in getPayloadBody requests",
|
||||
header.block_hash
|
||||
));
|
||||
};
|
||||
) {
|
||||
Ok(ExecutionPayload::Electra(ExecutionPayloadElectra {
|
||||
parent_hash: header.parent_hash,
|
||||
fee_recipient: header.fee_recipient,
|
||||
@@ -667,6 +663,13 @@ impl<E: EthSpec> ExecutionPayloadBodyV1<E> {
|
||||
deposit_requests,
|
||||
withdrawal_requests,
|
||||
}))
|
||||
} else {
|
||||
Err(format!(
|
||||
"block {} is post-electra but payload body doesn't have withdrawals/deposit_requests/withdrawal_requests \
|
||||
withdrawals: {}, deposit_requests: {}, withdrawal_requests: {}",
|
||||
header.block_hash, withdrawals_exist, deposit_requests_exist, withdrawal_requests_exist
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user