Skip to content

Serializing empty slices in protobufs #484

@matejpavlovic

Description

@matejpavlovic

When serializing and deserializing a protobuf-generated struct using, respectively, proto.Marshal and proto.Unmarshal, empty arrays contained in the struct turn into nil values. This creates inconsistencies between objects that nodes hold locally and the very same objects transmitted to other nodes over the network, as in the former case the serialize-deserialize cycle does not occur. This, in turn, leads to inconsistent state at different nodes.

A proper solution that is not just a workaround is probably only getting rid of protocol buffers altogether.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions