verification before persistence
This commit is contained in:
parent
83dcd82ce1
commit
3a6593647c
|
@ -216,7 +216,8 @@ proc storeBackfillBlock(
|
||||||
when typeof(signedBlock).kind >= ConsensusFork.Deneb:
|
when typeof(signedBlock).kind >= ConsensusFork.Deneb:
|
||||||
if dataColumnsOpt.isSome:
|
if dataColumnsOpt.isSome:
|
||||||
let data_columns = dataColumnsOpt.get()
|
let data_columns = dataColumnsOpt.get()
|
||||||
if data_columns.len > 0:
|
let kzgCommits = signedBlock.message.body.blob_kzg_commitments.asSeq
|
||||||
|
if data_columns.len > 0 and kzgCommits.len > 0:
|
||||||
for i in 0..<data_columns.len:
|
for i in 0..<data_columns.len:
|
||||||
let r = verify_data_column_sidecar_kzg_proofs(data_columns[i][])
|
let r = verify_data_column_sidecar_kzg_proofs(data_columns[i][])
|
||||||
if r.isErr():
|
if r.isErr():
|
||||||
|
@ -638,23 +639,21 @@ proc storeBlock(
|
||||||
# TODO with v1.4.0, not sure this is still relevant
|
# TODO with v1.4.0, not sure this is still relevant
|
||||||
# Establish blob viability before calling addHeadBlock to avoid
|
# Establish blob viability before calling addHeadBlock to avoid
|
||||||
# writing the block in case of blob error.
|
# writing the block in case of blob error.
|
||||||
# when typeof(signedBlock).kind >= ConsensusFork.Deneb:
|
when typeof(signedBlock).kind >= ConsensusFork.Deneb:
|
||||||
# # if blobsOpt.isSome:
|
if dataColumnsOpt.isSome:
|
||||||
# # let blobs = blobsOpt.get()
|
let data_columns = dataColumnsOpt.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 data_columns.len > 0 and kzgCommits.len > 0:
|
||||||
# # let r = validate_blobs(kzgCommits, blobs.mapIt(KzgBlob(bytes: it.blob)),
|
for i in 0..<data_columns.len:
|
||||||
# # blobs.mapIt(it.kzg_proof))
|
let r = verify_data_column_sidecar_kzg_proofs(data_columns[i][])
|
||||||
# # if r.isErr():
|
if r.isErr():
|
||||||
# # debug "blob validation failed",
|
debug "backfill data column validation failed",
|
||||||
# # blockRoot = shortLog(signedBlock.root),
|
blockRoot = shortLog(signedBlock.root),
|
||||||
# # blobs = shortLog(blobs),
|
column_sidecar = shortLog(data_columns[i][]),
|
||||||
# # blck = shortLog(signedBlock.message),
|
blck = shortLog(signedBlock.message),
|
||||||
# # kzgCommits = mapIt(kzgCommits, shortLog(it)),
|
signature = shortLog(signedBlock.signature),
|
||||||
# # signature = shortLog(signedBlock.signature),
|
msg = r.error()
|
||||||
# # msg = r.error()
|
return err((VerifierError.Invalid, ProcessingStatus.completed))
|
||||||
# # return err((VerifierError.Invalid, ProcessingStatus.completed))
|
|
||||||
|
|
||||||
|
|
||||||
type Trusted = typeof signedBlock.asTrusted()
|
type Trusted = typeof signedBlock.asTrusted()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue