validator: Activate RPC before halting on slot
This commit is contained in:
		
				
					committed by
					
						![mergify[bot]](/avatar/e3df20cd7a67969c41a65f03bea54961?size=40) mergify[bot]
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							c5e16383b0
						
					
				
				
					commit
					3b3f7341fa
				
			| @@ -368,19 +368,6 @@ impl Validator { | ||||
|             leader_schedule_cache.slot_leader_at(bank.slot(), Some(&bank)) | ||||
|         ); | ||||
|  | ||||
|         if config.dev_halt_at_slot.is_some() { | ||||
|             // Simulate a confirmed root to avoid RPC errors with CommitmentConfig::max() and | ||||
|             // to ensure RPC endpoints like getConfirmedBlock, which require a confirmed root, work | ||||
|             block_commitment_cache | ||||
|                 .write() | ||||
|                 .unwrap() | ||||
|                 .set_highest_confirmed_root(bank_forks.read().unwrap().root()); | ||||
|  | ||||
|             // Park with the RPC service running, ready for inspection! | ||||
|             warn!("Validator halted"); | ||||
|             std::thread::park(); | ||||
|         } | ||||
|  | ||||
|         let poh_config = Arc::new(genesis_config.poh_config.clone()); | ||||
|         let (mut poh_recorder, entry_receiver) = PohRecorder::new_with_clear_signal( | ||||
|             bank.tick_height(), | ||||
| @@ -464,6 +451,19 @@ impl Validator { | ||||
|                 (None, None) | ||||
|             }; | ||||
|  | ||||
|         if config.dev_halt_at_slot.is_some() { | ||||
|             // Simulate a confirmed root to avoid RPC errors with CommitmentConfig::max() and | ||||
|             // to ensure RPC endpoints like getConfirmedBlock, which require a confirmed root, work | ||||
|             block_commitment_cache | ||||
|                 .write() | ||||
|                 .unwrap() | ||||
|                 .set_highest_confirmed_root(bank_forks.read().unwrap().root()); | ||||
|  | ||||
|             // Park with the RPC service running, ready for inspection! | ||||
|             warn!("Validator halted"); | ||||
|             std::thread::park(); | ||||
|         } | ||||
|  | ||||
|         let ip_echo_server = solana_net_utils::ip_echo_server(node.sockets.ip_echo.unwrap()); | ||||
|  | ||||
|         let gossip_service = GossipService::new( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user