diff --git a/.github/workflows/optional-rust.yml b/.github/workflows/optional-rust.yml index e492ec4b4..b95047dfd 100644 --- a/.github/workflows/optional-rust.yml +++ b/.github/workflows/optional-rust.yml @@ -21,3 +21,15 @@ jobs: - name: Run cargo udeps run: cargo +nightly udeps --workspace --tests --all-targets --release --exclude ef-tests + + cargo-workspace-lints: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install cargo workspace lints + run: cargo install cargo-workspace-lints --locked + + - name: Run cargo workspace lints + run: cargo workspace-lints diff --git a/Cargo.toml b/Cargo.toml index b830b363f..25cb778c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,14 @@ repository = "https://github.com/ReamLabs/ream" rust-version = "1.88.0" version = "0.1.0" +[workspace.lints.clippy] +let_and_return = "warn" +uninlined_format_args = "warn" +unnecessary_debug_formatting = "warn" +unwrap_used = "warn" +useless_let_if_seq = "warn" +wildcard_imports = "warn" + [workspace.dependencies] actix-web = "4.10.2" actix-web-lab = "0.24.1" diff --git a/bin/ream/Cargo.toml b/bin/ream/Cargo.toml index fc7903831..8c5a2a632 100644 --- a/bin/ream/Cargo.toml +++ b/bin/ream/Cargo.toml @@ -56,3 +56,6 @@ ream-storage.workspace = true ream-sync.workspace = true ream-validator-beacon.workspace = true ream-validator-lean.workspace = true + +[lints] +workspace = true diff --git a/.clippy.toml b/clippy.toml similarity index 83% rename from .clippy.toml rename to clippy.toml index 7a883b058..9f106f733 100644 --- a/.clippy.toml +++ b/clippy.toml @@ -1,3 +1,5 @@ +allow-mixed-uninlined-format-args = false + # This feature is in Rust nightly, as of v1.62. The line is added in anticipation. # Once the feature stabilizes, remove the #[allow(clippy::unwrap_used)] lines in front of every `mod test` allow-unwrap-in-tests = true diff --git a/crates/common/account_manager/Cargo.toml b/crates/common/account_manager/Cargo.toml index 10d9b8887..7566c0912 100644 --- a/crates/common/account_manager/Cargo.toml +++ b/crates/common/account_manager/Cargo.toml @@ -14,3 +14,6 @@ bip39.workspace = true rand.workspace = true rand_chacha.workspace = true sha2.workspace = true + +[lints] +workspace = true diff --git a/crates/common/api_types/beacon/Cargo.toml b/crates/common/api_types/beacon/Cargo.toml index 5efaaf289..af52d6f9d 100644 --- a/crates/common/api_types/beacon/Cargo.toml +++ b/crates/common/api_types/beacon/Cargo.toml @@ -25,3 +25,6 @@ url.workspace = true ream-bls.workspace = true ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/api_types/common/Cargo.toml b/crates/common/api_types/common/Cargo.toml index b0057f460..e1b12aa17 100644 --- a/crates/common/api_types/common/Cargo.toml +++ b/crates/common/api_types/common/Cargo.toml @@ -14,3 +14,6 @@ actix-web.workspace = true alloy-primitives.workspace = true serde.workspace = true thiserror.workspace = true + +[lints] +workspace = true diff --git a/crates/common/api_types/lean/Cargo.toml b/crates/common/api_types/lean/Cargo.toml index 85e577051..fa4dfd1b6 100644 --- a/crates/common/api_types/lean/Cargo.toml +++ b/crates/common/api_types/lean/Cargo.toml @@ -16,3 +16,6 @@ ethereum_ssz.workspace = true ethereum_ssz_derive.workspace = true serde.workspace = true serde_json.workspace = true + +[lints] +workspace = true diff --git a/crates/common/chain/beacon/Cargo.toml b/crates/common/chain/beacon/Cargo.toml index 65dda70d5..cbf9d4bad 100644 --- a/crates/common/chain/beacon/Cargo.toml +++ b/crates/common/chain/beacon/Cargo.toml @@ -26,3 +26,6 @@ ream-network-spec.workspace = true ream-operation-pool.workspace = true ream-p2p.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/crates/common/chain/lean/Cargo.toml b/crates/common/chain/lean/Cargo.toml index 69af7c05c..05d512025 100644 --- a/crates/common/chain/lean/Cargo.toml +++ b/crates/common/chain/lean/Cargo.toml @@ -25,3 +25,6 @@ ream-metrics.workspace = true ream-network-spec.workspace = true ream-storage.workspace = true ream-sync.workspace = true + +[lints] +workspace = true diff --git a/crates/common/chain/lean/src/clock.rs b/crates/common/chain/lean/src/clock.rs index 382e28721..d6853b426 100644 --- a/crates/common/chain/lean/src/clock.rs +++ b/crates/common/chain/lean/src/clock.rs @@ -17,7 +17,7 @@ pub fn create_lean_clock_interval() -> anyhow::Result { lean_network_spec().genesis_time, SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .expect("system time before UNIX EPOCH") .as_secs() )) })?; diff --git a/crates/common/checkpoint_sync/Cargo.toml b/crates/common/checkpoint_sync/Cargo.toml index 747721d1c..db6491fb5 100644 --- a/crates/common/checkpoint_sync/Cargo.toml +++ b/crates/common/checkpoint_sync/Cargo.toml @@ -27,3 +27,6 @@ ream-consensus-misc.workspace = true ream-fork-choice.workspace = true ream-network-spec.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/crates/common/consensus/beacon/Cargo.toml b/crates/common/consensus/beacon/Cargo.toml index 8b2555362..b136880d9 100644 --- a/crates/common/consensus/beacon/Cargo.toml +++ b/crates/common/consensus/beacon/Cargo.toml @@ -40,3 +40,6 @@ ream-bls.workspace = true ream-consensus-misc.workspace = true ream-merkle.workspace = true ream-network-spec.workspace = true + +[lints] +workspace = true diff --git a/crates/common/consensus/beacon/src/electra/beacon_state.rs b/crates/common/consensus/beacon/src/electra/beacon_state.rs index 776e909e7..904dffec6 100644 --- a/crates/common/consensus/beacon/src/electra/beacon_state.rs +++ b/crates/common/consensus/beacon/src/electra/beacon_state.rs @@ -100,7 +100,9 @@ use crate::{ }; pub mod quoted_u8_var_list { - use super::*; + use super::{ + Deserialize, Deserializer, Serialize, Serializer, ValidatorRegistryLimit, VariableList, + }; pub fn serialize( value: &VariableList, diff --git a/crates/common/consensus/beacon/src/polynomial_commitments/kzg_commitment.rs b/crates/common/consensus/beacon/src/polynomial_commitments/kzg_commitment.rs index 65a88fb09..d3b67d406 100644 --- a/crates/common/consensus/beacon/src/polynomial_commitments/kzg_commitment.rs +++ b/crates/common/consensus/beacon/src/polynomial_commitments/kzg_commitment.rs @@ -97,9 +97,8 @@ impl FromStr for KZGCommitment { Ok(Self(kzg_commitment_bytes)) } else { Err(format!( - "InvalidByteLength: got {}, expected {}", + "InvalidByteLength: got {}, expected {BYTES_PER_COMMITMENT}", bytes.len(), - BYTES_PER_COMMITMENT )) } } diff --git a/crates/common/consensus/lean/Cargo.toml b/crates/common/consensus/lean/Cargo.toml index f67416cd3..cfe5db955 100644 --- a/crates/common/consensus/lean/Cargo.toml +++ b/crates/common/consensus/lean/Cargo.toml @@ -26,3 +26,6 @@ tree_hash_derive.workspace = true # Local dependencies ream-consensus-misc.workspace = true ream-metrics.workspace = true + +[lints] +workspace = true diff --git a/crates/common/consensus/misc/Cargo.toml b/crates/common/consensus/misc/Cargo.toml index 3b4366237..bc3a66eff 100644 --- a/crates/common/consensus/misc/Cargo.toml +++ b/crates/common/consensus/misc/Cargo.toml @@ -27,3 +27,6 @@ tree_hash_derive.workspace = true # ream dependencies ream-bls.workspace = true + +[lints] +workspace = true diff --git a/crates/common/execution_engine/Cargo.toml b/crates/common/execution_engine/Cargo.toml index 01b58b4c5..4d5129fae 100644 --- a/crates/common/execution_engine/Cargo.toml +++ b/crates/common/execution_engine/Cargo.toml @@ -30,3 +30,6 @@ tree_hash_derive.workspace = true # ream dependencies ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/executor/Cargo.toml b/crates/common/executor/Cargo.toml index 20a439da7..3e4d3f4f8 100644 --- a/crates/common/executor/Cargo.toml +++ b/crates/common/executor/Cargo.toml @@ -14,3 +14,6 @@ anyhow.workspace = true futures.workspace = true tokio.workspace = true tracing.workspace = true + +[lints] +workspace = true diff --git a/crates/common/fork_choice/Cargo.toml b/crates/common/fork_choice/Cargo.toml index 63d7c0fa0..05d716cb6 100644 --- a/crates/common/fork_choice/Cargo.toml +++ b/crates/common/fork_choice/Cargo.toml @@ -40,3 +40,6 @@ ream-network-spec.workspace = true ream-operation-pool.workspace = true ream-polynomial-commitments.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/crates/common/fork_choice/src/store.rs b/crates/common/fork_choice/src/store.rs index 483a50b94..4a000d6eb 100644 --- a/crates/common/fork_choice/src/store.rs +++ b/crates/common/fork_choice/src/store.rs @@ -403,9 +403,8 @@ impl Store { } // Calculate proposer score if ``proposer_boost_root`` is set - let mut proposer_score: u64 = 0; // Boost is applied if ``root`` is an ancestor of ``proposer_boost_root`` - if self.get_ancestor( + let proposer_score = if self.get_ancestor( self.db.proposer_boost_root_provider().get()?, self.db .beacon_block_provider() @@ -415,8 +414,10 @@ impl Store { .slot, )? == root { - proposer_score = self.get_proposer_score()?; - } + self.get_proposer_score()? + } else { + 0 + }; Ok(attestation_score + proposer_score) } diff --git a/crates/common/light_client/Cargo.toml b/crates/common/light_client/Cargo.toml index 8441f0ecc..a13ecfd3d 100644 --- a/crates/common/light_client/Cargo.toml +++ b/crates/common/light_client/Cargo.toml @@ -23,3 +23,6 @@ tree_hash_derive.workspace = true # ream dependencies ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/metrics/Cargo.toml b/crates/common/metrics/Cargo.toml index 761fe0a0e..f00a5ad52 100644 --- a/crates/common/metrics/Cargo.toml +++ b/crates/common/metrics/Cargo.toml @@ -12,3 +12,6 @@ version.workspace = true [dependencies] lazy_static.workspace = true prometheus_exporter.workspace = true + +[lints] +workspace = true diff --git a/crates/common/network_spec/Cargo.toml b/crates/common/network_spec/Cargo.toml index 28d2d3e1a..09c763699 100644 --- a/crates/common/network_spec/Cargo.toml +++ b/crates/common/network_spec/Cargo.toml @@ -18,3 +18,6 @@ serde_yaml.workspace = true # ream-dependencies ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/node/Cargo.toml b/crates/common/node/Cargo.toml index 93c6caab5..9167cc633 100644 --- a/crates/common/node/Cargo.toml +++ b/crates/common/node/Cargo.toml @@ -14,3 +14,6 @@ version.workspace = true [build-dependencies] vergen = { version = "9.0", features = ["build", "cargo", "emit_and_set", "rustc"] } vergen-git2 = "1.0" + +[lints] +workspace = true diff --git a/crates/common/operation_pool/Cargo.toml b/crates/common/operation_pool/Cargo.toml index c21ede691..0c5f484ce 100644 --- a/crates/common/operation_pool/Cargo.toml +++ b/crates/common/operation_pool/Cargo.toml @@ -17,3 +17,6 @@ tree_hash.workspace = true # ream dependencies ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/polynomial_commitments/Cargo.toml b/crates/common/polynomial_commitments/Cargo.toml index 9df0aecfd..bf17dd0eb 100644 --- a/crates/common/polynomial_commitments/Cargo.toml +++ b/crates/common/polynomial_commitments/Cargo.toml @@ -34,3 +34,6 @@ tree_hash_derive.workspace = true ream-bls.workspace = true ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/crates/common/sync/Cargo.toml b/crates/common/sync/Cargo.toml index a04444548..9e13a8ff8 100644 --- a/crates/common/sync/Cargo.toml +++ b/crates/common/sync/Cargo.toml @@ -12,3 +12,6 @@ version.workspace = true [dependencies] tokio.workspace = true + +[lints] +workspace = true diff --git a/crates/common/validator/beacon/Cargo.toml b/crates/common/validator/beacon/Cargo.toml index 631050cf7..a96ee35a8 100644 --- a/crates/common/validator/beacon/Cargo.toml +++ b/crates/common/validator/beacon/Cargo.toml @@ -40,3 +40,6 @@ ream-execution-engine.workspace = true ream-executor.workspace = true ream-keystore.workspace = true ream-network-spec.workspace = true + +[lints] +workspace = true diff --git a/crates/common/validator/lean/Cargo.toml b/crates/common/validator/lean/Cargo.toml index 2b51df461..f84997e61 100644 --- a/crates/common/validator/lean/Cargo.toml +++ b/crates/common/validator/lean/Cargo.toml @@ -24,3 +24,6 @@ ream-consensus-lean.workspace = true ream-consensus-misc.workspace = true ream-network-spec.workspace = true ream-sync.workspace = true + +[lints] +workspace = true diff --git a/crates/crypto/bls/Cargo.toml b/crates/crypto/bls/Cargo.toml index f4bb15a20..80d2deccc 100644 --- a/crates/crypto/bls/Cargo.toml +++ b/crates/crypto/bls/Cargo.toml @@ -27,3 +27,6 @@ ssz_types.workspace = true thiserror.workspace = true tree_hash.workspace = true tree_hash_derive.workspace = true + +[lints] +workspace = true diff --git a/crates/crypto/keystore/Cargo.toml b/crates/crypto/keystore/Cargo.toml index 21e33c1b1..59ae30b45 100644 --- a/crates/crypto/keystore/Cargo.toml +++ b/crates/crypto/keystore/Cargo.toml @@ -22,3 +22,6 @@ uuid = { version = "1.0", features = ["v4", "serde"] } # ream dependencies ream-bls.workspace = true + +[lints] +workspace = true diff --git a/crates/crypto/merkle/Cargo.toml b/crates/crypto/merkle/Cargo.toml index 7c905323d..a7e02d59f 100644 --- a/crates/crypto/merkle/Cargo.toml +++ b/crates/crypto/merkle/Cargo.toml @@ -14,3 +14,6 @@ alloy-primitives.workspace = true anyhow.workspace = true ethereum_hashing.workspace = true serde.workspace = true + +[lints] +workspace = true diff --git a/crates/crypto/post_quantum/Cargo.toml b/crates/crypto/post_quantum/Cargo.toml index e39a6999f..0eafcd0ed 100644 --- a/crates/crypto/post_quantum/Cargo.toml +++ b/crates/crypto/post_quantum/Cargo.toml @@ -26,3 +26,6 @@ serde_json.workspace = true thiserror.workspace = true tree_hash.workspace = true tree_hash_derive.workspace = true + +[lints] +workspace = true diff --git a/crates/networking/discv5/Cargo.toml b/crates/networking/discv5/Cargo.toml index 3c1c30d6b..43b52d778 100644 --- a/crates/networking/discv5/Cargo.toml +++ b/crates/networking/discv5/Cargo.toml @@ -26,3 +26,6 @@ tracing.workspace = true # ream dependencies ream-consensus-misc.workspace = true ream-network-spec.workspace = true + +[lints] +workspace = true diff --git a/crates/networking/manager/Cargo.toml b/crates/networking/manager/Cargo.toml index c4e4f6a2c..6664b27b4 100644 --- a/crates/networking/manager/Cargo.toml +++ b/crates/networking/manager/Cargo.toml @@ -41,3 +41,6 @@ ream-polynomial-commitments.workspace = true ream-storage.workspace = true ream-syncer.workspace = true ream-validator-beacon.workspace = true + +[lints] +workspace = true diff --git a/crates/networking/manager/src/gossipsub/validate/blob_sidecar.rs b/crates/networking/manager/src/gossipsub/validate/blob_sidecar.rs index a8acc04f2..1af472733 100644 --- a/crates/networking/manager/src/gossipsub/validate/blob_sidecar.rs +++ b/crates/networking/manager/src/gossipsub/validate/blob_sidecar.rs @@ -129,8 +129,8 @@ pub async fn validate_blob_sidecar( Ok(expected_index) => { if expected_index != header.proposer_index { return Ok(ValidationResult::Reject(format!( - "Wrong proposer index: slot {}: expected {}, got {}", - header.slot, expected_index, header.proposer_index + "Wrong proposer index: slot {}: expected {expected_index}, got {}", + header.slot, header.proposer_index ))); } } diff --git a/crates/networking/p2p/Cargo.toml b/crates/networking/p2p/Cargo.toml index 1fa5f95dd..c0f438c5a 100644 --- a/crates/networking/p2p/Cargo.toml +++ b/crates/networking/p2p/Cargo.toml @@ -53,3 +53,6 @@ ream-network-spec.workspace = true ream-storage.workspace = true ream-sync.workspace = true ream-validator-beacon.workspace = true + +[lints] +workspace = true diff --git a/crates/networking/p2p/src/gossipsub/beacon/topics.rs b/crates/networking/p2p/src/gossipsub/beacon/topics.rs index 34ef61284..04d44c3e0 100644 --- a/crates/networking/p2p/src/gossipsub/beacon/topics.rs +++ b/crates/networking/p2p/src/gossipsub/beacon/topics.rs @@ -91,11 +91,9 @@ impl std::fmt::Display for GossipTopic { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "/{}/{}/{}/{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{}/{ENCODING_POSTFIX}", self.fork.encode_hex(), self.kind, - ENCODING_POSTFIX ) } } @@ -126,42 +124,27 @@ impl From for TopicHash { LightClientOptimisticUpdate => LIGHT_CLIENT_OPTIMISTIC_UPDATE_TOPIC, BeaconAttestation(index) => { return TopicHash::from_raw(format!( - "/{}/{}/{}{}{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{BEACON_ATTESTATION_PREFIX}{index}{ENCODING_POSTFIX}", val.fork.encode_hex(), - BEACON_ATTESTATION_PREFIX, - index, - ENCODING_POSTFIX, )); } SyncCommittee(index) => { return TopicHash::from_raw(format!( - "/{}/{}/{}{}{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{SYNC_COMMITTEE_PREFIX_TOPIC}{index}{ENCODING_POSTFIX}", val.fork.encode_hex(), - SYNC_COMMITTEE_PREFIX_TOPIC, - index, - ENCODING_POSTFIX, )); } BlobSidecar(index) => { return TopicHash::from_raw(format!( - "/{}/{}/{}{}{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{BLOB_SIDECAR_PREFIX_TOPIC}{index}{ENCODING_POSTFIX}", val.fork.encode_hex(), - BLOB_SIDECAR_PREFIX_TOPIC, - index, - ENCODING_POSTFIX, )); } }; TopicHash::from_raw(format!( - "/{}/{}/{}{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{kind_str}{ENCODING_POSTFIX}", val.fork.encode_hex(), - kind_str, - ENCODING_POSTFIX )) } } diff --git a/crates/networking/p2p/src/gossipsub/lean/topics.rs b/crates/networking/p2p/src/gossipsub/lean/topics.rs index 65793ab98..f14e38a40 100644 --- a/crates/networking/p2p/src/gossipsub/lean/topics.rs +++ b/crates/networking/p2p/src/gossipsub/lean/topics.rs @@ -47,11 +47,9 @@ impl std::fmt::Display for LeanGossipTopic { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "/{}/{}/{}/{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{}/{ENCODING_POSTFIX}", self.fork.encode_hex(), self.kind, - ENCODING_POSTFIX ) } } @@ -75,11 +73,8 @@ impl From for TopicHash { Vote => LEAN_VOTE_TOPIC, }; TopicHash::from_raw(format!( - "/{}/{}/{}/{}", - TOPIC_PREFIX, + "/{TOPIC_PREFIX}/{}/{kind_str}/{ENCODING_POSTFIX}", val.fork.encode_hex(), - kind_str, - ENCODING_POSTFIX )) } } diff --git a/crates/networking/p2p/src/gossipsub/snappy.rs b/crates/networking/p2p/src/gossipsub/snappy.rs index b895d1a76..ce206094f 100644 --- a/crates/networking/p2p/src/gossipsub/snappy.rs +++ b/crates/networking/p2p/src/gossipsub/snappy.rs @@ -21,8 +21,8 @@ impl DataTransform for SnappyTransform { return Err(std::io::Error::new( std::io::ErrorKind::InvalidData, format!( - "Message size ({}) exceeds max gossip size per message ({})", - len, self.max_size_per_message + "Message size ({len}) exceeds max gossip size per message ({})", + self.max_size_per_message ), )); } diff --git a/crates/networking/p2p/src/network/beacon/mod.rs b/crates/networking/p2p/src/network/beacon/mod.rs index c707c05d9..a84f80732 100644 --- a/crates/networking/p2p/src/network/beacon/mod.rs +++ b/crates/networking/p2p/src/network/beacon/mod.rs @@ -183,7 +183,7 @@ impl Network { let config = swarm::Config::with_executor(Executor(executor)) .with_notify_handler_buffer_size(NonZeroUsize::new(7).expect("Not zero")) .with_per_connection_event_buffer_size(4) - .with_dial_concurrency_factor(NonZeroU8::new(1).unwrap()); + .with_dial_concurrency_factor(NonZeroU8::new(1).expect("Not zero")); let builder = SwarmBuilder::with_existing_identity(Keypair::from(local_key.clone())) .with_tokio() diff --git a/crates/networking/p2p/src/network/lean/mod.rs b/crates/networking/p2p/src/network/lean/mod.rs index 4d0b2d6e3..7fcd306fd 100644 --- a/crates/networking/p2p/src/network/lean/mod.rs +++ b/crates/networking/p2p/src/network/lean/mod.rs @@ -159,7 +159,7 @@ impl LeanNetworkService { let config = Config::with_executor(Executor(executor)) .with_notify_handler_buffer_size(NonZeroUsize::new(7).expect("Not zero")) .with_per_connection_event_buffer_size(4) - .with_dial_concurrency_factor(NonZeroU8::new(1).unwrap()); + .with_dial_concurrency_factor(NonZeroU8::new(1).expect("Not zero")); SwarmBuilder::with_existing_identity(local_key.clone()) .with_tokio() diff --git a/crates/networking/p2p/src/req_resp/protocol_id.rs b/crates/networking/p2p/src/req_resp/protocol_id.rs index 8e8544bce..9f9c18826 100644 --- a/crates/networking/p2p/src/req_resp/protocol_id.rs +++ b/crates/networking/p2p/src/req_resp/protocol_id.rs @@ -17,16 +17,14 @@ impl ProtocolId { let protocol_id = match protocol { SupportedProtocol::Beacon(beacon_protocol) => { format!( - "{}/{}/{}/ssz_snappy", - BEACON_PROTOCOL_PREFIX, + "{BEACON_PROTOCOL_PREFIX}/{}/{}/ssz_snappy", beacon_protocol.message_name(), beacon_protocol.schema_version() ) } SupportedProtocol::Lean(lean_protocol) => { format!( - "{}/{}/{}/ssz_snappy", - LEAN_PROTOCOL_PREFIX, + "{LEAN_PROTOCOL_PREFIX}/{}/{}/ssz_snappy", lean_protocol.message_name(), lean_protocol.schema_version() ) diff --git a/crates/networking/syncer/Cargo.toml b/crates/networking/syncer/Cargo.toml index 93ead0bc2..5e2e0fd7e 100644 --- a/crates/networking/syncer/Cargo.toml +++ b/crates/networking/syncer/Cargo.toml @@ -30,3 +30,6 @@ ream-executor.workspace = true ream-network-spec.workspace = true ream-p2p.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/crates/rpc/beacon/Cargo.toml b/crates/rpc/beacon/Cargo.toml index 6c0cbd825..6ffbf5f18 100644 --- a/crates/rpc/beacon/Cargo.toml +++ b/crates/rpc/beacon/Cargo.toml @@ -43,3 +43,6 @@ ream-operation-pool.workspace = true ream-p2p.workspace = true ream-rpc-common.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/crates/rpc/common/Cargo.toml b/crates/rpc/common/Cargo.toml index 0367552be..6a8a18ed7 100644 --- a/crates/rpc/common/Cargo.toml +++ b/crates/rpc/common/Cargo.toml @@ -18,3 +18,6 @@ tracing.workspace = true ream-api-types-beacon.workspace = true ream-api-types-common.workspace = true ream-node.workspace = true + +[lints] +workspace = true diff --git a/crates/rpc/lean/Cargo.toml b/crates/rpc/lean/Cargo.toml index 0f5a03653..44d314132 100644 --- a/crates/rpc/lean/Cargo.toml +++ b/crates/rpc/lean/Cargo.toml @@ -23,3 +23,6 @@ ream-chain-lean.workspace = true ream-consensus-lean.workspace = true ream-p2p.workspace = true ream-rpc-common.workspace = true + +[lints] +workspace = true diff --git a/crates/runtime/Cargo.toml b/crates/runtime/Cargo.toml index a326f4b7e..c2f556a80 100644 --- a/crates/runtime/Cargo.toml +++ b/crates/runtime/Cargo.toml @@ -10,3 +10,6 @@ rust-version.workspace = true version.workspace = true [dependencies] + +[lints] +workspace = true diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index 358c5d6e6..79cfa0dcd 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -30,3 +30,6 @@ tree_hash.workspace = true ream-consensus-beacon.workspace = true ream-consensus-lean.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/testing/beacon-api/Cargo.toml b/testing/beacon-api/Cargo.toml index 7e00d5c79..47be232e5 100644 --- a/testing/beacon-api/Cargo.toml +++ b/testing/beacon-api/Cargo.toml @@ -22,3 +22,6 @@ tokio.workspace = true # ream ream-consensus-beacon.workspace = true ream-consensus-misc.workspace = true + +[lints] +workspace = true diff --git a/testing/ef-tests/Cargo.toml b/testing/ef-tests/Cargo.toml index f897e1a79..cf4c1984f 100644 --- a/testing/ef-tests/Cargo.toml +++ b/testing/ef-tests/Cargo.toml @@ -35,3 +35,6 @@ ream-fork-choice.workspace = true ream-merkle.workspace = true ream-network-spec.workspace = true ream-storage.workspace = true + +[lints] +workspace = true diff --git a/testing/gossip-validation/Cargo.toml b/testing/gossip-validation/Cargo.toml index e002084b8..53ca80cea 100644 --- a/testing/gossip-validation/Cargo.toml +++ b/testing/gossip-validation/Cargo.toml @@ -29,3 +29,6 @@ ream-network-spec.workspace = true ream-operation-pool.workspace = true ream-storage.workspace = true +[lints] +workspace = true + diff --git a/testing/gossip-validation/tests/validate_block.rs b/testing/gossip-validation/tests/validate_block.rs index 903139e87..237ccfbea 100644 --- a/testing/gossip-validation/tests/validate_block.rs +++ b/testing/gossip-validation/tests/validate_block.rs @@ -1,3 +1,4 @@ +#[allow(clippy::unwrap_used)] mod tests { const PATH_TO_TEST_DATA_FOLDER: &str = "./tests"; use std::{path::PathBuf, str::FromStr}; @@ -77,7 +78,7 @@ mod tests { (beacon_chain, cached_db, block_root) } - #[allow(clippy::too_many_arguments)] + #[allow(clippy::too_many_arguments, clippy::unwrap_used)] pub async fn insert_mock_data( db: &mut BeaconDB, ancestor_beacon_block: SignedBeaconBlock,