Repository navigation
Proposer-based timestamp specification - #261
Conversation
|
@konnov is going to do an in-depth verification effort of the TLA+ spec in the beginning of April. This PR, and subsequent planning work (ADR) should not be blocked by that. |
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
…ft.md Co-authored-by: Marko <[email protected]>
There was a problem hiding this comment.
I have a few questions to help my understanding of this algorithm.
- What happens if 2/3+ precommit on a block that has a timestamp that a node deems to be untimely. Does it a) still commit it or b) panic
- Can a proposer in round 2 propose a block with a time less than a block proposed in round 1 (I'm guessing this is fine so long as it is still timely).
- Should there be any relation between timeout propose and PRECISION since a proposer waiting for the time to be ready to send out their proposal could timeout and thus miss their block (or if PRECISION is too relaxed a proposer could set their block time well in the future, where the proposer of the next height will be unable to propose a block before the timeout).
EDIT - What is the validation like for nodes that are still catching up and are thus validating blocks "from the past". Do they just ignore time (except maybe for being greater than the time of the previous block)
…t.md Co-authored-by: Callum Waters <[email protected]>
Short answer: a). Long answer: Following the discussion after the presentation, we changed the protocol a bit. Rather than dropping
Yes. Still, these two times are greater than the time of the last block.
You're right, we overlooked this. We will need
As far as we understand, currently the nodes that do validation check BFT time against the median of the commits in the same block. Analogously, the proposer-based timestamp is checked by checking that all nodes that signed the commit also signed the proposer-based timestamp. |
cmwaters
left a comment
There was a problem hiding this comment.
This all looks good at least from my angle 👍 . I see that there could be a couple of small things that may need to be ironed out but IMO I think this spec is well thought out. My question is how do we define when this is ready to be merged and what steps need to be taken following the merge of this PR.
| For safety (Point 1, Point 2, Point 3i) and liveness (Point 4) we need | ||
| the following assumptions: | ||
|
|
||
| - There exists a system parameter `PRECISION` such that for any two correct validators `V` and `W`, and at any real-time `t`, their local times `C_V(t)` and `C_W(t)` differ by less than `PRECISION` time units, |
There was a problem hiding this comment.
When you say system parameter, does this imply that PRECISION is a consensus parameter that is agreed upon in consensus or an individual node parameter?
There was a problem hiding this comment.
PRECISION needs to be agreed upon in consensus, as it will be part of the code. Moreover, in our analysis we assume it is the same on every node.
ACCURACY is not visible in the code. But it is crucial to relate blocktime to real-time. It required, e.g., by a lightclient to understand how old a block really is. In principle here a lightclient may subjectively say, "I assume accuracy is 10 sec". Then its safety depends on the correctness of this assumption. It would therefore be good if the validators would provide an estimate how large their ACCURACY is.
There was a problem hiding this comment.
Right. We could also persist real-time values for each node when they store their blocks and add this as part of an RPC endpoint. Thus, participants of the network could query nodes for their ACCURACY. Would doing something like that makes sense?
There was a problem hiding this comment.
I am not sure that would help.
But you are right: there is a bigger question: how are validators synchronizing their clocks now (I guess they use NTP) and what values for ACCURACY can we assume from there.
Or even more generally: right now there are a lot of implicit assumptions about time and clocks. We need to make them more explicit (as we tried in this PR). And once we made these assumptions explicit, what are suitable values for the parameters. For instance, the timeout values of Tendermint consensus implementation work pretty well. I wonder how these values where set/estimated initially. A similar approach we should take for the parameters introduced in this PR.
Also, I think we can be quite conservative here. Even if the precision/accuracy of the clocks with NTP is in the order of several hundred microseconds, perhaps it is enough to set the parameters in the code to 10 seconds. After all, given that unbonding and trusting periods are in the order of weeks, we just need to maintain some relation of real-time to block time.
The point about these parameters are not to be as precise as possible, but to understand "how precise" the solution guarantees to be in order to have sound guarantees at the system interfaces, e.g., between full nodes and light nodes. The point is to guarantee some value of precision that is sufficient for the application purpose rather to expose the actual precision that the system could achieve.
|
|
||
| #### Reception Step | ||
| In the reception step at node `p` at local time `now_p`, upon receiving a message `m`: | ||
| - **if** the message `m` is of type `PROPOSE` and satisfies `now_p - PRECISION < m.time < now_p + PRECISION + MSGDELAY`, then mark the message as `timely`. |
There was a problem hiding this comment.
There has been some talk about giving the application some degree of control over the block times (tendermint/tendermint#5911). Such control might be valuable when some transactions / loads require more time to process. In the case this idea was to come to any fruition would we redefine timely as:
now_p - PRECISION + BLOCKDELAY < m.time < now_p + PRECISION + MSGDELAY + BLOCKDELAY
There was a problem hiding this comment.
I don't think it interferes here.
Rather it interferes with the TimeoutPropose: I guess the cleanest way to do this is that the proposer waits until the BLOCKDELAY has expired before sending the PROPOSE message.
In #265 (comment) I have estimated how TimeoutPropose needs to be computed to ensure monotonic block times, that is
block(i+1).Time > block(i).Time
This would need to be generalized to
block(i+1).Time > block(i).Time + BLOCKDELAY
That is, to compute T2 in this case, we would need to add BLOCKDELAY. I guess we can already add a comment in the spec right now to be ready for such a change. What do you think?
There was a problem hiding this comment.
Thanks. Yeah this makes sense. If you want, you can mention it but I wouldn't say that the idea is well developed enough to warrant any changes to the math / calculations. What I will do, is relay what you've said in the original issue so we have a point of reference if anything develops
There was a problem hiding this comment.
We have added a comment in the spec about how BLOCKDELAY can be incorporated in the future.
This is the first draft of the English and TLA+ specifications of proposer-based timestamp, containing: