mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 02:12:33 +00:00
#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:
@@ -31,6 +31,7 @@ logging = { workspace = true }
|
||||
metrics = { workspace = true }
|
||||
monitoring_api = { workspace = true }
|
||||
network = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
sensitive_url = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -33,6 +33,8 @@ use genesis::{interop_genesis_state, Eth1GenesisService, DEFAULT_ETH1_BLOCK_HASH
|
||||
use lighthouse_network::{prometheus_client::registry::Registry, NetworkGlobals};
|
||||
use monitoring_api::{MonitoringHttpClient, ProcessType};
|
||||
use network::{NetworkConfig, NetworkSenders, NetworkService};
|
||||
use rand::rngs::{OsRng, StdRng};
|
||||
use rand::SeedableRng;
|
||||
use slasher::Slasher;
|
||||
use slasher_service::SlasherService;
|
||||
use std::net::TcpListener;
|
||||
@@ -210,7 +212,10 @@ where
|
||||
.event_handler(event_handler)
|
||||
.execution_layer(execution_layer)
|
||||
.import_all_data_columns(config.network.subscribe_all_data_column_subnets)
|
||||
.validator_monitor_config(config.validator_monitor.clone());
|
||||
.validator_monitor_config(config.validator_monitor.clone())
|
||||
.rng(Box::new(
|
||||
StdRng::from_rng(OsRng).map_err(|e| format!("Failed to create RNG: {:?}", e))?,
|
||||
));
|
||||
|
||||
let builder = if let Some(slasher) = self.slasher.clone() {
|
||||
builder.slasher(slasher)
|
||||
|
||||
Reference in New Issue
Block a user