Problem
The app outbound encoding helper currently receives Vec<u8> from Serializer::serialize and converts it into bytes::Bytes before wrapping codec frames. This is correct for the current serializer contract, but it prevents a zero-copy outbound path.
Suggested fix
Plan a serializer contract migration that can return Bytes or an equivalent owned byte buffer without forcing an intermediate Vec<u8> allocation. The migration should preserve existing serializer implementations or provide a compatibility shim.
Context
This was surfaced during the 2026-06-05 code-base audit implementation in src/app/outbound_encoding.rs. The current refactor intentionally keeps Serializer::serialize unchanged and tracks the zero-copy migration separately to avoid broad public API churn.
Problem
The app outbound encoding helper currently receives
Vec<u8>fromSerializer::serializeand converts it intobytes::Bytesbefore wrapping codec frames. This is correct for the current serializer contract, but it prevents a zero-copy outbound path.Suggested fix
Plan a serializer contract migration that can return
Bytesor an equivalent owned byte buffer without forcing an intermediateVec<u8>allocation. The migration should preserve existing serializer implementations or provide a compatibility shim.Context
This was surfaced during the 2026-06-05 code-base audit implementation in
src/app/outbound_encoding.rs. The current refactor intentionally keepsSerializer::serializeunchanged and tracks the zero-copy migration separately to avoid broad public API churn.