Skip to content

Commit

Permalink
Merge pull request #18 from Layr-Labs/switch-srs-to-mainnet-srs
Browse files Browse the repository at this point in the history
Switch srs to mainnet srs
  • Loading branch information
epociask authored Jul 30, 2024
2 parents d1f136c + 7fb28cf commit d80e544
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 15 deletions.
16 changes: 8 additions & 8 deletions arbitrator/prover/src/kzgbn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ lazy_static::lazy_static! {
// note that we are loading 3000 for testing purposes atm, but for production use these values:
// g1 and g2 points from the operator setup guide
// srs_order = 268435456
// srs_points_to_load = 131072
// srs_points_to_load = 131072 (65536 is enough)

pub static ref KZG: Kzg = Kzg::setup(
"./arbitrator/prover/src/test-files/g1.point",
"./arbitrator/prover/src/test-files/g2.point",
"./arbitrator/prover/src/test-files/g2.point.powerOf2",
3000,
3000
"./arbitrator/prover/src/mainnet-files/g1.point.65536",
"./arbitrator/prover/src/mainnet-files/g2.point.65536",
"./arbitrator/prover/src/mainnet-files/g2.point.powerOf2",
268435456,
65536
).unwrap();

}

/// Creates a KZG preimage proof consumable by the point evaluation precompile.
Expand All @@ -37,7 +36,8 @@ pub fn prove_kzg_preimage_bn254(
) -> Result<()> {
let mut kzg = KZG.clone();

println!("preimage: {}", encode(&preimage));
println!("preimage: {} {}", preimage.len(), encode(&preimage));
println!("offset: {}", offset);

// expand roots of unity
kzg.calculate_roots_of_unity(preimage.len() as u64)?;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 5 additions & 5 deletions arbitrator/prover/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ pub fn hash_preimage(preimage: &[u8], ty: PreimageType) -> Result<[u8; 32]> {
}
PreimageType::EigenDAHash => {
let kzg_bn254: KzgBN254 = KzgBN254::setup(
"./arbitrator/prover/src/test-files/g1.point",
"./arbitrator/prover/src/test-files/g2.point",
"./arbitrator/prover/src/test-files/g2.point.powerOf2",
3000,
3000,
"./arbitrator/prover/src/mainnet-files/g1.point.65536",
"./arbitrator/prover/src/mainnet-files/g2.point.65536",
"./arbitrator/prover/src/mainnet-files/g2.point.powerOf2",
268435456,
65536,
)
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/test-cases/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func main() {
}
}
// EIGENDA COMMIT HASH
_, err = wavmio.ResolveTypedPreimage(arbutil.EigenDaPreimageType, common.HexToHash("011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1"))
_, err = wavmio.ResolveTypedPreimage(arbutil.EigenDaPreimageType, common.HexToHash("01605220b6928163676612ca50bbe5e0c595052876796dbedeae8ef597c9fdcf"))
if err != nil {
panic(fmt.Sprintf("failed to resolve eigenda preimage: %v", err))
}
Expand Down
4 changes: 3 additions & 1 deletion arbitrator/prover/test-cases/rust/src/bin/host-io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ fn main() {
let expected_len = 0;

for i in 0..5{
let eigen_hash = hex!("011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1");
// test-files srs 011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1
// mainnet srs 01605220b6928163676612ca50bbe5e0c595052876796dbedeae8ef597c9fdcf
let eigen_hash = hex!("01605220b6928163676612ca50bbe5e0c595052876796dbedeae8ef597c9fdcf");
bytebuffer = Bytes32(eigen_hash);

let actual_len = wavm_read_eigen_da_hash_preimage(bytebuffer.0.as_mut_ptr(), i * 32);
Expand Down

0 comments on commit d80e544

Please sign in to comment.