Skip to content

Conversation

@r-near
Copy link
Contributor

@r-near r-near commented Feb 5, 2026

Updates the crate to Rust edition 2024 with resolver v3.

@r-near r-near requested a review from akorchyn as a code owner February 5, 2026 21:38
Copilot AI review requested due to automatic review settings February 5, 2026 21:38
@r-near r-near requested a review from a team as a code owner February 5, 2026 21:38
@github-project-automation github-project-automation bot moved this to NEW❗ in DevTools Feb 5, 2026
Copy link
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 Rust crate from edition 2021 to edition 2024. The workspace configuration uses a centralized edition setting that is automatically inherited by both workspace members (api and types crates) via edition.workspace = true. The minimum Rust version is set to 1.85, which supports edition 2024.

Changes:

  • Updated workspace edition from "2021" to "2024" in the root Cargo.toml

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

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.61%. Comparing base (e2d22ef) to head (bd19016).

Files with missing lines Patch % Lines
api/src/common/query/mod.rs 0.00% 6 Missing ⚠️
api/src/stake.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   51.58%   51.61%   +0.02%     
==========================================
  Files          40       40              
  Lines        5168     5169       +1     
==========================================
+ Hits         2666     2668       +2     
+ Misses       2502     2501       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@vsavchyn-dev vsavchyn-dev left a comment

Choose a reason for hiding this comment

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

Just few questions

Comment on lines +5 to +14
// Fetch a single final block
let final_block = Chain::block()
.at(Reference::Final)
.fetch_from_mainnet()
.await?;

let block_number = Chain::block_number().fetch_from_mainnet().await?;
let block_hash = Chain::block_hash().fetch_from_mainnet().await?;
let block_number = final_block.header.height;
let block_hash = final_block.header.hash.into();

let _block = Chain::block()
let _block_by_number = Chain::block()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the purpose of this test is to test code path of retrieving specific information of the block (block itself, "block_hash", "block_number"), right @akorchyn?

AFAIU, @r-near changed this test due to it failing to find block. It is related to the block reference being optimistic in Chain::block_number() and Chain::block_hash(), right?

Maybe we should just change these lines in test then:

    // Fetch a single final block
    let _final_block = Chain::block()
        .at(Reference::Optimistic)
        .fetch_from_mainnet()
        .await?;

    let block_number = Chain::block_number()
        .at(Reference::Final)
        .fetch_from_mainnet()
        .await?;

    let block_hash = Chain::block_hash()
        .at(Reference::Final)
        .fetch_from_mainnet()
        .await?;


[workspace.package]
edition = "2021"
edition = "2024"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
edition = "2024"
edition = "2024"
rust-version = "1.85"

Maybe we should also opt-in ./api/Cargo.toml and ./types/Cargo.toml with rust-version.workspace = true?

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.

2 participants