Add kzg crate functions

This commit is contained in:
Pawan Dhananjay
2022-11-22 01:21:10 +05:30
committed by realbigsean
parent 3288404ec1
commit e8b5f311aa
6 changed files with 82 additions and 17 deletions

View File

@@ -111,11 +111,11 @@ pub fn validate_blob_for_gossip<T: BeaconChainTypes>(
// Verify that blobs are properly formatted
//TODO: add the check while constructing a Blob type from bytes instead of after
for (i, blob) in blob_sidecar.blobs.iter().enumerate() {
if blob.iter().any(|b| *b >= *BLS_MODULUS) {
return Err(BlobError::BlobOutOfRange { blob_index: i });
}
}
// for (i, blob) in blob_sidecar.blobs.iter().enumerate() {
// if blob.iter().any(|b| *b >= *BLS_MODULUS) {
// return Err(BlobError::BlobOutOfRange { blob_index: i });
// }
// }
// Verify that the KZG proof is a valid G1 point
if PublicKey::deserialize(&blob_sidecar.kzg_aggregate_proof.0).is_err() {