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::send → MessageCodec::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.
Summary
Follow-up from #3774 / PR #3783. While fixing the missing
MAX_MESSAGE_SIZEcheck on the real send path (MessageCodec::encode_message),/planand both critics confirmed that an entire parallel encode/framing abstraction incrates/overlay/src/codec.rsandcrates/overlay/src/connection.rsis dead code in production:Encoder<AuthenticatedMessage>::encodetrait impl (codec.rs) — reachable only via aSink-trait generic-dispatch path.Sinkpath runs throughConnection::split()/ConnectionSender/ConnectionReceiver(connection.rs), which have zero callers anywhere in the workspace and are not re-exported fromlib.rs.The real send path is
Connection::send→MessageCodec::encode_message, and the real receive path isDecoder::decode; neither goes through the split abstraction.Suggested next step
Confirm (again, at cleanup time) that
Connection::split(),ConnectionSender,ConnectionReceiver, and theEncoder::encodetrait impl have no remaining callers, then remove the whole chain. After #3783 merges, the size-bound helper (check_encode_size) is called from bothencode_messageandEncoder::encode; removingEncoder::encodeleavesencode_messageas 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.