From f32e8204e0410d19201c5c7b730ce3aa34d90725 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Thu, 19 Sep 2024 12:10:14 +0200 Subject: [PATCH 1/6] chore(ci): bump rust version to 1.81 --- .github/workflows/lint.yml | 2 +- .github/workflows/reusable-build.yml | 6 +- .github/workflows/test.yml | 58 ++++--- Cargo.lock | 158 ++++++++++++------ containerfiles/Dockerfile | 2 +- .../src/bridge_withdrawer/startup.rs | 2 +- crates/astria-conductor/src/block_cache.rs | 4 +- crates/astria-conductor/src/lib.rs | 3 + crates/astria-sequencer/src/app/test_utils.rs | 4 - .../src/app/tests_execute_transaction.rs | 6 +- .../astria-telemetry/src/metrics/builders.rs | 2 +- justfile | 4 +- lint/tracing_debug_field/Cargo.toml | 6 +- lint/tracing_debug_field/rust-toolchain | 2 +- 14 files changed, 168 insertions(+), 91 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5626138da8..ec7dbff91c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2024-02-07 + toolchain: nightly-2024-09-15 components: rustfmt - name: run rustfmt run: cargo fmt --all -- --check diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index d2d5c43ef7..95aa28545c 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -13,6 +13,8 @@ on: env: REGISTRY: ghcr.io FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }} + # This must match the entry in rustup-toolchain.toml at the repository root + RUSTUP_TOOLCHAIN: "1.81.0" jobs: upload-binaries: @@ -34,7 +36,9 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.tag }} - - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: arduino/setup-protoc@v3 with: version: "24.4" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bed1d4fd3f..f01a68c793 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: Test env: CI: true RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable" + + # This must match the entry in rustup-toolchain.toml at the repository root + RUSTUP_TOOLCHAIN: "1.81.0" on: pull_request: merge_group: @@ -26,7 +29,9 @@ jobs: version: "1.32.0" github_token: ${{ secrets.GITHUB_TOKEN }} - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" @@ -51,7 +56,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" @@ -77,7 +84,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: taiki-e/install-action@v2.15.2 with: tool: cargo-hack@0.5.29 @@ -100,7 +109,9 @@ jobs: if: needs.run_checker.outputs.run_tests == 'true' steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "github" @@ -113,7 +124,9 @@ jobs: if: needs.run_checker.outputs.run_audit == 'true' steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: rustsec/audit-check@v1.4.1 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -126,7 +139,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" @@ -154,7 +169,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" @@ -179,7 +196,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@1.76.0 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" @@ -198,8 +217,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@1.78.0 + - uses: dtolnay/rust-toolchain@master with: + toolchain: ${{ env.RUSTUP_TOOLCHAIN }} components: clippy - uses: Swatinem/rust-cache@v2.7.3 with: @@ -226,26 +246,26 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: dtolnay/rust-toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: # This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints - toolchain: nightly-2023-12-28 - components: "clippy, llvm-tools-preview, rustc-dev" + toolchain: nightly-2024-09-05 + components: "clippy, llvm-tools-preview, rustc-dev, rust-src" - uses: Swatinem/rust-cache@v2.7.3 with: cache-provider: "buildjet" - name: install cargo-dylint and dylint-link - run: cargo install cargo-dylint@2.6.1 dylint-link@2.6.1 --locked + run: cargo install cargo-dylint@3.2.0 dylint-link@3.2.0 --locked - uses: arduino/setup-protoc@v3 with: version: "24.4" repo-token: ${{ secrets.GITHUB_TOKEN }} - - name: run clippy against custom lints - run: | - : # list all lint packages here to have clippy explicitly test them - cargo clippy --all-targets --all-features \ - -p tracing_debug_field \ - -- --warn clippy::pedantic --deny warnings + # - name: run clippy against custom lints + # run: | + # : # list all lint packages here to have clippy explicitly test them + # cargo clippy --all-targets --all-features \ + # -p tracing_debug_field \ + # -- --warn clippy::pedantic --deny warnings - name: run dylint clippy on workspace crates env: # set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache diff --git a/Cargo.lock b/Cargo.lock index f1cf124250..2559a1f088 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1800,23 +1800,23 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clippy_config" -version = "0.1.77" -source = "git+https://github.com/rust-lang/rust-clippy?rev=ac4c2094a6030530661bee3876e0228ddfeb6b8b#ac4c2094a6030530661bee3876e0228ddfeb6b8b" +version = "0.1.83" +source = "git+https://github.com/rust-lang/rust-clippy?rev=a95afe2d0a2051d97b723b0b197393b7811bc4e4#a95afe2d0a2051d97b723b0b197393b7811bc4e4" dependencies = [ - "rustc-semver", + "itertools 0.12.1", "serde", "toml 0.7.8", ] [[package]] name = "clippy_utils" -version = "0.1.77" -source = "git+https://github.com/rust-lang/rust-clippy?rev=ac4c2094a6030530661bee3876e0228ddfeb6b8b#ac4c2094a6030530661bee3876e0228ddfeb6b8b" +version = "0.1.83" +source = "git+https://github.com/rust-lang/rust-clippy?rev=a95afe2d0a2051d97b723b0b197393b7811bc4e4#a95afe2d0a2051d97b723b0b197393b7811bc4e4" dependencies = [ "arrayvec 0.7.6", "clippy_config", - "itertools 0.11.0", - "rustc-semver", + "itertools 0.12.1", + "rustc_apfloat", ] [[package]] @@ -1956,9 +1956,9 @@ dependencies = [ [[package]] name = "compiletest_rs" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7225fee1bcf9247bb3a1b1a2d7ecfe2f7a990e549a09d766a257a4ae30dac0d6" +checksum = "2b0f4b0a27f9efcea6a012305682f0f7c5691df7097b9eaf6abb50b75c89a8af" dependencies = [ "diff", "filetime", @@ -2555,9 +2555,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dylint" -version = "2.6.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6259cf4df09300534dcfa6a49918bb442327111e370c656b31f1c10ec08145" +checksum = "60c66a33f0ecdb430682ffd8fa085ad57d0df028c9edaebb16e1b31b8c0240b8" dependencies = [ "ansi_term", "anyhow", @@ -2576,9 +2576,9 @@ dependencies = [ [[package]] name = "dylint_internal" -version = "2.6.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9400420c9ffa71c6b1b75d84225a150e3428eb12159e5bf4f56285bd9eb1c095" +checksum = "d30490df8338ad9f2c9b2e5766632083cd4b08f12b93994042c020e1c4604381" dependencies = [ "ansi_term", "anyhow", @@ -2590,15 +2590,18 @@ dependencies = [ "is-terminal", "log", "once_cell", + "regex", "rust-embed", - "sedregex", + "serde", + "thiserror", + "toml 0.8.19", ] [[package]] name = "dylint_linting" -version = "2.6.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43fc05c7103dfadd497486bbbf941899888f4e19271da70b58f66385247230c2" +checksum = "82b1935d10c8bbfa22ee0b54ef6c05bbb432d36dd048f2723a2a5dfefa77e414" dependencies = [ "cargo_metadata", "dylint_internal", @@ -2611,9 +2614,9 @@ dependencies = [ [[package]] name = "dylint_testing" -version = "2.6.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785fa52ac8fe5f1056a71955f4ebda3ca90c269ef28b172ad85a3901752d5fdf" +checksum = "ee051ff840d2cdc82574ce73c604bc01c0e204ec07ae8b297530b494dd0df319" dependencies = [ "anyhow", "cargo_metadata", @@ -2741,17 +2744,27 @@ dependencies = [ "syn 2.0.75", ] +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -4918,11 +4931,11 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.7" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +checksum = "52ffbca2f655e33c08be35d87278e5b18b89550a37dbd598c20db92f6a471123" dependencies = [ - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -6595,10 +6608,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "rustc-semver" -version = "1.1.0" +name = "rustc_apfloat" +version = "0.2.1+llvm-462a31f5a5ab" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84" +checksum = "886d94c63c812a8037c4faca2607453a0fa4cf82f734665266876b022244543f" +dependencies = [ + "bitflags 1.3.2", + "smallvec", +] [[package]] name = "rustc_version" @@ -6620,14 +6637,14 @@ dependencies = [ [[package]] name = "rustfix" -version = "0.6.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" +checksum = "70f5b7fc8060f4f8373f9381a630304b42e1183535d9beb1d3f596b236c9106a" dependencies = [ - "anyhow", - "log", "serde", "serde_json", + "thiserror", + "tracing", ] [[package]] @@ -6861,15 +6878,6 @@ dependencies = [ "libc", ] -[[package]] -name = "sedregex" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19411e23596093f03bbd11dc45603b6329bb4bfec77b9fd13e2b9fc9b02efe3e" -dependencies = [ - "regex", -] - [[package]] name = "semver" version = "0.11.0" @@ -7508,15 +7516,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.3.0" @@ -8572,6 +8571,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -8630,6 +8644,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -8642,6 +8662,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -8654,6 +8680,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -8672,6 +8704,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -8684,6 +8722,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -8696,6 +8740,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -8708,6 +8758,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/containerfiles/Dockerfile b/containerfiles/Dockerfile index 60ab39f3c4..82060b90b0 100644 --- a/containerfiles/Dockerfile +++ b/containerfiles/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM rust:1.76-bookworm AS rust +FROM --platform=$BUILDPLATFORM rust:1.81-bookworm AS rust WORKDIR /build/ diff --git a/crates/astria-bridge-withdrawer/src/bridge_withdrawer/startup.rs b/crates/astria-bridge-withdrawer/src/bridge_withdrawer/startup.rs index 36332fcdc2..14b139033c 100644 --- a/crates/astria-bridge-withdrawer/src/bridge_withdrawer/startup.rs +++ b/crates/astria-bridge-withdrawer/src/bridge_withdrawer/startup.rs @@ -447,7 +447,7 @@ async fn wait_for_empty_mempool( /// 1. The last transaction by the bridge account did not contain a withdrawal action. /// 2. The memo of the last transaction by the bridge account could not be parsed. /// 3. The block number in the memo of the last transaction by the bridge account could not be -/// converted to a u64. +/// converted to a u64. fn rollup_height_from_signed_transaction( signed_transaction: &SignedTransaction, ) -> eyre::Result { diff --git a/crates/astria-conductor/src/block_cache.rs b/crates/astria-conductor/src/block_cache.rs index 3b3b3b56e8..d477bbf4ea 100644 --- a/crates/astria-conductor/src/block_cache.rs +++ b/crates/astria-conductor/src/block_cache.rs @@ -105,9 +105,7 @@ impl BlockCache { pub(crate) enum Error { #[error("block at sequencer height {height} already in cache")] Occupied { height: u64 }, - #[error( - "block too old: expect sequencer height {current_height} or newer, got {block_height}" - )] + #[error("block too old: expect sequencer height {current_height} or newer, got {block_height}")] Old { block_height: u64, current_height: u64, diff --git a/crates/astria-conductor/src/lib.rs b/crates/astria-conductor/src/lib.rs index eb9e88c0db..4bda194839 100644 --- a/crates/astria-conductor/src/lib.rs +++ b/crates/astria-conductor/src/lib.rs @@ -1,9 +1,12 @@ //! # Astria Conductor +//! //! The Astria conductor connects the shared sequencer layer and the execution layer. //! When a block is received from the sequencer layer, the conductor pushes it to the execution //! layer. There are two ways for a block to be received: +//! //! - pushed from the shared-sequencer //! - via the data availability layer +//! //! In the first case, the block is pushed to the execution layer, executed, and added to the //! blockchain. It's marked as a soft commitment; the block is not regarded as finalized on the //! execution layer until it's received from the data availability layer. In the second case, the diff --git a/crates/astria-sequencer/src/app/test_utils.rs b/crates/astria-sequencer/src/app/test_utils.rs index afe705fb6e..0290b3ccf0 100644 --- a/crates/astria-sequencer/src/app/test_utils.rs +++ b/crates/astria-sequencer/src/app/test_utils.rs @@ -241,7 +241,6 @@ pub(crate) fn mock_tx( Arc::new(tx.into_signed(signer)) } -#[cfg_attr(feature = "test", allow(dead_code))] pub(crate) const MOCK_SEQUENCE_FEE: u128 = 10; pub(crate) fn denom_0() -> Denom { "denom_0".parse().unwrap() @@ -271,8 +270,6 @@ fn denom_6() -> Denom { "denom_6".parse().unwrap() } -#[cfg_attr(feature = "test", allow(dead_code))] - pub(crate) fn mock_balances( denom_0_balance: u128, denom_1_balance: u128, @@ -292,7 +289,6 @@ pub(crate) fn mock_balances( balances } -#[cfg_attr(feature = "test", allow(dead_code))] pub(crate) fn mock_tx_cost( denom_0_cost: u128, denom_1_cost: u128, diff --git a/crates/astria-sequencer/src/app/tests_execute_transaction.rs b/crates/astria-sequencer/src/app/tests_execute_transaction.rs index e2cd67b1e4..0d1c5cc188 100644 --- a/crates/astria-sequencer/src/app/tests_execute_transaction.rs +++ b/crates/astria-sequencer/src/app/tests_execute_transaction.rs @@ -154,7 +154,7 @@ async fn app_execute_transaction_transfer_not_native_token() { let mut state_tx = StateDelta::new(app.state.clone()); state_tx - .put_account_balance(alice_address, &test_asset(), value) + .put_account_balance(alice_address, test_asset(), value) .unwrap(); app.apply(state_tx); @@ -519,7 +519,7 @@ async fn app_execute_transaction_fee_asset_change_addition() { app.execute_transaction(signed_tx).await.unwrap(); assert_eq!(app.state.get_account_nonce(alice_address).await.unwrap(), 1); - assert!(app.state.is_allowed_fee_asset(&test_asset()).await.unwrap()); + assert!(app.state.is_allowed_fee_asset(test_asset()).await.unwrap()); } #[tokio::test] @@ -638,7 +638,7 @@ async fn app_execute_transaction_init_bridge_account_ok() { ); assert_eq!( app.state - .get_account_balance(alice_address, &nria()) + .get_account_balance(alice_address, nria()) .await .unwrap(), before_balance - fee, diff --git a/crates/astria-telemetry/src/metrics/builders.rs b/crates/astria-telemetry/src/metrics/builders.rs index d713b7ff48..4e3a202681 100644 --- a/crates/astria-telemetry/src/metrics/builders.rs +++ b/crates/astria-telemetry/src/metrics/builders.rs @@ -16,7 +16,7 @@ use metrics_exporter_prometheus::{ PrometheusRecorder, }; -#[cfg(docs)] +#[cfg(doc)] use super::{ Counter, Gauge, diff --git a/justfile b/justfile index ceeff571c7..1124be77b6 100644 --- a/justfile +++ b/justfile @@ -54,11 +54,11 @@ _fmt-all: [no-exit-message] _fmt-rust: - cargo +nightly-2024-02-07 fmt --all + cargo +nightly-2024-09-15 fmt --all [no-exit-message] _lint-rust: - cargo +nightly-2024-02-07 fmt --all -- --check + cargo +nightly-2024-09-15 fmt --all -- --check cargo clippy -- --warn clippy::pedantic cargo dylint --all diff --git a/lint/tracing_debug_field/Cargo.toml b/lint/tracing_debug_field/Cargo.toml index 3ba5d34b53..cfd3a0f183 100644 --- a/lint/tracing_debug_field/Cargo.toml +++ b/lint/tracing_debug_field/Cargo.toml @@ -13,12 +13,12 @@ name = "ui" path = "ui/main.rs" [dependencies] -clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "ac4c2094a6030530661bee3876e0228ddfeb6b8b" } -dylint_linting = "2.6.1" +clippy_utils = { git = "https://github.com/rust-lang/rust-clippy", rev = "a95afe2d0a2051d97b723b0b197393b7811bc4e4" } +dylint_linting = "3.2.0" if_chain = "1.0.2" [dev-dependencies] -dylint_testing = "2.6.1" +dylint_testing = "3.2.0" tracing = "0.1" [package.metadata.rust-analyzer] diff --git a/lint/tracing_debug_field/rust-toolchain b/lint/tracing_debug_field/rust-toolchain index 8c7951e24c..44bc11be7c 100644 --- a/lint/tracing_debug_field/rust-toolchain +++ b/lint/tracing_debug_field/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2023-12-28" +channel = "nightly-2024-09-05" components = ["llvm-tools-preview", "rustc-dev"] From 3da4de0b25b17dde42abe341f0b573628e067dc5 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Mon, 23 Sep 2024 13:11:19 +0200 Subject: [PATCH 2/6] commit rust-toolchain.toml --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 2 +- rust-toolchain.toml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ec7dbff91c..ccb50f2d67 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,7 +56,7 @@ jobs: toolchain: nightly-2024-09-15 components: rustfmt - name: run rustfmt - run: cargo fmt --all -- --check + run: cargo +nightly-2024-09-15 fmt --all -- --check toml: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f01a68c793..ef6b31ffd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ env: CI: true RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable" - # This must match the entry in rustup-toolchain.toml at the repository root + # This must match the entry in rust-toolchain.toml at the repository root RUSTUP_TOOLCHAIN: "1.81.0" on: pull_request: diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..dd2691e044 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.81.0" +components = ["cargo", "clippy", "rust-std", "rustc"] From 0429a78bbe3e3f650a098fd1fdffe0c2cccec4a0 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Mon, 23 Sep 2024 14:05:27 +0200 Subject: [PATCH 3/6] also update reusable-build.yml --- .github/workflows/reusable-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 95aa28545c..e3eedc167c 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -13,7 +13,7 @@ on: env: REGISTRY: ghcr.io FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }} - # This must match the entry in rustup-toolchain.toml at the repository root + # This must match the entry in rust-toolchain.toml at the repository root RUSTUP_TOOLCHAIN: "1.81.0" jobs: From 87cef36c7b33c35c5bdf73541661f154e2bb2d40 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 25 Sep 2024 14:26:27 +0200 Subject: [PATCH 4/6] lint dylint --- .github/workflows/test.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef6b31ffd8..1e888e2e85 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -260,12 +260,13 @@ jobs: with: version: "24.4" repo-token: ${{ secrets.GITHUB_TOKEN }} - # - name: run clippy against custom lints - # run: | - # : # list all lint packages here to have clippy explicitly test them - # cargo clippy --all-targets --all-features \ - # -p tracing_debug_field \ - # -- --warn clippy::pedantic --deny warnings + - name: run clippy against custom lints + run: | + : # list all lint packages here to have clippy explicitly test them + : # uses the same nightly installed above to work around the entry in rust-toolchain.toml + cargo clippy +nightly-2024-09-05 --all-targets --all-features \ + -p tracing_debug_field \ + -- --warn clippy::pedantic --deny warnings - name: run dylint clippy on workspace crates env: # set the dylint driver path to the target/ directory so that it's hopefully cached by rust-cache From e367f13fac793dcb2fc65d50be9df48bf4503b05 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 25 Sep 2024 14:36:24 +0200 Subject: [PATCH 5/6] correct form of invoking cargo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e888e2e85..a31d403208 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -264,7 +264,7 @@ jobs: run: | : # list all lint packages here to have clippy explicitly test them : # uses the same nightly installed above to work around the entry in rust-toolchain.toml - cargo clippy +nightly-2024-09-05 --all-targets --all-features \ + cargo +nightly-2024-09-05 clippy --all-targets --all-features \ -p tracing_debug_field \ -- --warn clippy::pedantic --deny warnings - name: run dylint clippy on workspace crates From 30250aa46ecf79bd81a9744efd263fe625f9306b Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 25 Sep 2024 14:41:21 +0200 Subject: [PATCH 6/6] allow deadcode --- lint/tracing_debug_field/ui/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lint/tracing_debug_field/ui/main.rs b/lint/tracing_debug_field/ui/main.rs index e45f102001..a278bfe4f4 100644 --- a/lint/tracing_debug_field/ui/main.rs +++ b/lint/tracing_debug_field/ui/main.rs @@ -1,5 +1,11 @@ +#[allow(clippy::all)] use tracing::info; +#[expect( + dead_code, + reason = "the type and its inner value are used by dylint to test generated code and have no \ + further meaning beyond that" +)] #[derive(Clone, Copy, Debug)] struct Wrapped(&'static str);