File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
networks/movement/movement-full-node/src/node Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,16 @@ impl Manager {
52
52
. await
53
53
. context ( "Failed to create the executor" ) ?;
54
54
55
- let join_handle = tokio:: spawn ( node. run ( mempool_commit_tx_receiver) ) ;
56
-
57
- // Use tokio::select! to wait for either the handle or a cancellation signal
58
- tokio:: select! {
59
- _ = stop_rx. changed( ) =>( ) ,
60
- // manage Movement node execution return.
61
- res = join_handle => {
62
- res??;
63
- } ,
64
- } ;
55
+ let join_handle = tokio:: spawn ( node. run ( mempool_commit_tx_receiver, stop_rx ) ) ;
56
+ join_handle . await ?? ;
57
+ // // Use tokio::select! to wait for either the handle or a cancellation signal
58
+ // tokio::select! {
59
+ // _ = stop_rx.changed() =>(),
60
+ // // manage Movement node execution return.
61
+ // res = join_handle => {
62
+ // res??;
63
+ // },
64
+ // };
65
65
66
66
Ok ( ( ) )
67
67
}
Original file line number Diff line number Diff line change 39
39
pub async fn run (
40
40
self ,
41
41
mempool_commit_tx_receiver : UnboundedReceiver < Vec < TxExecutionResult > > ,
42
+ stop_rx : tokio:: sync:: watch:: Receiver < ( ) > ,
42
43
) -> Result < ( ) , anyhow:: Error > {
43
44
let ( context, exec_background) = self
44
45
. executor
89
90
self . config. da_db. allow_sync_from_zero,
90
91
propagate_execution_state,
91
92
& da_signer,
93
+ stop_rx,
92
94
)
93
95
. await
94
96
}
Original file line number Diff line number Diff line change 71
71
allow_sync_from_zero : bool ,
72
72
propagate_execution_state : bool ,
73
73
da_batch_signer : & SignerIdentifier ,
74
+ mut stop_rx : tokio:: sync:: watch:: Receiver < ( ) > ,
74
75
) -> anyhow:: Result < ( ) > {
75
76
let synced_height = self . da_db . get_synced_height ( ) ?;
76
77
// Sync Da from 0 is rejected by default. Only if forced it's allowed.
@@ -163,6 +164,8 @@ where
163
164
tracing:: error!( "Da client stream channel timeout because it's idle. Exit" ) ;
164
165
break ;
165
166
}
167
+ // Stop the node. No block are executing at this point.
168
+ _ = stop_rx. changed( ) => break ,
166
169
else => break ,
167
170
}
168
171
}
You can’t perform that action at this time.
0 commit comments