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 7 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-6-second-blocks.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-6-second-blocks](./cip-6-second-blocks.md)
jcstein marked this conversation as resolved.
Show resolved Hide resolved

- [Core Devs Call notes](./notes/README.md)
- [CDC #14](./notes/cdc-14.md)
Expand Down
72 changes: 72 additions & 0 deletions cips/cip-6-second-blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
| cip | TBD |
jcstein marked this conversation as resolved.
Show resolved Hide resolved
| - | - |
| title | Reduce block time to six seconds |
| description | Proposal to reduce block time on celestia-app to 6 seconds, from 12. |
| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Rootul Patel ([@rootulp](https://github.com/rootulp))|
| 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 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. This will double the throughput and reduce the time it takes for transactions to be finalized in half.
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this specification section should include a short blurb on why TimeoutCommit and TimeoutPropose were moved from local config parameters into versioned parameters controlled by the state machine. cc: @staheri14

Copy link
Member Author

Choose a reason for hiding this comment

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

using this for now "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. This change allows the system to adapt dynamically to version-specific requirements, improving overall stability and interoperability during upgrades."

Copy link
Member Author

Choose a reason for hiding this comment

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


1. The block time in celestia-app SHOULD be reduced from 12 seconds to 6 seconds. Concretely, this implies decreasing `TimeoutCommit` to 1 seconds and `TimeoutPropose` to 3 seconds.
jcstein marked this conversation as resolved.
Show resolved Hide resolved

1. All implementations of celestia-app SHALL adjust their block production mechanisms to conform to this new 6-second block time.

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.

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 implementation of this change SHOULD include appropriate testing and monitoring to ensure network stability during and after the transition.

1. Documentation and APIs related to block time and block production MUST be updated to reflect this change.

1. The `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.
jcstein marked this conversation as resolved.
Show resolved Hide resolved
1. Current default: `ttl-num-blocks = 5`
1. New default: `ttl-num-blocks = 12`

1. This change SHALL be implemented alongside the block time reduction to ensure consistent behavior of the mempool across the network upgrade.
jcstein marked this conversation as resolved.
Show resolved Hide resolved

1. All validator nodes MUST update their configuration files to reflect this new `ttl-num-blocks` value before the agreed-upon implementation block height.

## 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 * 6 seconds), which closely matches the previous behavior of about 60 seconds (5 blocks * 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.

## 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:
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 must 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