Skip to content

Overlay: remove dead Encoder::encode / Connection::split() sender-receiver chain #3784

Description

@tomerweller

Summary

Follow-up from #3774 / PR #3783. While fixing the missing MAX_MESSAGE_SIZE check on the real send path (MessageCodec::encode_message), /plan and both critics confirmed that an entire parallel encode/framing abstraction in crates/overlay/src/codec.rs and crates/overlay/src/connection.rs is dead code in production:

  • The Encoder<AuthenticatedMessage>::encode trait impl (codec.rs) — reachable only via a Sink-trait generic-dispatch path.
  • That Sink path runs through Connection::split() / ConnectionSender / ConnectionReceiver (connection.rs), which have zero callers anywhere in the workspace and are not re-exported from lib.rs.

The real send path is Connection::sendMessageCodec::encode_message, and the real receive path is Decoder::decode; neither goes through the split abstraction.

Suggested next step

Confirm (again, at cleanup time) that Connection::split(), ConnectionSender, ConnectionReceiver, and the Encoder::encode trait impl have no remaining callers, then remove the whole chain. After #3783 merges, the size-bound helper (check_encode_size) is called from both encode_message and Encoder::encode; removing Encoder::encode leaves encode_message as its sole caller, which is fine.

Context

Not urgent — pure dead-code removal, no observable-surface impact. Kept out of #3783 to keep that bug fix focused on the missing check.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions