Skip to content

Commit 357a8cc

Browse files
authored
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 #6837 (comment)) 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.
1 parent cd83d8d commit 357a8cc

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

beacon_node/beacon_chain/src/builder.rs

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -486,24 +486,36 @@ where
486486

487487
// Verify that blobs (if provided) match the block.
488488
if let Some(blobs) = &weak_subj_blobs {
489-
let commitments = weak_subj_block
490-
.message()
491-
.body()
492-
.blob_kzg_commitments()
493-
.map_err(|e| format!("Blobs provided but block does not reference them: {e:?}"))?;
494-
if blobs.len() != commitments.len() {
495-
return Err(format!(
496-
"Wrong number of blobs, expected: {}, got: {}",
497-
commitments.len(),
498-
blobs.len()
499-
));
500-
}
501-
if commitments
502-
.iter()
503-
.zip(blobs.iter())
504-
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
505-
{
506-
return Err("Checkpoint blob does not match block commitment".into());
489+
let fulu_enabled = weak_subj_block.fork_name_unchecked().fulu_enabled();
490+
if fulu_enabled && blobs.is_empty() {
491+
// Blobs expected for this block, but the checkpoint server is not able to serve them.
492+
// This is expected from Fulu, as only supernodes are able to serve blobs.
493+
// We can consider using backfill to retrieve the data columns from the p2p network,
494+
// but we can ignore this fow now until we have validator custody backfill
495+
// implemented as we'll likely be able to reuse the logic.
496+
// https://github.com/sigp/lighthouse/issues/6837
497+
} else {
498+
let commitments = weak_subj_block
499+
.message()
500+
.body()
501+
.blob_kzg_commitments()
502+
.map_err(|e| {
503+
format!("Blobs provided but block does not reference them: {e:?}")
504+
})?;
505+
if blobs.len() != commitments.len() {
506+
return Err(format!(
507+
"Wrong number of blobs, expected: {}, got: {}",
508+
commitments.len(),
509+
blobs.len()
510+
));
511+
}
512+
if commitments
513+
.iter()
514+
.zip(blobs.iter())
515+
.any(|(commitment, blob)| *commitment != blob.kzg_commitment)
516+
{
517+
return Err("Checkpoint blob does not match block commitment".into());
518+
}
507519
}
508520
}
509521

0 commit comments

Comments
 (0)