Time

CometBFT provides a Byzantine fault-tolerant source of time.

Time in CometBFT is defined with the Time field of the block Header.

Properties

The Time produced by CometBFT satisfies the following properties:

In addition, the Time produced by CometBFT is expected, by external observers, to provide:

Implementations

CometBFT implements two algorithms for computing block times:

Users are strongly encouraged to adopt PBTS in new chains or switch to PBTS when upgrading existing chains.

Comparison

The table below compares BFT Time and PBTS algorithms in terms of the above enumerated properties:

Algorithm Time Monotonicity Byzantine Fault Tolerance Relation to real time
BFT Time Guaranteed Tolerates < 1/3 Byzantine nodes Best effort and not guaranteed.
PBTS Guaranteed Tolerates < 2/3 Byzantine nodes Guaranteed with ACCURACY determined by the consensus parameters PRECISION and MSGDELAY.

Note that by Byzantine nodes we consider both malicious nodes, that purposely try to increase or decrease block times, and nodes that produce or propose inaccurate block times because they rely on inaccurate local clocks.

For more details, refer to the specification of BFT Time and Proposer-Based Timestamps.

Adopting PBTS

The Proposer-Based Timestamp (PBTS) algorithm is the recommended algorithm for producing block times.

As of CometBFT v1.x, however, PBTS is not enabled by default, neither for new chains using default values for genesis parameters, nor for chains upgrading to newer CometBFT versions, for backwards compatibility reasons.

Enabling PBTS requires configuring some consensus parameters:

Refer to the consensus parameters specification for more details, or to the PBTS user documentation for a more pragmatic description of the algorithm and recommendations on how to properly configure its parameters.

Decorative Orb