Clean up blockv3 metadata and client (#5015)

* Improve block production v3 client

* Delete wayward line

* Overhaul JSON endpoint as well

* Rename timeout param

* Update tests

* I broke everything

* Ah this is an insane fix

* Remove unnecessary optionals

* Doc fix
This commit is contained in:
Michael Sproul
2023-12-23 01:39:17 +11:00
committed by GitHub
parent a7e5926a1f
commit af11e78ae1
12 changed files with 451 additions and 324 deletions

View File

@@ -501,14 +501,14 @@ impl<E: EthSpec> BeaconBlockResponseWrapper<E> {
})
}
pub fn execution_payload_value(&self) -> Option<Uint256> {
pub fn execution_payload_value(&self) -> Uint256 {
match self {
BeaconBlockResponseWrapper::Full(resp) => resp.execution_payload_value,
BeaconBlockResponseWrapper::Blinded(resp) => resp.execution_payload_value,
}
}
pub fn consensus_block_value(&self) -> Option<u64> {
pub fn consensus_block_value(&self) -> u64 {
match self {
BeaconBlockResponseWrapper::Full(resp) => resp.consensus_block_value,
BeaconBlockResponseWrapper::Blinded(resp) => resp.consensus_block_value,
@@ -529,9 +529,9 @@ pub struct BeaconBlockResponse<T: EthSpec, Payload: AbstractExecPayload<T>> {
/// The Blobs / Proofs associated with the new block
pub blob_items: Option<(KzgProofs<T>, BlobsList<T>)>,
/// The execution layer reward for the block
pub execution_payload_value: Option<Uint256>,
pub execution_payload_value: Uint256,
/// The consensus layer reward to the proposer
pub consensus_block_value: Option<u64>,
pub consensus_block_value: u64,
}
impl FinalizationAndCanonicity {
@@ -5286,8 +5286,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
block,
state,
blob_items,
execution_payload_value: Some(execution_payload_value),
consensus_block_value: Some(consensus_block_value),
execution_payload_value,
consensus_block_value,
})
}
@@ -5563,6 +5563,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
parent_block_hash: forkchoice_update_params.head_hash.unwrap_or_default(),
payload_attributes: payload_attributes.into(),
},
metadata: Default::default(),
version: Some(self.spec.fork_name_at_slot::<T::EthSpec>(prepare_slot)),
}));
}