Commit Graph

105 Commits

Author SHA1 Message Date
Jasmina Malicevic
1f49985a1b Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-06-14 22:44:45 +02:00
Jasmina Malicevic
3ac1856579 linter error 2022-06-14 22:15:44 +02:00
Jasmina Malicevic
38b774601e blocksync: verification refactored 2022-06-14 13:39:11 +02:00
Callum Waters
b0ec8a0ea7 mempool: migrate rechecktx to be a consensus parameter (#8514) 2022-05-25 23:57:23 +02:00
Jasmina Malicevic
6f5978e906 blocksync: fixed bug if switching from statesync and no actual block in store 2022-05-24 17:13:05 +02:00
Jasmina Malicevic
e515dd4a8e applied PR comment 2022-05-24 11:17:07 +02:00
Jasmina Malicevic
f8d3bf8e6d Reverted increased test timeout 2022-05-24 11:13:39 +02:00
Jasmina Malicevic
dc4d7eac9b blocksync: merged with master 2022-05-24 10:50:50 +02:00
Jasmina Malicevic
94d5ff1bf8 Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-05-24 00:03:09 +02:00
Jasmina Malicevic
7d8fc400b7 Applied comments from PR and minor cleanup 2022-05-23 23:59:19 +02:00
William Banfield
0cceadf4d4 abci++: add consensus parameter logic to control vote extension require height (#8547)
This PR makes vote extensions optional within Tendermint. A new ConsensusParams field, called ABCIParams.VoteExtensionsEnableHeight, has been added to toggle whether or not extensions should be enabled or disabled depending on the current height of the consensus engine. Related to: #8453
2022-05-20 17:46:52 -04:00
Jasmina Malicevic
70dc94456f Merged with master and fixed linter error 2022-05-13 17:13:56 +02:00
Jasmina Malicevic
9dc425f2fa blocksync: code refactoring and bug fix 2022-05-13 13:59:01 +02:00
Jasmina Malicevic
f776b6cea0 blocksync: code refactoring and bug fix 2022-05-13 12:47:19 +02:00
Jasmina Malicevic
47bd5cc65d Minor comments from PR 2022-05-12 14:31:53 +02:00
Jasmina Malicevic
26e864c7ff tests compile, but multinode test not working with extensions 2022-05-12 09:49:11 +02:00
Jasmina Malicevic
32e06ad80a first merge with #8433 2022-05-11 17:41:54 +02:00
Jasmina Malicevic
54418abb3a Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-05-11 17:11:25 +02:00
Jasmina Malicevic
2aef5ec1fa blocksync: applied PR comment 2022-05-11 15:32:06 +02:00
Jasmina Malicevic
04645d218f blocksync: removed comment 2022-05-11 15:31:03 +02:00
Thane Thomson
06b1812094 abci++: Propagate vote extensions (RFC 017) (#8433)
* Add protos for ExtendedCommit

Cherry-pick from e73f0178b72a16ee81f8e856aadf651f2c62ec6e just the
changes to the .proto files, since we have deleted the .intermediate
files.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make proto-gen

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* BlockStore holds extended commit

Cherry-pick 8d504d4b50ec6afbdffe2df7ababbef30e15053d and fix conflicts.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Reshuffle ExtendedCommit and ExtendedCommitSig

Separate the data structures and functions from their Commit-oriented
counterparts to adhere to the current coding style.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix exit condition in blocksync

* Add note to remove TxResult proto

As Sergio pointed out in 3e31aa6f583cdc71e208ed03a82f1d804ec0de49, this
proto message can probably be removed. We should do this in a separate
PR.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Lift termination condition into for loop

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Enforce vote extension signature requirement

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand on comment for PeekTwoBlocks for posterity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Isolate TODO more clearly

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make mockery

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix comment

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Make panic output from BlockStore.SaveBlock more readable

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add helper methods to ExtendedCommitSig and ExtendedCommit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix most tests except TestHandshake*

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix store prefix collision

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix TestBlockFetchAtHeight

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove global state from store tests

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Apply suggestions from code review

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Co-authored-by: Sergio Mena <sergio@informal.systems>

* blocksync: Just return error

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Remove unused/commented-out code

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blocksync: Change pool AddBlock function signature to return errors

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Improve legibility of switch statements

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blocksync: Expand on extended commit requirement in AddBlock description

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blocksync: Return error without also logging it

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* consensus: Rename short-lived local variable

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* consensus: Allocate TODO to Sergio

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* evidence/pool_test: Inline slice construction

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Rename LoadBlockExtCommit to LoadBlockExtendedCommit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto: Remove TODO on TxResult

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Minor format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Reformat ExtendedCommitSig.BlockID

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Remove NewExtendedCommit constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Remove NewCommit constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Shorten receiver names for ExtendedCommit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Convert ExtendedCommit.Copy to a deep clone

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Assign TODO to Sergio

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Fix legibility nits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Improve legibility

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* store/state: Add TODO to move prefixes to common package

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Propagate validator info to PrepareProposal

In order to propagate validator voting power through to PrepareProposal,
we need to load the validator set info from the height corresponding to
the extended commit that we're passing through to PrepareProposal as the
"LocalLastCommit".

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Rename local var for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix TestMaxProposalBlockSize

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Rename local var for clarity

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove debug log

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove CommigSig.ForBlock helper

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove CommigSig.Absent helper

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove ExtendedCommitSig.ForBlock helper

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove ExtendedCommitSig.Absent helper

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* There are no extended commits below the initial height

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Fix comment grammar

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove JSON encoding from ExtendedCommit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Embed CommitSig into ExtendedCommitSig instead of duplicating fields

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Rename ExtendedCommit vote_extension field to extension for consistency with domain types

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blocksync: Panic if we peek a block without an extended commit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Apply suggestions from code review

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* Remove Sergio from TODO

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Increase hard-coded vote extension max size to 1MB

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Remove unnecessary comment

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* state: Ensure no of commit sigs equals validator set length

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* make format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Minor legibility improvements

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Improve legibility

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Remove unused GetVotes function on VoteSet

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Refactor TestMaxProposalBlockSize to construct more realistic extended commit

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Refactor buildExtendedCommitInfo to resemble buildLastCommitInfo

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Apply suggestions from code review

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>

* abci++: Disable VerifyVoteExtension call on nil precommits (#8491)

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* types: Require vote extensions on non-nil precommits and not otherwise

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Disable lint

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Increase timeout for TestReactorVotingPowerChange to counter flakiness

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only sign and verify vote extensions in non-nil precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Revert "Disable lint"

This reverts commit 6fffbf9402.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add missing non-nil check uncovered non-deterministically in TestHandshakeReplayAll

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Expand error message for accuracy

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only call ExtendVote when we make non-nil precommits

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Revert "Increase timeout for TestReactorVotingPowerChange to counter flakiness"

This reverts commit af514939db.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Refactor ValidateBasic for ExtendedCommitSig for legibility

Signed-off-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: Sergio Mena <sergio@informal.systems>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2022-05-11 07:10:32 -04:00
Jasmina Malicevic
3395affe75 blocksync: fixed merge induced error 2022-05-11 13:07:41 +02:00
Jasmina Malicevic
3a476331f1 Merged with #8493
Merge with #8493
2022-05-11 13:05:45 +02:00
Jasmina Malicevic
8b68022d16 Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-05-11 13:05:10 +02:00
Callum Waters
a4c3b5cab4 validate block before we persist it (#8493) 2022-05-10 17:34:53 +02:00
Jasmina Malicevic
753413941f blocksync: fixed behaviour when validation fails; appliead PR comments 2022-05-04 15:45:30 +02:00
Jasmina Malicevic
4b83be646c blocksync: fixed spelling error 2022-05-03 13:54:36 +02:00
Jasmina Malicevic
52bc079225 Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-05-03 12:56:33 +02:00
Thane Thomson
e7451a43e7 blocksync: Honor contexts supplied to BlockPool (#8447)
* Lift condition into for loop

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Honor contexts in BlockPool

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Only stop timers when necessary

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Optimize timers

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Simplify request interval definition

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Remove extraneous timer stop

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Convert switch into if

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Eliminate timers

Signed-off-by: Thane Thomson <connect@thanethomson.com>
2022-04-30 14:34:59 -04:00
Sam Kleinman
cf2a00b398 p2p: avoid using p2p.Channel internals (#8444) 2022-04-29 17:21:36 -04:00
Jasmina Malicevic
9a8bcba943 blocksync: comments on missing tests 2022-04-29 12:46:22 +02:00
Jasmina Malicevic
8ddedd157d formatting 2022-04-28 17:10:20 +02:00
Jasmina Malicevic
600f84dae6 blocksync: added test for syncing blocks from different heights 2022-04-28 16:41:55 +02:00
Jasmina Malicevic
3654fc9fae blocksync/pool: reverted to PeekTwoBlocks 2022-04-27 15:34:51 +02:00
Jasmina Malicevic
2a31843f8d blocksync: cleanedup 2022-04-27 15:26:04 +02:00
Jasmina Malicevic
2cdd71a38f blocksync: removed println noise 2022-04-27 15:21:10 +02:00
Jasmina Malicevic
d6cbb05105 blocksync: added support for multiple validators in tests 2022-04-27 15:19:01 +02:00
Jasmina Malicevic
4e6d38030c Removed commented out code 2022-04-26 16:24:38 +02:00
Jasmina Malicevic
abfc780202 Merge remote-tracking branch 'origin' into jasmina/4457-blocksync-verification_part1 2022-04-26 15:45:07 +02:00
Sam Kleinman
efd4f4a40b cleanup: unused parameters (#8372) 2022-04-18 16:45:21 -04:00
Sam Kleinman
c372390fea eventbus: publish without contexts (#8369) 2022-04-18 16:28:31 -04:00
Jasmina Malicevic
d22f4c458f blocksync: separate verification into different file 2022-04-15 16:24:35 +02:00
Jasmina Malicevic
b4f422e413 minor delete 2022-04-14 13:41:27 +02:00
Jasmina Malicevic
a6e0813be5 Merge remote-tracking branch 'origin/master' into jasmina/4457_block_sync_verification 2022-04-14 13:39:45 +02:00
Jasmina Malicevic
60eaa831af blocksync: Verification using LastCommit of block at height H + 2 2022-04-14 13:37:26 +02:00
Sam Kleinman
9d20e06900 statesync+blocksync: move event publications into the sync operations (#8274) 2022-04-07 16:23:36 -04:00
Jasmina Malicevic
4ba3892b03 Merged with master 2022-04-07 14:45:24 +02:00
Jasmina Malicevic
07fac4ccc0 Merge remote-tracking branch 'origin' into jasmina/4457_block_sync_verification 2022-04-07 14:42:57 +02:00
Jasmina Malicevic
09f522b249 blocksync: Initial working commit with adjacent block verification
store: Added functions ot return protobuf objects for block and commit (perf opt)
proto: Added Commit to the BlockResponse message

- WARN: Manual proto files for blocksync
2022-04-07 14:25:09 +02:00
Sam Kleinman
9d1e8eaad4 node: remove channel and peer update initialization from construction (#8238) 2022-04-05 13:26:53 +00:00