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

@@ -560,9 +560,22 @@ where
)?;
// Cache some values for the next forkchoiceUpdate call to the execution layer.
let head_hash = self
.get_block(&head_root)
.and_then(|b| b.execution_status.block_hash());
// For Gloas blocks, `execution_status` is Irrelevant (no embedded payload).
// If the payload envelope was received (Full), use the bid's block_hash as the
// execution chain head. Otherwise fall back to the parent hash (Pending) or None.
// TODO(gloas): this is a bit messy, and we probably need a similar treatment for
// justified/finalized
// Can fix as part of: https://github.com/sigp/lighthouse/issues/8957
let head_hash = self.get_block(&head_root).and_then(|b| {
b.execution_status
.block_hash()
.or(match head_payload_status {
PayloadStatus::Full => b.execution_payload_block_hash,
PayloadStatus::Pending | PayloadStatus::Empty => {
b.execution_payload_parent_hash
}
})
});
let justified_root = self.justified_checkpoint().root;
let finalized_root = self.finalized_checkpoint().root;
let justified_hash = self
@@ -804,7 +817,7 @@ where
}));
}
let attestation_threshold = spec.get_unaggregated_attestation_due();
let attestation_threshold = spec.get_attestation_due::<E>(block.slot());
// Add proposer score boost if the block is timely.
// TODO(gloas): the spec's `update_proposer_boost_root` additionally checks that
@@ -1493,6 +1506,14 @@ where
}
}
/// Returns whether the proposer should extend the execution payload chain of the given block.
pub fn should_extend_payload(&self, block_root: &Hash256) -> Result<bool, Error<T::Error>> {
let proposer_boost_root = self.fc_store.proposer_boost_root();
self.proto_array
.should_extend_payload::<E>(block_root, proposer_boost_root)
.map_err(Error::ProtoArrayStringError)
}
/// Returns an `ExecutionStatus` if the block is known **and** a descendant of the finalized root.
pub fn get_block_execution_status(&self, block_root: &Hash256) -> Option<ExecutionStatus> {
if self.is_finalized_checkpoint_or_descendant(*block_root) {