Skip to content
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

Merged
merged 16 commits into from
Jul 27, 2021

Conversation

evan-forbes
Copy link
Member

Description

This PR builds off of #441 and continues the work of #418 by not including the PartSetHeader in the CanonicalVote. It also removes the PartSetHeader from the Header's hash by removing it entirely from both types.Header and tmproto.Header

This PR can be merged into #441 or master after #441 is merged, whichever is most convenient for the reviewers

Closes: #456

@evan-forbes evan-forbes requested a review from liamsi as a code owner July 14, 2021 02:06
@evan-forbes evan-forbes self-assigned this Jul 14, 2021
@evan-forbes evan-forbes requested a review from Wondertan as a code owner July 14, 2021 02:06
Copy link
Member Author

@evan-forbes evan-forbes left a 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;
Copy link
Member Author

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;
Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member

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.

Comment on lines 58 to +65
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,
Copy link
Member Author

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Copy link
Member

@liamsi liamsi left a 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.

Copy link
Member

@Wondertan Wondertan left a 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!

@evan-forbes evan-forbes changed the base branch from evan/decouple-blockID to evan/ismail/explore_blockid_partsetheader July 25, 2021 16:42
Base automatically changed from evan/ismail/explore_blockid_partsetheader to master July 25, 2021 16:43
@evan-forbes evan-forbes force-pushed the evan/remove-lastpartsetheader-from-header branch from da3d85d to cbfed8c Compare July 27, 2021 06:04
@codecov-commenter
Copy link

Codecov Report

Merging #457 (74fcda5) into master (9d4265d) will increase coverage by 0.04%.
The diff coverage is 63.63%.

@@            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     
Impacted Files Coverage Δ
state/validation.go 94.54% <ø> (-0.29%) ⬇️
types/block.go 79.05% <ø> (+0.28%) ⬆️
types/protobuf.go 53.33% <0.00%> (+1.38%) ⬆️
types/vote.go 84.13% <0.00%> (-1.78%) ⬇️
state/state.go 82.94% <100.00%> (ø)
types/canonical.go 95.23% <100.00%> (-0.22%) ⬇️
libs/clist/clist.go 63.52% <0.00%> (-4.51%) ⬇️
p2p/ipld/sample.go 83.63% <0.00%> (-3.64%) ⬇️
types/tx.go 84.61% <0.00%> (-3.30%) ⬇️
types/share_merging.go 72.47% <0.00%> (-2.30%) ⬇️
... and 8 more

@evan-forbes evan-forbes merged commit 818be04 into master Jul 27, 2021
@evan-forbes evan-forbes deleted the evan/remove-lastpartsetheader-from-header branch July 27, 2021 07:10
evan-forbes added a commit that referenced this pull request Aug 23, 2021
evan-forbes added a commit that referenced this pull request Aug 25, 2021
* 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.
evan-forbes added a commit that referenced this pull request Aug 25, 2021
* 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
evan-forbes pushed a commit that referenced this pull request Jun 9, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't sign over the PartSetHeader or include it in the Header
4 participants