Skip to content

Proposer-Based Timestamp Implementation Steps #6942

@williambanfield

Description

@williambanfield

This issue lays out an ordered set of steps for implementing proposer-based timestamps. It represents a current best-estimate of the order of changes, but they may change as implementation proceeds. The first two issues are prerequisites that need to be completed to bring the code in-line with the spec and should be done before anything else.

The reason I'm breaking this set of steps down is that the state.go file is critically important. I'm thin-slicing these changes so that intermediate steps may receive adequate testing on our way towards producing the final change for proposer-based timestamps. A goal of this flow is that consensus is never in a broken state along the way so other engineers can continue testing on the master branch.

At this point, none of the timing of Tendermint will have been updated. We are weaving through the new configuration fields.

We now proceed to update the timing logic and validation logic:

  • Write a func timely(...) bool helper function that takes in a timestamp and indicates if the time is considered "timely" from the validator's view of local time and the appropriate new consensus parameters. This function will not yet be used but should be tested.
  • Write and test a func proposerWaitUntil(...) time.Time helper function that ingests the current time and previous block time and indicates when the proposer should wait until.
  • Write and test a func proposalStepWaitUntil(...) time.Time that returns a timestamp per the changes to the propose step timeout.
  • Update the timeout for waiting for the proposal using the newly written helper function. This will only increase the amount of time a validator will wait during this step so consensus should still proceed.
  • Update the proposer to wait until the previous block time has passed before proposing the next block.
  • Remove all the median time checks.
  • Update the proposer to set its current time into the block as the header timestamp.
  • Update the proposal validation logic to prevote nil for proposals with times that fail the timely check if the proof of lock round is -1. If the proof of lock round is not -1, do not check timely.
  • Update the block validation logic to reject blocks where the proposal time != the block time if the proof of lock round of the proposal is -1. If the proof of lock round is not -1, do not check timely.

Once these steps have completed, we will have added the new proposal timestamp to the header, ensured that correct validators agree on its value and ensured consensus only proceeds if enough correct validators are within a time bound of the proposed timestamp.

Finally, we should remove any vestiges of BFTTime.

  • remove the MedianTime method entirely.
  • remove voteTime entirely. Use time.Now() instead in any places it is still used.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions