Checkpoint sync without the blobs from Fulu (#7549)

Lighthouse currently requires checkpoint sync to be performed against a supernode in a PeerDAS network, as only supernodes can serve blobs.

This PR lifts that requirement, enabling Lighthouse to checkpoint sync from either a fullnode or a supernode (See https://github.com/sigp/lighthouse/issues/6837#issuecomment-2933094923)

Missing data columns for the checkpoint block isn't a big issue, but we should be able to easily implement backfill once we have the logic to backfill data columns.
This commit is contained in:
Jimmy Chen
2025-06-04 10:31:27 +10:00
committed by GitHub
parent cd83d8d95d
commit 357a8ccbb9

View File

@@ -486,24 +486,36 @@ where
// Verify that blobs (if provided) match the block.
if let Some(blobs) = &weak_subj_blobs {
let commitments = weak_subj_block
.message()
.body()
.blob_kzg_commitments()
.map_err(|e| format!("Blobs provided but block does not reference them: {e:?}"))?;
if blobs.len() != commitments.len() {
return Err(format!(
"Wrong number of blobs, expected: {}, got: {}",
commitments.len(),
blobs.len()
));
}
if commitments
.iter()
.zip(blobs.iter())
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
{
return Err("Checkpoint blob does not match block commitment".into());
let fulu_enabled = weak_subj_block.fork_name_unchecked().fulu_enabled();
if fulu_enabled && blobs.is_empty() {
// Blobs expected for this block, but the checkpoint server is not able to serve them.
// This is expected from Fulu, as only supernodes are able to serve blobs.
// We can consider using backfill to retrieve the data columns from the p2p network,
// but we can ignore this fow now until we have validator custody backfill
// implemented as we'll likely be able to reuse the logic.
// https://github.com/sigp/lighthouse/issues/6837
} else {
let commitments = weak_subj_block
.message()
.body()
.blob_kzg_commitments()
.map_err(|e| {
format!("Blobs provided but block does not reference them: {e:?}")
})?;
if blobs.len() != commitments.len() {
return Err(format!(
"Wrong number of blobs, expected: {}, got: {}",
commitments.len(),
blobs.len()
));
}
if commitments
.iter()
.zip(blobs.iter())
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
{
return Err("Checkpoint blob does not match block commitment".into());
}
}
}