Skip to content

types: change Commit to consist of just signatures - #4146

Merged
melekes merged 13 commits into
masterfrom
anton/1648-commit
Nov 26, 2019
Merged

melekes merged 13 commits into
masterfrom
anton/1648-commit

Conversation

@melekes

@melekes melekes commented Nov 15, 2019 •

Copy link
Copy Markdown
Contributor

These are final changes towards removing votes from commit and leaving
"only" signatures (see ADR-25)

Fixes #1648

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@melekes melekes added T:breaking Type: Breaking Change R:major PR contains breaking changes that have to wait till a major release is made to be merged labels Nov 15, 2019
@tac0turtle

ghost commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

this is so exciting!!! 😄

Comment thread types/block.go Resolved
Comment thread state/state.go Resolved
@melekes
melekes marked this pull request as ready for review November 15, 2019 12:26
Comment thread types/block.go Resolved
Comment thread types/block.go Resolved
Comment thread types/vote.go Resolved
Comment thread blockchain/v0/reactor_test.go Resolved
@melekes
melekes force-pushed the anton/1648-commit branch 2 times, most recently from cd3a8ad to 0376b70 Compare November 16, 2019 17:54
Comment thread state/validation_test.go Resolved
@melekes melekes added the WIP label Nov 17, 2019
@melekes

This comment has been minimized.

Comment thread types/block.go Resolved
Comment thread types/block.go Resolved
@melekes

ghost commented Nov 19, 2019 •

Copy link
Copy Markdown
Contributor Author

TODO:

  • disallow empty votes; instead use Vote with empty block ID

Comment thread types/block.go Resolved
Comment thread state/helpers_test.go
}
blockID := types.BlockID{Hash: block.Hash(), PartsHeader: types.PartSetHeader{}}
blockID := types.BlockID{Hash: block.Hash(),
PartsHeader: types.PartSetHeader{Total: 3, Hash: cmn.RandBytes(32)}}

ghost Nov 20, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For my own education: Can you tell me what the PartsHeader is, and why we're setting the Hash now when we weren't before?

ghost Nov 21, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/blockchain.md#blockid

It's basically an alternative hash for the block that's only used for gossipping the block during consensus but has unfortunately leaked into the more global BlockID. A better design might see it removed from the BlockID, but would probably make the consensus reactor more complicated. Probably it's filled in now because there's more validation and its expected to be populated

ghost Nov 22, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. It's because I've added a panic in Vote#CommitSig() func if BlockID is neither Empty nor Complete. Normally ValidateBasic() catches this kind of errors, but since in tests we construct objects manually you will get a panic if PartsHeader is empty here

Comment thread types/vote.go Resolved
@tessr

ghost commented Nov 20, 2019

Copy link
Copy Markdown
Contributor

OK so this is definitely a silly question. But my understanding from reading https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-025-commit.md is that all of this is happening by making Precommits field in Commit a CommitSig instead of a Vote, but it looks like that may have happened already. If that's true, then what exactly is this PR doing? Is the main change adding the BlockIDFlag stuff?

Comment thread types/block.go Resolved
@ebuchman

ghost commented Nov 21, 2019

Copy link
Copy Markdown
Contributor

but it looks like that may have happened already.

Indeed, we made a lot of preliminary changes to prepare for the final breaking change. It happened in a series of non-breaking PRs that paved the way for this final PR which actually makes the breaking change. We did introduce the CommitSig type before, but until this PR, it's just an alias for the Vote type! You can see the three merged PRs on the way to this one in #1648:

@tessr

ghost commented Nov 21, 2019

Copy link
Copy Markdown
Contributor

Yes! @marbar3778 pointed it out to me above ^ I guess I missed it just because it looked small. Thanks all for the explanations.

@codecov-io

ghost commented Nov 22, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #4146 into master will increase coverage by 0.05%.
The diff coverage is 79.16%.

@@            Coverage Diff             @@
##           master    #4146      +/-   ##
==========================================
+ Coverage   67.43%   67.48%   +0.05%     
==========================================
  Files         221      221              
  Lines       18666    18672       +6     
==========================================
+ Hits        12587    12601      +14     
+ Misses       5125     5117       -8     
  Partials      954      954
Impacted Files Coverage Δ
state/state.go 91.01% <100%> (+0.2%) ⬆️
lite/helpers.go 80.76% <100%> (+1.03%) ⬆️
state/execution.go 72.45% <44.44%> (-0.85%) ⬇️
state/validation.go 83.63% <50%> (ø) ⬆️
consensus/state.go 77.63% <80%> (-0.32%) ⬇️
consensus/reactor.go 79.58% <84.61%> (+1.38%) ⬆️
blockchain/v2/routine.go 81.81% <0%> (-6.07%) ⬇️
blockchain/v2/reactor.go 54.38% <0%> (-1.76%) ⬇️
p2p/pex/pex_reactor.go 84.43% <0%> (+1.72%) ⬆️

continue does not make sense in these cases
Comment thread types/block.go Resolved
Comment thread state/execution_test.go Resolved
@melekes melekes self-assigned this Nov 22, 2019
@melekes
melekes merged commit ad715fe into master Nov 26, 2019
@melekes
melekes deleted the anton/1648-commit branch November 26, 2019 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R:major PR contains breaking changes that have to wait till a major release is made to be merged T:breaking Type: Breaking Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change Commit to consist of just signatures

7 participants