Skip to content
This repository was archived by the owner on Feb 23, 2022. It is now read-only.
This repository was archived by the owner on Feb 23, 2022. It is now read-only.

Estimate the relation between timeoutPropose and PRECISION/ACCURACY #265

Closed

Description

@istoilkovska
3. 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).

You're right, we overlooked this. We will need timeoutPropose(r)>2∆+timeoutPrecommit(r−1) + x, where x is the maximum difference between the last block time and the local clocks. We will look at the exact value of x more closely next week.

Originally posted by @istoilkovska in #261 (comment)

Activity

  1. josef-widder commented on Mar 15, 2021

    @josef-widder
    Contributor

    Steps to take.

    • clarify implementation of
    timeoutPropose(r)>2∆+timeoutPrecommit(r−1)
    timeoutPrevote(r)>2∆
    timeoutPrecommit(r)> 2∆
    
    • relate [PBTS-CONSENSUS-REALTIME-VALID.0] to the time the proposer of the next block starts round 0

      • estimate how long the proposer waits until it can send propose
    • even right now, liveness should be maintained without updating the initial value of timeoutPropose (decision might be moved to a later round)

    • for practical considerations changing the initial value of timeoutPropose still seems favorable.

  2. josef-widder commented on Mar 16, 2021

    @josef-widder
    Contributor

    Rather than an additive term x, it might more sense to estimate when a proposal needs to arrive based on the

    • blocktime of the last block
    • the local clock of the validator (blocktime - now)

    and have a timout as maximum over two expressions.

  3. josef-widder commented on Mar 22, 2021

    @josef-widder
    Contributor

    We should update the timeout estimate in the spec according to the following reasoning:

    • If a proposer needs to wait to make sure its proposed time is larger than the blocktime of the previous block, then it sends by realtime blocktime + ACCURACY (By this time, its local clock must exceed blocktime)
    • the receiver will receive by blocktime + ACCURACY + MSGDELAY
    • the receiver's local clock will be <= blocktime + 2 * ACCURACY + MSGDELAY
    • thus when the receiver p enters this round it can set its timeout to a value T2 => blocktime + 2 * ACCURACY + MSGDELAY - now_p

    So we should set the timeout to max(timeoutPropose, T2), where timeoutPropose is the old timeoutPropose.

    @istoilkovska, let's incorporate this tomorrow, then we re ready to merge.

  4. cmwaters commented on Jul 22, 2021

    @cmwaters
    Contributor

    @josef-widder has the spec been updated or should this still be an open issue?

  5. josef-widder commented on Jul 26, 2021

    @josef-widder
    Contributor

    the issue had been addressed. OK to keep the issue closed.

  6. cmwaters commented on Aug 5, 2021

    @cmwaters
    Contributor

    I have a follow up question that relates to this issue. It's actually more a couple of statements which may help me understand the relationship of ACCURACY and PRECISION and thus how to reach good approximations of these values in a live network.

    We have the following definitions of these two parameters:

    There exists a system parameter PRECISION such that for any two correct validators V and W, and at any real-time t,
    |C_V(t) - C_W(t)| < PRECISION

    There is a system parameter ACCURACY, such that for all real-times t and all correct validators V,
    | C_V(t) - t | < ACCURACY

    If all validators are within ACCURACY of real time, then they can be at most 2 * ACCURACY away from each other. So PRECISION = SAFETY_MARGIN + 2 * ACCURACY is a reasonable default to have.

    Although, in terms of specification, it is good to clearly state these two parameters because they are different from one another, I am wondering for the actual implementation with an eye of keeping things simple for users, whether we should consider collapsing these two down to a single consensus parameter?

  7. josef-widder commented on Aug 5, 2021

    @josef-widder
    Contributor

    If all validators are within ACCURACY of real time, then they can be at most 2 * ACCURACY away from each other. So PRECISION = SAFETY_MARGIN + 2 * ACCURACY is a reasonable default to have.

    I agree. The important point here is the precondition "all validators are within ACCURACY of real time". It is important to make validators aware of this requirement. I am not sure what is the right way of communicating that.

    Although, in terms of specification, it is good to clearly state these two parameters because they are different from one another, I am wondering for the actual implementation with an eye of keeping things simple for users, whether we should consider collapsing these two down to a single consensus parameter?

    If it makes things simpler that we can go for that in the implementation. We need to make sure to document this decision. Since we are anyways discussing spec work to keep code and spec aligned (#323), we should add a section about that. (Or perhaps an ADR is also a place for that?).

  8. cmwaters commented on Aug 5, 2021

    @cmwaters
    Contributor

    Another thing that I've come to realise is more nuanced than I thought is MSGDELAY. If we imagine a network where every node is connected to 10 other nodes and you have 810 nodes in a network, then the optimal degree of connectivity (how many times the same message needs to be sent) would be 3. In practice it might be double or triple that. If we imagine network latency across all geographic points in the world to be a constant (which it's not), then maybe we could calculate MSGDELAY as degrees of connectivity * network latency. But this is incorrect because we also need to factor in verification time. A node won't gossip on the message until it has verified it to be correct. This involves signature verification as well. I guess the most important thing is that the MSGDELAY should be the same for proposal, prevotes, and precommits. I'm hoping given that they are the same size and require a similar amount of time to verify that it's okay to have a single parameter for message delay. But I'm not sure because what about block propagation which might take significantly longer. In summary, I'm uncertain about the feasibility of having a single variable model the timeouts in consensus

  9. josef-widder commented on Aug 6, 2021

    @josef-widder
    Contributor

    For putting a parameter in the code, it is important that we actually use the assumption on timely proposals [PBTS-MSG-FAIR.0] for safety and liveness. I guess only a bound on proposals needs to be captured. But perhaps I miss something?

  10. williambanfield commented on Aug 6, 2021

    @williambanfield
    Contributor

    It looks like [PBTS-ALG-STARTROUND.0] is the only step in the algorithm to use this parameter.

  11. josef-widder commented on Aug 9, 2021

    @josef-widder
    Contributor

    It also appears in the reception at [PBTS-RECEPTION-STEP.0].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions