Skip to content

Conversation

Peponks9
Copy link

@Peponks9 Peponks9 commented Aug 28, 2025

Motivation

This pull request addresses unnecessary #[allow(dead_code)] attributes scattered throughout the codebase that suppress compiler warnings.

Description

Cleaned up unnecessary #[allow(dead_code)] attributes throughout the codebase while preserving them where legitimately needed with explanatory comments.

Removed #[allow(dead_code)] from:

  • EngineType enums in storage modules (used in Store::new() methods)
  • DiscoveryError in p2p module (used throughout error handling)
  • OutMessage in l1_watcher (required by GenServer trait implementation)
  • init_network and get_bootnodes functions in initializers
  • read_node_config_file function in utils

Added explanatory comments for remaining legitimate uses:

  • Test utility struct FeesDetails that may be used conditionally in different test scenarios
  • ReplayerMode enum variants that may be used conditionally based on feature flags or runtime configuration

Closes #3968
cc @mpaulucci

- Add explanatory comments for removal of dead_code that triggers warnings.

Closes #[3968]
@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 02:31
@Peponks9 Peponks9 requested a review from a team as a code owner August 28, 2025 02:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request removes unnecessary #[allow(dead_code)] attributes that were suppressing compiler warnings for code that is actually used throughout the codebase.

  • Removed dead code attributes from enums, error types, and functions that are actively used
  • Added explanatory comments for remaining legitimate uses of the attribute
  • Cleaned up compiler warning suppressions to improve code hygiene

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/storage/store.rs Removed unnecessary dead code attribute from EngineType enum
crates/networking/p2p/discv4/server.rs Removed unnecessary dead code attribute from DiscoveryError enum
crates/l2/tests/tests.rs Added explanatory comment for legitimate dead code attribute on test utility struct
crates/l2/storage/src/store.rs Removed unnecessary dead code attribute from EngineType enum
crates/l2/sequencer/l1_watcher.rs Removed unnecessary dead code attribute from OutMessage enum
cmd/ethrex_replay/src/block_run_report.rs Added explanatory comment for legitimate dead code attribute on ReplayerMode enum
cmd/ethrex/utils.rs Removed unnecessary dead code attribute from read_node_config_file function
cmd/ethrex/initializers.rs Removed unnecessary dead code attributes from init_network and get_bootnodes functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Peponks9 Peponks9 changed the title Remove unnecessary #[allow(dead_code)] attributes fix(l1): Remove unnecessary #[allow(dead_code)] attributes Aug 29, 2025
@Peponks9 Peponks9 changed the title fix(l1): Remove unnecessary #[allow(dead_code)] attributes fix(l1): remove unnecessary #[allow(dead_code)] Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove #[allow(dead_code)] scattered throughout the codebase
1 participant