diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a09c6a20..ef1bbb88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: "1.88" + toolchain: "1.90" components: clippy - name: cargo cache uses: Swatinem/rust-cache@v2 @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: "1.88" + toolchain: "1.90" - name: cargo cache uses: Swatinem/rust-cache@v2 - name: cargo test scroll diff --git a/Cargo.toml b/Cargo.toml index fcfb6c85..b598f3f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,12 +13,30 @@ resolver = "2" [workspace.package] version = "2.0.0" edition = "2021" -rust-version = "1.88" +rust-version = "1.90" authors = ["Scroll developers"] license = "MIT OR Apache-2.0" homepage = "https://github.com/scroll-tech/stateless-block-verifier" repository = "https://github.com/scroll-tech/stateless-block-verifier" +[workspace.lints.rust] +missing-docs = "warn" +missing-debug-implementations = "warn" +unused-qualifications = "warn" + +[workspace.lints.clippy] +# some useful lints from pedantic group +assigning-clones = "warn" +cast-lossless = "warn" +redundant-else = "warn" +single-match-else = "warn" +elidable-lifetime-names = "warn" +uninlined-format-args = "warn" +unnecessary-box-returns = "warn" +unnecessary-debug-formatting = "warn" +# this is useful if we forget to align versions of alloy/revm when upgrading reth +multiple-crate-versions = "warn" + [workspace.dependencies] # https://github.com/alloy-rs/alloy alloy = { version = "1.0.41", default-features = false } @@ -123,10 +141,6 @@ tag = "scroll-v91" default-features = false features = ["std"] -[workspace.lints.rust] -missing-docs = "deny" -missing-debug-implementations = "deny" - [patch.crates-io] revm = { git = "https://github.com/scroll-tech/revm", tag = "scroll-v91" } revm-bytecode = { git = "https://github.com/scroll-tech/revm", tag = "scroll-v91" } diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 00000000..52616beb --- /dev/null +++ b/clippy.toml @@ -0,0 +1,39 @@ +# Please re-check this list when updating dependencies, keep it minimal. +allowed-duplicate-crates = [ + "ark-ff", + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "nybbles", + "digest", + "fastrlp", + "getrandom", + "itertools", + "rand", + "rand_chacha", + "rand_core", + "schemars", + "secp256k1", + "secp256k1-sys", + "syn", + "tracing-subscriber", + "windows-sys", + "windows-targets", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", + + # revisit these when fully remove rkyv + "foldhash", + "hashbrown", + "indexmap", + + # FIXME: remove after upgrade risc0-ethereum-trie + "alloy-trie", +] diff --git a/crates/core/src/executor/ethereum.rs b/crates/core/src/executor/ethereum.rs index 024573a2..8f3e2867 100644 --- a/crates/core/src/executor/ethereum.rs +++ b/crates/core/src/executor/ethereum.rs @@ -17,7 +17,7 @@ pub struct EvmExecutor<'a> { block: &'a RecoveredBlock, } -impl<'a> crate::EvmExecutor<'a> { +impl<'a> EvmExecutor<'a> { /// Create a new EVM executor pub fn new( chain_spec: Arc, diff --git a/crates/core/src/verifier/ethereum.rs b/crates/core/src/verifier/ethereum.rs index 353e113e..612cceca 100644 --- a/crates/core/src/verifier/ethereum.rs +++ b/crates/core/src/verifier/ethereum.rs @@ -41,6 +41,6 @@ mod tests { ) { let witness: BlockWitness = serde_json::from_str(witness_json).unwrap(); let chain_spec = get_chain_spec(Chain::from_id(witness.chain_id)).unwrap(); - crate::verifier::run(&[witness], chain_spec).unwrap(); + run(&[witness], chain_spec).unwrap(); } } diff --git a/crates/primitives/src/types.rs b/crates/primitives/src/types.rs index 675140bb..cad82a95 100644 --- a/crates/primitives/src/types.rs +++ b/crates/primitives/src/types.rs @@ -112,6 +112,7 @@ pub mod rpc { }; /// Transaction object used in RPC. + #[allow(unused_qualifications)] pub type RpcTransaction = alloy_rpc_types_eth::Transaction; /// Block representation for RPC. diff --git a/crates/utils/src/rpc.rs b/crates/utils/src/rpc.rs index 3bc4ad03..b9ac48c5 100644 --- a/crates/utils/src/rpc.rs +++ b/crates/utils/src/rpc.rs @@ -68,9 +68,9 @@ pub trait ProviderExt: Provider { #[cfg(not(feature = "scroll"))] async fn dump_block_ancestors( &self, - number: sbv_primitives::BlockNumber, + number: BlockNumber, ancestors: Option, - ) -> TransportResult>> { + ) -> TransportResult>> { use std::future::IntoFuture; let ancestors = ancestors @@ -78,7 +78,7 @@ pub trait ProviderExt: Provider { .clamp(1, (number as usize).min(256)); let ancestors = futures::future::try_join_all((1..=ancestors).map(|offset| { - let block_number = number - offset as sbv_primitives::BlockNumber; + let block_number = number - offset as BlockNumber; self.get_block_by_number(block_number.into()).into_future() })) .await?; @@ -188,7 +188,7 @@ impl<'a, P: ProviderExt> DumpBlockWitness<'a, P> { #[cfg(not(feature = "scroll"))] pub fn with_cached_ancestor_blocks(mut self, iter: I) -> Self where - I: IntoIterator, + I: IntoIterator, { self.builder = self.builder.ancestor_blocks(iter); self diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c95c9057..73328e05 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.88" +channel = "1.90"