10000 docs: document max values for PBTS Precision and MessageDelay by Himess · Pull Request #5046 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs: document max values for PBTS Precision and MessageDelay #5046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/explanation/core/proposer-based-timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ among all of the validators in the network.
Any two validators are expected to have clocks that differ by at most
`Precision` at any given instant.

**Note:** The `Precision` value must not exceed 30 seconds. This is a hard-coded upper limit enforced in the implementation to avoid overflow errors when used in timestamp calculations.

The `Precision` parameter is of [`time.Duration`](https://pkg.go.dev/time#Duration) type.

Networks should choose a `Precision` that is large enough to represent the
Expand All @@ -126,6 +128,9 @@ The `MessageDelay` parameter configures the acceptable upper-bound for the
end-to-end delay for transmitting a `Proposal` message from the proposer to
_all_ validators in the network.

**Note:** The `MessageDelay` value must not exceed `24 hours`. This cap is enforced in the implementation to avoid overflow errors in time-based computations, especially when combined with round-based
exponential delay adjustments.

The `MessageDelay` parameter is of [`time.Duration`](https://pkg.go.dev/time#Duration) type.

Networks should choose a `MessageDelay` that is large enough to represent the
Expand Down
6 changes: 6 additions & 0 deletions spec/consensus/proposer-based-timestamp/pbts-sysmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ proposal message broadcast by correct processes: it is a *worst-case* parameter.
As message delays depends on the message size, the above requirement implicitly
indicates that the size of proposal messages is either fixed or upper bounded.

**Note:** In the actual implementation of PBTS, the system parameters `MSGDELAY` and `PRECISION` are capped to upper bounds in order to prevent overflow errors in time-based computations:
- `MSGDELAY ≤24h`
- `PRECISION ≤30s`

These limits are not inherent to the formal model, and do not affect its properties. They are practical constraints introduced in the implementation to ensure arithmetic safety.

#### **[PBTS-MSG-DELAY-ADAPTIVE.0]**

This specification is written assuming that there exists an end-to-end maximum
Expand Down
4 changes: 4 additions & 0 deletions spec/core/data_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ These parameters are part of the Proposer-Based Timestamps (PBTS) algorithm.
For more information on the relationship of the synchrony parameters to
block timestamps validity, refer to the [PBTS specification][pbts].

**Note:** Both `precision` and `message_delay` have upper bounds enforced in the implementation to prevent overflow errors during timestamp validation:
- `precision` must not exceed `30s`
- `message_delay` must not exceed `24h`

[pbts]: ../consensus/proposer-based-timestamp/README.md
[bfttime]: ../consensus/bft-time.md
[proto-duration]: https://protobuf.dev/reference/protobuf/google.protobuf/#duration
0