Skip to content

Commit 2c15d16

Browse files
authored
Upgrade to Rust 1.68.0 (#4471)
* Update Rust to 1.68 * node: replace crossbeam-channel with std * config.toml: add useful comment
1 parent 094e40b commit 2c15d16

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.cargo/config.toml

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
[alias]
22
# Warnings create a lot of noise, we only print errors.
33
check-clippy = "clippy --no-deps -- --allow warnings"
4+
5+
# Can be safely removed once Cargo's sparse protocol (see
6+
# https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol)
7+
# becomes the default.
8+
[registries.crates-io]
9+
protocol = "sparse"

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ graphql-parser = "0.4.0"
2020
futures = { version = "0.3.1", features = ["compat"] }
2121
lazy_static = "1.2.0"
2222
url = "2.3.1"
23-
crossbeam-channel = "0.5.7"
2423
graph = { path = "../graph" }
2524
graph-core = { path = "../core" }
2625
graph-chain-arweave = { path = "../chain/arweave" }

node/src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ async fn main() {
561561
// Periodically check for contention in the tokio threadpool. First spawn a
562562
// task that simply responds to "ping" requests. Then spawn a separate
563563
// thread to periodically ping it and check responsiveness.
564-
let (ping_send, mut ping_receive) = mpsc::channel::<crossbeam_channel::Sender<()>>(1);
564+
let (ping_send, mut ping_receive) = mpsc::channel::<std::sync::mpsc::SyncSender<()>>(1);
565565
graph::spawn(async move {
566566
while let Some(pong_send) = ping_receive.recv().await {
567567
let _ = pong_send.clone().send(());
@@ -570,14 +570,13 @@ async fn main() {
570570
});
571571
std::thread::spawn(move || loop {
572572
std::thread::sleep(Duration::from_secs(1));
573-
let (pong_send, pong_receive) = crossbeam_channel::bounded(1);
573+
let (pong_send, pong_receive) = std::sync::mpsc::sync_channel(1);
574574
if futures::executor::block_on(ping_send.clone().send(pong_send)).is_err() {
575575
debug!(contention_logger, "Shutting down contention checker thread");
576576
break;
577577
}
578578
let mut timeout = Duration::from_millis(10);
579-
while pong_receive.recv_timeout(timeout)
580-
== Err(crossbeam_channel::RecvTimeoutError::Timeout)
579+
while pong_receive.recv_timeout(timeout) == Err(std::sync::mpsc::RecvTimeoutError::Timeout)
581580
{
582581
debug!(contention_logger, "Possible contention in tokio threadpool";
583582
"timeout_ms" => timeout.as_millis(),

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.66.0"
2+
channel = "1.68.0"
33
profile = "default"

0 commit comments

Comments
 (0)