@@ -1044,7 +1044,7 @@ mod tests {
10441044 preseed_node_3_before_checkpoint_sync : bool ,
10451045 }
10461046
1047- const BEACON_E2E_VALIDATOR_COUNT : usize = 16 ;
1047+ const BEACON_E2E_VALIDATOR_COUNT : usize = 8 ;
10481048 const BEACON_E2E_VALIDATOR_NODE_COUNT : usize = 2 ;
10491049 const BEACON_E2E_SLOT_DURATION_MS : u64 = 3_000 ;
10501050 const BEACON_E2E_KEYSTORE_PASSWORD : & str = "password" ;
@@ -2387,43 +2387,25 @@ mod tests {
23872387
23882388 let node_1_db = create_beacon_test_node_db ( "beacon_node_produce_blocks" , 1 ) ;
23892389 let node_2_db = create_beacon_test_node_db ( "beacon_node_produce_blocks" , 2 ) ;
2390- let node_3_db = create_beacon_test_node_db ( "beacon_node_produce_blocks" , 3 ) ;
2391- let node_4_db = create_beacon_test_node_db ( "beacon_node_produce_blocks" , 4 ) ;
23922390 let genesis_execution_block_hash = genesis_state. latest_execution_payload_header . block_hash ;
23932391 let genesis_validators_root =
23942392 seed_beacon_test_db ( & node_1_db, genesis_state. clone ( ) , & genesis_block) ;
23952393 let node_2_genesis_validators_root =
2396- seed_beacon_test_db ( & node_2_db, genesis_state. clone ( ) , & genesis_block) ;
2397- let node_3_genesis_validators_root =
2398- seed_beacon_test_db ( & node_3_db, genesis_state. clone ( ) , & genesis_block) ;
2399- let node_4_genesis_validators_root =
2400- seed_beacon_test_db ( & node_4_db, genesis_state, & genesis_block) ;
2394+ seed_beacon_test_db ( & node_2_db, genesis_state, & genesis_block) ;
24012395 assert_eq ! (
24022396 genesis_validators_root, node_2_genesis_validators_root,
24032397 "beacon e2e node 2 must be seeded from the same genesis"
24042398 ) ;
2405- assert_eq ! (
2406- genesis_validators_root, node_3_genesis_validators_root,
2407- "beacon e2e node 3 must be seeded from the same genesis"
2408- ) ;
2409- assert_eq ! (
2410- genesis_validators_root, node_4_genesis_validators_root,
2411- "beacon e2e node 4 must be seeded from the same genesis"
2412- ) ;
24132399 initialize_beacon_e2e_genesis_root ( genesis_validators_root) ;
24142400
24152401 let control_executor = ReamExecutor :: new ( ) . unwrap ( ) ;
24162402 let node_1_executor = ReamExecutor :: new ( ) . unwrap ( ) ;
24172403 let node_2_executor = ReamExecutor :: new ( ) . unwrap ( ) ;
2418- let node_3_executor = ReamExecutor :: new ( ) . unwrap ( ) ;
2419- let node_4_executor = ReamExecutor :: new ( ) . unwrap ( ) ;
24202404 let validator_executors: Vec < _ > = ( 0 ..BEACON_E2E_VALIDATOR_NODE_COUNT )
24212405 . map ( |_| ReamExecutor :: new ( ) . unwrap ( ) )
24222406 . collect ( ) ;
24232407 let node_1_executor_handle = node_1_executor. clone ( ) ;
24242408 let node_2_executor_handle = node_2_executor. clone ( ) ;
2425- let node_3_executor_handle = node_3_executor. clone ( ) ;
2426- let node_4_executor_handle = node_4_executor. clone ( ) ;
24272409 let validator_executor_handles = validator_executors. to_vec ( ) ;
24282410 let node_1_http_port = node_1_config. http_port ;
24292411
@@ -2463,54 +2445,14 @@ mod tests {
24632445 let node_2_http_port = node_2_config. http_port ;
24642446 let node_2_handle =
24652447 spawn_beacon_test_node ( node_2_config, node_2_db, node_2_executor_handle. clone ( ) ) ;
2466- if let Err ( err) =
2467- wait_for_connected_beacon_peer ( & [ node_1_http_port, node_2_http_port] ) . await
2468- {
2469- shutdown_beacon_test_node ( & node_2_executor_handle, node_2_handle) . await ;
2470- shutdown_beacon_test_node ( & node_1_executor_handle, node_1_handle) . await ;
2471- mock_execution_server. stop ( ) . await ;
2472- panic ! ( "Timed out waiting for node 2 to connect: {err:?}" ) ;
2473- }
2474-
2475- let node_3_config =
2476- beacon_node_config_from_args ( port_offset + 2 , Some ( node_1_enr. clone ( ) ) ) ;
2477- let node_3_http_port = node_3_config. http_port ;
2478- let node_3_handle =
2479- spawn_beacon_test_node ( node_3_config, node_3_db, node_3_executor_handle. clone ( ) ) ;
2480- if let Err ( err) = wait_for_connected_beacon_peer ( & [
2481- node_1_http_port,
2482- node_2_http_port,
2483- node_3_http_port,
2484- ] )
2485- . await
2486- {
2487- shutdown_beacon_test_node ( & node_3_executor_handle, node_3_handle) . await ;
2488- shutdown_beacon_test_node ( & node_2_executor_handle, node_2_handle) . await ;
2489- shutdown_beacon_test_node ( & node_1_executor_handle, node_1_handle) . await ;
2490- mock_execution_server. stop ( ) . await ;
2491- panic ! ( "Timed out waiting for node 3 to connect: {err:?}" ) ;
2492- }
2493-
2494- let node_4_config = beacon_node_config_from_args ( port_offset + 3 , Some ( node_1_enr) ) ;
2495- let node_4_http_port = node_4_config. http_port ;
2496- let node_4_handle =
2497- spawn_beacon_test_node ( node_4_config, node_4_db, node_4_executor_handle. clone ( ) ) ;
2498- let peer_counts = match wait_for_connected_beacon_peer ( & [
2499- node_1_http_port,
2500- node_2_http_port,
2501- node_3_http_port,
2502- node_4_http_port,
2503- ] )
2504- . await
2505- {
2448+ let peer_counts =
2449+ match wait_for_connected_beacon_peer ( & [ node_1_http_port, node_2_http_port] ) . await {
25062450 Ok ( peer_counts) => peer_counts,
25072451 Err ( err) => {
2508- shutdown_beacon_test_node ( & node_4_executor_handle, node_4_handle) . await ;
2509- shutdown_beacon_test_node ( & node_3_executor_handle, node_3_handle) . await ;
25102452 shutdown_beacon_test_node ( & node_2_executor_handle, node_2_handle) . await ;
25112453 shutdown_beacon_test_node ( & node_1_executor_handle, node_1_handle) . await ;
25122454 mock_execution_server. stop ( ) . await ;
2513- panic ! ( "Timed out waiting for beacon nodes to connect: {err:?}" ) ;
2455+ panic ! ( "Timed out waiting for node 2 to connect: {err:?}" ) ;
25142456 }
25152457 } ;
25162458
@@ -2533,8 +2475,6 @@ mod tests {
25332475 let finality_statuses = wait_for_finality_checkpoints_advanced_all ( & [
25342476 node_1_http_port,
25352477 node_2_http_port,
2536- node_3_http_port,
2537- node_4_http_port,
25382478 ] )
25392479 . await ;
25402480 let node_1_finality = (
@@ -2545,48 +2485,29 @@ mod tests {
25452485 finality_statuses[ 1 ] . justified_epoch ,
25462486 finality_statuses[ 1 ] . finalized_epoch ,
25472487 ) ;
2548- let node_3_finality = (
2549- finality_statuses[ 2 ] . justified_epoch ,
2550- finality_statuses[ 2 ] . finalized_epoch ,
2551- ) ;
2552- let node_4_finality = (
2553- finality_statuses[ 3 ] . justified_epoch ,
2554- finality_statuses[ 3 ] . finalized_epoch ,
2555- ) ;
25562488
25572489 // Wait until all beacon nodes converge on the same non-genesis head.
2558- let matching_head = wait_for_matching_heads_all ( & [
2559- node_1_http_port,
2490+ let matching_head =
2491+ wait_for_matching_heads_all ( & [ node_1_http_port, node_2_http_port] ) . await ;
2492+ let block_on_peer = wait_for_beacon_json (
25602493 node_2_http_port,
2561- node_3_http_port,
2562- node_4_http_port,
2563- ] )
2494+ & format ! ( "/eth/v2/beacon/blocks/{}" , matching_head. 0 ) ,
2495+ )
25642496 . await ;
2565- for peer_http_port in [ node_2_http_port, node_3_http_port, node_4_http_port] {
2566- let block_on_peer = wait_for_beacon_json (
2567- peer_http_port,
2568- & format ! ( "/eth/v2/beacon/blocks/{}" , matching_head. 0 ) ,
2569- )
2570- . await ;
2571- assert ! (
2572- block_on_peer[ "data" ] [ "message" ] [ "slot" ] . is_string( )
2573- || block_on_peer[ "data" ] [ "message" ] [ "slot" ] . is_u64( ) ,
2574- "peer {peer_http_port} did not return imported block by root: {block_on_peer:?}"
2575- ) ;
2576- }
2497+ assert ! (
2498+ block_on_peer[ "data" ] [ "message" ] [ "slot" ] . is_string( )
2499+ || block_on_peer[ "data" ] [ "message" ] [ "slot" ] . is_u64( ) ,
2500+ "peer {node_2_http_port} did not return imported block by root: {block_on_peer:?}"
2501+ ) ;
25772502
25782503 let node_1_finished = node_1_handle. is_finished ( ) ;
25792504 let node_2_finished = node_2_handle. is_finished ( ) ;
2580- let node_3_finished = node_3_handle. is_finished ( ) ;
2581- let node_4_finished = node_4_handle. is_finished ( ) ;
25822505 let validator_finished = validator_handles
25832506 . iter ( )
25842507 . map ( tokio:: task:: JoinHandle :: is_finished)
25852508 . collect :: < Vec < _ > > ( ) ;
25862509
25872510 shutdown_validator_test_nodes ( & validator_executor_handles, validator_handles) . await ;
2588- shutdown_beacon_test_node ( & node_4_executor_handle, node_4_handle) . await ;
2589- shutdown_beacon_test_node ( & node_3_executor_handle, node_3_handle) . await ;
25902511 shutdown_beacon_test_node ( & node_2_executor_handle, node_2_handle) . await ;
25912512 shutdown_beacon_test_node ( & node_1_executor_handle, node_1_handle) . await ;
25922513 mock_execution_server. stop ( ) . await ;
@@ -2595,48 +2516,36 @@ mod tests {
25952516 peer_counts,
25962517 node_1_finished,
25972518 node_2_finished,
2598- node_3_finished,
2599- node_4_finished,
26002519 validator_finished,
26012520 first_head,
26022521 second_head,
26032522 head_at_finality_target,
26042523 matching_head,
26052524 node_1_finality,
26062525 node_2_finality,
2607- node_3_finality,
2608- node_4_finality,
26092526 )
26102527 } ) ;
26112528
26122529 for validator_executor in validator_executors {
26132530 validator_executor. shutdown_runtime ( ) ;
26142531 }
2615- node_4_executor. shutdown_runtime ( ) ;
2616- node_3_executor. shutdown_runtime ( ) ;
26172532 node_2_executor. shutdown_runtime ( ) ;
26182533 node_1_executor. shutdown_runtime ( ) ;
26192534
26202535 let (
26212536 peer_counts,
26222537 node_1_finished,
26232538 node_2_finished,
2624- node_3_finished,
2625- node_4_finished,
26262539 validators_finished,
26272540 first_head,
26282541 second_head,
26292542 head_at_finality_target,
26302543 matching_head,
26312544 node_1_finality,
26322545 node_2_finality,
2633- node_3_finality,
2634- node_4_finality,
26352546 ) = result;
26362547 assert ! ( !node_1_finished, "node 1 task exited early" ) ;
26372548 assert ! ( !node_2_finished, "node 2 task exited early" ) ;
2638- assert ! ( !node_3_finished, "node 3 task exited early" ) ;
2639- assert ! ( !node_4_finished, "node 4 task exited early" ) ;
26402549 assert ! (
26412550 validators_finished
26422551 . iter( )
@@ -2654,8 +2563,6 @@ mod tests {
26542563 ?matching_head,
26552564 ?node_1_finality,
26562565 ?node_2_finality,
2657- ?node_3_finality,
2658- ?node_4_finality,
26592566 ?validators_finished,
26602567 "Beacon block production e2e test completed"
26612568 ) ;
0 commit comments