Skip to content

Commit 352221f

Browse files
committed
fix build error
1 parent 6a2f79b commit 352221f

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

aggregator/src/aggregation/barycentric.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ pub fn interpolate(z: Scalar, coefficients: &[Scalar; BLOB_WIDTH]) -> Scalar {
354354
mod tests {
355355
use super::*;
356356
use crate::{
357-
blob::{BatchData, KZG_TRUSTED_SETUP},
357+
blob::BatchData,
358358
eip4844::{get_blob_bytes, get_coefficients},
359359
MAX_AGG_SNARKS,
360360
};
@@ -423,8 +423,12 @@ mod tests {
423423
.collect::<Vec<_>>(),
424424
)
425425
.unwrap();
426-
let (_proof, y) =
427-
KzgProof::compute_kzg_proof(&blob, &to_be_bytes(z).into(), &KZG_TRUSTED_SETUP).unwrap();
426+
let (_proof, y) = KzgProof::compute_kzg_proof(
427+
&blob,
428+
&to_be_bytes(z).into(),
429+
c_kzg::ethereum_kzg_settings(),
430+
)
431+
.unwrap();
428432
from_canonical_be_bytes(*y)
429433
}
430434

aggregator/src/blob.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ pub const N_BLOB_BYTES: usize = BLOB_WIDTH * N_DATA_BYTES_PER_COEFFICIENT;
4343
/// Allow up to 5x compression via zstd encoding of the batch data.
4444
pub const N_BATCH_BYTES: usize = N_BLOB_BYTES * 5;
4545

46-
/// KZG trusted setup
47-
pub static KZG_TRUSTED_SETUP: Lazy<Arc<c_kzg::KzgSettings>> = Lazy::new(|| {
48-
Arc::new(
49-
c_kzg::KzgSettings::load_trusted_setup(
50-
&revm_primitives::kzg::G1_POINTS.0,
51-
&revm_primitives::kzg::G2_POINTS.0,
52-
)
53-
.expect("failed to load trusted setup"),
54-
)
55-
});
46+
// /// KZG trusted setup
47+
// pub static KZG_TRUSTED_SETUP: Lazy<Arc<c_kzg::KzgSettings>> = Lazy::new(|| {
48+
// Arc::new(
49+
// c_kzg::ethereum_kzg_settings()
50+
// )
51+
// });
5652

5753
/// Helper struct to generate witness for the Batch Data Config.
5854
#[derive(Clone, Debug)]

aggregator/src/eip4844.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use eth_types::{ToBigEndian, H256, U256};
22
use ethers_core::k256::sha2::{Digest, Sha256};
33
use revm_primitives::VERSIONED_HASH_VERSION_KZG;
44

5-
use crate::blob::{BLOB_WIDTH, KZG_TRUSTED_SETUP, N_BLOB_BYTES, N_BYTES_U256};
5+
use crate::blob::{BLOB_WIDTH, N_BLOB_BYTES, N_BYTES_U256};
66

77
/// Get the BLOB_WIDTH number of scalar field elements, as 32-bytes unsigned integers.
88
pub(crate) fn get_coefficients(blob_bytes: &[u8]) -> [U256; BLOB_WIDTH] {
@@ -30,7 +30,7 @@ pub(crate) fn get_versioned_hash(coefficients: &[U256; BLOB_WIDTH]) -> H256 {
3030
.collect::<Vec<_>>(),
3131
)
3232
.expect("blob-coefficients to 4844 blob should succeed");
33-
let c = c_kzg::KzgCommitment::blob_to_kzg_commitment(&blob, &KZG_TRUSTED_SETUP)
33+
let c = c_kzg::KzgCommitment::blob_to_kzg_commitment(&blob, c_kzg::ethereum_kzg_settings())
3434
.expect("blob to kzg commitment should succeed");
3535
kzg_to_versioned_hash(&c)
3636
}

0 commit comments

Comments
 (0)