-
Notifications
You must be signed in to change notification settings - Fork 264
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
Add the DataAvailabilityHeader to BlockMeta #372
Conversation
Codecov Report
@@ Coverage Diff @@
## master #372 +/- ##
==========================================
- Coverage 61.86% 61.79% -0.07%
==========================================
Files 262 262
Lines 22922 22933 +11
==========================================
- Hits 14180 14171 -9
- Misses 7249 7258 +9
- Partials 1493 1504 +11
|
proto/tendermint/types/types.proto
Outdated
@@ -213,6 +213,7 @@ message BlockMeta { | |||
int64 block_size = 2; | |||
Header header = 3 [(gogoproto.nullable) = false]; | |||
int64 num_txs = 4; | |||
DataAvailabilityHeader da_header = 5 [(gogoproto.nullable) = false]; |
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.
@liamsi, what was the thinking behind not using [(gogoproto.nullable) = false]
for the DAH in the tmproto.Block
? I used it here, but can revert.
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.
No particular reason. I want to use these gogoprote annotations as little as possible. Some of them break with the actual protobuf specification.
@marbar3778 is there a good rule of thumb when to use and when to use them?
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.
Revisiting John's favorite topic, but the deterministic protobuf spec doesn't include any provisions for gogoproto annotations. In fact, if we stick to deterministic protobuf then [(gogoproto.nullable) = false]
would be invalid. This is actually a big deal, because including those annotations in our proto definitions would mean having our own custom non-standard serialization format, and also tie us to an unmaintained third-party dependency.
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.
@adlerjohn, why do you think it is unmaintained?
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.
Edited in the link, but here: gogo/protobuf#691
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.
switched to not using gogo in https://github.com/lazyledger/lazyledger-core/pull/372/commits/3e3fa306441421fe78f96400f4737dcf899fdb93j, as always thanks for details @adlerjohn !
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.
👏🏼
BlockSize int `json:"block_size"` | ||
Header Header `json:"header"` | ||
NumTxs int `json:"num_txs"` | ||
DAHeader DataAvailabilityHeader `json:"da_header"` |
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.
Any reason to use value instead of a pointer?
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.
good question. my thinking was that we shouldn't be editing it, the dah consists of three slices which should be passed as by value, the general rule of thumb to not use pointers unless it's necessary, and that's what Block
uses
this was also why I was using gogoproto to do the same thing for the proto types, but that was revereted here 3e3fa30
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.
Ok, mostly my concern is to be consistent mostly about the use of a particular structure. For the case of DAHeader we don't do that(except for Block) and I think we need to change the places where we use pointers to values.
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
Description
This super simple PR adds the
DataAvailabilityHeader
toBlockMeta
. It's required for #374, which will close #373