From 357a8ccbb9960fee499d1d57546ae764ffbc96ee Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 4 Jun 2025 10:31:27 +1000 Subject: [PATCH] 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. --- beacon_node/beacon_chain/src/builder.rs | 48 +++++++++++++++---------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index 812dcbeda7..2346aca00b 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -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()); + } } }