You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

258 lines
11 KiB

  1. # PBTS: System Model and Properties
  2. ## System Model
  3. #### **[PBTS-CLOCK-NEWTON.0]**
  4. There is a reference Newtonian real-time `t` (UTC).
  5. No process has direct access to this reference time, used only for specification purposes.
  6. ### Synchronized clocks
  7. Processes are assumed to be equipped with synchronized clocks.
  8. This requires processes to periodically synchronize their local clocks with an
  9. external and trusted source of the time (e.g. NTP servers).
  10. Each synchronization cycle aligns the process local clock with the external
  11. source of time, making it a *fairly accurate* source of real time.
  12. The periodic (re)synchronization aims to correct the *drift* of local clocks,
  13. which tend to pace slightly faster or slower than the real time.
  14. To avoid an excessive level detail in the parameters and guarantees of
  15. synchronized clocks, we adopt a single system parameter `PRECISION` to
  16. encapsulate the potential inaccuracy of the synchronization mechanisms,
  17. and drifts of local clocks from real time.
  18. #### **[PBTS-CLOCK-PRECISION.0]**
  19. There exists a system parameter `PRECISION`, such that
  20. for any two processes `p` and `q`, with local clocks `C_p` and `C_q`,
  21. that read their local clocks at the same real-time `t`, we have:
  22. - If `p` and `q` are equipped with synchronized clocks, then `|C_p(t) - C_q(t)| < PRECISION`
  23. `PRECISION` thus bounds the difference on the times simultaneously read by processes
  24. from their local clocks, so that their clocks can be considered synchronized.
  25. #### Accuracy
  26. The [first draft][sysmodel_v1] of this specification included a second clock-related parameter, `ACCURACY`,
  27. that relates the values read by processes from their synchronized clocks with real time:
  28. - If `p` is a process is equipped with a synchronized clock, then at real time
  29. `t` it reads from its clock time `C_p(t)` with `|C_p(t) - t| < ACCURACY`
  30. The adoption of `ACCURACY` as the upper bound on the difference between clock
  31. readings and real time, however, renders the `PRECISION` parameter redundant.
  32. In fact, if we assume that clocks readings are at most `ACCURACY` from real
  33. time, we would therefore be assuming that they cannot be more than `2 * ACCURACY`
  34. apart from each other, thus establishing a worst-case upper bound for `PRECISION`.
  35. The approach we take is to assume that processes clocks are periodically
  36. synchronized with an external source of time, thus improving their accuracy.
  37. This allows us to adopt a relaxed version of the above `ACCURACY` definition:
  38. ##### **[PBTS-CLOCK-FAIR.0]**
  39. - At real time `t` there is at least one correct process `p` which clock marks
  40. `C_p(t)` with `|C_p(t) - t| < ACCURACY`
  41. Then, through [PBTS-CLOCK-PRECISION] we can extend this relation of clock times
  42. with real time to every correct process, which will have a clock with accuracy
  43. bound by `ACCURACY + PRECISION`.
  44. But, for the sake of simpler specification we can assume that the `PRECISION`,
  45. which is a worst-case parameter that applies to all correct processes,
  46. includes the best `ACCURACY` achieved by any of them.
  47. ### Message Delays
  48. The assumption that processes have access to synchronized clocks ensures that proposal times
  49. assigned by *correct processes* have a bounded relation with the real time.
  50. It is not enough, however, to identify (and reject) proposal times proposed by Byzantine processes.
  51. To properly evaluate whether the time assigned to a proposal is consistent with the real time,
  52. we need some information regarding the time it takes for a message carrying a proposal
  53. to reach all its (correct) destinations.
  54. More precisely, the *maximum delay* for delivering a proposal to its destinations allows
  55. defining a lower bound, a *minimum time* that a correct process assigns to proposal.
  56. While *minimum delay* for delivering a proposal to a destination allows defining
  57. an upper bound, the *maximum time* assigned to a proposal.
  58. #### **[PBTS-MSG-D.0]**
  59. There exists a system parameter `MSGDELAY` for end-to-end delays of messages carrying proposals,
  60. such for any two correct processes `p` and `q`, and any real time `t`:
  61. - If `p` sends a message `m` carrying a proposal at time `ts`,
  62. then if `q` receives the message and learns the proposal,
  63. `q` does that at time `t` such that `ts <= t <= ts + MSGDELAY`.
  64. While we don't want to impose particular restrictions regarding the format of `m`,
  65. we need to assume that their size is upper bounded.
  66. In practice, using messages with a fixed-size to carry proposals allows
  67. for a more accurate estimation of `MSGDELAY`, and therefore is advised.
  68. ## Problem Statement
  69. In this section we define the properties of Tendermint consensus
  70. (cf. the [arXiv paper][arXiv]) in this new system model.
  71. #### **[PBTS-PROPOSE.0]**
  72. A proposer proposes a consensus value `v` with an associated proposal time `v.time`.
  73. #### **[PBTS-INV-AGREEMENT.0]**
  74. [Agreement] No two correct processes decide on different values `v`. (This implies that no two correct processes decide on different proposal times `v.time`.)
  75. #### **[PBTS-INV-VALID.0]**
  76. [Validity] If a correct process decides on value `v`,
  77. then `v` satisfies a predefined `valid` predicate.
  78. #### **[PBTS-INV-TIMELY.0]**
  79. [Time-Validity] If a correct process decides on value `v`,
  80. then the associated proposal time `v.time` satisfies a predefined `timely` predicate.
  81. > Both [Validity] and [Time-Validity] must be observed even if up to `2f` validators are faulty.
  82. ### Timely proposals
  83. The `timely` predicate is evaluated when a process receives a proposal.
  84. Let `now_p` be time a process `p` reads from its local clock when `p` receives a proposal.
  85. Let `v` be the proposed value and `v.time` the proposal time.
  86. The proposal is considered `timely` by `p` if:
  87. #### **[PBTS-RECEPTION-STEP.1]**
  88. 1. `now_p >= v.time - PRECISION` and
  89. 1. `now_p <= v.time + MSGDELAY + PRECISION`
  90. ### Timely Proof-of-Locks
  91. We denote by `POL(v,r)` a *Proof-of-Lock* of value `v` at the round `r` of consensus.
  92. `POL(v,r)` consists of a set of `PREVOTE` messages of round `r` for the value `v`
  93. from processes whose cumulative voting power is at least `2f + 1`.
  94. #### **[PBTS-TIMELY-POL.1]**
  95. If
  96. - there is a valid `POL(v,r*)` for height `h`, and
  97. - `r*` is the lowest-numbered round `r` of height `h` for which there is a valid `POL(v,r)`, and
  98. - `POL(v,r*)` contains a `PREVOTE` message from at least one correct process,
  99. Then, where `p` is a such correct process:
  100. - `p` received a `PROPOSE` message of round `r*` and height `h`, and
  101. - the `PROPOSE` message contained a proposal for value `v` with proposal time `v.time`, and
  102. - a correct process `p` considered the proposal `timely`.
  103. The round `r*` above defined will be, in most cases,
  104. the round in which `v` was originally proposed, and when `v.time` was assigned,
  105. using a `PROPOSE` message with `POLRound = -1`.
  106. In any case, at least one correct process must consider the proposal `timely` at round `r*`
  107. to enable a valid `POL(v,r*)` to be observed.
  108. ### Derived Proof-of-Locks
  109. #### **[PBTS-DERIVED-POL.1]**
  110. If
  111. - there is a valid `POL(v,r)` for height `h`, and
  112. - `POL(v,r)` contains a `PREVOTE` message from at least one correct process,
  113. Then
  114. - there is a valid `POL(v,r*)` for height `h`, with `r* <= r`, and
  115. - `POL(v,r*)` contains a `PREVOTE` message from at least one correct process, and
  116. - a correct process considered the proposal for `v` `timely` at round `r*`.
  117. The above relation derives from a recursion on the round number `r`.
  118. It is trivially observed when `r = r*`, the base of the recursion,
  119. when a timely `POL(v,r*)` is obtained.
  120. We need to ensure that, once a timely `POL(v,r*)` is obtained,
  121. it is possible to obtain a valid `POL(v,r)` with `r > r*`,
  122. without the need of satisfying the `timely` predicate (again) in round `r`.
  123. In fact, since rounds are started in order, it is not likely that
  124. a proposal time `v.time`, assigned at round `r*`,
  125. will still be considered `timely` when the round `r > r*` is in progress.
  126. In other words, the algorithm should ensure that once a `POL(v,r*)` attests
  127. that the proposal for `v` is `timely`,
  128. further valid `POL(v,r)` with `r > r*` can be obtained,
  129. even though processes do not consider the proposal for `v` `timely` any longer.
  130. > This can be achieved if the proposer of round `r' > r*` proposes `v` in a `PROPOSE` message
  131. with `POLRound = r*`, and at least one correct processes is aware of a `POL(v,r*)`.
  132. > From this point, if a valid `POL(v,r')` is achieved, it can replace the adopted `POL(v,r*)`.
  133. ### SAFETY
  134. The safety of the algorithm requires a *timely* proof-of-lock for a decided value,
  135. either directly evaluated by a correct process,
  136. or indirectly received through a derived proof-of-lock.
  137. #### **[PBTS-CONSENSUS-TIME-VALID.0]**
  138. If
  139. - there is a valid commit `C` for height `k` and round `r`, and
  140. - `C` contains a `PRECOMMIT` message from at least one correct process
  141. Then, where `p` is one such correct process:
  142. - since `p` is correct, `p` received a valid `POL(v,r)`, and
  143. - `POL(v,r)` contains a `PREVOTE` message from at least one correct process, and
  144. - `POL(v,r)` is derived from a timely `POL(v,r*)` with `r* <= r`, and
  145. - `POL(v,r*)` contains a `PREVOTE` message from at least one correct process, and
  146. - a correct process considered a proposal for `v` `timely` at round `r*`.
  147. ### LIVENESS
  148. In terms of liveness, we need to ensure that a proposal broadcast by a correct process
  149. will be considered `timely` by any correct process that is ready to accept that proposal.
  150. So, if:
  151. - the proposer `p` of a round `r` is correct,
  152. - there is no `POL(v',r')` for any value `v'` and any round `r' < r`,
  153. - `p` proposes a valid value `v` and sets `v.time` to the time it reads from its local clock,
  154. Then let `q` be a correct process that receives `p`'s proposal, we have:
  155. - `q` receives `p`'s proposal after its clock reads `v.time - PRECISION`, and
  156. - if `q` is at or joins round `r` while `p`'s proposal is being transmitted,
  157. then `q` receives `p`'s proposal before its clock reads `v.time + MSGDELAY + PRECISION`
  158. > Note that, before `GST`, we cannot ensure that every correct process receives `p`'s proposals, nor that it does it while ready to accept a round `r` proposal.
  159. A correct process `q` as above defined must then consider `p`'s proposal `timely`.
  160. It will then broadcast a `PREVOTE` message for `v` at round `r`,
  161. thus enabling, from the Time-Validity point of view, `v` to be eventually decided.
  162. #### Under-estimated `MSGDELAY`s
  163. The liveness assumptions of PBTS are conditioned by a conservative and clever
  164. choice of the timing parameters, specially of `MSGDELAY`.
  165. In fact, if the transmission delay for a message carrying a proposal is wrongly
  166. estimated, correct processes may never consider a valid proposal as `timely`.
  167. To circumvent this liveness issue, which could result from a misconfiguration,
  168. we assume that the `MSGDELAY` parameter can be increased as rounds do not
  169. succeed on deciding a value, possibly because no proposal is considered
  170. `timely` by enough processes.
  171. The precise behavior for this workaround is under [discussion](https://github.com/tendermint/spec/issues/371).
  172. Back to [main document][main].
  173. [main]: ./README.md
  174. [algorithm]: ./pbts-algorithm_002_draft.md
  175. [sysmodel]: ./pbts-sysmodel_002_draft.md
  176. [sysmodel_v1]: ./v1/pbts-sysmodel_001_draft.md
  177. [arXiv]: https://arxiv.org/pdf/1807.04938.pdf