Skip to content

Commit cc87b22

Browse files
committed
Clean up and reduce max blobs per block for testing PeerDAS.
1 parent 31344ce commit cc87b22

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

consensus/types/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub struct ChainSpec {
243243
/*
244244
* Networking Fulu
245245
*/
246-
max_blobs_per_block_fulu: u64,
246+
pub max_blobs_per_block_fulu: u64,
247247

248248
/*
249249
* Networking Derived

testing/simulator/src/basic_sim.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> {
153153
spec.deneb_fork_epoch = Some(Epoch::new(DENEB_FORK_EPOCH));
154154
spec.electra_fork_epoch = Some(Epoch::new(ELECTRA_FORK_EPOCH));
155155
spec.fulu_fork_epoch = Some(Epoch::new(FULU_FORK_EPOCH));
156+
spec.max_blobs_per_block_fulu = 9;
156157
let spec = Arc::new(spec);
157158
env.eth2_config.spec = spec.clone();
158159

@@ -185,26 +186,22 @@ pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> {
185186

186187
// Add nodes to the network.
187188
for i in 0..node_count {
188-
let mut beacon_config = beacon_config.clone();
189-
// Run one PeerDAS supernode.
190-
if i == 0 {
191-
beacon_config.network.subscribe_all_data_column_subnets = true;
192-
}
189+
// Run two PeerDAS supernodes.
190+
let is_supernode = i < 2;
193191
network
194-
.add_beacon_node(beacon_config, mock_execution_config.clone(), false)
192+
.add_beacon_node(
193+
beacon_config.clone(),
194+
mock_execution_config.clone(),
195+
false,
196+
is_supernode,
197+
)
195198
.await?;
196199
}
197200

198201
/*
199202
* One by one, add proposer nodes to the network.
200203
*/
201-
for i in 0..proposer_nodes {
202-
let mut beacon_config = beacon_config.clone();
203-
// Run one PeerDAS proposer supernode.
204-
if i == 0 {
205-
beacon_config.network.subscribe_all_data_column_subnets = true;
206-
}
207-
204+
for _ in 0..proposer_nodes {
208205
println!("Adding a proposer node");
209206
network
210207
.add_beacon_node(beacon_config.clone(), mock_execution_config.clone(), true)

testing/simulator/src/local_network.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ impl<E: EthSpec> LocalNetwork<E> {
233233
mut beacon_config: ClientConfig,
234234
mut mock_execution_config: MockExecutionConfig,
235235
is_proposer: bool,
236+
is_supernode: bool,
236237
) -> Result<(LocalBeaconNode<E>, LocalExecutionNode<E>), String> {
237238
let count = (self.beacon_node_count() + self.proposer_node_count()) as u16;
238239

@@ -249,6 +250,7 @@ impl<E: EthSpec> LocalNetwork<E> {
249250
beacon_config.network.enr_tcp4_port = Some(libp2p_tcp_port.try_into().unwrap());
250251
beacon_config.network.discv5_config.table_filter = |_| true;
251252
beacon_config.network.proposer_only = is_proposer;
253+
beacon_config.network.subscribe_all_data_column_subnets = is_supernode;
252254

253255
mock_execution_config.server_config.listen_port = EXECUTION_PORT + count;
254256

@@ -282,6 +284,7 @@ impl<E: EthSpec> LocalNetwork<E> {
282284
mut beacon_config: ClientConfig,
283285
mock_execution_config: MockExecutionConfig,
284286
is_proposer: bool,
287+
is_supernode: bool,
285288
) -> Result<(), String> {
286289
let first_bn_exists: bool;
287290
{
@@ -301,8 +304,13 @@ impl<E: EthSpec> LocalNetwork<E> {
301304
}
302305
let (beacon_node, execution_node) = if first_bn_exists {
303306
// Network already exists. We construct a new node.
304-
self.construct_beacon_node(beacon_config, mock_execution_config, is_proposer)
305-
.await?
307+
self.construct_beacon_node(
308+
beacon_config,
309+
mock_execution_config,
310+
is_proposer,
311+
is_supernode,
312+
)
313+
.await?
306314
} else {
307315
// Network does not exist. We construct a boot node.
308316
self.construct_boot_node(beacon_config, mock_execution_config)

0 commit comments

Comments
 (0)