Skip to content

[rust-toolchain] Upgrade Rust toolchain to 1.95.0#5175

Open
eval-exec wants to merge 4 commits intonervosnetwork:developfrom
eval-exec:ckb.toolchain
Open

[rust-toolchain] Upgrade Rust toolchain to 1.95.0#5175
eval-exec wants to merge 4 commits intonervosnetwork:developfrom
eval-exec:ckb.toolchain

Conversation

@eval-exec
Copy link
Copy Markdown
Collaborator

@eval-exec eval-exec commented Apr 17, 2026

What problem does this PR solve?

https://releases.rs/docs/1.95.0/
Problem Summary: Upgrade direct Rust pins to 1.95.0 and fix the clippy failures exposed by Rust 1.95.0.

What is changed and how it works?

What's Changed:

  • bump direct toolchain pins to 1.95.0
  • fix handwritten clippy fallout needed for make clippy
  • nervosnetwork/ckb-docker-builder still needs a 1.95.0 update before package image tags can move
  • cargo update for ./Cargo.lock

Check List

Tests

  • Manual test: make clippy

Side effects

  • Breaking backward compatibility

@eval-exec eval-exec changed the title [codex] Upgrade Rust toolchain to 1.95.0 [rust-toolchain] Upgrade Rust toolchain to 1.95.0 Apr 17, 2026
Update the repositorys direct Rust version pins to 1.95.0.

This changes rust-toolchain.toml, the root Cargo.toml rust-version, and the GitHub Actions jobs that install Rust directly so local development and CI use the same compiler series.

It intentionally does not touch the package builder image tags yet, because the upstream ckb-docker-builder repository still targets 1.92.0 and changing those references here would point packaging at images that are not ready.
Adjust handwritten code that started failing under the Rust 1.95.0 clippy lint set.

These edits remove redundant iterator conversions, collapse match/if patterns that the newer clippy flags, and replace an is_some/expect pair with direct option binding in fee-rate collection.

The goal is only to keep behavior unchanged while making `make clippy` pass after the toolchain bump, so generated code and unrelated files are left untouched.
Replace the deprecated `tower_http::timeout::TimeoutLayer::new` call with `TimeoutLayer::with_status_code` in the RPC server setup.

This keeps the 30-second timeout behavior while making `make clippy` pass again after the dependency update pulled in a newer tower-http that warns on the old constructor.
@eval-exec eval-exec marked this pull request as ready for review April 23, 2026 15:25
@eval-exec eval-exec requested a review from a team as a code owner April 23, 2026 15:25
@eval-exec eval-exec requested review from Copilot and zhangsoledad and removed request for a team April 23, 2026 15:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the repository’s Rust toolchain baseline to 1.95.0 and applies code adjustments needed to keep make clippy passing under the newer compiler, along with a cargo update refresh of Cargo.lock.

Changes:

  • Bump Rust toolchain pins to 1.95.0 across rust-toolchain.toml, root Cargo.toml, and GitHub Actions workflows.
  • Apply small Rust/clippy-driven refactors (iterator usage, match ergonomics, RPC timeout configuration, fee-rate collection logic).
  • Update Cargo.lock via cargo update.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
util/reward-calculator/src/lib.rs Removes redundant .into_iter() usage when extending proposal IDs.
util/indexer/src/indexer.rs Simplifies match logic when extracting a stored header hash.
util/fixed-hash/macros/src/lib.rs Refactors macro parsing logic using match guards.
tx-pool/src/process.rs Refactors match in async notification path (currently introduces a compile error).
test/src/specs/dao/dao_verifier.rs Removes redundant .into_iter() in zipped iteration over outputs.
sync/src/synchronizer/mod.rs Refactors match arm using a guard for readability.
spec/src/tests/mod.rs Removes redundant .into_iter() when zipping outputs and outputs_data.
shared/src/shared_builder.rs Removes redundant .into_iter() usage when extending proposal IDs.
rust-toolchain.toml Updates pinned Rust toolchain channel to 1.95.0.
rpc/src/util/fee_rate.rs Refactors BlockExt field handling and cycles presence checks.
rpc/src/server.rs Changes request timeout layer configuration to return a 408 status on timeout.
Cargo.toml Updates root rust-version to 1.95.0.
Cargo.lock Updates dependency lockfile after cargo update.
.github/workflows/release-plz.yml Updates CI toolchain to 1.95.0.
.github/workflows/coverage_report.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_unit_tests_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_quick_checks_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_linters_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_integration_tests_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_cargo_deny_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_benchmarks_ubuntu.yaml Updates CI toolchain to 1.95.0.
.github/workflows/ci_aarch64_build_ubuntu.yaml Updates CI toolchain to 1.95.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tx-pool/src/process.rs
Comment on lines 172 to +191
pub(crate) async fn notify_block_assembler(&self, status: TxStatus) {
if self.should_notify_block_assembler() {
match status {
TxStatus::Fresh => {
TxStatus::Fresh
if self
.block_assembler_sender
.send(BlockAssemblerMessage::Pending)
.await
.is_err()
{
error!("block_assembler receiver dropped");
}
.is_err() =>
{
error!("block_assembler receiver dropped");
}
TxStatus::Proposed => {
TxStatus::Proposed
if self
.block_assembler_sender
.send(BlockAssemblerMessage::Proposed)
.await
.is_err()
{
error!("block_assembler receiver dropped");
}
.is_err() =>
{
error!("block_assembler receiver dropped");
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This match arm uses an if guard that awaits (.await) inside the guard expression. Rust does not allow await in match guards, so this will not compile. Consider rewriting to match on status without a guard and perform the async send().await inside the arm body (or use a match on status plus an inner if/let for the send result).

Copilot uses AI. Check for mistakes.
Comment thread Cargo.toml
Comment on lines 8 to 12
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.92.0"
rust-version = "1.95.0"
default-run = "ckb"
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the root package rust-version was bumped to 1.95.0, but many workspace member crates still declare rust-version = "1.92.0" (e.g. rpc/Cargo.toml, tx-pool/Cargo.toml, etc.). If the intent is to raise the workspace MSRV/toolchain baseline, consider updating the member crates as well (or centralizing MSRV via a workspace-level approach) to keep the declared MSRV consistent across the repo.

Copilot uses AI. Check for mistakes.
@chenyukang chenyukang moved this to 🆕 New in Kanban Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants