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

chore(general): bump MSRV to 1.81, use core::error::Error on no-std compatible crates #1552

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
rust:
- "stable"
- "nightly"
- "1.79" # MSRV
- "1.81" # MSRV
flags:
# No features
- "--no-default-features"
Expand All @@ -34,7 +34,7 @@ jobs:
- "--all-features"
exclude:
# All features on MSRV
- rust: "1.79" # MSRV
- rust: "1.81" # MSRV
flags: "--all-features"
steps:
- uses: actions/checkout@v4
Expand All @@ -53,14 +53,14 @@ jobs:
cache-on-failure: true
# Only run tests on latest stable and above
- name: Install cargo-nextest
if: ${{ matrix.rust != '1.79' }} # MSRV
if: ${{ matrix.rust != '1.81' }} # MSRV
uses: taiki-e/install-action@nextest
- name: build
if: ${{ matrix.rust == '1.79' }} # MSRV
if: ${{ matrix.rust == '1.81' }} # MSRV
run: cargo build --workspace ${{ matrix.flags }}
- name: test
shell: bash
if: ${{ matrix.rust != '1.79' }} # MSRV
if: ${{ matrix.rust != '1.81' }} # MSRV
run: cargo nextest run --workspace ${{ matrix.flags }}

doctest:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
version = "0.6.4"
edition = "2021"
rust-version = "1.79"
rust-version = "1.81"
authors = ["Alloy Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/alloy-rs/alloy"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ When updating this, also update:
- .github/workflows/ci.yml
-->

The current MSRV (minimum supported rust version) is 1.79.
The current MSRV (minimum supported rust version) is 1.81.

Alloy will keep a rolling MSRV policy of **at least** two versions behind the
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should remove this comment as it is not true anymore no?

Copy link
Member

Choose a reason for hiding this comment

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

Ah oops I thought the latest stable was 1.83. We should wait on this until the next version.

latest stable release (so if the latest stable release is 1.58, we would
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.79"
msrv = "1.81"
6 changes: 2 additions & 4 deletions crates/eips/src/eip1898.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ impl Display for HexStringMissingPrefixError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for HexStringMissingPrefixError {}
impl core::error::Error for HexStringMissingPrefixError {}

/// A Block Identifier.
/// <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1898.md>
Expand Down Expand Up @@ -799,8 +798,7 @@ impl fmt::Display for ParseBlockHashOrNumberError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for ParseBlockHashOrNumberError {}
impl core::error::Error for ParseBlockHashOrNumberError {}

impl FromStr for HashOrNumber {
type Err = ParseBlockHashOrNumberError;
Expand Down
3 changes: 1 addition & 2 deletions crates/eips/src/eip4844/trusted_setup_points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,4 @@ impl fmt::Display for KzgErrors {
}
}

#[cfg(feature = "std")]
impl std::error::Error for KzgErrors {}
impl core::error::Error for KzgErrors {}
3 changes: 1 addition & 2 deletions crates/rpc-types-engine/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@ pub enum PayloadValidationError {
},
}

#[cfg(feature = "std")]
impl std::error::Error for PayloadValidationError {}
impl core::error::Error for PayloadValidationError {}
3 changes: 1 addition & 2 deletions crates/rpc-types-engine/src/forkchoice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ pub enum ForkchoiceUpdateError {
UnknownFinalBlock,
}

#[cfg(feature = "std")]
impl std::error::Error for ForkchoiceUpdateError {}
impl core::error::Error for ForkchoiceUpdateError {}

#[cfg(feature = "jsonrpsee-types")]
impl From<ForkchoiceUpdateError> for jsonrpsee_types::error::ErrorObject<'static> {
Expand Down
3 changes: 1 addition & 2 deletions crates/rpc-types-eth/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ pub enum FilterBlockError {
},
}

#[cfg(feature = "std")]
impl std::error::Error for FilterBlockError {}
impl core::error::Error for FilterBlockError {}

/// Represents the target range of blocks for the filter
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
Expand Down