activate data column verification before storing backfill block

This commit is contained in:
Agnish Ghosh 2024-08-18 23:07:33 +05:30
parent 7e7c14989e
commit 831089825c
1 changed files with 19 additions and 19 deletions

View File

@ -192,26 +192,26 @@ proc storeBackfillBlock(
# writing the block in case of blob error. # writing the block in case of blob error.
# var blobsOk = true # var blobsOk = true
var columnsOk = true var columnsOk = true
var blobsOk = true # var blobsOk = true
when typeof(signedBlock).kind >= ConsensusFork.Deneb: # when typeof(signedBlock).kind >= ConsensusFork.Deneb:
if blobsOpt.isSome: # if blobsOpt.isSome:
let blobs = blobsOpt.get() # let blobs = blobsOpt.get()
let kzgCommits = signedBlock.message.body.blob_kzg_commitments.asSeq # let kzgCommits = signedBlock.message.body.blob_kzg_commitments.asSeq
if blobs.len > 0 or kzgCommits.len > 0: # if blobs.len > 0 or kzgCommits.len > 0:
let r = validate_blobs(kzgCommits, blobs.mapIt(KzgBlob(bytes: it.blob)), # let r = validate_blobs(kzgCommits, blobs.mapIt(KzgBlob(bytes: it.blob)),
blobs.mapIt(it.kzg_proof)) # blobs.mapIt(it.kzg_proof))
if r.isErr(): # if r.isErr():
debug "backfill blob validation failed", # debug "backfill blob validation failed",
blockRoot = shortLog(signedBlock.root), # blockRoot = shortLog(signedBlock.root),
blobs = shortLog(blobs), # blobs = shortLog(blobs),
blck = shortLog(signedBlock.message), # blck = shortLog(signedBlock.message),
kzgCommits = mapIt(kzgCommits, shortLog(it)), # kzgCommits = mapIt(kzgCommits, shortLog(it)),
signature = shortLog(signedBlock.signature), # signature = shortLog(signedBlock.signature),
msg = r.error() # msg = r.error()
blobsOk = r.isOk() # blobsOk = r.isOk()
if not blobsOk: # if not blobsOk:
return err(VerifierError.Invalid) # return err(VerifierError.Invalid)
when typeof(signedBlock).kind >= ConsensusFork.Deneb: when typeof(signedBlock).kind >= ConsensusFork.Deneb:
if dataColumnsOpt.isSome: if dataColumnsOpt.isSome: