Convert a FullPayload to a BlindedPayload correctly (#5005)
This commit is contained in:
parent
189430a45c
commit
ae4a296089
@ -5167,8 +5167,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
.try_into()
|
||||
.map_err(|_| BlockProductionError::InvalidPayloadFork)?,
|
||||
bls_to_execution_changes: bls_to_execution_changes.into(),
|
||||
blob_kzg_commitments: kzg_commitments
|
||||
.ok_or(BlockProductionError::InvalidPayloadFork)?,
|
||||
blob_kzg_commitments: kzg_commitments.ok_or(
|
||||
BlockProductionError::MissingKzgCommitment(
|
||||
"Kzg commitments missing from block contents".to_string(),
|
||||
),
|
||||
)?,
|
||||
},
|
||||
}),
|
||||
maybe_blobs_and_proofs,
|
||||
|
@ -176,15 +176,26 @@ impl<T: EthSpec> From<BlockProposalContents<T, FullPayload<T>>>
|
||||
for BlockProposalContents<T, BlindedPayload<T>>
|
||||
{
|
||||
fn from(item: BlockProposalContents<T, FullPayload<T>>) -> Self {
|
||||
let block_value = item.block_value().to_owned();
|
||||
|
||||
let blinded_payload: BlockProposalContents<T, BlindedPayload<T>> =
|
||||
match item {
|
||||
BlockProposalContents::Payload {
|
||||
payload: item.to_payload().execution_payload().into(),
|
||||
payload,
|
||||
block_value,
|
||||
};
|
||||
|
||||
blinded_payload
|
||||
} => BlockProposalContents::Payload {
|
||||
payload: payload.execution_payload().into(),
|
||||
block_value,
|
||||
},
|
||||
BlockProposalContents::PayloadAndBlobs {
|
||||
payload,
|
||||
block_value,
|
||||
kzg_commitments,
|
||||
blobs_and_proofs: _,
|
||||
} => BlockProposalContents::PayloadAndBlobs {
|
||||
payload: payload.execution_payload().into(),
|
||||
block_value,
|
||||
kzg_commitments,
|
||||
blobs_and_proofs: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user