Skip to content

Commit e41b611

Browse files
jimmygchenmichaelsproul
authored andcommitted
Try signing with a rayon threadpool.
1 parent 41ba135 commit e41b611

File tree

1 file changed

+5
-7
lines changed
  • validator_client/signing_method/src

1 file changed

+5
-7
lines changed

validator_client/signing_method/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use parking_lot::Mutex;
99
use reqwest::{Client, header::ACCEPT};
1010
use std::path::PathBuf;
1111
use std::sync::Arc;
12-
use task_executor::TaskExecutor;
12+
use task_executor::{RayonPoolType, TaskExecutor};
1313
use tracing::instrument;
1414
use types::*;
1515
use url::Url;
@@ -181,13 +181,11 @@ impl SigningMethod {
181181
// Spawn a blocking task to produce the signature. This avoids blocking the core
182182
// tokio executor.
183183
let signature = executor
184-
.spawn_blocking_handle(
185-
move || voting_keypair.sk.sign(signing_root),
186-
"local_keystore_signer",
187-
)
188-
.ok_or(Error::ShuttingDown)?
184+
.spawn_blocking_with_rayon_async(RayonPoolType::HighPriority, move || {
185+
voting_keypair.sk.sign(signing_root)
186+
})
189187
.await
190-
.map_err(|e| Error::TokioJoin(e.to_string()))?;
188+
.map_err(|_| Error::ShuttingDown)?;
191189
Ok(signature)
192190
}
193191
SigningMethod::Web3Signer {

0 commit comments

Comments
 (0)