Skip to content

Commit

Permalink
feat: Arbitrator 2mb blob test - cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Aug 9, 2024
1 parent 73ccbfa commit d681b91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 4 additions & 7 deletions arbitrator/prover/src/kzgbn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ pub fn prove_kzg_preimage_bn254(
kzg.calculate_roots_of_unity(preimage.len() as u64)?;

// preimage is already padded and is the actual blob data, NOT the IFFT'd form.
let blob_polynomial =
Blob::from_padded_bytes_unchecked(&preimage).
to_polynomial(PolynomialFormat::InCoefficientForm)?;
let blob_polynomial = Blob::from_padded_bytes_unchecked(&preimage)
.to_polynomial(PolynomialFormat::InCoefficientForm)?;
let blob_commitment = kzg.commit(&blob_polynomial)?;

let mut commitment_bytes = Vec::new();
Expand Down Expand Up @@ -113,10 +112,8 @@ pub fn prove_kzg_preimage_bn254(
.clone();
let g2_tau_minus_g2_z = (g2_tau - z_g2).into_affine();

let kzg_proof = kzg.compute_kzg_proof_with_roots_of_unity(
&blob_polynomial,
proving_offset as u64 / 32,
)?;
let kzg_proof =
kzg.compute_kzg_proof_with_roots_of_unity(&blob_polynomial, proving_offset as u64 / 32)?;

let offset_usize = proving_offset as usize;
// This should cause failure when proving past offset.
Expand Down
4 changes: 3 additions & 1 deletion arbitrator/prover/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ fn main() -> Result<()> {

println!(
"read preimage of type {:?} with hash 0x{} and size {}",
preimage_ty, hex::encode(hash), size
preimage_ty,
hex::encode(hash),
size
);
preimages
.entry(preimage_ty)
Expand Down

0 comments on commit d681b91

Please sign in to comment.