Skip to content

refactor: additional unused code cleanup (Phase 1)#10444

Closed
smartprogrammer93 wants to merge 1 commit intoNethermindEth:refactoring/unused-codefrom
smartprogrammer93:refactoring/unused-code-phase1
Closed

refactor: additional unused code cleanup (Phase 1)#10444
smartprogrammer93 wants to merge 1 commit intoNethermindEth:refactoring/unused-codefrom
smartprogrammer93:refactoring/unused-code-phase1

Conversation

@smartprogrammer93
Copy link
Copy Markdown
Contributor

Additional Unused Code Cleanup

Building on top of #10440, this PR removes more unused code found via automated analysis across the full codebase.

Changes

5 empty (0-byte) files deleted:

  • TxNonceTxPoolReserveSealer.cs, TxPool.NonceInfo.cs (TxPool)
  • OverridableTxProcessingScope.cs, IOverridableTxProcessorSource.cs, IOverridableTxProcessingScope.cs (Consensus)

7 unused private methods removed:

  • TrieStore.IsStillNeeded() — dead wrapper
  • PatriciaTree.ThrowInvalidDataException/ThrowMissingChildException/ThrowMissingPrefixException — unused throw helpers
  • EthereumRunner.Stop() — replaced by ServiceStopper pattern
  • EthereumL1Bridge.LogReorg() — never called
  • Ssz.DecodeDynamicOffset() — never called (moved VarOffsetSize to BasicTypes.cs)

7 unused fields removed:

  • TrieNode._nodeDecoder — static instance, all calls use static methods
  • PatriciaTree._singleByteKeys — unused byte array
  • PersistentStorageProvider._loadFromTreeStorageFunc — delegate never invoked
  • SmallTrieVisitContext._branchChildIndex — no accessor, never read
  • TdxsClient._logger — assigned but never read
  • InitializeBlockchain._logManager — assigned but never referenced
  • SyncProgressResolver._logger — assigned but never read

6 dead NDM/LES timeout constants removed from Timeouts.cs (NDM and LES protocols were removed long ago)

11 unused/duplicate ErrorCodes constants removed

3 dead L1 epoch constants removed from EthereumL1Bridge

Unused using directives cleaned up where removal of dead code made them unnecessary

- Delete 5 empty (0-byte) files in TxPool and Consensus
- Remove 7 unused private methods:
  - TrieStore.IsStillNeeded()
  - PatriciaTree.ThrowInvalidDataException/ThrowMissingChildException/ThrowMissingPrefixException
  - EthereumRunner.Stop()
  - EthereumL1Bridge.LogReorg()
  - Ssz.DecodeDynamicOffset() (moved VarOffsetSize to BasicTypes.cs)
- Remove 7 unused private/static fields:
  - TrieNode._nodeDecoder
  - PatriciaTree._singleByteKeys
  - PersistentStorageProvider._loadFromTreeStorageFunc
  - SmallTrieVisitContext._branchChildIndex
  - TdxsClient._logger
  - InitializeBlockchain._logManager
  - SyncProgressResolver._logger
- Remove 6 dead NDM/LES timeout constants from Timeouts.cs
- Remove 11 unused/duplicate ErrorCodes constants
- Remove 3 unused L1 epoch constants from EthereumL1Bridge
- Clean up unused using directives (System.IO, System)
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.

1 participant