Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing empty slices in protobufs #484

Open
matejpavlovic opened this issue Jul 7, 2023 · 0 comments
Open

Serializing empty slices in protobufs #484

matejpavlovic opened this issue Jul 7, 2023 · 0 comments

Comments

@matejpavlovic
Copy link
Contributor

matejpavlovic commented Jul 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant