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

ProtobufRuntime issue, possibly when decoding array of int32 #23

Closed
lightyear15 opened this issue Dec 2, 2021 · 4 comments · Fixed by #30
Closed

ProtobufRuntime issue, possibly when decoding array of int32 #23

lightyear15 opened this issue Dec 2, 2021 · 4 comments · Fixed by #30

Comments

@lightyear15
Copy link

Please refer to the bug reported in repository:
https://github.com/lightyear15/sol-protobug

As explained in the README, it looks like it might be something related to the repeated int32 field.

@siburu
Copy link
Contributor

siburu commented Dec 3, 2021

Thanks for this report!
I investigated this issue and finally noticed that the current implementation of solidity-protobuf cannot decode packed repeated fields at all.
In proto3, repeated fields of scalar numeric types are packed by default.

(For packed repeated fields, see https://developers.google.com/protocol-buffers/docs/encoding#packed)

@siburu
Copy link
Contributor

siburu commented Dec 3, 2021

In fact, I passed your test by adding [packed=false] to L57.
https://github.com/lightyear15/sol-protobug/blob/main/test.proto#L57

@siburu
Copy link
Contributor

siburu commented Dec 3, 2021

@lightyear15 This is still an issue and should be fixed at some point, but can you use this workaround ([packed=false]) at this point?

@lightyear15
Copy link
Author

lightyear15 commented Dec 3, 2021

Thanks a lot @siburu ,
The protobuf message definition are not under my control.
I can try to push for review the change and see what maintainers have to say about.
I will mention this Issue ticket and see what they think about this
In the meantime: thanks a lot.

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

Successfully merging a pull request may close this issue.

2 participants