diff --git a/Cargo.toml b/Cargo.toml index 002beb6..0cddb1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,20 +23,99 @@ categories = ["cryptography", "cryptography::cryptocurrencies"] all-features = true rustdoc-args = ["--cfg", "docsrs"] -[workspace.lints.clippy] -dbg-macro = "warn" -manual-string-new = "warn" -uninlined-format-args = "warn" -use-self = "warn" +[workspace.lints] +rust.missing_debug_implementations = "warn" +rust.missing_docs = "warn" +rust.rust_2018_idioms = { level = "deny", priority = -1 } +rust.unreachable_pub = "warn" +rust.unused_must_use = "deny" +rustdoc.all = "warn" +rust.unnameable-types = "warn" -[workspace.lints.rust] -rust-2018-idioms = "deny" -unreachable-pub = "warn" -unused-must-use = "deny" -missing_docs = "warn" +[workspace.lints.clippy] +# These are some of clippy's nursery (i.e., experimental) lints that we like. +# By default, nursery lints are allowed. Some of the lints below have made good +# suggestions which we fixed. The others didn't have any findings, so we can +# assume they don't have that many false positives. Let's enable them to +# prevent future problems. +borrow_as_ptr = "warn" +branches_sharing_code = "warn" +clear_with_drain = "warn" +cloned_instead_of_copied = "warn" +collection_is_never_read = "warn" +derive_partial_eq_without_eq = "warn" +doc_markdown = "warn" +empty_line_after_doc_comments = "warn" +empty_line_after_outer_attr = "warn" +enum_glob_use = "warn" +equatable_if_let = "warn" +explicit_into_iter_loop = "warn" +explicit_iter_loop = "warn" +flat_map_option = "warn" +from_iter_instead_of_collect = "warn" +if_not_else = "warn" +implicit_clone = "warn" +imprecise_flops = "warn" +iter_on_empty_collections = "warn" +iter_on_single_items = "warn" +iter_with_drain = "warn" +iter_without_into_iter = "warn" +large_stack_frames = "warn" +manual_assert = "warn" +manual_clamp = "warn" +manual_is_variant_and = "warn" +manual_string_new = "warn" +match_same_arms = "warn" +missing_const_for_fn = "warn" +mutex_integer = "warn" +naive_bytecount = "warn" +needless_bitwise_bool = "warn" +needless_continue = "warn" +needless_for_each = "warn" +needless_pass_by_ref_mut = "warn" +nonstandard_macro_braces = "warn" +option_as_ref_cloned = "warn" +or_fun_call = "warn" +path_buf_push_overwrite = "warn" +read_zero_byte_vec = "warn" +redundant_clone = "warn" +redundant_else = "warn" +single_char_pattern = "warn" +string_lit_as_bytes = "warn" +string_lit_chars_any = "warn" +suboptimal_flops = "warn" +suspicious_operation_groupings = "warn" +trailing_empty_array = "warn" +trait_duplication_in_bounds = "warn" +transmute_undefined_repr = "warn" +trivial_regex = "warn" +tuple_array_conversions = "warn" +type_repetition_in_bounds = "warn" +uninhabited_references = "warn" +unnecessary_self_imports = "warn" +unnecessary_struct_initialization = "warn" +unnested_or_patterns = "warn" +unused_peekable = "warn" +unused_rounding = "warn" +use_self = "warn" +useless_let_if_seq = "warn" +while_float = "warn" +zero_sized_map_values = "warn" -[workspace.lints.rustdoc] -all = "warn" +# These are nursery lints which have findings. Allow them for now. Some are not +# quite mature enough for use in our codebase and some we don't really want. +# Explicitly listing should make it easier to fix in the future. +as_ptr_cast_mut = "allow" +cognitive_complexity = "allow" +debug_assert_with_mut_call = "allow" +fallible_impl_from = "allow" +future_not_send = "allow" +needless_collect = "allow" +non_send_fields_in_send_ty = "allow" +redundant_pub_crate = "allow" +significant_drop_in_scrutinee = "allow" +significant_drop_tightening = "allow" +too_long_first_doc_paragraph = "allow" [profile.release] opt-level = 3 diff --git a/bin/odyssey/src/main.rs b/bin/odyssey/src/main.rs index 9612e5d..8a95eb2 100644 --- a/bin/odyssey/src/main.rs +++ b/bin/odyssey/src/main.rs @@ -57,7 +57,7 @@ fn main() { .with_add_ons(OptimismAddOns::new(rollup_args.sequencer_http.clone())) .extend_rpc_modules(move |ctx| { // register sequencer tx forwarder - if let Some(sequencer_http) = rollup_args.sequencer_http.clone() { + if let Some(sequencer_http) = rollup_args.sequencer_http { ctx.registry .eth_api() .set_sequencer_client(SequencerClient::new(sequencer_http))?; diff --git a/crates/node/src/evm.rs b/crates/node/src/evm.rs index 5295c8e..1e99b73 100644 --- a/crates/node/src/evm.rs +++ b/crates/node/src/evm.rs @@ -1,6 +1,6 @@ //! # Odyssey EVM configuration //! -//! The [OdysseyEvmConfig] type implements the [ConfigureEvm] and [ConfigureEvmEnv] traits, +//! The [`OdysseyEvmConfig`] type implements the [`ConfigureEvm`] and [`ConfigureEvmEnv`] traits, //! configuring the custom Odyssey precompiles and instructions. //! //! These trait implementations allow for custom precompiles and instructions to be implemented and @@ -47,8 +47,8 @@ impl OdysseyEvmConfig { /// Sets the precompiles to the EVM handler /// - /// This will be invoked when the EVM is created via [ConfigureEvm::evm] or - /// [ConfigureEvm::evm_with_inspector] + /// This will be invoked when the EVM is created via [`ConfigureEvm::evm`] or + /// [`ConfigureEvm::evm_with_inspector`] /// /// This will use the default mainnet precompiles and add additional precompiles. fn set_precompiles(handler: &mut EvmHandler<'_, EXT, DB>) diff --git a/crates/node/src/lib.rs b/crates/node/src/lib.rs index 3de4745..c0e4ee6 100644 --- a/crates/node/src/lib.rs +++ b/crates/node/src/lib.rs @@ -1,15 +1,15 @@ //! Standalone crate for Odyssey's node configuration and builder types. //! -//! This contains mainly two types, [OdysseyNode](node::OdysseyNode) and -//! [OdysseyEvmConfig](evm::OdysseyEvmConfig). +//! This contains mainly two types, [`OdysseyNode`](node::OdysseyNode) and +//! [`OdysseyEvmConfig`](evm::OdysseyEvmConfig). //! -//! The [OdysseyNode](node::OdysseyNode) type implements the -//! [NodeTypes](reth_node_builder::NodeTypes) trait, and configures the engine types required for +//! The [`OdysseyNode`](node::OdysseyNode) type implements the +//! [`NodeTypes`](reth_node_builder::NodeTypes) trait, and configures the engine types required for //! the optimism engine API. //! -//! The [OdysseyEvmConfig](evm::OdysseyEvmConfig) type implements the -//! [ConfigureEvm](reth_node_api::ConfigureEvm) and -//! [ConfigureEvmEnv](reth_node_api::ConfigureEvmEnv) traits, configuring the custom Odyssey +//! The [`OdysseyEvmConfig`](evm::OdysseyEvmConfig) type implements the +//! [`ConfigureEvm`](reth_node_api::ConfigureEvm) and +//! [`ConfigureEvmEnv`](reth_node_api::ConfigureEvmEnv) traits, configuring the custom Odyssey //! precompiles and instructions. #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] diff --git a/crates/node/src/node.rs b/crates/node/src/node.rs index 1356a92..836937d 100644 --- a/crates/node/src/node.rs +++ b/crates/node/src/node.rs @@ -1,6 +1,6 @@ //! # Odyssey Node types configuration //! -//! The [OdysseyNode] type implements the [NodeTypes] trait, and configures the engine types +//! The [`OdysseyNode`] type implements the [`NodeTypes`] trait, and configures the engine types //! required for the optimism engine API. use crate::evm::OdysseyEvmConfig; @@ -43,7 +43,7 @@ impl OdysseyNode { Self { args } } - /// Returns the components for the given [RollupArgs]. + /// Returns the components for the given [`RollupArgs`]. pub fn components( args: &RollupArgs, ) -> ComponentsBuilder< @@ -173,7 +173,7 @@ where ctx: &BuilderContext, pool: Pool, ) -> eyre::Result> { - self.inner.spawn(OdysseyEvmConfig::new(ctx.chain_spec().clone()), ctx, pool) + self.inner.spawn(OdysseyEvmConfig::new(ctx.chain_spec()), ctx, pool) } } diff --git a/crates/testing/src/tests.rs b/crates/testing/src/tests.rs index 0db677e..fb16181 100644 --- a/crates/testing/src/tests.rs +++ b/crates/testing/src/tests.rs @@ -1,4 +1,4 @@ #[test] -fn dummy() { +const fn dummy() { // kept here to prevent the ci from failing on no tests } diff --git a/crates/wallet/src/lib.rs b/crates/wallet/src/lib.rs index 495db03..079ece3 100644 --- a/crates/wallet/src/lib.rs +++ b/crates/wallet/src/lib.rs @@ -162,6 +162,7 @@ impl From for jsonrpsee::types::error::ErrorObject<'static> } /// Implementation of the Odyssey `wallet_` namespace. +#[derive(Debug)] pub struct OdysseyWallet { inner: Arc>, } @@ -310,6 +311,7 @@ where } /// Implementation of the Odyssey `wallet_` namespace. +#[derive(Debug)] struct OdysseyWalletInner { provider: Provider, eth_api: Eth,