Fix for #6296: Deterministic RNG in peer DAS publish block tests (#7192)

#6296: Deterministic RNG in peer DAS publish block tests


  Made test functions to call publish-block APIs with true for the deterministic RNG boolean parameter while production code with false. This will deterministically shuffle columns for unit tests under broadcast_validation_tests.rs.
This commit is contained in:
SunnysidedJ
2025-04-09 16:35:15 +01:00
committed by GitHub
parent 759b0612b3
commit d96b73152e
9 changed files with 36 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ use beacon_chain::{
};
use genesis::{generate_deterministic_keypairs, interop_genesis_state, DEFAULT_ETH1_BLOCK_HASH};
use lighthouse_network::NetworkConfig;
use rand::rngs::StdRng;
use rand::SeedableRng;
use slot_clock::{SlotClock, SystemTimeSlotClock};
use std::sync::{Arc, LazyLock};
use std::time::{Duration, SystemTime};
@@ -76,6 +78,7 @@ impl TestBeaconChain {
Duration::from_millis(SLOT_DURATION_MILLIS),
))
.shutdown_sender(shutdown_tx)
.rng(Box::new(StdRng::seed_from_u64(42)))
.build()
.expect("should build"),
);