mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(bench): more determinism (#13603)
This commit is contained in:
@ -4,20 +4,12 @@ use alloy_consensus::TxEip4844;
|
||||
use alloy_eips::eip4844::{
|
||||
env_settings::EnvKzgSettings, BlobTransactionSidecar, MAX_BLOBS_PER_BLOCK,
|
||||
};
|
||||
use alloy_primitives::hex;
|
||||
use criterion::{
|
||||
criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion,
|
||||
};
|
||||
use proptest::{
|
||||
prelude::*,
|
||||
strategy::ValueTree,
|
||||
test_runner::{RngAlgorithm, TestRng, TestRunner},
|
||||
};
|
||||
use proptest::{prelude::*, strategy::ValueTree, test_runner::TestRunner};
|
||||
use proptest_arbitrary_interop::arb;
|
||||
|
||||
// constant seed to use for the rng
|
||||
const SEED: [u8; 32] = hex!("1337133713371337133713371337133713371337133713371337133713371337");
|
||||
|
||||
/// Benchmarks EIP-48444 blob validation.
|
||||
fn blob_validation(c: &mut Criterion) {
|
||||
let mut group = c.benchmark_group("Blob Transaction KZG validation");
|
||||
@ -35,9 +27,7 @@ fn validate_blob_tx(
|
||||
kzg_settings: EnvKzgSettings,
|
||||
) {
|
||||
let setup = || {
|
||||
let config = ProptestConfig::default();
|
||||
let rng = TestRng::from_seed(RngAlgorithm::ChaCha, &SEED);
|
||||
let mut runner = TestRunner::new_with_rng(config, rng);
|
||||
let mut runner = TestRunner::deterministic();
|
||||
|
||||
// generate tx and sidecar
|
||||
let mut tx = arb::<TxEip4844>().new_tree(&mut runner).unwrap().current();
|
||||
|
||||
Reference in New Issue
Block a user