Skip to content

Commit

Permalink
Upgrade tarpc and tokio (solana-labs#13293)
Browse files Browse the repository at this point in the history
  • Loading branch information
garious authored Oct 30, 2020
1 parent b5c8b86 commit ca00197
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 130 deletions.
371 changes: 255 additions & 116 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions banks-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ bincode = "1.3.1"
futures = "0.3"
solana-banks-interface = { path = "../banks-interface", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
tarpc = { version = "0.22.0", features = ["full"] }
tokio = "0.2"
tarpc = { version = "0.23.0", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
tokio-serde = { version = "0.6", features = ["bincode"] }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions banks-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
use solana_sdk::{message::Message, signature::Signer, system_instruction};
use std::sync::{Arc, RwLock};
use tarpc::transport;
use tokio::{runtime::Runtime, time::delay_for};
use tokio::{runtime::Runtime, time::sleep};

#[test]
fn test_banks_client_new() {
Expand Down Expand Up @@ -285,7 +285,7 @@ mod tests {
if root_slot > last_valid_slot {
break;
}
delay_for(Duration::from_millis(100)).await;
sleep(Duration::from_millis(100)).await;
status = banks_client.get_transaction_status(signature).await?;
}
assert!(status.unwrap().err.is_none());
Expand Down
2 changes: 1 addition & 1 deletion banks-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.112", features = ["derive"] }
solana-sdk = { path = "../sdk", version = "1.5.0" }
tarpc = { version = "0.22.0", features = ["full"] }
tarpc = { version = "0.23.0", features = ["full"] }

[lib]
crate-type = ["lib"]
Expand Down
4 changes: 2 additions & 2 deletions banks-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ solana-banks-interface = { path = "../banks-interface", version = "1.5.0" }
solana-runtime = { path = "../runtime", version = "1.5.0" }
solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-metrics = { path = "../metrics", version = "1.5.0" }
tarpc = { version = "0.22.0", features = ["full"] }
tokio = "0.2"
tarpc = { version = "0.23.0", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
tokio-serde = { version = "0.6", features = ["bincode"] }

[lib]
Expand Down
4 changes: 2 additions & 2 deletions banks-server/src/banks_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use tarpc::{
server::{self, Channel, Handler},
transport,
};
use tokio::time::delay_for;
use tokio::time::sleep;
use tokio_serde::formats::Bincode;

#[derive(Clone)]
Expand Down Expand Up @@ -118,7 +118,7 @@ impl BanksServer {
.bank(commitment)
.get_signature_status_with_blockhash(signature, blockhash);
while status.is_none() {
delay_for(Duration::from_millis(200)).await;
sleep(Duration::from_millis(200)).await;
let bank = self.bank(commitment);
if bank.slot() > last_valid_slot {
break;
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ solana-vote-signer = { path = "../vote-signer", version = "1.5.0" }
spl-token-v2-0 = { package = "spl-token", version = "=2.0.8" }
tempfile = "3.1.0"
thiserror = "1.0"
tokio = { version = "0.2.22", features = ["full"] }
tokio = { version = "0.2", features = ["full"] }
tokio_01 = { version = "0.1", package = "tokio" }
tokio_fs_01 = { version = "0.1", package = "tokio-fs" }
tokio_io_01 = { version = "0.1", package = "tokio-io" }
Expand Down
2 changes: 1 addition & 1 deletion tokens/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ solana-sdk = { path = "../sdk", version = "1.5.0" }
solana-stake-program = { path = "../programs/stake", version = "1.5.0" }
tempfile = "3.1.0"
thiserror = "1.0"
tokio = "0.2"
tokio = { version = "0.3", features = ["full"] }
url = "2.1"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions tokens/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::{
io,
time::Duration,
};
use tokio::time::delay_for;
use tokio::time::sleep;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
struct Allocation {
Expand Down Expand Up @@ -417,7 +417,7 @@ async fn finalize_transactions(
}

// Sleep for about 1 slot
delay_for(Duration::from_millis(500)).await;
sleep(Duration::from_millis(500)).await;
let opt_conf = update_finalized_transactions(client, db).await?;
opt_confirmations = opt_conf;
}
Expand Down
2 changes: 1 addition & 1 deletion tokens/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let url = Url::parse(&rpc_banks_url)?;
let host_port = (url.host_str().unwrap(), url.port().unwrap());

let mut runtime = Runtime::new().unwrap();
let runtime = Runtime::new().unwrap();
let mut banks_client = runtime.block_on(start_tcp_client(&host_port))?;

match command_args.command {
Expand Down

0 comments on commit ca00197

Please sign in to comment.