{"record":{"id":"db6fd488e5dbdee6","repo":"linera-io/linera-protocol","slug":"serialize-event-ids","errorCode":null,"errorMessage":"serialize event_ids","messagePattern":"serialize event_ids","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"linera-rpc/src/grpc/conversions.rs","lineNumber":1117,"sourceCode":"        }\n    }\n}\n\nimpl TryFrom<api::DownloadCertificatesByHeightsRequest> for CertificatesByHeightRequest {\n    type Error = GrpcProtoConversionError;\n\n    fn try_from(request: api::DownloadCertificatesByHeightsRequest) -> Result<Self, Self::Error> {\n        Ok(Self {\n            chain_id: try_proto_convert(request.chain_id)?,\n            heights: request.heights.into_iter().map(Into::into).collect(),\n        })\n    }\n}\n\nimpl From<Vec<EventId>> for api::EventBlockHeightsRequest {\n    fn from(event_ids: Vec<EventId>) -> Self {\n        Self {\n            event_ids: bincode::serialize(&event_ids).expect(\"serialize event_ids\"),\n        }\n    }\n}\n\nimpl TryFrom<api::EventBlockHeightsRequest> for Vec<EventId> {\n    type Error = GrpcProtoConversionError;\n\n    fn try_from(request: api::EventBlockHeightsRequest) -> Result<Self, Self::Error> {\n        Ok(bincode::deserialize(&request.event_ids)?)\n    }\n}\n\nimpl From<Vec<Option<BlockHeight>>> for api::EventBlockHeightsResponse {\n    fn from(heights: Vec<Option<BlockHeight>>) -> Self {\n        Self {\n            heights: bincode::serialize(&heights).expect(\"serialize heights\"),\n        }\n    }","sourceCodeStart":1099,"sourceCodeEnd":1135,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-rpc/src/grpc/conversions.rs#L1099-L1135","documentation":"The From<Vec<EventId>> for api::EventBlockHeightsRequest conversion (linera-rpc/src/grpc/conversions.rs:1114) bincode-serializes the event IDs into the protobuf request and expects success. bincode serialization of Vec<EventId>, whose elements are plain integer-based types, cannot fail; the expect documents that this conversion is infallible rather than guarding a realistic failure.","triggerScenarios":"Not realistically reachable: it would require EventId's Serialize impl itself to error, which the type's definition does not allow. Hits here indicate a corrupted build or a custom EventId type introduced upstream.","commonSituations":"None under normal operation; only appears if linera-rpc is forked with custom Serialize impls that can fail.","solutions":["If hit in a fork, make the conversion fallible (TryFrom) or fix the custom Serialize impl.","In upstream builds, treat the panic as an internal bug and report it with a backtrace."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No prevention needed: bincode serialization of Vec<EventId> is infallible in practice.","Only fork maintainers who change EventId's Serialize impl need to convert this to TryFrom."],"tags":["linera-rpc","grpc","bincode","serialization","unreachable"],"backgroundTag":"serialization-failure","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}