-
Notifications
You must be signed in to change notification settings - Fork 300
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
Stop Signing over the PartSetHeader
for Votes and remove it from the Header
#457
Stop Signing over the PartSetHeader
for Votes and remove it from the Header
#457
Conversation
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.
There are not that many meaningful changes, so I pointed them out to hopefully save reviewers a bit of time.
@@ -63,23 +63,22 @@ message Header { | |||
|
|||
// prev block info | |||
BlockID last_block_id = 5 [(gogoproto.nullable) = false]; | |||
PartSetHeader last_part_set_header = 6; |
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.
removal of the LastPartSetHeader
field in the proto header
@@ -35,5 +35,4 @@ message CanonicalVote { | |||
CanonicalBlockID block_id = 4 [(gogoproto.customname) = "BlockID"]; | |||
google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; | |||
string chain_id = 6 [(gogoproto.customname) = "ChainID"]; | |||
CanonicalPartSetHeader part_set_header = 7; |
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.
removal of the PartSetHeader
from the CanonicalVote
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.
So the CanonicalPartSetHeader
is still needed bc/ we have to sign over it in the proposal at least, right?
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, yes. I double-checked and CanonicalPartSetHeader
is only used in the canonical proposal.
func CanonicalizeVote(chainID string, vote *tmproto.Vote) tmproto.CanonicalVote { | ||
cppsh := CanonicalizePartSetHeader(*vote.PartSetHeader) | ||
return tmproto.CanonicalVote{ | ||
Type: vote.Type, | ||
Height: vote.Height, // encoded as sfixed64 | ||
Round: int64(vote.Round), // encoded as sfixed64 | ||
BlockID: CanonicalizeBlockID(vote.BlockID), | ||
Timestamp: vote.Timestamp, | ||
ChainID: chainID, | ||
PartSetHeader: &cppsh, | ||
Type: vote.Type, | ||
Height: vote.Height, // encoded as sfixed64 | ||
Round: int64(vote.Round), // encoded as sfixed64 | ||
BlockID: CanonicalizeBlockID(vote.BlockID), | ||
Timestamp: vote.Timestamp, | ||
ChainID: chainID, |
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.
the removal of the PartSetHeader
in the CanonicalVote
allows for the preservation of the PartSetHeader
in tmproto.Vote
require.NoError(t, err) | ||
|
||
require.Equal(t, voteA.Signature, voteB.Signature) | ||
|
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.
👍🏼
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.
Just FYI. This looks really good. I'd still like to go through each line which might take a while.
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.
Was trying to find something, but seems totally good!
da3d85d
to
cbfed8c
Compare
Codecov Report
@@ Coverage Diff @@
## master #457 +/- ##
==========================================
+ Coverage 62.77% 62.82% +0.04%
==========================================
Files 263 263
Lines 32526 32499 -27
==========================================
- Hits 20419 20417 -2
+ Misses 10555 10532 -23
+ Partials 1552 1550 -2
|
* Revert "Remove the PartSetHeader from VoteSetMaj23, VoteSetBits, and state.State (#479)" This reverts commit 3ba47c2. * Revert "Stop Signing over the `PartSetHeader` for Votes and remove it from the `Header` (#457)" This reverts commit 818be04. * Revert "Decouple PartSetHeader from BlockID (#441)" This reverts commit 9d4265d.
* Revert "Remove the PartSetHeader from VoteSetMaj23, VoteSetBits, and state.State (#479)" This reverts commit 3ba47c2. * Revert "Stop Signing over the `PartSetHeader` for Votes and remove it from the `Header` (#457)" This reverts commit 818be04. * Revert "Decouple PartSetHeader from BlockID (#441)" This reverts commit 9d4265d. * Revert "Save and load block data using IPFS (#374)" This reverts commit 8da1644. * fix merge error * Revert "Add the ipfs dag api object in Blockstore (#356)" and get rid of embedded ipfs objects This reverts commit 40acb17. * remove ipfs node provider from new node * stop init ipfs repos * remove IPFS node config * clean up remaining ipfs stuff
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.14.0 to 1.15.0. - [Release notes](https://github.com/bufbuild/buf-setup-action/releases) - [Commits](bufbuild/buf-setup-action@v1.14.0...v1.15.0) --- updated-dependencies: - dependency-name: bufbuild/buf-setup-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description
This PR builds off of #441 and continues the work of #418 by not including the
PartSetHeader
in theCanonicalVote
. It also removes thePartSetHeader
from theHeader
's hash by removing it entirely from bothtypes.Header
andtmproto.Header
This PR can be merged into #441 or master after #441 is merged, whichever is most convenient for the reviewers
Closes: #456