-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update peerdas-kzg library (#6118)
* chore: update peerDAS lib * chore: update library * chore: update library to version that include "init context" benchmarks and optional validation checks * chore: (can remove) -- Add benchmarks for init context
- Loading branch information
1 parent
55a3be7
commit 04d9eef
Showing
5 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use c_kzg::KzgSettings; | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use eth2_network_config::TRUSTED_SETUP_BYTES; | ||
use kzg::TrustedSetup; | ||
use peerdas_kzg::{PeerDASContext, TrustedSetup as PeerDASTrustedSetup}; | ||
|
||
pub fn bench_init_context(c: &mut Criterion) { | ||
c.bench_function(&format!("Initialize context peerdas-kzg"), |b| { | ||
b.iter(|| { | ||
const NUM_THREADS: usize = 1; | ||
let trusted_setup = PeerDASTrustedSetup::default(); | ||
PeerDASContext::with_threads(&trusted_setup, NUM_THREADS) | ||
}) | ||
}); | ||
c.bench_function(&format!("Initialize context c-kzg (4844)"), |b| { | ||
b.iter(|| { | ||
let trusted_setup: TrustedSetup = serde_json::from_reader(TRUSTED_SETUP_BYTES) | ||
.map_err(|e| format!("Unable to read trusted setup file: {}", e)) | ||
.expect("should have trusted setup"); | ||
KzgSettings::load_trusted_setup(&trusted_setup.g1_points(), &trusted_setup.g2_points()) | ||
.unwrap() | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, bench_init_context); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters