mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
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:
@@ -1053,6 +1053,24 @@ impl ProtoArrayForkChoice {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Returns the canonical payload status of a block, matching the decision
|
||||
/// `get_head` would make between `(root, FULL)` and `(root, EMPTY)`.
|
||||
pub fn get_canonical_payload_status<E: EthSpec>(
|
||||
&self,
|
||||
block_root: &Hash256,
|
||||
current_slot: Slot,
|
||||
proposer_boost_root: Hash256,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<PayloadStatus, Error> {
|
||||
self.proto_array.get_canonical_payload_status::<E>(
|
||||
*block_root,
|
||||
current_slot,
|
||||
proposer_boost_root,
|
||||
&self.balances,
|
||||
spec,
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns the weight of a given block.
|
||||
pub fn get_weight(&self, block_root: &Hash256) -> Option<u64> {
|
||||
let block_index = self.proto_array.indices.get(block_root)?;
|
||||
|
||||
Reference in New Issue
Block a user