Skip to content
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

feat: Versioned timeouts CIP draft #216

Merged
merged 28 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eb058c0
feat: add 6 second block CIP draft
jcstein Oct 10, 2024
f7c77dd
docs: edits
jcstein Oct 10, 2024
d5c7daf
Apply suggestions from code review
jcstein Oct 10, 2024
9e50d02
docs: add suggestions from review part 1
jcstein Oct 10, 2024
2fb54eb
suggestion from code review
jcstein Oct 10, 2024
a57d494
docs: fix lint
jcstein Oct 16, 2024
cabdb4c
docs: suggestion from code review
jcstein Oct 16, 2024
fc4f6c6
docs: fix lint
jcstein Oct 16, 2024
30484f3
Apply suggestions from code review
jcstein Oct 16, 2024
017751b
docs: remove unecessary spec point
jcstein Oct 16, 2024
bb82780
docs: remove another repetitive point
jcstein Oct 16, 2024
a435fb3
Apply suggestions from code review
jcstein Oct 16, 2024
627866e
docs: suggestions from review
jcstein Oct 16, 2024
837357a
docs: clarify upgrade path and why params moved
jcstein Oct 16, 2024
107de98
docs: rearrange spec
jcstein Oct 16, 2024
2696f42
Apply suggestions from code review
jcstein Oct 16, 2024
b46a5e5
Apply suggestions from code review
jcstein Oct 16, 2024
2809152
docs: edit CIP-25 to include this CIP-26
jcstein Oct 16, 2024
758f3f4
Merge branch 'main' into jcs/cip-6-seconds
jcstein Oct 16, 2024
9b016b8
Apply suggestions from code review
jcstein Oct 17, 2024
3cde806
Apply suggestions from code review
jcstein Oct 17, 2024
ee6a733
Update cips/README.md
jcstein Oct 17, 2024
57d1dd5
Apply suggestions from code review
jcstein Oct 17, 2024
684d62c
Apply suggestions from code review
jcstein Oct 17, 2024
9140c80
fix: linting
jcstein Oct 17, 2024
49a9a3f
Apply suggestions from code review
jcstein Oct 17, 2024
76cb77d
Apply suggestions from code review
jcstein Oct 17, 2024
57c5259
Apply suggestions from code review
jcstein Oct 17, 2024
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
1 change: 1 addition & 0 deletions cips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Read [CIP-1](./cip-1.md) for information on the CIP process.
| [23](./cip-23.md) | Coordinated prevote times | Callum Waters ([@cmwaters](https://github.com/cmwaters)) |
| [24](./cip-24.md) | Versioned Gas Scheduler Variable | Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)) |
| [25](./cip-25.md) | Ginger Network Upgrade | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)) |
| [26](./cip-26.md) | Versioned timeouts | Josh Stein ([@jcstein](https://github.com/jcstein)), Rootul Patel ([@rootulp](https://github.com/rootulp)), Sanaz Taheri ([@staheri14](https://github.com/staheri14) |

## Contributing

Expand Down
1 change: 1 addition & 0 deletions cips/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [CIP-23](./cip-23.md)
- [CIP-24](./cip-24.md)
- [CIP-25](./cip-25.md)
- [CIP-26](./cip-26.md)

- [Core Devs Call notes](./notes/README.md)
- [CDC #14](./notes/cdc-14.md)
Expand Down
7 changes: 4 additions & 3 deletions cips/cip-25.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| status | Draft |
| type | Meta |
| created | 2024-10-01 |
| requires | CIP-21, CIP-24, CIP-TBD-1, CIP-TBD-2 |
| requires | CIP-21, CIP-24, CIP-26, CIP-TBD-2 |

## Abstract

Expand All @@ -19,8 +19,9 @@ This Meta CIP lists the CIPs included in the Ginger network upgrade.

- [CIP-21](./cip-21.md): Introduce blob type with verified signer
- [CIP-24](./cip-24.md): Versioned Gas Scheduler Variables
- CIP-TBD-1: Reduce block time to six seconds
- CIP-TBD-2: Limiting compute per block
- [CIP-26](./cip-26.md): Versioned timeouts
- CIP-TBD-1: Block limits for number of PFBs and non-PFBs
- CIP-TBD-2: Transaction size limit

All of the above CIPs are state breaking, and thus require a breaking network upgrade. The activation of this network upgrade will be different from previous network upgrades, as described in [CIP-10](./cip-10.md).

Expand Down
69 changes: 69 additions & 0 deletions cips/cip-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
| cip | 26 |
| - | - |
| title | Versioned timeouts |
| description | Timeouts are now controlled by the application version. |
| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Rootul Patel ([@rootulp](https://github.com/rootulp)), Sanaz Taheri ([@staheri14](https://github.com/staheri14)) |
| discussions-to | <https://forum.celestia.org/t/cip-decrease-block-time-to-6-seconds/1836> |
| status | Draft |
| type | Standards Track |
| category | Core |
| created | 2024-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.
1. Celestia consensus nodes SHOULD update their software to accommodate this change prior to the agreed-upon block height.
1. 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.

1. 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`
1. New default: `ttl-num-blocks = 12`
1. 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.
1. All validator nodes SHOULD update their configuration files to reflect this new `ttl-num-blocks` value before the agreed-upon implementation block height.

1. 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.
1. The increase of `ttl-num-blocks` from 5 to 12 is crucial for maintaining the security and efficiency of the mempool:
jcstein marked this conversation as resolved.
Show resolved Hide resolved
1. It prevents premature removal of valid transactions, reducing the risk of unintended exclusion from blocks.
1. 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.
1. 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

Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE).