From 95a58393c652e28ed8d848db0a790892ddb47738 Mon Sep 17 00:00:00 2001 From: Eitan Seri- Levi Date: Tue, 31 Mar 2026 09:59:42 -0700 Subject: [PATCH] Smol fix --- consensus/proto_array/src/proto_array.rs | 32 +++++++++++++++++-- .../src/proto_array_fork_choice.rs | 6 +++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/consensus/proto_array/src/proto_array.rs b/consensus/proto_array/src/proto_array.rs index 6bca814cb4..96492e695d 100644 --- a/consensus/proto_array/src/proto_array.rs +++ b/consensus/proto_array/src/proto_array.rs @@ -1431,7 +1431,30 @@ impl ProtoArray { .nodes .get(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 // let mut children = vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())]; // // The FULL virtual child only exists if the payload has been received. @@ -1448,7 +1471,7 @@ impl ProtoArray { vec![(node.with_status(PayloadStatus::Empty), proto_node.clone())] }; // TODO(gloas) delete up to here - + Ok(children) } else { let child_indices = children_index @@ -1459,7 +1482,10 @@ impl ProtoArray { .iter() .filter_map(|&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; } Some(( diff --git a/consensus/proto_array/src/proto_array_fork_choice.rs b/consensus/proto_array/src/proto_array_fork_choice.rs index 6c90af1302..cb467f2531 100644 --- a/consensus/proto_array/src/proto_array_fork_choice.rs +++ b/consensus/proto_array/src/proto_array_fork_choice.rs @@ -997,7 +997,11 @@ impl ProtoArrayForkChoice { /// Returns the `block.execution_status` field, if the block is present. pub fn get_block_execution_status(&self, block_root: &Hash256) -> Option { 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.