Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgade rust-toolchain to 1.75.0 #4356

Merged
2 changes: 1 addition & 1 deletion .github/workflows/ci_aarch64_build_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- uses: actions/checkout@v3
- run: rustup component add rustfmt
- run: sudo apt-get update && sudo apt-get install libssl-dev pkg-config libclang-dev -y && sudo apt-get install -y gcc-multilib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_benchmarks_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- run: rustup component add rustfmt
- run: rustup component add clippy
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_integration_tests_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- run: rustup component add rustfmt
- run: rustup component add clippy
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- run: rustup component add rustfmt
- run: rustup component add clippy
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_linters_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- uses: actions/checkout@v3
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_quick_checks_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- run: rustup component add rustfmt
- uses: actions/checkout@v3
- run: cargo fmt --all -- --check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_unit_tests_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.71.1
toolchain: 1.75.0
- run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config libclang-dev
- name: Install nextest
uses: taiki-e/install-action@nextest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
name: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.71.1-openssl-3.1.3
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.75.0
REL_PKG: ${{ matrix.rel_pkg }}

package-for-linux-aarch64:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
name: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.71.1-openssl-3.1.3
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.75.0
REL_PKG: ${{ matrix.rel_pkg }}

package-for-mac:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build = "build.rs"
description = "CKB is the layer 1 of Nervos Network, a public/permissionless blockchain."
homepage = "https://github.com/nervosnetwork/ckb"
repository = "https://github.com/nervosnetwork/ckb"
rust-version = "1.71.1"
rust-version = "1.75.0"

[build-dependencies]
ckb-build-info = { path = "util/build-info", version = "= 0.115.0-pre" }
Expand Down
2 changes: 1 addition & 1 deletion chain/src/tests/block_assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn test_block_template_message() {
.cellbase
.data
.witnesses
.get(0)
.first()
.unwrap()
.as_bytes(),
)
Expand Down
2 changes: 1 addition & 1 deletion ckb-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/nervosnetwork/ckb"
repository = "https://github.com/nervosnetwork/ckb"

[dependencies]
clap = { version = "4" }
clap = { version = "=4.4" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
serde_plain = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion ckb-bin/src/subcommand/list_hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl TryFrom<ChainSpec> for SpecHashes {
cellbase
.outputs()
.into_iter()
.zip(cellbase.outputs_data().into_iter())
.zip(cellbase.outputs_data())
.skip(1),
)
.enumerate()
Expand Down
2 changes: 1 addition & 1 deletion devtools/doc/rpc-gen/src/syn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub(crate) fn visit_for_types() -> Vec<(String, String)> {
let mut finder = CommentFinder {
type_comments: Default::default(),
current_type: None,
types: vec!["JsonBytes", "IndexerRange", "PoolTransactionReject"]
types: ["JsonBytes", "IndexerRange", "PoolTransactionReject"]
.iter()
.map(|&s| s.to_owned())
.collect(),
Expand Down
2 changes: 1 addition & 1 deletion docker/hub/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nervos/ckb-docker-builder:bionic-rust-1.71.1-openssl-3.1.3 as ckb-docker-builder
FROM nervos/ckb-docker-builder:bionic-rust-1.75.0 as ckb-docker-builder

WORKDIR /ckb
COPY ./ .
Expand Down
2 changes: 1 addition & 1 deletion docker/hub/Dockerfile-aarch64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nervos/ckb-docker-builder:aarch64-rust-1.71.1-openssl-3.1.3 as ckb-docker-builder
FROM nervos/ckb-docker-builder:aarch64-rust-1.75.0 as ckb-docker-builder

WORKDIR /ckb
COPY ./ .
Expand Down
33 changes: 14 additions & 19 deletions network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,25 +1124,20 @@ impl NetworkService {
}
start_sender.send(Ok(())).unwrap();
tokio::spawn(async move { p2p_service.run().await });
loop {
tokio::select! {
_ = receiver.cancelled() => {
info!("NetworkService receive exit signal, start shutdown...");
let _ = p2p_control.shutdown().await;
// Drop senders to stop all corresponding background task
drop(bg_signals);

info!("NetworkService shutdown now");
break;
},
else => {
let _ = p2p_control.shutdown().await;
// Drop senders to stop all corresponding background task
drop(bg_signals);

break;
},
}
tokio::select! {
_ = receiver.cancelled() => {
info!("NetworkService receive exit signal, start shutdown...");
let _ = p2p_control.shutdown().await;
// Drop senders to stop all corresponding background task
drop(bg_signals);

info!("NetworkService shutdown now");
},
else => {
let _ = p2p_control.shutdown().await;
// Drop senders to stop all corresponding background task
drop(bg_signals);
},
}
});
}
Expand Down
15 changes: 8 additions & 7 deletions network/src/peer_registry.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Peer registry
use crate::network_group::Group;
use crate::peer_store::PeerStore;
use crate::{
errors::{Error, PeerError},
Expand Down Expand Up @@ -166,13 +167,13 @@ impl PeerRegistry {
// Group peers by network group
let evict_group = candidate_peers
.into_iter()
.fold(HashMap::new(), |mut groups, peer| {
groups
.entry(peer.network_group())
.or_insert_with(Vec::new)
.push(peer);
groups
})
.fold(
HashMap::new(),
|mut groups: HashMap<Group, Vec<&Peer>>, peer| {
groups.entry(peer.network_group()).or_default().push(peer);
groups
},
)
.values()
.max_by_key(|group| group.len())
.cloned()
Expand Down
4 changes: 2 additions & 2 deletions network/src/services/dns_seeding/seed_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ impl SeedRecord {
peer_id: Option<&PeerId>,
valid_until: u64,
) -> String {
vec![
[
ip.to_string(),
port.to_string(),
peer_id.map(PeerId::to_base58).unwrap_or_else(String::new),
peer_id.map(PeerId::to_base58).unwrap_or_default(),
valid_until.to_string(),
]
.join(&SEP.to_string())
Expand Down
2 changes: 1 addition & 1 deletion network/src/services/dns_seeding/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl SeedRecord {
sig[0..64].copy_from_slice(&signed_data[0..64]);
sig[64] = recid.to_i32() as u8;
let signature_string = bs58::encode(&sig[..]).into_string();
Ok(vec![data, signature_string].join(&SEP.to_string()))
Ok([data, signature_string].join(&SEP.to_string()))
}
}

Expand Down
Loading
Loading