reject invalid proofs when validating blobs (#5445)

Currently, passing `0xc00000...` proof seems to pass `verifyProofs`.
Unsure why such a check is not necessary in spec, and also unsure
whether it is correct to reject proof at infinity, or if it could
occur, e.g., for a blob containing all 0 bytes. Weird overall...

* proper fix
This commit is contained in:
Etan Kissling 2023-09-20 00:13:58 +02:00 committed by GitHub
parent c1b43d166b
commit 1640c45a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -791,7 +791,10 @@ proc validate_blobs*(expected_kzg_commitments: seq[KzgCommitment],
if proofs.len != blobs.len:
return err("validate_blobs: different proof and blob lengths")
if verifyProofs(blobs, expected_kzg_commitments, proofs).isErr():
let res = verifyProofs(blobs, expected_kzg_commitments, proofs).valueOr:
return err("validate_blobs: proof verification error")
if not res:
return err("validate_blobs: proof verification failed")
ok()