Skip to content

Commit a820a92

Browse files
authored
fix: Run attestation requests within a tokio runtime (#1229)
1 parent 3a2059e commit a820a92

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/node/src/cli.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,13 @@ pub struct ExportKeyshareCmd {
225225

226226
impl StartCmd {
227227
async fn run(self) -> anyhow::Result<()> {
228+
let root_runtime = tokio::runtime::Builder::new_multi_thread()
229+
.enable_all()
230+
.worker_threads(1)
231+
.build()?;
232+
233+
let _tokio_enter_guard = root_runtime.enter();
234+
228235
// Load configuration and initialize persistent secrets
229236
let home_dir = PathBuf::from(self.home_dir.clone());
230237
let config = load_config_file(&home_dir)?;
@@ -248,11 +255,6 @@ impl StartCmd {
248255
let (debug_request_sender, _) = tokio::sync::broadcast::channel(10);
249256
let root_task_handle = Arc::new(OnceLock::new());
250257

251-
let root_runtime = tokio::runtime::Builder::new_multi_thread()
252-
.enable_all()
253-
.worker_threads(1)
254-
.build()?;
255-
256258
let (protocol_state_sender, protocol_state_receiver) =
257259
watch::channel(ProtocolContractState::NotInitialized);
258260

0 commit comments

Comments
 (0)