Skip to content

Commit

Permalink
Merge pull request #4818 from eval-exec/exec/upgrade-toolchain-1.85.0
Browse files Browse the repository at this point in the history
Upgrade rust-toolchain from 1.81.0 to 1.85.0, Upgrade rust edition from 2021 to 2024
  • Loading branch information
zhangsoledad authored Mar 5, 2025
2 parents 8444466 + cfddf9c commit dca491c
Show file tree
Hide file tree
Showing 479 changed files with 1,754 additions and 1,501 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[cargo-new]
name = "Nervos Core Dev"
email = "dev@nervos.org"
edition = "2021"
edition = "2024"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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.81.0
toolchain: 1.85.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 @@ -82,7 +82,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.81.0
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.85.0
REL_PKG: ${{ matrix.rel_pkg }}

package-for-linux-aarch64:
Expand Down Expand Up @@ -166,7 +166,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.81.0
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.85.0
REL_PKG: ${{ matrix.rel_pkg }}

package-for-mac:
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "ckb"
version = "0.200.0-pre"
license = "MIT"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2021"
edition = "2024"
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.81.0"
rust-version = "1.85.0"

[build-dependencies]
ckb-build-info = { path = "util/build-info", version = "= 0.200.0-pre" }
Expand Down Expand Up @@ -100,6 +100,8 @@ members = [
[workspace.dependencies]
tempfile = "3"
itertools = "0.11.0"
# issue tracking: https://github.com/GREsau/schemars/pull/251
schemars = { package = "ckb_schemars", version="0.8.22" }

[profile.release]
overflow-checks = true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MOLC := moleculec
MOLC_VERSION := 0.7.5
VERBOSE := $(if ${CI},--verbose,)
CLIPPY_OPTS := -D warnings -D clippy::clone_on_ref_ptr -D clippy::redundant_clone -D clippy::enum_glob_use -D clippy::fallible_impl_from \
-A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return
-A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return -A clippy::needless_lifetimes -A clippy::extra_unused_lifetimes
CKB_TEST_ARGS := -c 4 ${CKB_TEST_ARGS}
CKB_FEATURES ?= deadlock_detection,with_sentry
ALL_FEATURES := deadlock_detection,with_sentry,with_dns_seeding,profiling,march-native
Expand Down
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "ckb-benches"
version = "0.200.0-pre"
license = "MIT"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2021"
edition = "2024"
description = "CKB benchmarks."
homepage = "https://github.com/nervosnetwork/ckb"
repository = "https://github.com/nervosnetwork/ckb"
Expand Down
32 changes: 19 additions & 13 deletions benches/benches/benchmarks/always_success.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::benchmarks::util::{gen_always_success_block, new_always_success_chain};
use ckb_store::{self, ChainStore};
use ckb_verification_traits::Switch;
use criterion::{criterion_group, BatchSize, BenchmarkId, Criterion};
use criterion::{BatchSize, BenchmarkId, Criterion, criterion_group};
use std::sync::Arc;

#[cfg(not(feature = "ci"))]
Expand All @@ -24,10 +24,12 @@ fn bench(c: &mut Criterion) {
let chains = new_always_success_chain(*i, 2);
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..20).for_each(|_| {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
Expand Down Expand Up @@ -72,10 +74,12 @@ fn bench(c: &mut Criterion) {
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let (ref chain3, ref shared3) = chains.0[2];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..5).for_each(|i| {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
Expand Down Expand Up @@ -149,10 +153,12 @@ fn bench(c: &mut Criterion) {
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let (ref chain3, ref shared3) = chains.0[2];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..5).for_each(|i| {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
Expand Down
12 changes: 6 additions & 6 deletions benches/benches/benchmarks/overall.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
use crate::benchmarks::util::{create_2out_transaction, create_secp_tx, secp_cell};
use ckb_app_config::NetworkConfig;
use ckb_app_config::{BlockAssemblerConfig, TxPoolConfig};
use ckb_chain::{start_chain_services, ChainController};
use ckb_chain::{ChainController, start_chain_services};
use ckb_chain_spec::consensus::{ConsensusBuilder, ProposalWindow};
use ckb_dao_utils::genesis_dao_data;
use ckb_jsonrpc_types::JsonBytes;
use ckb_network::{network::TransportType, Flags, NetworkController, NetworkService, NetworkState};
use ckb_network::{Flags, NetworkController, NetworkService, NetworkState, network::TransportType};
use ckb_shared::{Shared, SharedBuilder};
use ckb_store::ChainStore;
use ckb_types::{
U256,
bytes::Bytes,
core::{
capacity_bytes, BlockBuilder, BlockView, Capacity, EpochNumberWithFraction, FeeRate,
ScriptHashType, TransactionBuilder, TransactionView,
BlockBuilder, BlockView, Capacity, EpochNumberWithFraction, FeeRate, ScriptHashType,
TransactionBuilder, TransactionView, capacity_bytes,
},
packed::{Block, CellDep, CellInput, CellOutput, Header, OutPoint},
prelude::*,
utilities::difficulty_to_compact,
U256,
};
use ckb_verification::HeaderVerifier;
use ckb_verification_traits::Switch;
use ckb_verification_traits::Verifier;
use criterion::{criterion_group, BatchSize, BenchmarkId, Criterion};
use criterion::{BatchSize, BenchmarkId, Criterion, criterion_group};
use rand::random;
use std::sync::Arc;

Expand Down
9 changes: 4 additions & 5 deletions benches/benches/benchmarks/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
use crate::benchmarks::util::create_2out_transaction;
use ckb_app_config::{BlockAssemblerConfig, TxPoolConfig};
use ckb_chain::{start_chain_services, ChainController};
use ckb_chain::{ChainController, start_chain_services};
use ckb_chain_spec::{ChainSpec, IssuedCell};
use ckb_jsonrpc_types::JsonBytes;
use ckb_resource::Resource;
use ckb_shared::{Shared, SharedBuilder, Snapshot};
use ckb_types::global::DATA_DIR;
use ckb_types::{
H160, H256,
bytes::Bytes,
core::{
capacity_bytes,
BlockView, Capacity, DepType, FeeRate, ScriptHashType, TransactionView, capacity_bytes,
cell::{resolve_transaction, setup_system_cell_cache},
BlockView, Capacity, DepType, FeeRate, ScriptHashType, TransactionView,
},
h160, h256,
packed::{CellDep, OutPoint, Script},
prelude::*,
H160, H256,
};
use criterion::{criterion_group, BatchSize, BenchmarkId, Criterion};
use criterion::{BatchSize, BenchmarkId, Criterion, criterion_group};
use std::collections::HashSet;

#[cfg(not(feature = "ci"))]
Expand Down
32 changes: 19 additions & 13 deletions benches/benches/benchmarks/secp_2in2out.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::benchmarks::util::{gen_secp_block, new_secp_chain};
use ckb_store::{self, ChainStore};
use ckb_verification_traits::Switch;
use criterion::{criterion_group, BatchSize, BenchmarkId, Criterion};
use criterion::{BatchSize, BenchmarkId, Criterion, criterion_group};
use std::sync::Arc;

#[cfg(not(feature = "ci"))]
Expand All @@ -24,10 +24,12 @@ fn bench(c: &mut Criterion) {
let chains = new_secp_chain(*txs_size, 2);
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..20).for_each(|_| {
let block = gen_secp_block(&mut blocks, &parent, shared2);
Expand Down Expand Up @@ -72,10 +74,12 @@ fn bench(c: &mut Criterion) {
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let (ref chain3, ref shared3) = chains.0[2];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..5).for_each(|i| {
let block = gen_secp_block(&mut blocks, &parent, shared2);
Expand Down Expand Up @@ -149,10 +153,12 @@ fn bench(c: &mut Criterion) {
let (ref chain1, ref shared1) = chains.0[0];
let (ref chain2, ref shared2) = chains.0[1];
let (ref chain3, ref shared3) = chains.0[2];
let mut blocks = vec![shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap()];
let mut blocks = vec![
shared1
.snapshot()
.get_block(&shared1.genesis_hash())
.unwrap(),
];
let mut parent = blocks[0].clone();
(0..5).for_each(|i| {
let block = gen_secp_block(&mut blocks, &parent, shared2);
Expand Down
Loading

0 comments on commit dca491c

Please sign in to comment.