Ensure payload envelope streamer always serves canonical envelopes after the split slot (#9085)

Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Eitan Seri-Levi
2026-04-23 20:32:26 +09:00
committed by GitHub
parent cfc748309f
commit 82dc8b4edc
9 changed files with 533 additions and 36 deletions

View File

@@ -78,6 +78,7 @@ pub enum Error<T> {
UnrealizedVoteProcessing(state_processing::EpochProcessingError),
ValidatorStatuses(BeaconStateError),
ChainSpecError(String),
DoesNotDescendFromFinalizedCheckpoint,
}
impl<T> From<InvalidAttestation> for Error<T> {
@@ -1523,6 +1524,29 @@ where
}
}
/// Returns the canonical payload status of a block. See
/// `ProtoArrayForkChoice::get_canonical_payload_status`.
pub fn get_canonical_payload_status(
&self,
block_root: &Hash256,
spec: &ChainSpec,
) -> Result<PayloadStatus, Error<T::Error>> {
if self.is_finalized_checkpoint_or_descendant(*block_root) {
let current_slot = self.fc_store.get_current_slot();
let proposer_boost_root = self.fc_store.proposer_boost_root();
self.proto_array
.get_canonical_payload_status::<E>(
block_root,
current_slot,
proposer_boost_root,
spec,
)
.map_err(Error::ProtoArrayError)
} else {
Err(Error::DoesNotDescendFromFinalizedCheckpoint)
}
}
/// Returns the weight for the given block root.
pub fn get_block_weight(&self, block_root: &Hash256) -> Option<u64> {
self.proto_array.get_weight(block_root)