Gloas spec v1.7.0-alpha.5 and beacon_chain tests (#8998)

Fix database pruning post-Gloas


  - Fix DB pruning logic (and state summaries DAG)
- Get the `beacon_chain` tests running with `FORK_NAME=gloas` 🎉


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

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

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Michael Sproul
2026-04-21 16:29:15 +10:00
committed by GitHub
parent c028bac28d
commit cf3d5e285e
82 changed files with 1513 additions and 1391 deletions

View File

@@ -568,8 +568,10 @@ impl ProtoArray {
ProtoNode::V29(v29) => {
// Both parent and child are Gloas blocks. The parent is full if the
// block hash in the parent node matches the parent block hash in the
// child bid.
if execution_payload_parent_hash == v29.execution_payload_block_hash {
// child bid and the parent block isn't the genesis block.
if v29.execution_payload_block_hash != ExecutionBlockHash::zero()
&& execution_payload_parent_hash == v29.execution_payload_block_hash
{
PayloadStatus::Full
} else {
PayloadStatus::Empty
@@ -582,18 +584,16 @@ impl ProtoArray {
}
}
} else {
// TODO(gloas): re-assess this assumption
// Parent is missing (genesis or pruned due to finalization). Default to Full
// since this path should only be hit at Gloas genesis.
PayloadStatus::Full
// Parent is missing (genesis or pruned due to finalization). This code path
// should only be hit at Gloas genesis. Default to empty, the genesis block
// has no payload enevelope.
PayloadStatus::Empty
};
// Per spec `get_forkchoice_store`: the anchor (genesis) block has
// its payload state initialized (`payload_states = {anchor_root: ...}`).
// Without `payload_received = true` on genesis, the FULL virtual
// child doesn't exist in the spec's `get_node_children`, making all
// Full concrete children of genesis unreachable in `get_head`.
let is_genesis = parent_index.is_none();
// The spec does something slightly strange where it initialises the payload timeliness
// votes and payload data availability votes for the anchor block to all true, but never
// adds the anchor to `store.payloads`, so it is never considered full.
let is_anchor = parent_index.is_none();
ProtoNode::V29(ProtoNodeV29 {
slot: block.slot,
@@ -614,26 +614,25 @@ impl ProtoArray {
execution_payload_block_hash,
execution_payload_parent_hash,
// Per spec `get_forkchoice_store`: the anchor block's PTC votes are
// initialized to all-True, ensuring `is_payload_timely` and
// `is_payload_data_available` return true for the anchor.
payload_timeliness_votes: if is_genesis {
// initialized to all-True.
payload_timeliness_votes: if is_anchor {
all_true_bitvector()
} else {
BitVector::default()
},
payload_data_availability_votes: if is_genesis {
payload_data_availability_votes: if is_anchor {
all_true_bitvector()
} else {
BitVector::default()
},
payload_received: is_genesis,
payload_received: false,
proposer_index,
// Spec: `record_block_timeliness` + `get_forkchoice_store`.
// Anchor gets [True, True]. Others computed from time_into_slot.
block_timeliness_attestation_threshold: is_genesis
block_timeliness_attestation_threshold: is_anchor
|| (is_current_slot
&& time_into_slot < spec.get_attestation_due::<E>(current_slot)),
block_timeliness_ptc_threshold: is_genesis
block_timeliness_ptc_threshold: is_anchor
|| (is_current_slot && time_into_slot < spec.get_payload_attestation_due()),
equivocating_attestation_score: 0,
})
@@ -1438,7 +1437,7 @@ impl ProtoArray {
}
}
fn should_extend_payload<E: EthSpec>(
pub fn should_extend_payload<E: EthSpec>(
&self,
fc_node: &IndexedForkChoiceNode,
proto_node: &ProtoNode,