-
Notifications
You must be signed in to change notification settings - Fork 43
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
fix: replacing jsonProof with pb.Proof #233
Conversation
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
=======================================
Coverage 68.30% 68.30%
=======================================
Files 6 6
Lines 1325 1325
=======================================
Hits 905 905
Misses 403 403
Partials 17 17
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, we should consider making all the fields on the Proof public (It might be breaking).
It's feels wrong to reuse pb definition for json marshalling, even though it works.
I still disagree with making fields public only for the point of serialization. These are not fields that should be touched outside of the given methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] I think this should be marked breaking (i.e. fix!:
in PR title) because it impacts JSON encoding observed in downstream repos (i.e. celestia-node).
[question] Do we need a unit test in this PR that the field names in the proof JSON encoding match what is expected or does that test belong in celestia-node?
Actually true, encapsulation for Proofs is more important for security.
Using autogenerated proto for json completely solves consistency between json and proto, as it also autogenerates json tags(TIL), so it's not that bad after all. |
Yeah but the main problem is not being able to define methods on it |
I meant keeping native go struct |
What is the status on this? |
@rootulp Can we get this merged? |
Sorry we need one more @celestiaorg/celestia-core approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there follow on work to fix rpc @distractedm1nd?
jsonProof is not necessary when we already have pb.Proof, which caused issues because of mismatching field names.
Related: celestiaorg/celestia-node#2631
Specifically: celestiaorg/celestia-node#2631 (comment)