From dda57adcef51a2917ac8f2d62b9b18c63b7e2aff Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Fri, 6 Dec 2024 10:40:04 -0600 Subject: [PATCH 1/7] bump msrv --- .github/workflows/reusable-build.yml | 2 +- .github/workflows/test.yml | 2 +- crates/astria-bridge-contracts/Cargo.toml | 2 +- crates/astria-bridge-withdrawer/Cargo.toml | 2 +- crates/astria-build-info/Cargo.toml | 2 +- crates/astria-cli/Cargo.toml | 2 +- crates/astria-composer/Cargo.toml | 2 +- .../src/executor/bundle_factory/mod.rs | 4 ++-- crates/astria-conductor/Cargo.toml | 2 +- crates/astria-conductor/src/block_cache.rs | 2 +- crates/astria-conductor/src/celestia/reporting.rs | 6 +++--- crates/astria-conductor/src/executor/mod.rs | 2 ++ crates/astria-conductor/src/sequencer/reporting.rs | 4 ++-- crates/astria-config/Cargo.toml | 2 +- crates/astria-core-address/src/lib.rs | 2 +- crates/astria-core-crypto/Cargo.toml | 2 +- crates/astria-core/Cargo.toml | 2 +- crates/astria-core/src/generated/mod.rs | 3 ++- crates/astria-core/src/primitive/v1/asset/denom.rs | 10 +++++----- crates/astria-core/src/protocol/genesis/v1.rs | 6 ------ crates/astria-eyre/Cargo.toml | 2 +- crates/astria-grpc-mock-test/Cargo.toml | 2 +- crates/astria-grpc-mock-test/src/lib.rs | 3 ++- crates/astria-grpc-mock/Cargo.toml | 2 +- crates/astria-grpc-mock/src/mock_server.rs | 7 ++++--- crates/astria-merkle/Cargo.toml | 2 +- crates/astria-merkle/src/audit.rs | 4 ++-- crates/astria-merkle/src/lib.rs | 4 ++-- crates/astria-sequencer-client/Cargo.toml | 2 +- crates/astria-sequencer-relayer/Cargo.toml | 2 +- .../src/relayer/write/conversion.rs | 3 ++- .../src/relayer/write/mod.rs | 2 ++ .../blackbox/helpers/mock_sequencer_server.rs | 2 ++ crates/astria-sequencer-utils/Cargo.toml | 2 +- crates/astria-sequencer-utils/src/blob_parser.rs | 14 +++++++------- crates/astria-sequencer/Cargo.toml | 2 +- .../src/accounts/storage/values.rs | 4 ++-- .../src/app/storage/values/block_height.rs | 2 +- .../src/app/storage/values/block_timestamp.rs | 2 +- .../src/app/storage/values/chain_id.rs | 4 ++-- .../src/app/storage/values/revision_number.rs | 2 +- .../src/app/storage/values/storage_version.rs | 2 +- .../src/authority/storage/values.rs | 4 ++-- .../src/bridge/storage/values/address_bytes.rs | 2 +- .../src/bridge/storage/values/block_height.rs | 2 +- .../bridge/storage/values/ibc_prefixed_denom.rs | 2 +- .../src/bridge/storage/values/rollup_id.rs | 2 +- .../src/bridge/storage/values/transaction_id.rs | 2 +- .../src/grpc/storage/values/block_hash.rs | 2 +- .../src/grpc/storage/values/rollup_ids.rs | 2 +- .../src/grpc/storage/values/rollup_transactions.rs | 2 +- .../grpc/storage/values/sequencer_block_header.rs | 6 +++--- crates/astria-sequencer/src/ibc/storage/values.rs | 4 ++-- crates/astria-sequencer/src/mempool/mod.rs | 2 +- crates/astria-sequencer/src/storage/keys.rs | 8 ++++---- .../astria-sequencer/src/storage/stored_value.rs | 2 +- crates/astria-telemetry/Cargo.toml | 2 +- crates/astria-telemetry/src/display.rs | 4 ++-- crates/astria-telemetry/src/metrics/factories.rs | 6 +++--- crates/astria-test-utils/Cargo.toml | 2 +- rust-toolchain.toml | 2 +- 61 files changed, 97 insertions(+), 93 deletions(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 3d4c52c6d9..fedbd889ca 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -14,7 +14,7 @@ env: REGISTRY: ghcr.io FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }} # This must match the entry in rust-toolchain.toml at the repository root - RUSTUP_TOOLCHAIN: "1.81.0" + RUSTUP_TOOLCHAIN: "1.83.0" jobs: upload-binaries: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ebe04560b..12aa27d1bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ env: RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable" # This must match the entry in rust-toolchain.toml at the repository root - RUSTUP_TOOLCHAIN: "1.81.0" + RUSTUP_TOOLCHAIN: "1.83.0" on: pull_request: merge_group: diff --git a/crates/astria-bridge-contracts/Cargo.toml b/crates/astria-bridge-contracts/Cargo.toml index a398dc9d2a..ec539e6189 100644 --- a/crates/astria-bridge-contracts/Cargo.toml +++ b/crates/astria-bridge-contracts/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-bridge-contracts" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-bridge-withdrawer/Cargo.toml b/crates/astria-bridge-withdrawer/Cargo.toml index f5f50a2cc4..103f23ae8e 100644 --- a/crates/astria-bridge-withdrawer/Cargo.toml +++ b/crates/astria-bridge-withdrawer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-bridge-withdrawer" version = "1.0.1" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-build-info/Cargo.toml b/crates/astria-build-info/Cargo.toml index ceab67fe22..a6b7434702 100644 --- a/crates/astria-build-info/Cargo.toml +++ b/crates/astria-build-info/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-build-info" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-cli/Cargo.toml b/crates/astria-cli/Cargo.toml index eabf1c69b2..0dd1fca9fa 100644 --- a/crates/astria-cli/Cargo.toml +++ b/crates/astria-cli/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-cli" version = "0.5.1" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-composer/Cargo.toml b/crates/astria-composer/Cargo.toml index 5c62d2de7d..ac17b45de7 100644 --- a/crates/astria-composer/Cargo.toml +++ b/crates/astria-composer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-composer" version = "1.0.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-composer/src/executor/bundle_factory/mod.rs b/crates/astria-composer/src/executor/bundle_factory/mod.rs index f35eb89d95..81652d86b9 100644 --- a/crates/astria-composer/src/executor/bundle_factory/mod.rs +++ b/crates/astria-composer/src/executor/bundle_factory/mod.rs @@ -36,7 +36,7 @@ enum SizedBundleError { pub(super) struct SizedBundleReport<'a>(pub(super) &'a SizedBundle); -impl<'a> Serialize for SizedBundleReport<'a> { +impl Serialize for SizedBundleReport<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -277,7 +277,7 @@ pub(super) struct NextFinishedBundle<'a> { bundle_factory: &'a mut BundleFactory, } -impl<'a> NextFinishedBundle<'a> { +impl NextFinishedBundle<'_> { pub(super) fn pop(self) -> SizedBundle { self.bundle_factory .finished diff --git a/crates/astria-conductor/Cargo.toml b/crates/astria-conductor/Cargo.toml index 8dc3f608a8..7934612df9 100644 --- a/crates/astria-conductor/Cargo.toml +++ b/crates/astria-conductor/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-conductor" version = "1.0.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-conductor/src/block_cache.rs b/crates/astria-conductor/src/block_cache.rs index 344d2bbec5..2f6e1b8046 100644 --- a/crates/astria-conductor/src/block_cache.rs +++ b/crates/astria-conductor/src/block_cache.rs @@ -120,7 +120,7 @@ pin_project! { } } -impl<'a, T> Future for NextBlock<'a, T> { +impl Future for NextBlock<'_, T> { type Output = Option; fn poll( diff --git a/crates/astria-conductor/src/celestia/reporting.rs b/crates/astria-conductor/src/celestia/reporting.rs index cd16454b6f..684be8a326 100644 --- a/crates/astria-conductor/src/celestia/reporting.rs +++ b/crates/astria-conductor/src/celestia/reporting.rs @@ -12,7 +12,7 @@ use super::{ }; pub(super) struct ReportReconstructedBlocks<'a>(pub(super) &'a ReconstructedBlocks); -impl<'a> Serialize for ReportReconstructedBlocks<'a> { +impl Serialize for ReportReconstructedBlocks<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -26,7 +26,7 @@ impl<'a> Serialize for ReportReconstructedBlocks<'a> { } struct ReportReconstructedBlocksSeq<'a>(&'a [ReconstructedBlock]); -impl<'a> Serialize for ReportReconstructedBlocksSeq<'a> { +impl Serialize for ReportReconstructedBlocksSeq<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -40,7 +40,7 @@ impl<'a> Serialize for ReportReconstructedBlocksSeq<'a> { } struct ReportReconstructedBlock<'a>(&'a ReconstructedBlock); -impl<'a> Serialize for ReportReconstructedBlock<'a> { +impl Serialize for ReportReconstructedBlock<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/crates/astria-conductor/src/executor/mod.rs b/crates/astria-conductor/src/executor/mod.rs index 8c3155ca8b..1d5bed113e 100644 --- a/crates/astria-conductor/src/executor/mod.rs +++ b/crates/astria-conductor/src/executor/mod.rs @@ -153,6 +153,8 @@ impl Handle { Ok(()) } + // TODO(search_here): box the large variant to avoid large error size + #[expect(clippy::result_large_err, reason = "should be fixed")] pub(crate) fn try_send_firm_block( &self, block: ReconstructedBlock, diff --git a/crates/astria-conductor/src/sequencer/reporting.rs b/crates/astria-conductor/src/sequencer/reporting.rs index 779eb5762e..25dafd3a31 100644 --- a/crates/astria-conductor/src/sequencer/reporting.rs +++ b/crates/astria-conductor/src/sequencer/reporting.rs @@ -13,7 +13,7 @@ use serde::ser::{ }; pub(super) struct ReportFilteredSequencerBlock<'a>(pub(super) &'a FilteredSequencerBlock); -impl<'a> Serialize for ReportFilteredSequencerBlock<'a> { +impl Serialize for ReportFilteredSequencerBlock<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -27,7 +27,7 @@ impl<'a> Serialize for ReportFilteredSequencerBlock<'a> { struct ReportRollups<'a>(&'a IndexMap); -impl<'a> Serialize for ReportRollups<'a> { +impl Serialize for ReportRollups<'_> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/crates/astria-config/Cargo.toml b/crates/astria-config/Cargo.toml index 6672b75287..a8642f478b 100644 --- a/crates/astria-config/Cargo.toml +++ b/crates/astria-config/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-config" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core-address/src/lib.rs b/crates/astria-core-address/src/lib.rs index 3685222d87..43bbe74960 100644 --- a/crates/astria-core-address/src/lib.rs +++ b/crates/astria-core-address/src/lib.rs @@ -214,7 +214,7 @@ impl Builder { } } -impl<'a, 'b, TFormat, TBytesIter> Builder, WithPrefix<'b>> +impl Builder, WithPrefix<'_>> where TBytesIter: IntoIterator, TBytesIter::IntoIter: ExactSizeIterator, diff --git a/crates/astria-core-crypto/Cargo.toml b/crates/astria-core-crypto/Cargo.toml index 4e8b94bf7c..264cff2dfa 100644 --- a/crates/astria-core-crypto/Cargo.toml +++ b/crates/astria-core-crypto/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-core-crypto" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core/Cargo.toml b/crates/astria-core/Cargo.toml index b816e3fdf5..7003f1d9f6 100644 --- a/crates/astria-core/Cargo.toml +++ b/crates/astria-core/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-core" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core/src/generated/mod.rs b/crates/astria-core/src/generated/mod.rs index 41e186e2d7..1fef28c5e7 100644 --- a/crates/astria-core/src/generated/mod.rs +++ b/crates/astria-core/src/generated/mod.rs @@ -2,7 +2,8 @@ unreachable_pub, clippy::pedantic, clippy::needless_borrows_for_generic_args, - clippy::arithmetic_side_effects + clippy::arithmetic_side_effects, + clippy::needless_lifetimes )] //! Files generated using [`tonic-build`] and [`buf`] via the [`tools/protobuf-compiler`] //! build tool. diff --git a/crates/astria-core/src/primitive/v1/asset/denom.rs b/crates/astria-core/src/primitive/v1/asset/denom.rs index f85511bd54..0c1ead3558 100644 --- a/crates/astria-core/src/primitive/v1/asset/denom.rs +++ b/crates/astria-core/src/primitive/v1/asset/denom.rs @@ -99,13 +99,13 @@ impl From for Denom { } } -impl<'a> From<&'a IbcPrefixed> for Denom { +impl From<&IbcPrefixed> for Denom { fn from(value: &IbcPrefixed) -> Self { Self::IbcPrefixed(*value) } } -impl<'a> From<&'a TracePrefixed> for Denom { +impl From<&TracePrefixed> for Denom { fn from(value: &TracePrefixed) -> Self { Self::TracePrefixed(value.clone()) } @@ -117,7 +117,7 @@ impl From for IbcPrefixed { } } -impl<'a> From<&'a TracePrefixed> for IbcPrefixed { +impl From<&TracePrefixed> for IbcPrefixed { fn from(value: &TracePrefixed) -> Self { value.to_ibc_prefixed() } @@ -129,13 +129,13 @@ impl From for IbcPrefixed { } } -impl<'a> From<&'a Denom> for IbcPrefixed { +impl From<&Denom> for IbcPrefixed { fn from(value: &Denom) -> Self { value.to_ibc_prefixed() } } -impl<'a> From<&'a IbcPrefixed> for IbcPrefixed { +impl From<&IbcPrefixed> for IbcPrefixed { fn from(value: &IbcPrefixed) -> Self { *value } diff --git a/crates/astria-core/src/protocol/genesis/v1.rs b/crates/astria-core/src/protocol/genesis/v1.rs index 2dac7e1aae..d6102f23d3 100644 --- a/crates/astria-core/src/protocol/genesis/v1.rs +++ b/crates/astria-core/src/protocol/genesis/v1.rs @@ -152,12 +152,6 @@ impl Protobuf for GenesisAppState { type Error = GenesisAppStateError; type Raw = raw::GenesisAppState; - // TODO (https://github.com/astriaorg/astria/issues/1580): remove this once Rust is upgraded to/past 1.83 - #[expect( - clippy::allow_attributes, - clippy::allow_attributes_without_reason, - reason = "false positive on `allowed_fee_assets` due to \"allow\" in the name" - )] fn try_from_raw_ref(raw: &Self::Raw) -> Result { let Self::Raw { address_prefixes, diff --git a/crates/astria-eyre/Cargo.toml b/crates/astria-eyre/Cargo.toml index 6ee2bb106a..e0a63967e3 100644 --- a/crates/astria-eyre/Cargo.toml +++ b/crates/astria-eyre/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-eyre" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock-test/Cargo.toml b/crates/astria-grpc-mock-test/Cargo.toml index 1767b42a7f..be5638119d 100644 --- a/crates/astria-grpc-mock-test/Cargo.toml +++ b/crates/astria-grpc-mock-test/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-grpc-mock-test" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock-test/src/lib.rs b/crates/astria-grpc-mock-test/src/lib.rs index 6dad4f20cb..c1f9a2287e 100644 --- a/crates/astria-grpc-mock-test/src/lib.rs +++ b/crates/astria-grpc-mock-test/src/lib.rs @@ -8,7 +8,8 @@ #[expect( clippy::allow_attributes, clippy::allow_attributes_without_reason, - reason = "cannot prevent generated files from having allow attributes" + clippy::needless_lifetimes, + reason = "cannot prevent generated files from having allow attributes or specific lifetimes" )] pub mod health { include!("generated/grpc.health.v1.rs"); diff --git a/crates/astria-grpc-mock/Cargo.toml b/crates/astria-grpc-mock/Cargo.toml index 97f7c6a5b8..cb66c612d8 100644 --- a/crates/astria-grpc-mock/Cargo.toml +++ b/crates/astria-grpc-mock/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-grpc-mock" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock/src/mock_server.rs b/crates/astria-grpc-mock/src/mock_server.rs index dcbad3d806..4f78077e07 100644 --- a/crates/astria-grpc-mock/src/mock_server.rs +++ b/crates/astria-grpc-mock/src/mock_server.rs @@ -178,7 +178,7 @@ impl MockServer { if let VerificationOutcome::Failure(failed_verifications) = self.state.read().await.verify() { let received_requests_message = - received_requests_message(&self.state.read().await.received_requests); + received_requests_message(self.state.read().await.received_requests.as_ref()); let verifications_errors: String = failed_verifications.iter().fold(String::new(), |mut s, m| { @@ -366,7 +366,8 @@ impl Drop for MockGuard { if report.is_satisfied() { state.mock_set.deactivate(*mock_id); } else { - let received_requests_message = received_requests_message(&state.received_requests); + let received_requests_message = + received_requests_message(state.received_requests.as_ref()); let verifications_error = format!("- {}\n", report.error_message()); let error_message = format!( @@ -385,7 +386,7 @@ impl Drop for MockGuard { } fn received_requests_message( - received_requests: &Option>, + received_requests: Option<&Vec<(&'static str, MockRequest)>>, ) -> String { if let Some(received_requests) = received_requests { if received_requests.is_empty() { diff --git a/crates/astria-merkle/Cargo.toml b/crates/astria-merkle/Cargo.toml index 19af2d1aa3..be01e6458c 100644 --- a/crates/astria-merkle/Cargo.toml +++ b/crates/astria-merkle/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-merkle" version = "1.0.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-merkle/src/audit.rs b/crates/astria-merkle/src/audit.rs index ce524e0a74..b8b99329fd 100644 --- a/crates/astria-merkle/src/audit.rs +++ b/crates/astria-merkle/src/audit.rs @@ -141,7 +141,7 @@ impl<'a, TLeaf, TRoot> Audit<'a, TLeaf, TRoot> { } } -impl<'a, TRoot> Audit<'a, WithLeafHash, TRoot> { +impl Audit<'_, WithLeafHash, TRoot> { /// Reconstruct the root hash using the leaf hash stored in the [`WithLeafHash`] state. /// /// # Examples @@ -171,7 +171,7 @@ impl<'a, TRoot> Audit<'a, WithLeafHash, TRoot> { } } -impl<'a> Audit<'a, WithLeafHash, WithRoot> { +impl Audit<'_, WithLeafHash, WithRoot> { /// Check if the leaf is included in the tree using the internal proof. /// /// This method reconstructs a Merkle tree root starting from the diff --git a/crates/astria-merkle/src/lib.rs b/crates/astria-merkle/src/lib.rs index 9ca82b184a..2da5206752 100644 --- a/crates/astria-merkle/src/lib.rs +++ b/crates/astria-merkle/src/lib.rs @@ -184,7 +184,7 @@ pub struct LeafBuilder<'a> { hasher: Option, } -impl<'a> LeafBuilder<'a> { +impl LeafBuilder<'_> { /// Takes ownership of the builder, dropping it. /// /// This method causes the leaf builder to go out of scope, causing it @@ -232,7 +232,7 @@ impl<'a> LeafBuilder<'a> { } } -impl<'a> Drop for LeafBuilder<'a> { +impl Drop for LeafBuilder<'_> { fn drop(&mut self) { let Self { tree, diff --git a/crates/astria-sequencer-client/Cargo.toml b/crates/astria-sequencer-client/Cargo.toml index 1fa879ff12..1807b11c6c 100644 --- a/crates/astria-sequencer-client/Cargo.toml +++ b/crates/astria-sequencer-client/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-client" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.81.0" +rust-version = "1.83.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-relayer/Cargo.toml b/crates/astria-sequencer-relayer/Cargo.toml index a0eed0eb64..1d0589e932 100644 --- a/crates/astria-sequencer-relayer/Cargo.toml +++ b/crates/astria-sequencer-relayer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-relayer" version = "1.0.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.81.0" +rust-version = "1.83.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs index 82d425ff89..ad00a3cbd0 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs @@ -387,7 +387,7 @@ pin_project! { } } -impl<'a> Future for TakeSubmission<'a> { +impl Future for TakeSubmission<'_> { type Output = Option; fn poll(self: Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll { @@ -441,6 +441,7 @@ fn sequencer_namespace(metadata: &SubmittedMetadata) -> Namespace { ) } +#[expect(clippy::ref_option, reason = "necessary for serde impl")] fn serialize_opt_namespace( namespace: &Option, serializer: S, diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index bed9880a20..81db1ff239 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -93,6 +93,8 @@ impl BlobSubmitterHandle { /// Send a block to the blob submitter immediately. /// /// This is a thin wrapper around [`mpsc::Sender::try_send`]. + // TODO(search_here) + #[expect(clippy::result_large_err, reason = "should be fixed")] pub(super) fn try_send( &self, block: SequencerBlock, diff --git a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs index 33ff34d989..a12b02e52b 100644 --- a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs +++ b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs @@ -96,6 +96,8 @@ impl MockSequencerServer { } } +// TODO(search_here): box enum variants to avoid large sizes +#[expect(clippy::large_enum_variant, reason = "should be fixed")] pub enum SequencerBlockToMount { GoodAtHeight(u32), BadAtHeight(u32), diff --git a/crates/astria-sequencer-utils/Cargo.toml b/crates/astria-sequencer-utils/Cargo.toml index 2c2974577f..992a473948 100644 --- a/crates/astria-sequencer-utils/Cargo.toml +++ b/crates/astria-sequencer-utils/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-utils" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.81.0" +rust-version = "1.83.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-utils/src/blob_parser.rs b/crates/astria-sequencer-utils/src/blob_parser.rs index 6fb450ff90..131677019d 100644 --- a/crates/astria-sequencer-utils/src/blob_parser.rs +++ b/crates/astria-sequencer-utils/src/blob_parser.rs @@ -488,17 +488,17 @@ impl Display for RollupTransaction { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { colored_ln(f, "hash", &self.hash)?; colored_ln(f, "nonce", &self.nonce)?; - colored_ln(f, "block hash", none_or_value(&self.block_hash))?; - colored_ln(f, "block number", none_or_value(&self.block_number))?; + colored_ln(f, "block hash", none_or_value(self.block_hash.as_ref()))?; + colored_ln(f, "block number", none_or_value(self.block_number.as_ref()))?; colored_ln( f, "transaction index", - none_or_value(&self.transaction_index), + none_or_value(self.transaction_index.as_ref()), )?; colored_ln(f, "from", &self.from)?; - colored_ln(f, "to", none_or_value(&self.to))?; + colored_ln(f, "to", none_or_value(self.to.as_ref()))?; colored_ln(f, "value", &self.value)?; - colored_ln(f, "gas price", none_or_value(&self.gas_price))?; + colored_ln(f, "gas price", none_or_value(self.gas_price.as_ref()))?; colored_ln(f, "gas", &self.gas)?; colored_ln(f, "input", &self.input)?; colored_ln(f, "v", self.v)?; @@ -788,10 +788,10 @@ fn indent<'a, 'b>(f: &'a mut Formatter<'b>) -> indenter::Indented<'a, Formatter< indented(f).with_str(" ") } -fn none_or_value(maybe_value: &Option) -> String { +fn none_or_value(maybe_value: Option<&T>) -> String { maybe_value .as_ref() - .map_or("none".to_string(), T::to_string) + .map_or("none".to_string(), |o| o.to_string()) } fn colored_label(f: &mut Formatter<'_>, label: &str) -> fmt::Result { diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index a2b8ee67b7..cac7c5e45b 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer" version = "1.0.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.81.0" +rust-version = "1.83.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer/src/accounts/storage/values.rs b/crates/astria-sequencer/src/accounts/storage/values.rs index ca5f7b3977..9a771823ae 100644 --- a/crates/astria-sequencer/src/accounts/storage/values.rs +++ b/crates/astria-sequencer/src/accounts/storage/values.rs @@ -28,7 +28,7 @@ impl From for u128 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(balance: Balance) -> Self { crate::storage::StoredValue::Accounts(Value(ValueImpl::Balance(balance))) } @@ -61,7 +61,7 @@ impl From for u32 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(nonce: Nonce) -> Self { crate::storage::StoredValue::Accounts(Value(ValueImpl::Nonce(nonce))) } diff --git a/crates/astria-sequencer/src/app/storage/values/block_height.rs b/crates/astria-sequencer/src/app/storage/values/block_height.rs index 29b5298a47..c07102a4da 100644 --- a/crates/astria-sequencer/src/app/storage/values/block_height.rs +++ b/crates/astria-sequencer/src/app/storage/values/block_height.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(block_height: BlockHeight) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::BlockHeight(block_height))) } diff --git a/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs b/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs index 23aa4cddf3..6a28e3d087 100644 --- a/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs +++ b/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs @@ -49,7 +49,7 @@ impl BorshDeserialize for BlockTimestamp { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(block_timestamp: BlockTimestamp) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::BlockTimestamp(block_timestamp))) } diff --git a/crates/astria-sequencer/src/app/storage/values/chain_id.rs b/crates/astria-sequencer/src/app/storage/values/chain_id.rs index 0547029db4..237f204ec8 100644 --- a/crates/astria-sequencer/src/app/storage/values/chain_id.rs +++ b/crates/astria-sequencer/src/app/storage/values/chain_id.rs @@ -30,13 +30,13 @@ impl<'a> From> for tendermint::chain::Id { } } -impl<'a> BorshSerialize for ChainId<'a> { +impl BorshSerialize for ChainId<'_> { fn serialize(&self, writer: &mut W) -> std::io::Result<()> { self.0.as_str().serialize(writer) } } -impl<'a> BorshDeserialize for ChainId<'a> { +impl BorshDeserialize for ChainId<'_> { fn deserialize_reader(reader: &mut R) -> std::io::Result { let chain_id_str = String::deserialize_reader(reader)?; let chain_id = diff --git a/crates/astria-sequencer/src/app/storage/values/revision_number.rs b/crates/astria-sequencer/src/app/storage/values/revision_number.rs index d238b5b5ee..93e5c42a92 100644 --- a/crates/astria-sequencer/src/app/storage/values/revision_number.rs +++ b/crates/astria-sequencer/src/app/storage/values/revision_number.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(revision_number: RevisionNumber) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::RevisionNumber(revision_number))) } diff --git a/crates/astria-sequencer/src/app/storage/values/storage_version.rs b/crates/astria-sequencer/src/app/storage/values/storage_version.rs index 933f76b8fb..53e7a6f9ab 100644 --- a/crates/astria-sequencer/src/app/storage/values/storage_version.rs +++ b/crates/astria-sequencer/src/app/storage/values/storage_version.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(storage_version: StorageVersion) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::StorageVersion(storage_version))) } diff --git a/crates/astria-sequencer/src/authority/storage/values.rs b/crates/astria-sequencer/src/authority/storage/values.rs index 1c2aaaa4a1..a2e1a30957 100644 --- a/crates/astria-sequencer/src/authority/storage/values.rs +++ b/crates/astria-sequencer/src/authority/storage/values.rs @@ -36,7 +36,7 @@ enum ValueImpl<'a> { #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::authority) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl<'a> Debug for AddressBytes<'a> { +impl Debug for AddressBytes<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } @@ -75,7 +75,7 @@ impl<'a> TryFrom> for AddressBytes<'a> { #[derive(BorshSerialize, BorshDeserialize)] struct VerificationKey<'a>(Cow<'a, [u8; 32]>); -impl<'a> Debug for VerificationKey<'a> { +impl Debug for VerificationKey<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs b/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs index 73d1d016f0..d420cf3336 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs @@ -24,7 +24,7 @@ use crate::accounts::AddressBytes as DomainAddressBytes; #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl<'a> Debug for AddressBytes<'a> { +impl Debug for AddressBytes<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/block_height.rs b/crates/astria-sequencer/src/bridge/storage/values/block_height.rs index 1fe4edf48c..3c88824ac7 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/block_height.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/block_height.rs @@ -36,7 +36,7 @@ impl From for u64 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(block_height: BlockHeight) -> Self { crate::storage::StoredValue::Bridge(Value(ValueImpl::BlockHeight(block_height))) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs b/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs index 725af800d4..db8b23f91d 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct IbcPrefixedDenom<'a>(Cow<'a, [u8; 32]>); -impl<'a> Debug for IbcPrefixedDenom<'a> { +impl Debug for IbcPrefixedDenom<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs b/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs index 5a67daf7fb..dff8246b16 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct RollupId<'a>(Cow<'a, [u8; 32]>); -impl<'a> Debug for RollupId<'a> { +impl Debug for RollupId<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs b/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs index fa12a21f43..d752d3c635 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs @@ -26,7 +26,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct TransactionId<'a>(Cow<'a, [u8; TRANSACTION_ID_LEN]>); -impl<'a> Debug for TransactionId<'a> { +impl Debug for TransactionId<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", hex(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs b/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs index 4c772091ca..dea59d835a 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs @@ -22,7 +22,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::grpc) struct BlockHash<'a>(Cow<'a, [u8; 32]>); -impl<'a> Debug for BlockHash<'a> { +impl Debug for BlockHash<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs b/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs index 05575132af..d2bb6f6079 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(super) struct RollupId<'a>(Cow<'a, [u8; 32]>); -impl<'a> Debug for RollupId<'a> { +impl Debug for RollupId<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs b/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs index f54947e033..733c6f8be0 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs @@ -32,7 +32,7 @@ pub(in crate::grpc) struct RollupTransactions<'a> { proof: Proof<'a>, } -impl<'a> Debug for RollupTransactions<'a> { +impl Debug for RollupTransactions<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("RollupTransactions") .field("rollup_id", &self.rollup_id) diff --git a/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs b/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs index 0c53040cca..3c6f6ab622 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs @@ -45,13 +45,13 @@ impl<'a> From> for tendermint::chain::Id { } } -impl<'a> BorshSerialize for ChainId<'a> { +impl BorshSerialize for ChainId<'_> { fn serialize(&self, writer: &mut W) -> std::io::Result<()> { self.0.as_str().serialize(writer) } } -impl<'a> BorshDeserialize for ChainId<'a> { +impl BorshDeserialize for ChainId<'_> { fn deserialize_reader(reader: &mut R) -> std::io::Result { let chain_id_str = String::deserialize_reader(reader)?; let chain_id = @@ -106,7 +106,7 @@ pub(in crate::grpc) struct SequencerBlockHeader<'a> { proposer_address: [u8; ADDRESS_LEN], } -impl<'a> Debug for SequencerBlockHeader<'a> { +impl Debug for SequencerBlockHeader<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("SequencerBlockHeader") .field("chain_id", &self.chain_id) diff --git a/crates/astria-sequencer/src/ibc/storage/values.rs b/crates/astria-sequencer/src/ibc/storage/values.rs index f1a0783f89..ad35125058 100644 --- a/crates/astria-sequencer/src/ibc/storage/values.rs +++ b/crates/astria-sequencer/src/ibc/storage/values.rs @@ -41,7 +41,7 @@ impl From for u128 { } } -impl<'a> From for crate::storage::StoredValue<'a> { +impl From for crate::storage::StoredValue<'_> { fn from(balance: Balance) -> Self { crate::storage::StoredValue::Ibc(Value(ValueImpl::Balance(balance))) } @@ -61,7 +61,7 @@ impl<'a> TryFrom> for Balance { #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::ibc) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl<'a> Debug for AddressBytes<'a> { +impl Debug for AddressBytes<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/mempool/mod.rs b/crates/astria-sequencer/src/mempool/mod.rs index 68579620f4..2271f281dd 100644 --- a/crates/astria-sequencer/src/mempool/mod.rs +++ b/crates/astria-sequencer/src/mempool/mod.rs @@ -112,7 +112,7 @@ struct ContainedTxLock<'a> { txs: RwLockWriteGuard<'a, HashSet<[u8; 32]>>, } -impl<'a> ContainedTxLock<'a> { +impl ContainedTxLock<'_> { fn add(&mut self, id: [u8; 32]) { if !self.txs.insert(id) { self.mempool.metrics.increment_internal_logic_error(); diff --git a/crates/astria-sequencer/src/storage/keys.rs b/crates/astria-sequencer/src/storage/keys.rs index edf0333ba8..fba71e6beb 100644 --- a/crates/astria-sequencer/src/storage/keys.rs +++ b/crates/astria-sequencer/src/storage/keys.rs @@ -30,7 +30,7 @@ impl<'a, T> AccountPrefixer<'a, T> { } } -impl<'a, T: AddressBytes> Display for AccountPrefixer<'a, T> { +impl Display for AccountPrefixer<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { use base64::{ display::Base64Display, @@ -46,13 +46,13 @@ impl<'a, T: AddressBytes> Display for AccountPrefixer<'a, T> { #[cfg_attr(test, derive(Debug, PartialEq))] pub(crate) struct Asset<'a>(Cow<'a, IbcPrefixed>); -impl<'a> Asset<'a> { +impl Asset<'_> { pub(crate) fn get(self) -> IbcPrefixed { self.0.into_owned() } } -impl<'a> Display for Asset<'a> { +impl Display for Asset<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { self.0.fmt(f) } @@ -67,7 +67,7 @@ where } } -impl<'a> FromStr for Asset<'a> { +impl FromStr for Asset<'_> { type Err = ParseIbcPrefixedError; fn from_str(s: &str) -> Result { diff --git a/crates/astria-sequencer/src/storage/stored_value.rs b/crates/astria-sequencer/src/storage/stored_value.rs index 07164615e7..3fe203521b 100644 --- a/crates/astria-sequencer/src/storage/stored_value.rs +++ b/crates/astria-sequencer/src/storage/stored_value.rs @@ -21,7 +21,7 @@ pub(crate) enum StoredValue<'a> { Grpc(crate::grpc::storage::Value<'a>), } -impl<'a> StoredValue<'a> { +impl StoredValue<'_> { pub(crate) fn serialize(&self) -> Result> { borsh::to_vec(&self).wrap_err("failed to serialize stored value") } diff --git a/crates/astria-telemetry/Cargo.toml b/crates/astria-telemetry/Cargo.toml index 7cc30072a5..cb17bdcc92 100644 --- a/crates/astria-telemetry/Cargo.toml +++ b/crates/astria-telemetry/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-telemetry" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-telemetry/src/display.rs b/crates/astria-telemetry/src/display.rs index 3a1c9b98e5..c132f0c516 100644 --- a/crates/astria-telemetry/src/display.rs +++ b/crates/astria-telemetry/src/display.rs @@ -97,7 +97,7 @@ pub struct Json<'a, T>(&'a T); // NOTE: This implementation is lifted straight from serde_json: // https://docs.rs/serde_json/1.0.114/src/serde_json/value/mod.rs.html#197 -impl<'a, T> Display for Json<'a, T> +impl Display for Json<'_, T> where T: serde::Serialize, { @@ -106,7 +106,7 @@ where inner: &'a mut Formatter<'b>, } - impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> { + impl io::Write for WriterFormatter<'_, '_> { fn write(&mut self, buf: &[u8]) -> io::Result { // NOTE: Same argument for safety as in // https://docs.rs/serde_json/1.0.114/src/serde_json/value/mod.rs.html#229 diff --git a/crates/astria-telemetry/src/metrics/factories.rs b/crates/astria-telemetry/src/metrics/factories.rs index a3abc3b85c..bdd1549265 100644 --- a/crates/astria-telemetry/src/metrics/factories.rs +++ b/crates/astria-telemetry/src/metrics/factories.rs @@ -176,7 +176,7 @@ trait RegisterMetric { fn metric_type() -> &'static str; } -impl<'a> RegisterMetric for Factory<'a, Counter> { +impl RegisterMetric for Factory<'_, Counter> { fn register_metric(&self, key: &Key) -> Counter { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Counter::new(self.recorder.register_counter(key, &ignored_metadata)) @@ -187,7 +187,7 @@ impl<'a> RegisterMetric for Factory<'a, Counter> { } } -impl<'a> RegisterMetric for Factory<'a, Gauge> { +impl RegisterMetric for Factory<'_, Gauge> { fn register_metric(&self, key: &Key) -> Gauge { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Gauge::new(self.recorder.register_gauge(key, &ignored_metadata)) @@ -198,7 +198,7 @@ impl<'a> RegisterMetric for Factory<'a, Gauge> { } } -impl<'a> RegisterMetric for Factory<'a, Histogram> { +impl RegisterMetric for Factory<'_, Histogram> { fn register_metric(&self, key: &Key) -> Histogram { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Histogram::new(self.recorder.register_histogram(key, &ignored_metadata)) diff --git a/crates/astria-test-utils/Cargo.toml b/crates/astria-test-utils/Cargo.toml index 854cdd4b03..e7a551c1d6 100644 --- a/crates/astria-test-utils/Cargo.toml +++ b/crates/astria-test-utils/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-test-utils" version = "0.1.0" edition = "2021" -rust-version = "1.81.0" +rust-version = "1.83.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index dd2691e044..3a6eabc898 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.81.0" +channel = "1.83.0" components = ["cargo", "clippy", "rust-std", "rustc"] From 5e312453b0cee528d79fdd0ca1cfe83e31f36156 Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Fri, 6 Dec 2024 11:04:24 -0600 Subject: [PATCH 2/7] update changelogs, add issue links --- crates/astria-bridge-withdrawer/CHANGELOG.md | 4 ++++ crates/astria-cli/CHANGELOG.md | 1 + crates/astria-composer/CHANGELOG.md | 1 + crates/astria-conductor/CHANGELOG.md | 1 + crates/astria-conductor/src/executor/mod.rs | 2 +- crates/astria-core/CHANGELOG.md | 1 + crates/astria-sequencer-relayer/CHANGELOG.md | 1 + crates/astria-sequencer-relayer/src/relayer/write/mod.rs | 2 +- .../tests/blackbox/helpers/mock_sequencer_server.rs | 2 +- crates/astria-sequencer/CHANGELOG.md | 1 + 10 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/astria-bridge-withdrawer/CHANGELOG.md b/crates/astria-bridge-withdrawer/CHANGELOG.md index e298881919..d21d4ee034 100644 --- a/crates/astria-bridge-withdrawer/CHANGELOG.md +++ b/crates/astria-bridge-withdrawer/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.1] - 2024-11-01 +### Changed + +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). + ### Fixed - Set `batch_total_settled_value` metric to 0 when no withdrawals are settled [#1778](https://github.com/astriaorg/astria/pull/1768) diff --git a/crates/astria-cli/CHANGELOG.md b/crates/astria-cli/CHANGELOG.md index 8bb8637b8f..8508558da3 100644 --- a/crates/astria-cli/CHANGELOG.md +++ b/crates/astria-cli/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Removed default values from `--sequencer.chain-id` and `--sequencer-url` arguments [#1792](https://github.com/astriaorg/astria/pull/1792) diff --git a/crates/astria-composer/CHANGELOG.md b/crates/astria-composer/CHANGELOG.md index e430c3d066..dd50bdc9f8 100644 --- a/crates/astria-composer/CHANGELOG.md +++ b/crates/astria-composer/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-conductor/CHANGELOG.md b/crates/astria-conductor/CHANGELOG.md index eb75e304d5..62a9c54424 100644 --- a/crates/astria-conductor/CHANGELOG.md +++ b/crates/astria-conductor/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-conductor/src/executor/mod.rs b/crates/astria-conductor/src/executor/mod.rs index 1d5bed113e..bbd2ad64ed 100644 --- a/crates/astria-conductor/src/executor/mod.rs +++ b/crates/astria-conductor/src/executor/mod.rs @@ -153,7 +153,7 @@ impl Handle { Ok(()) } - // TODO(search_here): box the large variant to avoid large error size + // TODO(https://github.com/astriaorg/astria/issues/1858): box the large variant to avoid large error size #[expect(clippy::result_large_err, reason = "should be fixed")] pub(crate) fn try_send_firm_block( &self, diff --git a/crates/astria-core/CHANGELOG.md b/crates/astria-core/CHANGELOG.md index 0477f1767c..a563133ad1 100644 --- a/crates/astria-core/CHANGELOG.md +++ b/crates/astria-core/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Moved `astria_core::crypto` to `astria-core-crypto` and reexported `astria_core_crypto as crypto` (this change is transparent) [#1800](https://github.com/astriaorg/astria/pull/1800/) diff --git a/crates/astria-sequencer-relayer/CHANGELOG.md b/crates/astria-sequencer-relayer/CHANGELOG.md index 63d39156ac..b4e9a8e29a 100644 --- a/crates/astria-sequencer-relayer/CHANGELOG.md +++ b/crates/astria-sequencer-relayer/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index 81db1ff239..c967ab5fbe 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -93,7 +93,7 @@ impl BlobSubmitterHandle { /// Send a block to the blob submitter immediately. /// /// This is a thin wrapper around [`mpsc::Sender::try_send`]. - // TODO(search_here) + // TODO(https://github.com/astriaorg/astria/issues/1860) #[expect(clippy::result_large_err, reason = "should be fixed")] pub(super) fn try_send( &self, diff --git a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs index a12b02e52b..9a1405bc2a 100644 --- a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs +++ b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs @@ -96,7 +96,7 @@ impl MockSequencerServer { } } -// TODO(search_here): box enum variants to avoid large sizes +// TODO(https://github.com/astriaorg/astria/issues/1859): box enum variants to avoid large sizes #[expect(clippy::large_enum_variant, reason = "should be fixed")] pub enum SequencerBlockToMount { GoodAtHeight(u32), diff --git a/crates/astria-sequencer/CHANGELOG.md b/crates/astria-sequencer/CHANGELOG.md index 3fffea9a55..dc18afbc3d 100644 --- a/crates/astria-sequencer/CHANGELOG.md +++ b/crates/astria-sequencer/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786). - Consolidate action handling to single module [#1759](https://github.com/astriaorg/astria/pull/1759). - Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807). From b88948655b2dd0a1bc4aae98d5cf483c3c12a28b Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Fri, 6 Dec 2024 14:30:45 -0600 Subject: [PATCH 3/7] fix err --- crates/astria-sequencer-relayer/src/relayer/mod.rs | 2 +- crates/astria-sequencer-relayer/src/relayer/write/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/astria-sequencer-relayer/src/relayer/mod.rs b/crates/astria-sequencer-relayer/src/relayer/mod.rs index e4e58e0cb7..5dd28f6285 100644 --- a/crates/astria-sequencer-relayer/src/relayer/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/mod.rs @@ -302,7 +302,7 @@ impl Relayer { block_stream.pause(); debug!("block stream paused"); - match error { + match *error { TrySendError::Full(block) => { *forward = async move { submitter.send(block).await }.boxed().fuse(); } diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index c967ab5fbe..2cbc043704 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -98,8 +98,8 @@ impl BlobSubmitterHandle { pub(super) fn try_send( &self, block: SequencerBlock, - ) -> Result<(), TrySendError> { - self.tx.try_send(block) + ) -> Result<(), Box>> { + self.tx.try_send(block).map_err(Box::new) } /// Sends a block to the blob submitter. From 6a0de6579163028dc910ceb75fb7123cd31a0212 Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Fri, 6 Dec 2024 14:40:05 -0600 Subject: [PATCH 4/7] Revert "update changelogs, add issue links" This reverts commit 5e312453b0cee528d79fdd0ca1cfe83e31f36156. --- crates/astria-bridge-withdrawer/CHANGELOG.md | 4 ---- crates/astria-cli/CHANGELOG.md | 1 - crates/astria-composer/CHANGELOG.md | 1 - crates/astria-conductor/CHANGELOG.md | 1 - crates/astria-conductor/src/executor/mod.rs | 2 +- crates/astria-core/CHANGELOG.md | 1 - crates/astria-sequencer-relayer/CHANGELOG.md | 1 - crates/astria-sequencer-relayer/src/relayer/write/mod.rs | 2 +- .../tests/blackbox/helpers/mock_sequencer_server.rs | 2 +- crates/astria-sequencer/CHANGELOG.md | 1 - 10 files changed, 3 insertions(+), 13 deletions(-) diff --git a/crates/astria-bridge-withdrawer/CHANGELOG.md b/crates/astria-bridge-withdrawer/CHANGELOG.md index d21d4ee034..e298881919 100644 --- a/crates/astria-bridge-withdrawer/CHANGELOG.md +++ b/crates/astria-bridge-withdrawer/CHANGELOG.md @@ -11,10 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.1] - 2024-11-01 -### Changed - -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - ### Fixed - Set `batch_total_settled_value` metric to 0 when no withdrawals are settled [#1778](https://github.com/astriaorg/astria/pull/1768) diff --git a/crates/astria-cli/CHANGELOG.md b/crates/astria-cli/CHANGELOG.md index 8508558da3..8bb8637b8f 100644 --- a/crates/astria-cli/CHANGELOG.md +++ b/crates/astria-cli/CHANGELOG.md @@ -20,7 +20,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Removed default values from `--sequencer.chain-id` and `--sequencer-url` arguments [#1792](https://github.com/astriaorg/astria/pull/1792) diff --git a/crates/astria-composer/CHANGELOG.md b/crates/astria-composer/CHANGELOG.md index dd50bdc9f8..e430c3d066 100644 --- a/crates/astria-composer/CHANGELOG.md +++ b/crates/astria-composer/CHANGELOG.md @@ -13,7 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-conductor/CHANGELOG.md b/crates/astria-conductor/CHANGELOG.md index 62a9c54424..eb75e304d5 100644 --- a/crates/astria-conductor/CHANGELOG.md +++ b/crates/astria-conductor/CHANGELOG.md @@ -13,7 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-conductor/src/executor/mod.rs b/crates/astria-conductor/src/executor/mod.rs index bbd2ad64ed..1d5bed113e 100644 --- a/crates/astria-conductor/src/executor/mod.rs +++ b/crates/astria-conductor/src/executor/mod.rs @@ -153,7 +153,7 @@ impl Handle { Ok(()) } - // TODO(https://github.com/astriaorg/astria/issues/1858): box the large variant to avoid large error size + // TODO(search_here): box the large variant to avoid large error size #[expect(clippy::result_large_err, reason = "should be fixed")] pub(crate) fn try_send_firm_block( &self, diff --git a/crates/astria-core/CHANGELOG.md b/crates/astria-core/CHANGELOG.md index a563133ad1..0477f1767c 100644 --- a/crates/astria-core/CHANGELOG.md +++ b/crates/astria-core/CHANGELOG.md @@ -18,7 +18,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Moved `astria_core::crypto` to `astria-core-crypto` and reexported `astria_core_crypto as crypto` (this change is transparent) [#1800](https://github.com/astriaorg/astria/pull/1800/) diff --git a/crates/astria-sequencer-relayer/CHANGELOG.md b/crates/astria-sequencer-relayer/CHANGELOG.md index b4e9a8e29a..63d39156ac 100644 --- a/crates/astria-sequencer-relayer/CHANGELOG.md +++ b/crates/astria-sequencer-relayer/CHANGELOG.md @@ -13,7 +13,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Bump penumbra dependencies [#1740](https://github.com/astriaorg/astria/pull/1740). ## [1.0.0-rc.2] - 2024-10-23 diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index 2cbc043704..0fc9683e61 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -93,7 +93,7 @@ impl BlobSubmitterHandle { /// Send a block to the blob submitter immediately. /// /// This is a thin wrapper around [`mpsc::Sender::try_send`]. - // TODO(https://github.com/astriaorg/astria/issues/1860) + // TODO(search_here) #[expect(clippy::result_large_err, reason = "should be fixed")] pub(super) fn try_send( &self, diff --git a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs index 9a1405bc2a..a12b02e52b 100644 --- a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs +++ b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs @@ -96,7 +96,7 @@ impl MockSequencerServer { } } -// TODO(https://github.com/astriaorg/astria/issues/1859): box enum variants to avoid large sizes +// TODO(search_here): box enum variants to avoid large sizes #[expect(clippy::large_enum_variant, reason = "should be fixed")] pub enum SequencerBlockToMount { GoodAtHeight(u32), diff --git a/crates/astria-sequencer/CHANGELOG.md b/crates/astria-sequencer/CHANGELOG.md index dc18afbc3d..3fffea9a55 100644 --- a/crates/astria-sequencer/CHANGELOG.md +++ b/crates/astria-sequencer/CHANGELOG.md @@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Bump MSRV to 1.83.0 [#1857](https://github.com/astriaorg/astria/pull/1857). - Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786). - Consolidate action handling to single module [#1759](https://github.com/astriaorg/astria/pull/1759). - Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807). From a7e6ef5e086b8f594d8291037acb4a32c01cc420 Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Fri, 6 Dec 2024 14:40:13 -0600 Subject: [PATCH 5/7] Revert "bump msrv" This reverts commit dda57adcef51a2917ac8f2d62b9b18c63b7e2aff. --- .github/workflows/reusable-build.yml | 2 +- .github/workflows/test.yml | 2 +- crates/astria-bridge-contracts/Cargo.toml | 2 +- crates/astria-bridge-withdrawer/Cargo.toml | 2 +- crates/astria-build-info/Cargo.toml | 2 +- crates/astria-cli/Cargo.toml | 2 +- crates/astria-composer/Cargo.toml | 2 +- .../src/executor/bundle_factory/mod.rs | 4 ++-- crates/astria-conductor/Cargo.toml | 2 +- crates/astria-conductor/src/block_cache.rs | 2 +- crates/astria-conductor/src/celestia/reporting.rs | 6 +++--- crates/astria-conductor/src/executor/mod.rs | 2 -- crates/astria-conductor/src/sequencer/reporting.rs | 4 ++-- crates/astria-config/Cargo.toml | 2 +- crates/astria-core-address/src/lib.rs | 2 +- crates/astria-core-crypto/Cargo.toml | 2 +- crates/astria-core/Cargo.toml | 2 +- crates/astria-core/src/generated/mod.rs | 3 +-- crates/astria-core/src/primitive/v1/asset/denom.rs | 10 +++++----- crates/astria-core/src/protocol/genesis/v1.rs | 6 ++++++ crates/astria-eyre/Cargo.toml | 2 +- crates/astria-grpc-mock-test/Cargo.toml | 2 +- crates/astria-grpc-mock-test/src/lib.rs | 3 +-- crates/astria-grpc-mock/Cargo.toml | 2 +- crates/astria-grpc-mock/src/mock_server.rs | 7 +++---- crates/astria-merkle/Cargo.toml | 2 +- crates/astria-merkle/src/audit.rs | 4 ++-- crates/astria-merkle/src/lib.rs | 4 ++-- crates/astria-sequencer-client/Cargo.toml | 2 +- crates/astria-sequencer-relayer/Cargo.toml | 2 +- .../src/relayer/write/conversion.rs | 3 +-- .../src/relayer/write/mod.rs | 2 -- .../blackbox/helpers/mock_sequencer_server.rs | 2 -- crates/astria-sequencer-utils/Cargo.toml | 2 +- crates/astria-sequencer-utils/src/blob_parser.rs | 14 +++++++------- crates/astria-sequencer/Cargo.toml | 2 +- .../src/accounts/storage/values.rs | 4 ++-- .../src/app/storage/values/block_height.rs | 2 +- .../src/app/storage/values/block_timestamp.rs | 2 +- .../src/app/storage/values/chain_id.rs | 4 ++-- .../src/app/storage/values/revision_number.rs | 2 +- .../src/app/storage/values/storage_version.rs | 2 +- .../src/authority/storage/values.rs | 4 ++-- .../src/bridge/storage/values/address_bytes.rs | 2 +- .../src/bridge/storage/values/block_height.rs | 2 +- .../bridge/storage/values/ibc_prefixed_denom.rs | 2 +- .../src/bridge/storage/values/rollup_id.rs | 2 +- .../src/bridge/storage/values/transaction_id.rs | 2 +- .../src/grpc/storage/values/block_hash.rs | 2 +- .../src/grpc/storage/values/rollup_ids.rs | 2 +- .../src/grpc/storage/values/rollup_transactions.rs | 2 +- .../grpc/storage/values/sequencer_block_header.rs | 6 +++--- crates/astria-sequencer/src/ibc/storage/values.rs | 4 ++-- crates/astria-sequencer/src/mempool/mod.rs | 2 +- crates/astria-sequencer/src/storage/keys.rs | 8 ++++---- .../astria-sequencer/src/storage/stored_value.rs | 2 +- crates/astria-telemetry/Cargo.toml | 2 +- crates/astria-telemetry/src/display.rs | 4 ++-- crates/astria-telemetry/src/metrics/factories.rs | 6 +++--- crates/astria-test-utils/Cargo.toml | 2 +- rust-toolchain.toml | 2 +- 61 files changed, 93 insertions(+), 97 deletions(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index fedbd889ca..3d4c52c6d9 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -14,7 +14,7 @@ env: REGISTRY: ghcr.io FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }} # This must match the entry in rust-toolchain.toml at the repository root - RUSTUP_TOOLCHAIN: "1.83.0" + RUSTUP_TOOLCHAIN: "1.81.0" jobs: upload-binaries: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 12aa27d1bd..0ebe04560b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ env: RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable" # This must match the entry in rust-toolchain.toml at the repository root - RUSTUP_TOOLCHAIN: "1.83.0" + RUSTUP_TOOLCHAIN: "1.81.0" on: pull_request: merge_group: diff --git a/crates/astria-bridge-contracts/Cargo.toml b/crates/astria-bridge-contracts/Cargo.toml index ec539e6189..a398dc9d2a 100644 --- a/crates/astria-bridge-contracts/Cargo.toml +++ b/crates/astria-bridge-contracts/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-bridge-contracts" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-bridge-withdrawer/Cargo.toml b/crates/astria-bridge-withdrawer/Cargo.toml index 103f23ae8e..f5f50a2cc4 100644 --- a/crates/astria-bridge-withdrawer/Cargo.toml +++ b/crates/astria-bridge-withdrawer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-bridge-withdrawer" version = "1.0.1" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-build-info/Cargo.toml b/crates/astria-build-info/Cargo.toml index a6b7434702..ceab67fe22 100644 --- a/crates/astria-build-info/Cargo.toml +++ b/crates/astria-build-info/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-build-info" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-cli/Cargo.toml b/crates/astria-cli/Cargo.toml index 0dd1fca9fa..eabf1c69b2 100644 --- a/crates/astria-cli/Cargo.toml +++ b/crates/astria-cli/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-cli" version = "0.5.1" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-composer/Cargo.toml b/crates/astria-composer/Cargo.toml index ac17b45de7..5c62d2de7d 100644 --- a/crates/astria-composer/Cargo.toml +++ b/crates/astria-composer/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-composer" version = "1.0.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-composer/src/executor/bundle_factory/mod.rs b/crates/astria-composer/src/executor/bundle_factory/mod.rs index 81652d86b9..f35eb89d95 100644 --- a/crates/astria-composer/src/executor/bundle_factory/mod.rs +++ b/crates/astria-composer/src/executor/bundle_factory/mod.rs @@ -36,7 +36,7 @@ enum SizedBundleError { pub(super) struct SizedBundleReport<'a>(pub(super) &'a SizedBundle); -impl Serialize for SizedBundleReport<'_> { +impl<'a> Serialize for SizedBundleReport<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -277,7 +277,7 @@ pub(super) struct NextFinishedBundle<'a> { bundle_factory: &'a mut BundleFactory, } -impl NextFinishedBundle<'_> { +impl<'a> NextFinishedBundle<'a> { pub(super) fn pop(self) -> SizedBundle { self.bundle_factory .finished diff --git a/crates/astria-conductor/Cargo.toml b/crates/astria-conductor/Cargo.toml index 7934612df9..8dc3f608a8 100644 --- a/crates/astria-conductor/Cargo.toml +++ b/crates/astria-conductor/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-conductor" version = "1.0.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-conductor/src/block_cache.rs b/crates/astria-conductor/src/block_cache.rs index 2f6e1b8046..344d2bbec5 100644 --- a/crates/astria-conductor/src/block_cache.rs +++ b/crates/astria-conductor/src/block_cache.rs @@ -120,7 +120,7 @@ pin_project! { } } -impl Future for NextBlock<'_, T> { +impl<'a, T> Future for NextBlock<'a, T> { type Output = Option; fn poll( diff --git a/crates/astria-conductor/src/celestia/reporting.rs b/crates/astria-conductor/src/celestia/reporting.rs index 684be8a326..cd16454b6f 100644 --- a/crates/astria-conductor/src/celestia/reporting.rs +++ b/crates/astria-conductor/src/celestia/reporting.rs @@ -12,7 +12,7 @@ use super::{ }; pub(super) struct ReportReconstructedBlocks<'a>(pub(super) &'a ReconstructedBlocks); -impl Serialize for ReportReconstructedBlocks<'_> { +impl<'a> Serialize for ReportReconstructedBlocks<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -26,7 +26,7 @@ impl Serialize for ReportReconstructedBlocks<'_> { } struct ReportReconstructedBlocksSeq<'a>(&'a [ReconstructedBlock]); -impl Serialize for ReportReconstructedBlocksSeq<'_> { +impl<'a> Serialize for ReportReconstructedBlocksSeq<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -40,7 +40,7 @@ impl Serialize for ReportReconstructedBlocksSeq<'_> { } struct ReportReconstructedBlock<'a>(&'a ReconstructedBlock); -impl Serialize for ReportReconstructedBlock<'_> { +impl<'a> Serialize for ReportReconstructedBlock<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/crates/astria-conductor/src/executor/mod.rs b/crates/astria-conductor/src/executor/mod.rs index 1d5bed113e..8c3155ca8b 100644 --- a/crates/astria-conductor/src/executor/mod.rs +++ b/crates/astria-conductor/src/executor/mod.rs @@ -153,8 +153,6 @@ impl Handle { Ok(()) } - // TODO(search_here): box the large variant to avoid large error size - #[expect(clippy::result_large_err, reason = "should be fixed")] pub(crate) fn try_send_firm_block( &self, block: ReconstructedBlock, diff --git a/crates/astria-conductor/src/sequencer/reporting.rs b/crates/astria-conductor/src/sequencer/reporting.rs index 25dafd3a31..779eb5762e 100644 --- a/crates/astria-conductor/src/sequencer/reporting.rs +++ b/crates/astria-conductor/src/sequencer/reporting.rs @@ -13,7 +13,7 @@ use serde::ser::{ }; pub(super) struct ReportFilteredSequencerBlock<'a>(pub(super) &'a FilteredSequencerBlock); -impl Serialize for ReportFilteredSequencerBlock<'_> { +impl<'a> Serialize for ReportFilteredSequencerBlock<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, @@ -27,7 +27,7 @@ impl Serialize for ReportFilteredSequencerBlock<'_> { struct ReportRollups<'a>(&'a IndexMap); -impl Serialize for ReportRollups<'_> { +impl<'a> Serialize for ReportRollups<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, diff --git a/crates/astria-config/Cargo.toml b/crates/astria-config/Cargo.toml index a8642f478b..6672b75287 100644 --- a/crates/astria-config/Cargo.toml +++ b/crates/astria-config/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-config" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core-address/src/lib.rs b/crates/astria-core-address/src/lib.rs index 43bbe74960..3685222d87 100644 --- a/crates/astria-core-address/src/lib.rs +++ b/crates/astria-core-address/src/lib.rs @@ -214,7 +214,7 @@ impl Builder { } } -impl Builder, WithPrefix<'_>> +impl<'a, 'b, TFormat, TBytesIter> Builder, WithPrefix<'b>> where TBytesIter: IntoIterator, TBytesIter::IntoIter: ExactSizeIterator, diff --git a/crates/astria-core-crypto/Cargo.toml b/crates/astria-core-crypto/Cargo.toml index 264cff2dfa..4e8b94bf7c 100644 --- a/crates/astria-core-crypto/Cargo.toml +++ b/crates/astria-core-crypto/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-core-crypto" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core/Cargo.toml b/crates/astria-core/Cargo.toml index 7003f1d9f6..b816e3fdf5 100644 --- a/crates/astria-core/Cargo.toml +++ b/crates/astria-core/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-core" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-core/src/generated/mod.rs b/crates/astria-core/src/generated/mod.rs index 1fef28c5e7..41e186e2d7 100644 --- a/crates/astria-core/src/generated/mod.rs +++ b/crates/astria-core/src/generated/mod.rs @@ -2,8 +2,7 @@ unreachable_pub, clippy::pedantic, clippy::needless_borrows_for_generic_args, - clippy::arithmetic_side_effects, - clippy::needless_lifetimes + clippy::arithmetic_side_effects )] //! Files generated using [`tonic-build`] and [`buf`] via the [`tools/protobuf-compiler`] //! build tool. diff --git a/crates/astria-core/src/primitive/v1/asset/denom.rs b/crates/astria-core/src/primitive/v1/asset/denom.rs index 0c1ead3558..f85511bd54 100644 --- a/crates/astria-core/src/primitive/v1/asset/denom.rs +++ b/crates/astria-core/src/primitive/v1/asset/denom.rs @@ -99,13 +99,13 @@ impl From for Denom { } } -impl From<&IbcPrefixed> for Denom { +impl<'a> From<&'a IbcPrefixed> for Denom { fn from(value: &IbcPrefixed) -> Self { Self::IbcPrefixed(*value) } } -impl From<&TracePrefixed> for Denom { +impl<'a> From<&'a TracePrefixed> for Denom { fn from(value: &TracePrefixed) -> Self { Self::TracePrefixed(value.clone()) } @@ -117,7 +117,7 @@ impl From for IbcPrefixed { } } -impl From<&TracePrefixed> for IbcPrefixed { +impl<'a> From<&'a TracePrefixed> for IbcPrefixed { fn from(value: &TracePrefixed) -> Self { value.to_ibc_prefixed() } @@ -129,13 +129,13 @@ impl From for IbcPrefixed { } } -impl From<&Denom> for IbcPrefixed { +impl<'a> From<&'a Denom> for IbcPrefixed { fn from(value: &Denom) -> Self { value.to_ibc_prefixed() } } -impl From<&IbcPrefixed> for IbcPrefixed { +impl<'a> From<&'a IbcPrefixed> for IbcPrefixed { fn from(value: &IbcPrefixed) -> Self { *value } diff --git a/crates/astria-core/src/protocol/genesis/v1.rs b/crates/astria-core/src/protocol/genesis/v1.rs index d6102f23d3..2dac7e1aae 100644 --- a/crates/astria-core/src/protocol/genesis/v1.rs +++ b/crates/astria-core/src/protocol/genesis/v1.rs @@ -152,6 +152,12 @@ impl Protobuf for GenesisAppState { type Error = GenesisAppStateError; type Raw = raw::GenesisAppState; + // TODO (https://github.com/astriaorg/astria/issues/1580): remove this once Rust is upgraded to/past 1.83 + #[expect( + clippy::allow_attributes, + clippy::allow_attributes_without_reason, + reason = "false positive on `allowed_fee_assets` due to \"allow\" in the name" + )] fn try_from_raw_ref(raw: &Self::Raw) -> Result { let Self::Raw { address_prefixes, diff --git a/crates/astria-eyre/Cargo.toml b/crates/astria-eyre/Cargo.toml index e0a63967e3..6ee2bb106a 100644 --- a/crates/astria-eyre/Cargo.toml +++ b/crates/astria-eyre/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-eyre" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock-test/Cargo.toml b/crates/astria-grpc-mock-test/Cargo.toml index be5638119d..1767b42a7f 100644 --- a/crates/astria-grpc-mock-test/Cargo.toml +++ b/crates/astria-grpc-mock-test/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-grpc-mock-test" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock-test/src/lib.rs b/crates/astria-grpc-mock-test/src/lib.rs index c1f9a2287e..6dad4f20cb 100644 --- a/crates/astria-grpc-mock-test/src/lib.rs +++ b/crates/astria-grpc-mock-test/src/lib.rs @@ -8,8 +8,7 @@ #[expect( clippy::allow_attributes, clippy::allow_attributes_without_reason, - clippy::needless_lifetimes, - reason = "cannot prevent generated files from having allow attributes or specific lifetimes" + reason = "cannot prevent generated files from having allow attributes" )] pub mod health { include!("generated/grpc.health.v1.rs"); diff --git a/crates/astria-grpc-mock/Cargo.toml b/crates/astria-grpc-mock/Cargo.toml index cb66c612d8..97f7c6a5b8 100644 --- a/crates/astria-grpc-mock/Cargo.toml +++ b/crates/astria-grpc-mock/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-grpc-mock" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/astria-grpc-mock/src/mock_server.rs b/crates/astria-grpc-mock/src/mock_server.rs index 4f78077e07..dcbad3d806 100644 --- a/crates/astria-grpc-mock/src/mock_server.rs +++ b/crates/astria-grpc-mock/src/mock_server.rs @@ -178,7 +178,7 @@ impl MockServer { if let VerificationOutcome::Failure(failed_verifications) = self.state.read().await.verify() { let received_requests_message = - received_requests_message(self.state.read().await.received_requests.as_ref()); + received_requests_message(&self.state.read().await.received_requests); let verifications_errors: String = failed_verifications.iter().fold(String::new(), |mut s, m| { @@ -366,8 +366,7 @@ impl Drop for MockGuard { if report.is_satisfied() { state.mock_set.deactivate(*mock_id); } else { - let received_requests_message = - received_requests_message(state.received_requests.as_ref()); + let received_requests_message = received_requests_message(&state.received_requests); let verifications_error = format!("- {}\n", report.error_message()); let error_message = format!( @@ -386,7 +385,7 @@ impl Drop for MockGuard { } fn received_requests_message( - received_requests: Option<&Vec<(&'static str, MockRequest)>>, + received_requests: &Option>, ) -> String { if let Some(received_requests) = received_requests { if received_requests.is_empty() { diff --git a/crates/astria-merkle/Cargo.toml b/crates/astria-merkle/Cargo.toml index be01e6458c..19af2d1aa3 100644 --- a/crates/astria-merkle/Cargo.toml +++ b/crates/astria-merkle/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-merkle" version = "1.0.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-merkle/src/audit.rs b/crates/astria-merkle/src/audit.rs index b8b99329fd..ce524e0a74 100644 --- a/crates/astria-merkle/src/audit.rs +++ b/crates/astria-merkle/src/audit.rs @@ -141,7 +141,7 @@ impl<'a, TLeaf, TRoot> Audit<'a, TLeaf, TRoot> { } } -impl Audit<'_, WithLeafHash, TRoot> { +impl<'a, TRoot> Audit<'a, WithLeafHash, TRoot> { /// Reconstruct the root hash using the leaf hash stored in the [`WithLeafHash`] state. /// /// # Examples @@ -171,7 +171,7 @@ impl Audit<'_, WithLeafHash, TRoot> { } } -impl Audit<'_, WithLeafHash, WithRoot> { +impl<'a> Audit<'a, WithLeafHash, WithRoot> { /// Check if the leaf is included in the tree using the internal proof. /// /// This method reconstructs a Merkle tree root starting from the diff --git a/crates/astria-merkle/src/lib.rs b/crates/astria-merkle/src/lib.rs index 2da5206752..9ca82b184a 100644 --- a/crates/astria-merkle/src/lib.rs +++ b/crates/astria-merkle/src/lib.rs @@ -184,7 +184,7 @@ pub struct LeafBuilder<'a> { hasher: Option, } -impl LeafBuilder<'_> { +impl<'a> LeafBuilder<'a> { /// Takes ownership of the builder, dropping it. /// /// This method causes the leaf builder to go out of scope, causing it @@ -232,7 +232,7 @@ impl LeafBuilder<'_> { } } -impl Drop for LeafBuilder<'_> { +impl<'a> Drop for LeafBuilder<'a> { fn drop(&mut self) { let Self { tree, diff --git a/crates/astria-sequencer-client/Cargo.toml b/crates/astria-sequencer-client/Cargo.toml index 1807b11c6c..1fa879ff12 100644 --- a/crates/astria-sequencer-client/Cargo.toml +++ b/crates/astria-sequencer-client/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-client" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.83.0" +rust-version = "1.81.0" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-relayer/Cargo.toml b/crates/astria-sequencer-relayer/Cargo.toml index 1d0589e932..a0eed0eb64 100644 --- a/crates/astria-sequencer-relayer/Cargo.toml +++ b/crates/astria-sequencer-relayer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-relayer" version = "1.0.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.83.0" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs index ad00a3cbd0..82d425ff89 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/conversion.rs @@ -387,7 +387,7 @@ pin_project! { } } -impl Future for TakeSubmission<'_> { +impl<'a> Future for TakeSubmission<'a> { type Output = Option; fn poll(self: Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll { @@ -441,7 +441,6 @@ fn sequencer_namespace(metadata: &SubmittedMetadata) -> Namespace { ) } -#[expect(clippy::ref_option, reason = "necessary for serde impl")] fn serialize_opt_namespace( namespace: &Option, serializer: S, diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index 0fc9683e61..086da7b0f4 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -93,8 +93,6 @@ impl BlobSubmitterHandle { /// Send a block to the blob submitter immediately. /// /// This is a thin wrapper around [`mpsc::Sender::try_send`]. - // TODO(search_here) - #[expect(clippy::result_large_err, reason = "should be fixed")] pub(super) fn try_send( &self, block: SequencerBlock, diff --git a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs index a12b02e52b..33ff34d989 100644 --- a/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs +++ b/crates/astria-sequencer-relayer/tests/blackbox/helpers/mock_sequencer_server.rs @@ -96,8 +96,6 @@ impl MockSequencerServer { } } -// TODO(search_here): box enum variants to avoid large sizes -#[expect(clippy::large_enum_variant, reason = "should be fixed")] pub enum SequencerBlockToMount { GoodAtHeight(u32), BadAtHeight(u32), diff --git a/crates/astria-sequencer-utils/Cargo.toml b/crates/astria-sequencer-utils/Cargo.toml index 992a473948..2c2974577f 100644 --- a/crates/astria-sequencer-utils/Cargo.toml +++ b/crates/astria-sequencer-utils/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer-utils" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.83.0" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer-utils/src/blob_parser.rs b/crates/astria-sequencer-utils/src/blob_parser.rs index 131677019d..6fb450ff90 100644 --- a/crates/astria-sequencer-utils/src/blob_parser.rs +++ b/crates/astria-sequencer-utils/src/blob_parser.rs @@ -488,17 +488,17 @@ impl Display for RollupTransaction { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { colored_ln(f, "hash", &self.hash)?; colored_ln(f, "nonce", &self.nonce)?; - colored_ln(f, "block hash", none_or_value(self.block_hash.as_ref()))?; - colored_ln(f, "block number", none_or_value(self.block_number.as_ref()))?; + colored_ln(f, "block hash", none_or_value(&self.block_hash))?; + colored_ln(f, "block number", none_or_value(&self.block_number))?; colored_ln( f, "transaction index", - none_or_value(self.transaction_index.as_ref()), + none_or_value(&self.transaction_index), )?; colored_ln(f, "from", &self.from)?; - colored_ln(f, "to", none_or_value(self.to.as_ref()))?; + colored_ln(f, "to", none_or_value(&self.to))?; colored_ln(f, "value", &self.value)?; - colored_ln(f, "gas price", none_or_value(self.gas_price.as_ref()))?; + colored_ln(f, "gas price", none_or_value(&self.gas_price))?; colored_ln(f, "gas", &self.gas)?; colored_ln(f, "input", &self.input)?; colored_ln(f, "v", self.v)?; @@ -788,10 +788,10 @@ fn indent<'a, 'b>(f: &'a mut Formatter<'b>) -> indenter::Indented<'a, Formatter< indented(f).with_str(" ") } -fn none_or_value(maybe_value: Option<&T>) -> String { +fn none_or_value(maybe_value: &Option) -> String { maybe_value .as_ref() - .map_or("none".to_string(), |o| o.to_string()) + .map_or("none".to_string(), T::to_string) } fn colored_label(f: &mut Formatter<'_>, label: &str) -> fmt::Result { diff --git a/crates/astria-sequencer/Cargo.toml b/crates/astria-sequencer/Cargo.toml index cac7c5e45b..a2b8ee67b7 100644 --- a/crates/astria-sequencer/Cargo.toml +++ b/crates/astria-sequencer/Cargo.toml @@ -3,7 +3,7 @@ name = "astria-sequencer" version = "1.0.0" edition = "2021" license = "MIT OR Apache-2.0" -rust-version = "1.83.0" +rust-version = "1.81.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" homepage = "https://astria.org" diff --git a/crates/astria-sequencer/src/accounts/storage/values.rs b/crates/astria-sequencer/src/accounts/storage/values.rs index 9a771823ae..ca5f7b3977 100644 --- a/crates/astria-sequencer/src/accounts/storage/values.rs +++ b/crates/astria-sequencer/src/accounts/storage/values.rs @@ -28,7 +28,7 @@ impl From for u128 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(balance: Balance) -> Self { crate::storage::StoredValue::Accounts(Value(ValueImpl::Balance(balance))) } @@ -61,7 +61,7 @@ impl From for u32 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(nonce: Nonce) -> Self { crate::storage::StoredValue::Accounts(Value(ValueImpl::Nonce(nonce))) } diff --git a/crates/astria-sequencer/src/app/storage/values/block_height.rs b/crates/astria-sequencer/src/app/storage/values/block_height.rs index c07102a4da..29b5298a47 100644 --- a/crates/astria-sequencer/src/app/storage/values/block_height.rs +++ b/crates/astria-sequencer/src/app/storage/values/block_height.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(block_height: BlockHeight) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::BlockHeight(block_height))) } diff --git a/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs b/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs index 6a28e3d087..23aa4cddf3 100644 --- a/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs +++ b/crates/astria-sequencer/src/app/storage/values/block_timestamp.rs @@ -49,7 +49,7 @@ impl BorshDeserialize for BlockTimestamp { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(block_timestamp: BlockTimestamp) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::BlockTimestamp(block_timestamp))) } diff --git a/crates/astria-sequencer/src/app/storage/values/chain_id.rs b/crates/astria-sequencer/src/app/storage/values/chain_id.rs index 237f204ec8..0547029db4 100644 --- a/crates/astria-sequencer/src/app/storage/values/chain_id.rs +++ b/crates/astria-sequencer/src/app/storage/values/chain_id.rs @@ -30,13 +30,13 @@ impl<'a> From> for tendermint::chain::Id { } } -impl BorshSerialize for ChainId<'_> { +impl<'a> BorshSerialize for ChainId<'a> { fn serialize(&self, writer: &mut W) -> std::io::Result<()> { self.0.as_str().serialize(writer) } } -impl BorshDeserialize for ChainId<'_> { +impl<'a> BorshDeserialize for ChainId<'a> { fn deserialize_reader(reader: &mut R) -> std::io::Result { let chain_id_str = String::deserialize_reader(reader)?; let chain_id = diff --git a/crates/astria-sequencer/src/app/storage/values/revision_number.rs b/crates/astria-sequencer/src/app/storage/values/revision_number.rs index 93e5c42a92..d238b5b5ee 100644 --- a/crates/astria-sequencer/src/app/storage/values/revision_number.rs +++ b/crates/astria-sequencer/src/app/storage/values/revision_number.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(revision_number: RevisionNumber) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::RevisionNumber(revision_number))) } diff --git a/crates/astria-sequencer/src/app/storage/values/storage_version.rs b/crates/astria-sequencer/src/app/storage/values/storage_version.rs index 53e7a6f9ab..933f76b8fb 100644 --- a/crates/astria-sequencer/src/app/storage/values/storage_version.rs +++ b/crates/astria-sequencer/src/app/storage/values/storage_version.rs @@ -24,7 +24,7 @@ impl From for u64 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(storage_version: StorageVersion) -> Self { crate::storage::StoredValue::App(Value(ValueImpl::StorageVersion(storage_version))) } diff --git a/crates/astria-sequencer/src/authority/storage/values.rs b/crates/astria-sequencer/src/authority/storage/values.rs index a2e1a30957..1c2aaaa4a1 100644 --- a/crates/astria-sequencer/src/authority/storage/values.rs +++ b/crates/astria-sequencer/src/authority/storage/values.rs @@ -36,7 +36,7 @@ enum ValueImpl<'a> { #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::authority) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl Debug for AddressBytes<'_> { +impl<'a> Debug for AddressBytes<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } @@ -75,7 +75,7 @@ impl<'a> TryFrom> for AddressBytes<'a> { #[derive(BorshSerialize, BorshDeserialize)] struct VerificationKey<'a>(Cow<'a, [u8; 32]>); -impl Debug for VerificationKey<'_> { +impl<'a> Debug for VerificationKey<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs b/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs index d420cf3336..73d1d016f0 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/address_bytes.rs @@ -24,7 +24,7 @@ use crate::accounts::AddressBytes as DomainAddressBytes; #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl Debug for AddressBytes<'_> { +impl<'a> Debug for AddressBytes<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/block_height.rs b/crates/astria-sequencer/src/bridge/storage/values/block_height.rs index 3c88824ac7..1fe4edf48c 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/block_height.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/block_height.rs @@ -36,7 +36,7 @@ impl From for u64 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(block_height: BlockHeight) -> Self { crate::storage::StoredValue::Bridge(Value(ValueImpl::BlockHeight(block_height))) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs b/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs index db8b23f91d..725af800d4 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/ibc_prefixed_denom.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct IbcPrefixedDenom<'a>(Cow<'a, [u8; 32]>); -impl Debug for IbcPrefixedDenom<'_> { +impl<'a> Debug for IbcPrefixedDenom<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs b/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs index dff8246b16..5a67daf7fb 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/rollup_id.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct RollupId<'a>(Cow<'a, [u8; 32]>); -impl Debug for RollupId<'_> { +impl<'a> Debug for RollupId<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs b/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs index d752d3c635..fa12a21f43 100644 --- a/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs +++ b/crates/astria-sequencer/src/bridge/storage/values/transaction_id.rs @@ -26,7 +26,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::bridge) struct TransactionId<'a>(Cow<'a, [u8; TRANSACTION_ID_LEN]>); -impl Debug for TransactionId<'_> { +impl<'a> Debug for TransactionId<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", hex(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs b/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs index dea59d835a..4c772091ca 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/block_hash.rs @@ -22,7 +22,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::grpc) struct BlockHash<'a>(Cow<'a, [u8; 32]>); -impl Debug for BlockHash<'_> { +impl<'a> Debug for BlockHash<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs b/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs index d2bb6f6079..05575132af 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/rollup_ids.rs @@ -23,7 +23,7 @@ use super::{ #[derive(BorshSerialize, BorshDeserialize)] pub(super) struct RollupId<'a>(Cow<'a, [u8; 32]>); -impl Debug for RollupId<'_> { +impl<'a> Debug for RollupId<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs b/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs index 733c6f8be0..f54947e033 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/rollup_transactions.rs @@ -32,7 +32,7 @@ pub(in crate::grpc) struct RollupTransactions<'a> { proof: Proof<'a>, } -impl Debug for RollupTransactions<'_> { +impl<'a> Debug for RollupTransactions<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("RollupTransactions") .field("rollup_id", &self.rollup_id) diff --git a/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs b/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs index 3c6f6ab622..0c53040cca 100644 --- a/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs +++ b/crates/astria-sequencer/src/grpc/storage/values/sequencer_block_header.rs @@ -45,13 +45,13 @@ impl<'a> From> for tendermint::chain::Id { } } -impl BorshSerialize for ChainId<'_> { +impl<'a> BorshSerialize for ChainId<'a> { fn serialize(&self, writer: &mut W) -> std::io::Result<()> { self.0.as_str().serialize(writer) } } -impl BorshDeserialize for ChainId<'_> { +impl<'a> BorshDeserialize for ChainId<'a> { fn deserialize_reader(reader: &mut R) -> std::io::Result { let chain_id_str = String::deserialize_reader(reader)?; let chain_id = @@ -106,7 +106,7 @@ pub(in crate::grpc) struct SequencerBlockHeader<'a> { proposer_address: [u8; ADDRESS_LEN], } -impl Debug for SequencerBlockHeader<'_> { +impl<'a> Debug for SequencerBlockHeader<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { f.debug_struct("SequencerBlockHeader") .field("chain_id", &self.chain_id) diff --git a/crates/astria-sequencer/src/ibc/storage/values.rs b/crates/astria-sequencer/src/ibc/storage/values.rs index ad35125058..f1a0783f89 100644 --- a/crates/astria-sequencer/src/ibc/storage/values.rs +++ b/crates/astria-sequencer/src/ibc/storage/values.rs @@ -41,7 +41,7 @@ impl From for u128 { } } -impl From for crate::storage::StoredValue<'_> { +impl<'a> From for crate::storage::StoredValue<'a> { fn from(balance: Balance) -> Self { crate::storage::StoredValue::Ibc(Value(ValueImpl::Balance(balance))) } @@ -61,7 +61,7 @@ impl<'a> TryFrom> for Balance { #[derive(BorshSerialize, BorshDeserialize)] pub(in crate::ibc) struct AddressBytes<'a>(Cow<'a, [u8; ADDRESS_LEN]>); -impl Debug for AddressBytes<'_> { +impl<'a> Debug for AddressBytes<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", base64(self.0.as_slice())) } diff --git a/crates/astria-sequencer/src/mempool/mod.rs b/crates/astria-sequencer/src/mempool/mod.rs index 2271f281dd..68579620f4 100644 --- a/crates/astria-sequencer/src/mempool/mod.rs +++ b/crates/astria-sequencer/src/mempool/mod.rs @@ -112,7 +112,7 @@ struct ContainedTxLock<'a> { txs: RwLockWriteGuard<'a, HashSet<[u8; 32]>>, } -impl ContainedTxLock<'_> { +impl<'a> ContainedTxLock<'a> { fn add(&mut self, id: [u8; 32]) { if !self.txs.insert(id) { self.mempool.metrics.increment_internal_logic_error(); diff --git a/crates/astria-sequencer/src/storage/keys.rs b/crates/astria-sequencer/src/storage/keys.rs index fba71e6beb..edf0333ba8 100644 --- a/crates/astria-sequencer/src/storage/keys.rs +++ b/crates/astria-sequencer/src/storage/keys.rs @@ -30,7 +30,7 @@ impl<'a, T> AccountPrefixer<'a, T> { } } -impl Display for AccountPrefixer<'_, T> { +impl<'a, T: AddressBytes> Display for AccountPrefixer<'a, T> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { use base64::{ display::Base64Display, @@ -46,13 +46,13 @@ impl Display for AccountPrefixer<'_, T> { #[cfg_attr(test, derive(Debug, PartialEq))] pub(crate) struct Asset<'a>(Cow<'a, IbcPrefixed>); -impl Asset<'_> { +impl<'a> Asset<'a> { pub(crate) fn get(self) -> IbcPrefixed { self.0.into_owned() } } -impl Display for Asset<'_> { +impl<'a> Display for Asset<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { self.0.fmt(f) } @@ -67,7 +67,7 @@ where } } -impl FromStr for Asset<'_> { +impl<'a> FromStr for Asset<'a> { type Err = ParseIbcPrefixedError; fn from_str(s: &str) -> Result { diff --git a/crates/astria-sequencer/src/storage/stored_value.rs b/crates/astria-sequencer/src/storage/stored_value.rs index 3fe203521b..07164615e7 100644 --- a/crates/astria-sequencer/src/storage/stored_value.rs +++ b/crates/astria-sequencer/src/storage/stored_value.rs @@ -21,7 +21,7 @@ pub(crate) enum StoredValue<'a> { Grpc(crate::grpc::storage::Value<'a>), } -impl StoredValue<'_> { +impl<'a> StoredValue<'a> { pub(crate) fn serialize(&self) -> Result> { borsh::to_vec(&self).wrap_err("failed to serialize stored value") } diff --git a/crates/astria-telemetry/Cargo.toml b/crates/astria-telemetry/Cargo.toml index cb17bdcc92..7cc30072a5 100644 --- a/crates/astria-telemetry/Cargo.toml +++ b/crates/astria-telemetry/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-telemetry" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/crates/astria-telemetry/src/display.rs b/crates/astria-telemetry/src/display.rs index c132f0c516..3a1c9b98e5 100644 --- a/crates/astria-telemetry/src/display.rs +++ b/crates/astria-telemetry/src/display.rs @@ -97,7 +97,7 @@ pub struct Json<'a, T>(&'a T); // NOTE: This implementation is lifted straight from serde_json: // https://docs.rs/serde_json/1.0.114/src/serde_json/value/mod.rs.html#197 -impl Display for Json<'_, T> +impl<'a, T> Display for Json<'a, T> where T: serde::Serialize, { @@ -106,7 +106,7 @@ where inner: &'a mut Formatter<'b>, } - impl io::Write for WriterFormatter<'_, '_> { + impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> { fn write(&mut self, buf: &[u8]) -> io::Result { // NOTE: Same argument for safety as in // https://docs.rs/serde_json/1.0.114/src/serde_json/value/mod.rs.html#229 diff --git a/crates/astria-telemetry/src/metrics/factories.rs b/crates/astria-telemetry/src/metrics/factories.rs index bdd1549265..a3abc3b85c 100644 --- a/crates/astria-telemetry/src/metrics/factories.rs +++ b/crates/astria-telemetry/src/metrics/factories.rs @@ -176,7 +176,7 @@ trait RegisterMetric { fn metric_type() -> &'static str; } -impl RegisterMetric for Factory<'_, Counter> { +impl<'a> RegisterMetric for Factory<'a, Counter> { fn register_metric(&self, key: &Key) -> Counter { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Counter::new(self.recorder.register_counter(key, &ignored_metadata)) @@ -187,7 +187,7 @@ impl RegisterMetric for Factory<'_, Counter> { } } -impl RegisterMetric for Factory<'_, Gauge> { +impl<'a> RegisterMetric for Factory<'a, Gauge> { fn register_metric(&self, key: &Key) -> Gauge { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Gauge::new(self.recorder.register_gauge(key, &ignored_metadata)) @@ -198,7 +198,7 @@ impl RegisterMetric for Factory<'_, Gauge> { } } -impl RegisterMetric for Factory<'_, Histogram> { +impl<'a> RegisterMetric for Factory<'a, Histogram> { fn register_metric(&self, key: &Key) -> Histogram { let ignored_metadata = Metadata::new("", metrics::Level::ERROR, None); Histogram::new(self.recorder.register_histogram(key, &ignored_metadata)) diff --git a/crates/astria-test-utils/Cargo.toml b/crates/astria-test-utils/Cargo.toml index e7a551c1d6..854cdd4b03 100644 --- a/crates/astria-test-utils/Cargo.toml +++ b/crates/astria-test-utils/Cargo.toml @@ -2,7 +2,7 @@ name = "astria-test-utils" version = "0.1.0" edition = "2021" -rust-version = "1.83.0" +rust-version = "1.81.0" license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/astriaorg/astria" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 3a6eabc898..dd2691e044 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.83.0" +channel = "1.81.0" components = ["cargo", "clippy", "rust-std", "rustc"] From d113119a3a1f3c342a49db2d741073da8bf19f71 Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Mon, 9 Dec 2024 13:22:19 -0600 Subject: [PATCH 6/7] requested changes --- .../astria-sequencer-relayer/src/relayer/mod.rs | 13 +++++++++---- .../src/relayer/write/mod.rs | 16 ++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/astria-sequencer-relayer/src/relayer/mod.rs b/crates/astria-sequencer-relayer/src/relayer/mod.rs index 5dd28f6285..83d00c5a23 100644 --- a/crates/astria-sequencer-relayer/src/relayer/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/mod.rs @@ -172,7 +172,7 @@ impl Relayer { // future to forward a sequencer block to the celestia-submission-task. // gets set in the select-loop if the task is at capacity. let mut forward_once_free: Fuse< - BoxFuture>>, + BoxFuture>>>, > = Fuse::terminated(); self.state.set_ready(); @@ -276,6 +276,11 @@ impl Relayer { } #[instrument(skip_all, fields(%height))] + #[expect( + clippy::type_complexity, + reason = "complexity comes from the error type, which is boxed to avoid a large Err \ + variant of the result" + )] fn forward_block_for_submission( &self, height: SequencerHeight, @@ -283,7 +288,7 @@ impl Relayer { block_stream: &mut read::BlockStream, submitter: write::BlobSubmitterHandle, forward: &mut Fuse< - BoxFuture>>, + BoxFuture>>>, >, ) -> eyre::Result<()> { assert!( @@ -292,7 +297,7 @@ impl Relayer { congested and this future is in-flight", ); - if let Err(error) = submitter.try_send(block) { + if let Err(error) = submitter.try_send(Box::new(block)) { debug!( // Just print the error directly: TrySendError has no cause chain. %error, @@ -302,7 +307,7 @@ impl Relayer { block_stream.pause(); debug!("block stream paused"); - match *error { + match error { TrySendError::Full(block) => { *forward = async move { submitter.send(block).await }.boxed().fuse(); } diff --git a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs index 086da7b0f4..aebb0debd4 100644 --- a/crates/astria-sequencer-relayer/src/relayer/write/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/write/mod.rs @@ -86,7 +86,7 @@ struct StartedSubmissionAndFee { #[derive(Clone)] pub(super) struct BlobSubmitterHandle { - tx: mpsc::Sender, + tx: mpsc::Sender>, } impl BlobSubmitterHandle { @@ -95,9 +95,9 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::try_send`]. pub(super) fn try_send( &self, - block: SequencerBlock, - ) -> Result<(), Box>> { - self.tx.try_send(block).map_err(Box::new) + block: Box, + ) -> Result<(), TrySendError>> { + self.tx.try_send(block) } /// Sends a block to the blob submitter. @@ -105,8 +105,8 @@ impl BlobSubmitterHandle { /// This is a thin wrapper around [`mpsc::Sender::send`]. pub(super) async fn send( &self, - block: SequencerBlock, - ) -> Result<(), SendError> { + block: Box, + ) -> Result<(), SendError>> { self.tx.send(block).await } } @@ -116,7 +116,7 @@ pub(super) struct BlobSubmitter { client_builder: CelestiaClientBuilder, /// The channel over which sequencer blocks are received. - blocks: mpsc::Receiver, + blocks: mpsc::Receiver>, /// The accumulator of all data that will be submitted to Celestia on the next submission. next_submission: NextSubmission, @@ -253,7 +253,7 @@ impl BlobSubmitter { sequencer_height = %block.height(), "skipping sequencer block as already included in previous submission" )); - } else if let Err(error) = self.add_sequencer_block_to_next_submission(block) { + } else if let Err(error) = self.add_sequencer_block_to_next_submission(*block) { break Err(error).wrap_err( "critically failed adding Sequencer block to next submission" ); From 7ef3361dce9ee6e4e6363bacd2e9cf683e3491f0 Mon Sep 17 00:00:00 2001 From: ethanoroshiba Date: Tue, 10 Dec 2024 08:32:08 -0600 Subject: [PATCH 7/7] make type alias for complicated type --- crates/astria-sequencer-relayer/src/relayer/mod.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/astria-sequencer-relayer/src/relayer/mod.rs b/crates/astria-sequencer-relayer/src/relayer/mod.rs index 83d00c5a23..6f7afb299c 100644 --- a/crates/astria-sequencer-relayer/src/relayer/mod.rs +++ b/crates/astria-sequencer-relayer/src/relayer/mod.rs @@ -83,6 +83,9 @@ use crate::{ IncludeRollup, }; +type ForwardFut<'a> = + Fuse>>>>; + pub(crate) struct Relayer { /// A token to notify relayer that it should shut down. #[expect( @@ -276,20 +279,13 @@ impl Relayer { } #[instrument(skip_all, fields(%height))] - #[expect( - clippy::type_complexity, - reason = "complexity comes from the error type, which is boxed to avoid a large Err \ - variant of the result" - )] fn forward_block_for_submission( &self, height: SequencerHeight, block: SequencerBlock, block_stream: &mut read::BlockStream, submitter: write::BlobSubmitterHandle, - forward: &mut Fuse< - BoxFuture>>>, - >, + forward: &mut ForwardFut, ) -> eyre::Result<()> { assert!( forward.is_terminated(),