Merge branch 'peerdas-devnet-7' into peerdas-rangesync

This commit is contained in:
Jimmy Chen
2025-06-04 16:06:23 +10:00
committed by GitHub

View File

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