@@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
2020use solana_keypair:: Keypair ;
2121use solana_signer:: Signer ;
2222use surfpool_core:: { start_local_surfnet, surfnet:: svm:: SurfnetSvm } ;
23- use surfpool_types:: { SanitizedConfig , SimnetEvent , SubgraphEvent } ;
23+ use surfpool_types:: { SanitizedConfig , SimnetCommand , SimnetEvent , SubgraphEvent } ;
2424use txtx_core:: kit:: {
2525 channel:: Receiver , futures:: future:: join_all, helpers:: fs:: FileLocation ,
2626 types:: frontend:: BlockEvent ,
@@ -199,6 +199,7 @@ pub async fn handle_start_local_surfnet_command(
199199 subgraph_events_rx,
200200 cmd. debug ,
201201 deploy_progress_rx,
202+ simnet_commands_tx,
202203 ) ?;
203204 } else {
204205 tui:: simnet:: start_app (
@@ -222,6 +223,7 @@ fn log_events(
222223 subgraph_events_rx : Receiver < SubgraphEvent > ,
223224 include_debug_logs : bool ,
224225 deploy_progress_rx : Vec < Receiver < BlockEvent > > ,
226+ simnet_commands_tx : Sender < SimnetCommand > ,
225227) -> Result < ( ) , String > {
226228 let mut deployment_completed = false ;
227229 let stop_loop = Arc :: new ( AtomicBool :: new ( false ) ) ;
@@ -324,10 +326,14 @@ fn log_events(
324326 SimnetEvent :: RunbookStarted ( runbook_id) => {
325327 deployment_completed = false ;
326328 info ! ( "Runbook '{}' execution started" , runbook_id) ;
329+ let _ =
330+ simnet_commands_tx. send ( SimnetCommand :: SetInstructionProfiling ( false ) ) ;
327331 }
328332 SimnetEvent :: RunbookCompleted ( runbook_id) => {
329333 deployment_completed = true ;
330334 info ! ( "Runbook '{}' execution completed" , runbook_id) ;
335+ let _ =
336+ simnet_commands_tx. send ( SimnetCommand :: SetInstructionProfiling ( true ) ) ;
331337 }
332338 } ,
333339 Err ( _e) => {
@@ -372,6 +378,7 @@ fn log_events(
372378 } ,
373379 Err ( _e) => {
374380 deployment_completed = true ;
381+ let _ = simnet_commands_tx. send ( SimnetCommand :: SetInstructionProfiling ( true ) ) ;
375382 }
376383 } ,
377384 }
@@ -389,7 +396,6 @@ async fn write_and_execute_iac(
389396 . map_err ( |e| format ! ( "Failed to detect project framework: {}" , e) ) ?;
390397
391398 let ( progress_tx, progress_rx) = crossbeam:: channel:: unbounded ( ) ;
392-
393399 if let Some ( ( framework, programs) ) = deployment {
394400 // Is infrastructure-as-code (IaC) already setup?
395401 let base_location =
0 commit comments