Skip to content

Commit

Permalink
Merge of #5946
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 19, 2024
2 parents 265d414 + 7a4d83f commit cff5784
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions consensus/types/src/blob_sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use crate::{
use crate::{KzgProofs, SignedBeaconBlock};
use bls::Signature;
use derivative::Derivative;
use kzg::{
Blob as KzgBlob, Kzg, KzgCommitment, KzgProof, BYTES_PER_BLOB, BYTES_PER_FIELD_ELEMENT,
FIELD_ELEMENTS_PER_BLOB,
};
use kzg::{Blob as KzgBlob, Kzg, KzgCommitment, KzgProof, BYTES_PER_BLOB, BYTES_PER_FIELD_ELEMENT};
use merkle_proof::{merkle_root_from_branch, verify_merkle_proof, MerkleTreeError};
use rand::Rng;
use safe_arith::ArithError;
Expand Down Expand Up @@ -221,13 +218,7 @@ impl<E: EthSpec> BlobSidecar<E> {
rng.fill_bytes(&mut blob_bytes);
// Ensure that the blob is canonical by ensuring that
// each field element contained in the blob is < BLS_MODULUS
for i in 0..FIELD_ELEMENTS_PER_BLOB {
let Some(byte) = blob_bytes.get_mut(
i.checked_mul(BYTES_PER_FIELD_ELEMENT)
.ok_or("overflow".to_string())?,
) else {
return Err(format!("blob byte index out of bounds: {:?}", i));
};
for byte in blob_bytes.iter_mut().step_by(BYTES_PER_FIELD_ELEMENT) {
*byte = 0;
}

Expand Down

0 comments on commit cff5784

Please sign in to comment.