-
Notifications
You must be signed in to change notification settings - Fork 967
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
[Feature Request]: Unify the representation of jsonProof and pb.Proof #2427
Comments
Also it looks like in |
Hello @zvolin. Thanks for creating an issue. Yes, I think it makes sense to keep them consistent. Will extend protocol struct with one more field and fix naming |
I am also thinking about removing is-max-namespace-ignore field in JSON instead. This is a system wide param, rather than per proof, so we can simplify things by removing it. @vgonkivs, also consider unifying the BEFP proof proto definition if possible |
@Wondertan it's just 1 byte and I don't think it will take much place. Also, please not that json representation is from nmt repo. Anyway, I've created an issue in the nmt and proposing to move all photo-proof code there - closer to the implementation. |
they are encoded as i32, which takes up to 4 bytes, so they probably just take 1 or 2 🙏 |
Yes, they Are encoded as i32 but protobuf also uses a form of variable-length encoding called "variant" encoding. That means that smaller values can be encoded using fewer bytes. So, it's possible that |
@Wondertan I don't think that the recently linked pull request resolves the problem mentioned. It is only related in a sense that it fixes the json representation of something, but it doesn't touch the Ideally, I'd like to have it completed once
I'm happy to discuss those, but please reopen as this PR wasn't really related |
I think the problem is that in the linked commit there is:
Github only cares about the part |
Thanks for noting @zvolin. This issue is definitely not resolved. It was closed due to the “fixes” keyword in celestiaorg/go-header#82 after the merge. EDIT: as you mentioned in the subsequent comment, which I read after writing the comment |
ooooops, yes, my fault. Sorry. |
Hello @zvolin, we moved a pb definition of proof to the nmt library. You can find it here. The last thing is to rename |
Implementation ideas
Hi,
I think it'd be nice if the
jsonProof
andpb.Proof
had the same representations. My use case is that I'm generating most of the celestia types from protobuf definitions and that would allow me to re-use the pb-generated proof type in node rpc api calls without translating between types.Currently those two look like so
jsonProof
pb.Proof
Eg the protobuf definition could be changed like so to allow for seamless transitions:
I know this would be a breaking change tho, so curious to hear your opinion
The text was updated successfully, but these errors were encountered: