cip26
titleVersioned timeouts
descriptionTimeouts are now controlled by the application version.
authorJosh Stein (@jcstein), Rootul Patel (@rootulp), Sanaz Taheri (@staheri14)
discussions-tohttps://forum.celestia.org/t/cip-decrease-block-time-to-6-seconds/1836
statusDraft
typeStandards Track
categoryCore
created2024-10-09

Abstract

This CIP proposes making timeouts application-version dependent. Starting from v3, timeouts will be controlled by the application version, rendering manual timeout configurations ineffective unless the implementation changes in the future.

This change enables automated block time adjustments, eliminating the need for validators to modify configurations manually, as the adjustments (if any) will occur automatically with each celestia-app version upgrade.

Updating the timeouts will naturally impact block time, block rate, and network throughput. For v3 of celestia-app, the timeout values are set to reduce the block time from 12 seconds to 6 seconds. This means block time is cut in half which, consequently, will nearly double the block rate and throughput (considering other network factors).

Additionally, this CIP proposes increasing the ttl-num-blocks parameter in the mempool configuration from 5 to 12 to align with the reduced block time.

Motivation

The motivation for this CIP stems from a discussion in Core Devs Call 17, where it was proposed to reduce the block time to 6 seconds from 12 seconds.

Specification

  1. The block time in celestia-app SHOULD be reduced from 12 seconds to 6 seconds. Concretely, this implies decreasing TimeoutCommit to 4.2 seconds and TimeoutPropose to 3.5 seconds.

    1. The TimeoutCommit and TimeoutPropose parameters were moved from local config parameters into versioned parameters controlled by the state machine. The timeouts will be managed by the application and communicated with Celestia-core through the following ABCI interfaces: InitChain, EndBlock, and Info, now extended with TimeoutsInfo, which encapsulates TimeoutPropose and TimeoutCommit. The timeouts obtained through these interfaces are utilized by the Celestia-core side as needed.
    2. Celestia consensus nodes SHOULD update their software to accommodate this change prior to the agreed-upon block height.
    3. Client applications interacting with the Celestia network SHOULD be updated to account for the faster block time, particularly in areas related to transaction confirmation and block finality.
  2. The default ttl-num-blocks parameter in the mempool configuration SHALL be increased from 5 to 12. This change is necessary to maintain consistency with the new block time and ensure that transactions remain in the mempool for a similar duration as before.

    1. Current default: ttl-num-blocks = 5
    2. New default: ttl-num-blocks = 12
    3. This change SHALL NOT be implemented alongside the block time reduction. The default increase from 5 to 12 will occur when users upgrade to celestia-app v3.0.0 and regenerate their config files. The block time reduction will happen one week later when the v2 to v3 activation height occurs. This approach ensures consistent behavior of the mempool across the network upgrade.
    4. All validator nodes SHOULD update their configuration files to reflect this new ttl-num-blocks value before the agreed-upon implementation block height.
  3. Documentation and APIs related to block time and block production MUST be updated to reflect these changes.

Rationale

The rationale for this change is to increase the throughput of the Celestia network by doubling the number of blocks produced per unit of time. This will reduce the time it takes for transactions to be finalized and improve the overall user experience on the network.

The increase in ttl-num-blocks from 5 to 12 is necessary to maintain consistent mempool behavior with the new block time. This change ensures that transactions remain in the mempool for approximately 72 seconds (12 blocks times 6 seconds), which closely matches the previous behavior of about 60 seconds (5 blocks times 12 seconds).

Backwards Compatibility

This upgrade requires all participants to update their software to v3 to accommodate the new block time and ttl-num-blocks. Nodes running older versions may not function correctly with the new network parameters. All validators and node operators should update to v3 before the agreed-upon implementation block height to ensure network consistency and optimal performance.

Test Cases

This will be tested on Arabica devnet and Mocha testnet before going live on Celestia Mainnet Beta.

Security Considerations

While the reduction in block time itself does not introduce significant new security risks to the network, there are important considerations:

  1. Participants should ensure that their systems are capable of handling the increased throughput from faster block times.
  2. The increase of ttl-num-blocks from 5 to 12 is crucial for maintaining the security and efficiency of the mempool:
    1. It prevents premature removal of valid transactions, reducing the risk of unintended exclusion from blocks.
    2. Without this adjustment, transactions would be pruned from the mempool after only 30 seconds, potentially leading to increased transaction failures and a poor user experience.
  3. Validators and node operators should update their configurations to reflect the new ttl-num-blocks value to maintain network consistency and security.

These changes require careful implementation and testing to ensure network stability during and after the transition.

Copyright and related rights waived via CC0.