Skip to content

refactor: additional unused code cleanup#10445

Merged
smartprogrammer93 merged 3 commits intorefactoring/unused-codefrom
refactoring/unused-code-phase1
Feb 7, 2026
Merged

refactor: additional unused code cleanup#10445
smartprogrammer93 merged 3 commits intorefactoring/unused-codefrom
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)
Removes unused ILogManager parameter that was causing CI build failure.
The parameter was not used anywhere in the class after previous cleanup.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@smartprogrammer93 smartprogrammer93 changed the title refactor: additional unused code cleanup (Phase 1) refactor: additional unused code cleanup Feb 7, 2026
Delete 15 unreferenced type files identified through codebase-wide
static analysis:

Synchronization (5):
- AllocationChangeEventArgs
- StaticStrategy, NullStrategy, ClientTypeStrategy
- StrategySelectionType enum

Core (5):
- CompositePublisher, SortedRealList, ConcurrentWriteBatcher
- CappedArrayMemoryManager, ISpanCache

Serialization/Network/RPC (5):
- LogPublisher, CountingTextWriter, CountingTextReader
- IDiscoveryMsgSerializersProvider, IJsonRpcResult

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@smartprogrammer93 smartprogrammer93 marked this pull request as ready for review February 7, 2026 20:12
@smartprogrammer93 smartprogrammer93 merged commit 4aae5c6 into refactoring/unused-code Feb 7, 2026
71 checks passed
@smartprogrammer93 smartprogrammer93 deleted the refactoring/unused-code-phase1 branch February 7, 2026 20:13
@benaadams benaadams added refactoring network optimism taiko related to the taiko alethia rollup labels Feb 12, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (815c462) to head (2ed31f7).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           refactoring/unused-code   #10445       +/-   ##
============================================================
- Coverage                    57.42%        0   -57.43%     
============================================================
  Files                         2818        0     -2818     
  Lines                       132494        0   -132494     
  Branches                     19921        0    -19921     
============================================================
- Hits                         76082        0    -76082     
+ Misses                       51335        0    -51335     
+ Partials                      5077        0     -5077     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

network optimism refactoring taiko related to the taiko alethia rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants