Skip to content

Eliminate AbstractRLPOutput abstraction to reduce technical debt #8889

@jflo

Description

@jflo

Problem

Brittleness Signal: Unnecessary abstraction layer between RLPOutput interface and its single implementation
Frequency: Low impact on development velocity, but increases code complexity
Investigation Time: Developers need to understand abstract/concrete relationship for simple RLP encoding

Root Cause

Hidden Coupling: AbstractRLPOutput exists with only one concrete implementation (BytesValueRLPOutput)
Files Involved:

  • ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/AbstractRLPOutput.java
  • ethereum/rlp/src/main/java/org/hyperledger/besu/ethereum/rlp/BytesValueRLPOutput.java

Why It Exists: Premature abstraction - designed for multiple implementations that never materialized

Proposed Solution

Approach: Direct class consolidation - merge AbstractRLPOutput logic into BytesValueRLPOutput
Scope: 2 files, ~150+ usage sites (no changes needed to usage sites)
Success Criteria:

  • Single concrete RLPOutput implementation class
  • All existing tests pass unchanged
  • No import statement changes required across codebase
  • Same public API surface maintained

Implementation Plan

Step 1: Consolidate classes (max 1 hour)

  • Move all methods from AbstractRLPOutput into BytesValueRLPOutput
  • Change BytesValueRLPOutput from extends AbstractRLPOutput to implements RLPOutput
  • Remove abstract keywords, make class concrete
  • Delete AbstractRLPOutput.java
  • Verify with ./gradlew :ethereum:rlp:test

Safety Checks

  • Can revert each step independently
  • Tests exist to verify functionality (RLP module tests)
  • No changes to public APIs
  • Change only affects RLP module

Definition of Done

  • AbstractRLPOutput.java file deleted
  • BytesValueRLPOutput directly implements RLPOutput interface
  • All RLP module tests pass
  • No compilation errors across entire codebase
  • Code reviewer confirms abstraction layer eliminated

Additional Context

This follows the same pattern as the recent AbstractRLPInput elimination. The RLP module had premature abstractions on both input and output sides that provide no value with single implementations.

Metadata

Metadata

Assignees

Labels

techdebtmaintenance, cleanup, refactoring, documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions