From 921a5892c141d98caff78dabab810ee8101d9cca Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:21:38 -0400 Subject: [PATCH 1/6] docs: cip for tx limits --- cips/cip-tx-limits.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 cips/cip-tx-limits.md diff --git a/cips/cip-tx-limits.md b/cips/cip-tx-limits.md new file mode 100644 index 0000000..a95b86e --- /dev/null +++ b/cips/cip-tx-limits.md @@ -0,0 +1,35 @@ +| cip | TBD(28) | +| - | - | +| title | Transaction size limit | +| description | Set limit for transaction size | +| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)) | +| discussions-to | | +| status | Draft | +| type | Standards Track | +| category | Core | +| created | 2024-10-16 | + +## Abstract + +This CIP proposes to set the limit for transaction size to 2MiB. This is a consensus-breaking change. + +## Specification + +1. Transaction size is limited to 2MiB by setting the versioned parameter `MaxTxSize` to 2097152 (2MiB in bytes). +2. From version v3 and above, in `CheckTx`, `PrepareProposal`, and `ProcessProposal`, each transaction's size is checked against the `appconsts.MaxTxSize` threshold. + +## Rationale + +To set the transaction size limit to 2MiB, even with 8MiB blocks, to prevent issues with gossiping large transactions. Gossiping an 8MiB transaction without chunking could be detrimental to the network. + +## Backwards Compatibility + +This proposal is meant to be included with v3 and the Ginger Network Upgrade. It is a consensus-breaking change. + +## Security Considerations + +This proposal does not introduce new security risks but impacts network behavior and user experience. + +## Copyright + +Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE). From 8983582d4df818f879bacfe162ad28d0550bcbd0 Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:29:18 -0400 Subject: [PATCH 2/6] docs: edits --- cips/cip-pfb-limits.md | 43 ++++++++++++++++++++++++++++++++++++++++++ cips/cip-tx-limits.md | 13 ++++++++----- 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 cips/cip-pfb-limits.md diff --git a/cips/cip-pfb-limits.md b/cips/cip-pfb-limits.md new file mode 100644 index 0000000..6c47984 --- /dev/null +++ b/cips/cip-pfb-limits.md @@ -0,0 +1,43 @@ +| cip | TBD(27) | +| - | - | +| title | Block limits for number of PFBs and non-PFBs | +| description | Set limits for number of PFBs and non-PFBs per block | +| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), rach-id ([@rach-id](https://github.com/rach-id)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | +| discussions-to | | +| status | Draft | +| type | Standards Track | +| category | Core | +| created | 2024-10-16 | + +## Abstract + +This CIP proposes to set limits for the number of PayForBlobs (PFBs) messages and non-PFBs messages per block. The proposal is to set the limits to 600 PFBs messages and 200 non-PFBs messages per block. Setting PFB and non-PFBs limits is not consensus-breaking. + +## Specification + +1. Set `MaxPFBMessages` to 600, limiting the number of PFBs per block to 600. +2. Set `MaxNonPFBMessages` to 200, limiting the number of non-PFBs messages per block to 200. +3. These limits are implemented as soft limits in the `PrepareProposal` stage of the `celestia-app`. +4. Validators can potentially modify the `PrepareProposal` logic and produce blocks exceeding these limits. + +## Rationale + +1. To prevent long block times by limiting PFBs and non-PFBs messages per block. +2. Limits were established based on benchmarks in [PR 3904](https://github.com/celestiaorg/celestia-app/pull/3904): + - Target processing time: ~0.25 seconds + - Benchmarks run on recommended validator configuration (4 CPU, 16GB RAM) + - Soft limiter implemented in prepare proposal stage +3. This approach balances network efficiency with block processing speed. +4. While initially not considered consensus-breaking, it has a meaningful effect on users and should be formalized. + +## Backwards Compatibility + +This proposal is meant to be included with v3 and the [Ginger Network Upgrade](./cip-25.md). It is backwards compatible with v2. + +## Security Considerations + +This proposal does not introduce new security risks but impacts network behavior and user experience. + +## Copyright + +Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE). diff --git a/cips/cip-tx-limits.md b/cips/cip-tx-limits.md index a95b86e..311282b 100644 --- a/cips/cip-tx-limits.md +++ b/cips/cip-tx-limits.md @@ -15,20 +15,23 @@ This CIP proposes to set the limit for transaction size to 2MiB. This is a conse ## Specification -1. Transaction size is limited to 2MiB by setting the versioned parameter `MaxTxSize` to 2097152 (2MiB in bytes). -2. From version v3 and above, in `CheckTx`, `PrepareProposal`, and `ProcessProposal`, each transaction's size is checked against the `appconsts.MaxTxSize` threshold. +1. Set the versioned parameter `MaxTxSize` to 2097152 (2MiB in bytes). +2. From version v3 and above, enforce this limit in `CheckTx`, `PrepareProposal`, and `ProcessProposal`. +3. Transactions exceeding this limit will be rejected or excluded at all stages, from initial submission to execution. ## Rationale -To set the transaction size limit to 2MiB, even with 8MiB blocks, to prevent issues with gossiping large transactions. Gossiping an 8MiB transaction without chunking could be detrimental to the network. +1. To prevent issues with gossiping large transactions, even with 8MiB blocks. +2. Gossiping an 8MiB transaction without chunking could be detrimental to the network. +3. This change ensures network stability and efficient transaction processing. ## Backwards Compatibility -This proposal is meant to be included with v3 and the Ginger Network Upgrade. It is a consensus-breaking change. +This proposal is meant to be included with v3 and the [Ginger Network Upgrade](./cip-25.md). It is a consensus-breaking change. ## Security Considerations -This proposal does not introduce new security risks but impacts network behavior and user experience. +While this proposal doesn't introduce new security risks, it significantly impacts network behavior and transaction processing, which must be carefully considered during implementation. ## Copyright From 66de5cf2a344cdb8d8f79dacc1cbb79c0ab79f3c Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:35:42 -0400 Subject: [PATCH 3/6] docs: add original context from previous PR --- cips/cip-pfb-limits.md | 43 ------------------------------------------ cips/cip-tx-limits.md | 14 +++++--------- 2 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 cips/cip-pfb-limits.md diff --git a/cips/cip-pfb-limits.md b/cips/cip-pfb-limits.md deleted file mode 100644 index 6c47984..0000000 --- a/cips/cip-pfb-limits.md +++ /dev/null @@ -1,43 +0,0 @@ -| cip | TBD(27) | -| - | - | -| title | Block limits for number of PFBs and non-PFBs | -| description | Set limits for number of PFBs and non-PFBs per block | -| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), rach-id ([@rach-id](https://github.com/rach-id)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | -| discussions-to | | -| status | Draft | -| type | Standards Track | -| category | Core | -| created | 2024-10-16 | - -## Abstract - -This CIP proposes to set limits for the number of PayForBlobs (PFBs) messages and non-PFBs messages per block. The proposal is to set the limits to 600 PFBs messages and 200 non-PFBs messages per block. Setting PFB and non-PFBs limits is not consensus-breaking. - -## Specification - -1. Set `MaxPFBMessages` to 600, limiting the number of PFBs per block to 600. -2. Set `MaxNonPFBMessages` to 200, limiting the number of non-PFBs messages per block to 200. -3. These limits are implemented as soft limits in the `PrepareProposal` stage of the `celestia-app`. -4. Validators can potentially modify the `PrepareProposal` logic and produce blocks exceeding these limits. - -## Rationale - -1. To prevent long block times by limiting PFBs and non-PFBs messages per block. -2. Limits were established based on benchmarks in [PR 3904](https://github.com/celestiaorg/celestia-app/pull/3904): - - Target processing time: ~0.25 seconds - - Benchmarks run on recommended validator configuration (4 CPU, 16GB RAM) - - Soft limiter implemented in prepare proposal stage -3. This approach balances network efficiency with block processing speed. -4. While initially not considered consensus-breaking, it has a meaningful effect on users and should be formalized. - -## Backwards Compatibility - -This proposal is meant to be included with v3 and the [Ginger Network Upgrade](./cip-25.md). It is backwards compatible with v2. - -## Security Considerations - -This proposal does not introduce new security risks but impacts network behavior and user experience. - -## Copyright - -Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE). diff --git a/cips/cip-tx-limits.md b/cips/cip-tx-limits.md index 311282b..8b0c45f 100644 --- a/cips/cip-tx-limits.md +++ b/cips/cip-tx-limits.md @@ -2,7 +2,7 @@ | - | - | | title | Transaction size limit | | description | Set limit for transaction size | -| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)) | +| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | | discussions-to | | | status | Draft | | type | Standards Track | @@ -11,19 +11,15 @@ ## Abstract -This CIP proposes to set the limit for transaction size to 2MiB. This is a consensus-breaking change. +This CIP proposes to set the limit for transaction size. The proposal is to set the transaction size limit to 2MiB. Setting the transaction size limit is consensus-breaking. ## Specification -1. Set the versioned parameter `MaxTxSize` to 2097152 (2MiB in bytes). -2. From version v3 and above, enforce this limit in `CheckTx`, `PrepareProposal`, and `ProcessProposal`. -3. Transactions exceeding this limit will be rejected or excluded at all stages, from initial submission to execution. +1. Transaction size is limited to 2MiB by setting the versioned parameter `MaxTxSize` to 2097152, which is 2MiB in bytes. From version v3 and above, in `CheckTx`, `PrepareProposal`, and `ProcessProposal`, each transaction's size is checked against the `appconsts.MaxTxSize` threshold. This ensures that transactions over the limit are rejected or excluded at all stages, from initial submission to execution. ## Rationale -1. To prevent issues with gossiping large transactions, even with 8MiB blocks. -2. Gossiping an 8MiB transaction without chunking could be detrimental to the network. -3. This change ensures network stability and efficient transaction processing. +The rationale for this proposal is to set the transaction size limit to 2MiB, even with 8MiB blocks, to prevent issues with gossiping large transactions. Gossiping an 8MiB transaction without chunking could be detrimental to the network. This is a consensus-breaking change. ## Backwards Compatibility @@ -31,7 +27,7 @@ This proposal is meant to be included with v3 and the [Ginger Network Upgrade](. ## Security Considerations -While this proposal doesn't introduce new security risks, it significantly impacts network behavior and transaction processing, which must be carefully considered during implementation. +This proposal does not introduce any new security risks. However, it does impact network behavior and user experience, which should be carefully considered during implementation. ## Copyright From 8d435faa9bf0ca4d5ef225e9ed2aea18e63894fa Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:38:23 -0400 Subject: [PATCH 4/6] docs: name to cip-28.md --- cips/README.md | 3 ++- cips/SUMMARY.md | 1 + cips/{cip-tx-limits.md => cip-28.md} | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) rename cips/{cip-tx-limits.md => cip-28.md} (99%) diff --git a/cips/README.md b/cips/README.md index 42390c1..fc7afbd 100644 --- a/cips/README.md +++ b/cips/README.md @@ -56,7 +56,8 @@ Read [CIP-1](./cip-1.md) for information on the CIP process. | [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) | -| [27](./cip-26.md) | Block limits for number of PFBs and non-PFBs | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), rach-id ([@rach-id](https://github.com/rach-id)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | +| [27](./cip-27.md) | Block limits for number of PFBs and non-PFBs | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), rach-id ([@rach-id](https://github.com/rach-id)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | +| [28](./cip-28.md) | Transaction size limit | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)), Rootul Patel ([@rootulp](https://github.com/rootulp)) | ## Contributing diff --git a/cips/SUMMARY.md b/cips/SUMMARY.md index 263f3af..e338885 100644 --- a/cips/SUMMARY.md +++ b/cips/SUMMARY.md @@ -30,6 +30,7 @@ - [CIP-25](./cip-25.md) - [CIP-26](./cip-26.md) - [CIP-27](./cip-27.md) + - [CIP-28](./cip-28.md) - [Core Devs Call notes](./notes/README.md) - [CDC #14](./notes/cdc-14.md) diff --git a/cips/cip-tx-limits.md b/cips/cip-28.md similarity index 99% rename from cips/cip-tx-limits.md rename to cips/cip-28.md index 8b0c45f..1f7cb2c 100644 --- a/cips/cip-tx-limits.md +++ b/cips/cip-28.md @@ -1,4 +1,4 @@ -| cip | TBD(28) | +| cip | 28 | | - | - | | title | Transaction size limit | | description | Set limit for transaction size | From 8506c2d4c657c2b06725fb1a19ddb27de5c80aa1 Mon Sep 17 00:00:00 2001 From: jcstein <46639943+jcstein@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:41:19 -0400 Subject: [PATCH 5/6] docs: add to CIP-25 --- cips/cip-25.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cips/cip-25.md b/cips/cip-25.md index 2423d5d..2a44739 100644 --- a/cips/cip-25.md +++ b/cips/cip-25.md @@ -7,7 +7,7 @@ | status | Draft | | type | Meta | | created | 2024-10-01 | -| requires | CIP-21, CIP-24, CIP-26, CIP-27, CIP-TBD-2 | +| requires | CIP-21, CIP-24, CIP-26, CIP-27, CIP-28 | ## Abstract @@ -21,7 +21,7 @@ This Meta CIP lists the CIPs included in the Ginger network upgrade. - [CIP-24](./cip-24.md): Versioned Gas Scheduler Variables - [CIP-26](./cip-26.md): Versioned timeouts - [CIP-27](./cip-27.md): Block limits for number of PFBs and non-PFBs -- CIP-TBD-2: Transaction size limit +- [CIP-28](./cip-27.md): 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). From 52a528164c3df2c7e427730fd0112d8edfd0cb00 Mon Sep 17 00:00:00 2001 From: Josh Stein <46639943+jcstein@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:20:40 -0400 Subject: [PATCH 6/6] Apply suggestions from code review --- cips/cip-28.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cips/cip-28.md b/cips/cip-28.md index 1f7cb2c..bc657a0 100644 --- a/cips/cip-28.md +++ b/cips/cip-28.md @@ -19,7 +19,15 @@ This CIP proposes to set the limit for transaction size. The proposal is to set ## Rationale -The rationale for this proposal is to set the transaction size limit to 2MiB, even with 8MiB blocks, to prevent issues with gossiping large transactions. Gossiping an 8MiB transaction without chunking could be detrimental to the network. This is a consensus-breaking change. +This proposal aims to set a transaction size limit of 2 MiB, even with blocks of 8 MiB or larger, primarily as a preventative measure. Gossiping transactions approaching 8 MiB without chunking could potentially be detrimental to network performance and stability. + +The 2 MiB limit serves to: + +1. Maintain network stability +2. Provide clear expectations for users and developers +3. Safeguard against potential issues as network usage grows + +This approach prioritizes network-wide consistency and stability while allowing for future scalability considerations. ## Backwards Compatibility @@ -27,7 +35,7 @@ This proposal is meant to be included with v3 and the [Ginger Network Upgrade](. ## Security Considerations -This proposal does not introduce any new security risks. However, it does impact network behavior and user experience, which should be carefully considered during implementation. +Any changes to the block validity rules (via `PrepareProposal` and `ProcessProposal`) introduce implementation risks that could potentially lead to a chain halt. ## Copyright