add more logging of KZG commitments, proofs, and blobs (#5735)

This commit is contained in:
tersec 2024-01-13 06:44:40 +00:00 committed by GitHub
parent 017f9f1103
commit 1559a09184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -192,11 +192,12 @@ proc storeBackfillBlock(
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),
signature = shortLog(signedBlock.signature), kzgCommits = mapIt(kzgCommits, shortLog(it)),
msg = r.error() signature = shortLog(signedBlock.signature),
msg = r.error()
blobsOk = r.isOk() blobsOk = r.isOk()
if not blobsOk: if not blobsOk:
@ -539,6 +540,7 @@ proc storeBlock(
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)),
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))

View File

@ -508,6 +508,12 @@ type
func initHashedBeaconState*(s: BeaconState): HashedBeaconState = func initHashedBeaconState*(s: BeaconState): HashedBeaconState =
HashedBeaconState(data: s) HashedBeaconState(data: s)
func shortLog*(v: KzgCommitment | KzgProof): auto =
to0xHex(v)
func shortLog*(v: Blob): auto =
to0xHex(v.toOpenArray(0, 31))
func shortLog*(v: SomeBeaconBlock): auto = func shortLog*(v: SomeBeaconBlock): auto =
( (
slot: shortLog(v.slot), slot: shortLog(v.slot),
@ -534,8 +540,11 @@ func shortLog*(v: SomeBeaconBlock): auto =
func shortLog*(v: BlobSidecar): auto = func shortLog*(v: BlobSidecar): auto =
( (
index: v.index, index: v.index,
blob: shortLog(v.blob),
bloblen: v.blob.len(), bloblen: v.blob.len(),
block_header: shortLog(v.signed_block_header.message), block_header: shortLog(v.signed_block_header.message),
kzg_commitment: shortLog(v.kzg_commitment),
kzg_proof: shortLog(v.kzg_proof),
) )
func shortLog*(v: seq[BlobSidecar]): auto = func shortLog*(v: seq[BlobSidecar]): auto =