Skip to content

Commit

Permalink
Rename runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillLykov committed Dec 11, 2024
1 parent b4dd2c1 commit 2103135
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,13 @@ use {
tokio::runtime::{self, Runtime as TokioRuntime},
};

static GLOBAL_RUNTIME: LazyLock<TokioRuntime> = LazyLock::new(|| {
static STS_CLIENT_RUNTIME: LazyLock<TokioRuntime> = LazyLock::new(|| {
runtime::Builder::new_multi_thread()
.enable_all()
.build()
.expect("Failed to create Tokio runtime")
});

// Function to get a handle to the runtime
fn get_runtime_handle() -> tokio::runtime::Handle {
GLOBAL_RUNTIME.handle().clone()
}

const MAX_COMPLETED_DATA_SETS_IN_CHANNEL: usize = 100_000;
const WAIT_FOR_SUPERMAJORITY_THRESHOLD_PERCENT: u64 = 80;
// Right now since we reuse the wait for supermajority code, the
Expand Down Expand Up @@ -1116,7 +1111,7 @@ impl Validator {
.map_err(|err| ValidatorError::Other(format!("{err}")))?;

let client = TpuClientNextClient::new(
get_runtime_handle(),
STS_CLIENT_RUNTIME.handle().clone(),
my_tpu_address,
config.send_transaction_service_config.tpu_peers.clone(),
Some(leader_info),
Expand Down

0 comments on commit 2103135

Please sign in to comment.