mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Smol fix
This commit is contained in:
@@ -1432,6 +1432,29 @@ impl ProtoArray {
|
|||||||
.get(node.proto_node_index)
|
.get(node.proto_node_index)
|
||||||
.ok_or(Error::InvalidNodeIndex(node.proto_node_index))?;
|
.ok_or(Error::InvalidNodeIndex(node.proto_node_index))?;
|
||||||
|
|
||||||
|
// V17 (pre-GLOAS) nodes don't have payload_received or parent_payload_status.
|
||||||
|
// Skip the virtual Empty/Full split and return real children directly.
|
||||||
|
if proto_node.as_v17().is_ok() {
|
||||||
|
let child_indices = children_index
|
||||||
|
.get(node.proto_node_index)
|
||||||
|
.map(|c| c.as_slice())
|
||||||
|
.unwrap_or(&[]);
|
||||||
|
return Ok(child_indices
|
||||||
|
.iter()
|
||||||
|
.filter_map(|&child_index| {
|
||||||
|
let child_node = self.nodes.get(child_index)?;
|
||||||
|
Some((
|
||||||
|
IndexedForkChoiceNode {
|
||||||
|
root: child_node.root(),
|
||||||
|
proto_node_index: child_index,
|
||||||
|
payload_status: PayloadStatus::Pending,
|
||||||
|
},
|
||||||
|
child_node.clone(),
|
||||||
|
))
|
||||||
|
})
|
||||||
|
.collect());
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(gloas) this is the actual change we want to keep once PTC is implemented
|
// TODO(gloas) this is the actual change we want to keep once PTC is implemented
|
||||||
// let mut children = vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())];
|
// let mut children = vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())];
|
||||||
// // The FULL virtual child only exists if the payload has been received.
|
// // The FULL virtual child only exists if the payload has been received.
|
||||||
@@ -1459,7 +1482,10 @@ impl ProtoArray {
|
|||||||
.iter()
|
.iter()
|
||||||
.filter_map(|&child_index| {
|
.filter_map(|&child_index| {
|
||||||
let child_node = self.nodes.get(child_index)?;
|
let child_node = self.nodes.get(child_index)?;
|
||||||
if child_node.get_parent_payload_status() != node.payload_status {
|
// Skip parent_payload_status filter for V17 children (they don't have it)
|
||||||
|
if child_node.as_v17().is_err()
|
||||||
|
&& child_node.get_parent_payload_status() != node.payload_status
|
||||||
|
{
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
Some((
|
Some((
|
||||||
|
|||||||
@@ -997,7 +997,11 @@ impl ProtoArrayForkChoice {
|
|||||||
/// Returns the `block.execution_status` field, if the block is present.
|
/// Returns the `block.execution_status` field, if the block is present.
|
||||||
pub fn get_block_execution_status(&self, block_root: &Hash256) -> Option<ExecutionStatus> {
|
pub fn get_block_execution_status(&self, block_root: &Hash256) -> Option<ExecutionStatus> {
|
||||||
let block = self.get_proto_node(block_root)?;
|
let block = self.get_proto_node(block_root)?;
|
||||||
block.execution_status().ok()
|
Some(
|
||||||
|
block
|
||||||
|
.execution_status()
|
||||||
|
.unwrap_or_else(|_| ExecutionStatus::irrelevant()),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether the execution payload for a block has been received.
|
/// Returns whether the execution payload for a block has been received.
|
||||||
|
|||||||
Reference in New Issue
Block a user