feat(proof): create a proto representation of the proof#220
feat(proof): create a proto representation of the proof#220rootulp merged 7 commits intocelestiaorg:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #220 +/- ##
===========================================
- Coverage 93.67% 65.20% -28.47%
===========================================
Files 5 6 +1
Lines 601 891 +290
===========================================
+ Hits 563 581 +18
- Misses 21 293 +272
Partials 17 17
|
16791f9 to
0c83717
Compare
| message Proof { | ||
| int64 start = 1; | ||
| int64 end = 2; | ||
| repeated bytes nodes = 3; | ||
| bytes leafHash = 4; | ||
| bool isMaxNamespaceIDIgnored=5; | ||
| } No newline at end of file |
There was a problem hiding this comment.
[optional] doc comments on what each field does would be super helpful. Content from the specs may help https://github.com/celestiaorg/nmt/blob/master/docs/spec/nmt.md#namespace-proof
pb/proof.proto
Outdated
| int64 end = 2; | ||
| repeated bytes nodes = 3; | ||
| bytes leafHash = 4; | ||
| bool isMaxNamespaceIDIgnored=5; |
There was a problem hiding this comment.
[not blocking] Related: #206 . Once we make this a protobuf field, I wonder if renaming it would be breaking. I think renaming shouldn't block this PR but wanted to call it out. cc: @staheri14
There was a problem hiding this comment.
Thanks @rootulp for this suggestion. I also agree that in line with #206, it would be good to change this message field to isMaxNamespaceIgnored. I don't think it has to match the same field in the Proof struct, so it should be fine to use isMaxNamespaceIgnored instead.
staheri14
left a comment
There was a problem hiding this comment.
Thanks for the PR! I have added some comments.
pb/proof.proto
Outdated
| int64 end = 2; | ||
| repeated bytes nodes = 3; | ||
| bytes leafHash = 4; | ||
| bool isMaxNamespaceIDIgnored=5; |
There was a problem hiding this comment.
Thanks @rootulp for this suggestion. I also agree that in line with #206, it would be good to change this message field to isMaxNamespaceIgnored. I don't think it has to match the same field in the Proof struct, so it should be fine to use isMaxNamespaceIgnored instead.
| } | ||
|
|
||
| // ProtoToProof creates a proof from its proto representation. | ||
| func ProtoToProof(protoProof pb.Proof) Proof { |
There was a problem hiding this comment.
Don't we need an encoding counterpart i.e., ProofToProto?
There was a problem hiding this comment.
The counterpart will look like a creation of a pb struct. I think it could be done in place(but can make a counterpart).
Co-authored-by: Rootul P <rootulp@gmail.com>
46597ef to
fe29c87
Compare
|
@vgonkivs do you mind if we rename the PR title to |
|
Yes, please. You can name it whatever fits you. |
Co-authored-by: Rootul P <rootulp@gmail.com>
staheri14
left a comment
There was a problem hiding this comment.
LGTM! I suggested an optional change, but I highly recommended it.
|
Snyk claims this PR introduces 14 new vulnerabilities b/c the |
|
Thanks @rootulp for looking into this, I have created the tracking issue, feel free to add a snapshot of the Snyk errors in the issue for the record. |
Overview
Added and generated a proto representation of the Proof
Checklist