From 0cf3a6fec91b145a5b96cdb5b217cfa7de358afd Mon Sep 17 00:00:00 2001 From: Josh Stein <46639943+jcstein@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:20:59 -0400 Subject: [PATCH] docs: cip for tx limits (#226) * docs: cip for tx limits * docs: edits * docs: add original context from previous PR * docs: name to cip-28.md * docs: add to CIP-25 * Apply suggestions from code review --- cips/README.md | 3 ++- cips/SUMMARY.md | 1 + cips/cip-25.md | 4 ++-- cips/cip-28.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 cips/cip-28.md 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-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). diff --git a/cips/cip-28.md b/cips/cip-28.md new file mode 100644 index 0000000..bc657a0 --- /dev/null +++ b/cips/cip-28.md @@ -0,0 +1,42 @@ +| cip | 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)), 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 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. 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 + +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 + +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 + +Any changes to the block validity rules (via `PrepareProposal` and `ProcessProposal`) introduce implementation risks that could potentially lead to a chain halt. + +## Copyright + +Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE).