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 19 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)) |
| [6 second blocks](./cip-26.md) | Reduce block time to six seconds | Josh Stein ([@jcstein](https://github.com/jcstein)) |
jcstein marked this conversation as resolved.
Show resolved Hide resolved

## 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
6 changes: 3 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,8 @@ 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): Reduce block time to six seconds
jcstein marked this conversation as resolved.
Show resolved Hide resolved
- CIP-TBD-2: limiting compute per block
jcstein marked this conversation as resolved.
Show resolved Hide resolved

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
64 changes: 64 additions & 0 deletions cips/cip-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
| cip | 26 |
| - | - |
| title | Reduce block time to six seconds |
jcstein marked this conversation as resolved.
Show resolved Hide resolved
| description | Proposal to reduce block time on celestia-app to 6 seconds, from 12. |
jcstein marked this conversation as resolved.
Show resolved Hide resolved
jcstein marked this conversation as resolved.
Show resolved Hide resolved
| 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 to reduce the block time on celestia-app to 6 seconds, from 12. This will double the throughput and reduce the time it takes for transactions to be finalized in half. This CIP also proposes to increase the `ttl-num-blocks` parameter in the mempool configuration from 5 to 12 to maintain consistency with the new block time.
jcstein marked this conversation as resolved.
Show resolved Hide resolved
jcstein marked this conversation as resolved.
Show resolved Hide resolved

## 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 to ensure consistency and correctness across different protocol versions.
jcstein marked this conversation as resolved.
Show resolved Hide resolved
jcstein marked this conversation as resolved.
Show resolved Hide resolved
1. The change in block time MUST be implemented at a specific block height, which SHALL be determined and agreed upon by the Celestia community via on-chain signaling by validators.
jcstein marked this conversation as resolved.
Show resolved Hide resolved
jcstein marked this conversation as resolved.
Show resolved Hide resolved
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 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change SHALL NOT be implemented alongside the block time reduction.

It is not immediately clear what is the order of operations here, and specifically what upgrade means here:

The default increase from 5 to 12 will occur when users upgrade to v3.0.0 and regenerate their config files.

Nodes switch their binaries to v3? or when signalling mechanism is conducted and the results indicates an app version upgrade to v3 is going to take place?

Copy link
Member Author

@jcstein jcstein Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added after this feedback #216 (comment)

With that as context, what would you suggest changes in this section?

jcstein marked this conversation as resolved.
Show resolved Hide resolved
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 is a breaking network upgrade and will require all participants to update their software to accommodate the new block time and `ttl-num-blocks`. The change in block time will not be backward compatible with the existing network, and all participants MUST be compliant by the agreed-upon implementation block height.
jcstein marked this conversation as resolved.
Show resolved Hide resolved
jcstein marked this conversation as resolved.
Show resolved Hide resolved

## 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).
Loading