pub fn encode_response( response: &ResponseEnvelope, limits: ProtocolLimits, ) -> Result<Vec<u8>, ProtocolError>