Commit Graph

9355 Commits

Author SHA1 Message Date
Anca Zamfir
693bae7a29 Review comments from Daniel 2022-01-07 12:52:57 +01:00
Anca Zamfir
bd99771b27 Check timely before ValidateBlock 2022-01-07 11:12:29 +01:00
Anca Zamfir
e065fba752 Add IsTimely test for genesis proposal 2022-01-04 17:07:54 +01:00
Anca Zamfir
2678191ccf Merge branch 'wb/proposer-based-timestamps' into anca/prevote_nil_untimely 2022-01-04 16:27:30 +01:00
William Banfield
a145696a9d always reset proposal time 2022-01-04 09:49:04 -05:00
William Banfield
5e83436019 received -> receive 2022-01-04 09:42:45 -05:00
William Banfield
9ade45d81b consensus: check that proposal is non-nil before voting (#7480) 2021-12-22 11:09:57 -05:00
William Banfield
cda3a1bbd0 save proposal time on roundstate 2021-12-22 11:01:03 -05:00
Anca Zamfir
6f23bc8404 Merge branch 'wb/proposer-based-timestamps' into anca/prevote_nil_untimely 2021-12-21 20:51:17 +01:00
Anca Zamfir
e6d8b7c043 Fix pbts tests (#7413)
* Allow nil block ID check in ensureProposalWithTimout

* William's suggestion to get the proposal from the proposer instead of
generating it.

* Remove error check on service stop
2021-12-21 20:39:11 +01:00
Anca Zamfir
9adbd50808 Cleanup 2021-12-21 20:34:25 +01:00
Anca Zamfir
6b8cf31510 Mark proposal invalid in SetProposal, fix in the future test 2021-12-21 20:28:53 +01:00
Anca Zamfir
f95abc275c Add more timely tests and check votes 2021-12-21 18:15:54 +01:00
Anca Zamfir
59e360472a Fix proposal tests 2021-12-20 18:19:56 +01:00
Anca Zamfir
692b2299dd Fix lint errors 2021-12-20 17:34:51 +01:00
Anca Zamfir
f61ed903a8 Update IsTimely to match the specification 2021-12-20 17:29:49 +01:00
Anca Zamfir
8009903357 Update IsTimely comment 2021-12-20 15:44:32 +01:00
Anca Zamfir
9b7ab1d3c2 Revert ensureTimeout change 2021-12-20 15:24:44 +01:00
Anca Zamfir
cd36671a0d Fix TestIsTimely 2021-12-20 00:43:12 +01:00
Anca Zamfir
ea3398bde8 Don't check lhs for genesis block 2021-12-20 00:36:23 +01:00
Anca Zamfir
ba42727a9b Merge branch 'anca/fix_pbts_tests' into anca/prevote_nil_untimely 2021-12-19 14:10:15 +01:00
Anca Zamfir
a587cfddbb Bring back block ID check in ensureProposalWithTimout 2021-12-18 03:26:30 +01:00
Anca Zamfir
c175313621 Remove error check on service stop 2021-12-18 03:19:58 +01:00
Anca Zamfir
8c02f2c2e6 William's suggestion to get the proposal from the proposer instead of
generating it.
2021-12-18 03:01:26 +01:00
Anca Zamfir
bb43c8139d Merge branch 'wb/proposer-based-timestamps' into anca/fix_pbts_tests 2021-12-18 02:30:25 +01:00
Anca Zamfir
e8a37cefb2 Merge commit 'b03dced9a' into wb/proposer-based-timestamps 2021-12-18 02:27:36 +01:00
William Banfield
56a20056ec internal/consensus: prevote nil if proposal timestamp does not match (#7391)
This change updates the proposal logic to use the block's timestamp in the proposal message. It adds an additional piece of validation logic to the prevote step to check that the block's timestamp matches the proposal message's timestamp.
2021-12-15 14:46:55 -05:00
Anca Zamfir
9cd4cfed6b Remove block Id checks and enable tests 2021-12-14 20:09:02 -05:00
Anca Zamfir
2801a2baf1 Merge branch 'wb/proposer-based-timestamps' into anca/fix_pbts_tests 2021-12-10 20:51:32 -05:00
William Banfield
e4598b1de1 internal/consensus: remove proposal wait time (#7418) 2021-12-09 17:18:41 -05:00
Anca Zamfir
7180e47e92 Prevote nil if not timely 2021-12-09 08:25:54 -05:00
Anca Zamfir
b03dced9af Fix compilation 2021-12-09 08:13:49 -05:00
Anca Zamfir
8f204cf5c7 Remove MedianTime, set block time to Now() (#7382)
* Remove MedianTime, set block time to Now()

* Fix goimports

* Fix import ordering
2021-12-09 05:01:27 +01:00
William Banfield
e91bac3565 internal/consensus: proposer waits for previous block time (#7376)
This change introduces the logic to have the proposer wait until the previous block time has passed before attempting to propose the next block.

The change achieves this by by adding a new clause into the enterPropose state machine method. The method now checks if the validator is the proposer and if the validator's clock is behind the previous block's time. If the validator's clock is behind the previous block time, it schedules a timeout to re-enter the enter propose method after enough time has passed.
2021-12-08 11:23:33 -05:00
William Banfield
a9b2bbd70d types: add new consensus params from proto (#7354)
This change adds the new TimingParams proto messages. These new messages were build using the wb/proposer-based-timestamps branch on the spec repo.
This change also adds validation that these values are positive when parsed and adds the new parameters into the existing tests.
2021-12-05 19:20:37 -05:00
William Banfield
a9aab99b41 internal/consensus: refactor ensure functions to use a common function (#7373)
* internal/consensus: refactor the common_test functions to use a single timeout function

* remove ensurePrecommit

* Update internal/consensus/common_test.go

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

* join lines for fatal messages

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

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-12-02 19:09:02 -05:00
Sam Kleinman
884e4e99ca tools: remove tm-signer-harness (#7370) 2021-12-02 15:36:20 -05:00
William Banfield
591cc87669 types: remove accuracy from timestamp params (#7341) 2021-11-30 11:52:51 -05:00
William Banfield
1d68f340a6 consensus: ensure proposal receipt waits for maxWaitingTime (#7307)
* consensus: ensure proposal receipt waits for maxWaitingTime

* rebase fixups

* lint++

* lint++

* register result chan separately

* lint++
2021-11-30 09:45:36 -05:00
William Banfield
6be5efaaa9 consensus: add calculation for proposal step waits from pbts (#7290)
* initial proposerWaitsUntil implementation

* switch to duration for easier use with timeout scheduling

* add proposal step waiting time with tests

* minor aesthetic change to IsTimely

* minor language fix

* Update internal/consensus/state.go

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

* reword comment

* change accuracy to precision

* move tests to separate pbts test file

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
2021-11-24 18:47:34 -05:00
William Banfield
24c40b5b7b consensus: refactor the fake validator to take a clock source (#7300) 2021-11-24 18:46:46 -05:00
William Banfield
d4e712e4f1 factory: simplify validator and genesis factory functions (#7305) 2021-11-24 18:27:30 -05:00
William Banfield
15d6aefaf9 state: add an 'IsTimely' method to implement the 'timely' check for proposer-based timestamps (#7170)
* state: add an IsTimely function to implement the check for timely in proposer-based timestamps

* move time checks into block.go and add time source mechanism

* timestamp params comment

* add todo related to pbts spec and timestamp params

* remove old istimely

* switch to using built in before function

* lint++

* wip

* move into proposal and create a default set of params

* defer using default cons params for now
2021-11-24 17:59:25 -05:00
William Banfield
0c3401c5a4 consensus: update state to prevote nil when proposal block does not match locked block. (#6986)
* add failing test

* tweak comments in failing test

* failing test comment

* initial attempt at removing prevote locked block logic

* comment out broken function

* undo reset on prevotes

* fixing TestProposeValidBlock test

* update test for completed POL update

* comment updates

* further unlock testing

* update comments

* Update internal/consensus/state.go

* spacing nit

* comment cleanup

* nil check in addVote

* update unlock description

* update precommit on relock comment

* add ensure new timeout back

* rename IsZero to IsNil and replace uses of block len check with helper

* add testing.T to new assertions

* begin removing unlock condition

* fix TestStateProposerSelection2 to precommit for nil correctly

* remove erroneous sleep

* update TestStatePOL comment

* update relock test to be more clear

* add _ into test names

* rename slashing

* udpate no relock function to be cleaner

* do not relock on old proposal test cleanup

* con state name update

* remove all references to unlock

* update test comments to include new

* add relock test

* add ensureRelock to common_test

* remove all event unlock

* remove unlock checks

* no lint add space

* lint ++

* add test for nil prevote on different proposal

* fix prevote nil condition

* fix defaultDoPrevote

* state_test.go fixes to accomodate prevoting for nil

* add failing test for POL from previous round case

* update prevote logic to prevote POL from previous round

* state.go comment fixes

* update validatePrevotes to correctly look for nil

* update new test name and comment

* update POLFromPreviousRound test

* fixes post merge

* fix spacing

* make the linter happy

* change prevote log message

* update prevote nil debug line

* update enterPrevote comment

* lint

* Update internal/consensus/state.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* Update internal/consensus/state.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* add english description of alg rules

* Update internal/consensus/state.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* comment fixes from review

* fix comment

* fix comment

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
2021-11-24 17:58:24 -05:00
William Banfield
d42addfe9c consensus: remove logic to unlock block on 2/3 prevote for nil (#6954) 2021-11-24 17:33:12 -05:00
William Banfield
765e1e313c consensus: remove panics from test helper functions (#6969) 2021-11-24 16:51:08 -05:00
William Banfield
02c7dca945 docs: add abci timing metrics to the metrics docs (#7311) 2021-11-23 19:53:59 +00:00
M. J. Fromberger
26b887b883 build: update location of proto builder image (#7296)
Updates #7272.
2021-11-19 18:45:38 +00:00
Sam Kleinman
7e58f02eb8 service: remove quit method (#7293) 2021-11-19 11:49:51 -05:00
Sam Kleinman
6ab62fe7b6 service: remove stop method and use contexts (#7292) 2021-11-18 17:56:21 -05:00