diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index dd051c065..7482a52f4 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -39,7 +39,7 @@ jobs: uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746 # Version 1.0.6 with: # The same version must be used in the `.pre-commit-config.yaml` file - toolchain: nightly-2025-03-29 + toolchain: nightly-2025-05-09 profile: minimal components: rustfmt override: true @@ -186,7 +186,6 @@ jobs: with: key: ${{ github.ref }}->${{ github.workflow }}->${{ github.job }}->${{ join(matrix.os, '_') }} github-token: ${{ secrets.GITHUB_TOKEN }} - # We build AND run the binaries that are also used in the integration tests later on. - name: Run the node binary to check the config file validity uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1 with: @@ -197,7 +196,8 @@ jobs: with: command: run args: -p nomos-executor nodes/nomos-executor/config.yaml --check-config - - name: Build binaries with all features # This includes testing feature needed for tests + # This includes testing feature needed for tests + - name: Build binaries with all features uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 with: command: build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fd4f7e15..dd7aafc5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: # We're running `fmt` with `--all` and `pass_filenames: false` to format the entire workspace at once. # Otherwise, `pre-commit` passes staged files one by one, which can lead to inconsistent results # due to, presumably, the lack of full workspace context. - entry: cargo +nightly-2025-03-29 fmt + entry: cargo +nightly-2025-05-09 fmt pass_filenames: false - id: clippy args: ["--all", "--all-targets", "--all-features", "--", "-D", "warnings"] diff --git a/Cargo.toml b/Cargo.toml index ec25fcd4c..8973f8445 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] # Make sure any excluded crates are still clipped in our CI. Also, make sure they use the same Clippy and rustc lints we specify in this file down below. -exclude = ["nomos-core/cl", "nomos-core/proof_statements", "nomos-core/risc0_proofs"] +exclude = ["nomos-core/proof_statements", "nomos-core/risc0_proofs"] members = [ "consensus/cryptarchia-engine", "consensus/cryptarchia-sync", @@ -53,7 +53,6 @@ resolver = "2" bundler = { path = "./nomos-bundler" } cfgsync = { path = "./testnet/cfgsync" } chain-service = { path = "./nomos-services/chain-service" } -cl = { path = "./nomos-core/cl" } common-http-client = { path = "./nodes/nomos-node/http-client" } cryptarchia-engine = { path = "./consensus/cryptarchia-engine" } cryptarchia-sync = { path = "./consensus/cryptarchia-sync" } @@ -199,6 +198,7 @@ missing_assert_message = { level = "allow" } missing_errors_doc = { level = "allow" } missing_panics_doc = { level = "allow" } pattern_type_mismatch = { level = "allow" } +redundant_test_prefix = { level = "allow" } ref_patterns = { level = "allow" } renamed_function_params = { level = "allow" } same_name_method = { level = "allow" } diff --git a/Dockerfile b/Dockerfile index 9bffebb43..f7a50f286 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # BUILD IMAGE # =========================== -FROM rust:1.87.0-slim-bookworm AS builder +FROM rust:1.88.0-slim-bookworm AS builder LABEL maintainer="augustinas@status.im" \ source="https://github.com/logos-co/nomos-node" \ diff --git a/ci/Dockerfile b/ci/Dockerfile index cb2446f84..cc5eaaa8a 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.87.0-slim-bookworm +FROM rust:1.88.0-slim-bookworm LABEL maintainer="augustinas@status.im" \ source="https://github.com/logos-co/nomos-node" \ diff --git a/nomos-core/proof_statements/Cargo.toml b/nomos-core/proof_statements/Cargo.toml index 64f13b4bd..d15d1fc14 100644 --- a/nomos-core/proof_statements/Cargo.toml +++ b/nomos-core/proof_statements/Cargo.toml @@ -96,6 +96,7 @@ missing_assert_message = { level = "allow" } missing_errors_doc = { level = "allow" } missing_panics_doc = { level = "allow" } pattern_type_mismatch = { level = "allow" } +redundant_test_prefix = { level = "allow" } ref_patterns = { level = "allow" } renamed_function_params = { level = "allow" } same_name_method = { level = "allow" } diff --git a/nomos-core/risc0_proofs/Cargo.toml b/nomos-core/risc0_proofs/Cargo.toml index b4167bcfb..2797ee440 100644 --- a/nomos-core/risc0_proofs/Cargo.toml +++ b/nomos-core/risc0_proofs/Cargo.toml @@ -104,6 +104,7 @@ missing_assert_message = { level = "allow" } missing_errors_doc = { level = "allow" } missing_panics_doc = { level = "allow" } pattern_type_mismatch = { level = "allow" } +redundant_test_prefix = { level = "allow" } ref_patterns = { level = "allow" } renamed_function_params = { level = "allow" } same_name_method = { level = "allow" } diff --git a/nomos-core/risc0_proofs/proof_of_leadership/Cargo.toml b/nomos-core/risc0_proofs/proof_of_leadership/Cargo.toml index 86db7bc9e..b3c95e707 100644 --- a/nomos-core/risc0_proofs/proof_of_leadership/Cargo.toml +++ b/nomos-core/risc0_proofs/proof_of_leadership/Cargo.toml @@ -102,6 +102,7 @@ missing_assert_message = { level = "allow" } missing_errors_doc = { level = "allow" } missing_panics_doc = { level = "allow" } pattern_type_mismatch = { level = "allow" } +redundant_test_prefix = { level = "allow" } ref_patterns = { level = "allow" } renamed_function_params = { level = "allow" } same_name_method = { level = "allow" } diff --git a/nomos-da/network/core/src/swarm/executor.rs b/nomos-da/network/core/src/swarm/executor.rs index c8ceca9f0..e8a491e8e 100644 --- a/nomos-da/network/core/src/swarm/executor.rs +++ b/nomos-da/network/core/src/swarm/executor.rs @@ -281,6 +281,10 @@ where handle_replication_event(&self.validation_events_sender, event).await; } + #[expect( + clippy::cognitive_complexity, + reason = "TODO: Address this at some point" + )] async fn handle_behaviour_event( &mut self, event: ExecutorBehaviourEvent< diff --git a/nomos-da/network/core/src/swarm/validator.rs b/nomos-da/network/core/src/swarm/validator.rs index 4693f15c0..e42c1c326 100644 --- a/nomos-da/network/core/src/swarm/validator.rs +++ b/nomos-da/network/core/src/swarm/validator.rs @@ -246,6 +246,10 @@ where handle_replication_event(&self.validation_events_sender, event).await; } + #[expect( + clippy::cognitive_complexity, + reason = "TODO: Address this at some point" + )] async fn handle_behaviour_event( &mut self, event: ValidatorBehaviourEvent< diff --git a/nomos-services/chain-service/src/leadership.rs b/nomos-services/chain-service/src/leadership.rs index 66a54472f..9f1ef5933 100644 --- a/nomos-services/chain-service/src/leadership.rs +++ b/nomos-services/chain-service/src/leadership.rs @@ -29,6 +29,10 @@ impl Leader { Self { utxos, sk, config } } + #[expect( + clippy::cognitive_complexity, + reason = "TODO: Address this at some point" + )] pub async fn build_proof_for( &self, aged_tree: &UtxoTree, diff --git a/nomos-services/membership/src/lib.rs b/nomos-services/membership/src/lib.rs index b3cc0b268..5ac554c35 100644 --- a/nomos-services/membership/src/lib.rs +++ b/nomos-services/membership/src/lib.rs @@ -164,6 +164,10 @@ where Sdp: SdpAdapter, Backend::Settings: Clone, { + #[expect( + clippy::cognitive_complexity, + reason = "TODO: Address this at some point" + )] async fn handle_message(&mut self, msg: MembershipMessage) { match msg { MembershipMessage::GetSnapshotAt { diff --git a/nomos-services/mempool/src/backend/mockpool/mod.rs b/nomos-services/mempool/src/backend/mockpool/mod.rs index 3b3683f22..8284131af 100644 --- a/nomos-services/mempool/src/backend/mockpool/mod.rs +++ b/nomos-services/mempool/src/backend/mockpool/mod.rs @@ -146,10 +146,6 @@ where } fn view(&self, _ancestor_hint: BlockId) -> Box + Send> { - #[expect( - clippy::needless_collect, - reason = "We need to have an owned version of the iterator to bypass adding a lifetime bound to the return iterator type" - )] let pending_items: Vec = self.pending_items.values().cloned().collect(); Box::new(pending_items.into_iter()) } diff --git a/nomos-services/sdp/src/lib.rs b/nomos-services/sdp/src/lib.rs index d0c994d5d..60d4ec1c3 100644 --- a/nomos-services/sdp/src/lib.rs +++ b/nomos-services/sdp/src/lib.rs @@ -126,6 +126,10 @@ impl< RuntimeServiceId: Send + Sync + 'static, > SdpService { + #[expect( + clippy::cognitive_complexity, + reason = "TODO: Address this at some point" + )] async fn handle_sdp_message(&mut self, msg: SdpMessage) { match msg { SdpMessage::Process { diff --git a/nomos-utils/src/bounded_duration.rs b/nomos-utils/src/bounded_duration.rs index eb6c47e65..41c1bd786 100644 --- a/nomos-utils/src/bounded_duration.rs +++ b/nomos-utils/src/bounded_duration.rs @@ -42,7 +42,7 @@ pub(crate) trait TimeTag { fn inner() -> char; } -pub struct BoundTag {} +pub struct BoundTag; impl TimeTag for BoundTag { fn inner() -> char { TAG diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 35e03b85f..bd274aa75 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -9,6 +9,6 @@ # * workflows/code-check.yml (fmt job) # * .pre-commit-config.yml (fmt hook) # Then, if there is any new allow-by-default rustc lint introduced/stabilized, add it to the respective entry in our `config.toml`. -channel = "1.87.0" +channel = "1.88.0" # Even if clippy should be included in the default profile, in some cases it is not installed. So we force it with an explicit declaration. components = ["clippy"] diff --git a/shell.nix b/shell.nix index 9ef4e699e..4625da930 100644 --- a/shell.nix +++ b/shell.nix @@ -6,7 +6,7 @@ overlays = [ (import (fetchGit { url = "https://github.com/oxalica/rust-overlay.git"; - rev = "0e624f2b1972a34be1a9b35290ed18ea4b419b6f"; + rev = "e28ba067a9368286a8bc88b68dc2ca92181a09f0"; })) ]; } @@ -19,7 +19,7 @@ pkgs.mkShell { pkg-config # Updating the version here requires also updating the `rev` version in the `overlays` section above # with a commit that contains the new version in its manifest - rust-bin.stable."1.87.0".default + rust-bin.stable."1.88.0".default clang_14 llvmPackages_14.libclang openssl.dev diff --git a/testnet/Dockerfile b/testnet/Dockerfile index c9e10c131..5235a845c 100644 --- a/testnet/Dockerfile +++ b/testnet/Dockerfile @@ -1,6 +1,6 @@ # BUILD IMAGE --------------------------------------------------------- -FROM rust:1.87.0-slim-bookworm AS builder +FROM rust:1.88.0-slim-bookworm AS builder LABEL maintainer="augustinas@status.im" \ source="https://github.com/logos-co/nomos-node" \ diff --git a/testnet/Dockerfile.debug b/testnet/Dockerfile.debug index ea0426576..4b74f8ed2 100644 --- a/testnet/Dockerfile.debug +++ b/testnet/Dockerfile.debug @@ -1,6 +1,6 @@ # BUILD IMAGE --------------------------------------------------------- -FROM rust:1.87.0-slim-bookworm AS builder +FROM rust:1.88.0-slim-bookworm AS builder # Install dependencies needed for building RocksDB and etcd. RUN apt-get update && apt-get install -yq \ @@ -29,8 +29,8 @@ RUN git clone https://github.com/risc0/risc0.git && \ FROM rust:1.87.0-slim-bookworm AS final LABEL maintainer="romanzac@status.im" \ - source="https://github.com/logos-co/nomos" \ - description="Nomos testnet debug image" + source="https://github.com/logos-co/nomos" \ + description="Nomos testnet debug image" COPY --from=builder /usr/local/cargo /usr/local/cargo COPY --from=builder /root/.risc0 /root/.risc0 diff --git a/testnet/cfgsync/src/lib.rs b/testnet/cfgsync/src/lib.rs index b667142a8..2cb0be24f 100644 --- a/testnet/cfgsync/src/lib.rs +++ b/testnet/cfgsync/src/lib.rs @@ -27,7 +27,7 @@ mod tests { }; #[tokio::test] - #[ignore] + #[ignore = "Ignored until mantle related configuration is settled"] async fn test_address_book() { let n_hosts = 4; let config = CfgSyncConfig { diff --git a/testnet/cfgsync/src/repo.rs b/testnet/cfgsync/src/repo.rs index 9fd160f71..84d28f2c3 100644 --- a/testnet/cfgsync/src/repo.rs +++ b/testnet/cfgsync/src/repo.rs @@ -81,11 +81,7 @@ impl ConfigRepo { println!("All hosts have announced their IPs"); let mut waiting_hosts = self.waiting_hosts.lock().unwrap(); - let hosts = waiting_hosts - .iter() - .map(|(host, _)| host) - .cloned() - .collect(); + let hosts = waiting_hosts.keys().cloned().collect(); let configs = create_node_configs( &self.consensus_params,