-
Notifications
You must be signed in to change notification settings - Fork 44
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
docs: add CIP for block limits on pfbs and tx size #220
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f7f4a3d
docs: add CIP for block limits on pfbs and tx size
jcstein 282bc93
docs: clarify rationale and security considerations
jcstein f89c0ba
Apply suggestions from code review
jcstein 2d60926
Apply suggestions from code review
jcstein f401653
docs: suggestion from nina review
jcstein e81a4de
docs: add Nina as author
jcstein 61de07e
style: add to list
jcstein c6d9a7c
docs: code review
jcstein 164e63c
docs: rachid's suggestion
jcstein 8fbee0e
docs: use new variables, suggestions from review
jcstein 0bb0df6
Apply suggestions from code review
jcstein cdb6f4c
Apply suggestions from code review
jcstein fbb27e3
Apply suggestions from code review
jcstein d251f3a
Apply suggestions from code review
jcstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
| cip | TBD(27) | | ||
| - | - | | ||
| title | Block limits for number of PFBs/non-PFBs and transaction size | | ||
| description | Set limits for number of PFBs and non-PFBs per block and transaction size | | ||
| author | Josh Stein ([@jcstein](https://github.com/jcstein)), Nina Barbakadze ([@ninabarbakadze](https://github.com/ninabarbakadze)) | | ||
| discussions-to | <https://forum.celestia.org/t/cip-limit-number-of-pfbs-and-non-pfbs-per-block-increase-transaction-size-limit/1843> | | ||
| 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 and set the limit for transaction size. The proposal is to set the limits to 600 PFBs messages and 200 non-PFBs messages per block and set the transaction size limit to 2MiB. Setting PFB and non-PFBs limits is not consensus-breaking. Setting the transaction size limit is consensus-breaking. | ||
|
||
## Specification | ||
|
||
1. The number of PFBs per block is limited to 600 by setting `MaxPFBMessages` to 600. | ||
|
||
1. The number of non-PFBs messages per block is limited to 200 by setting `MaxNonPFBMessages` to 200. | ||
|
||
jcstein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
1. It's important to note that these limits are not strictly enforced. While they are defined by the `celestia-app` implementation, a validator could potentially modify the `PrepareProposal` logic, run a custom binary, and produce blocks that exceed the specified limits for PFB or non-PFBs transactions. | ||
|
||
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 | ||
|
||
The rationale for this proposal is twofold: | ||
|
||
1. To prevent long block times on the network by limiting the number of PFBs and non-PFBs messages per block. This was initially not considered consensus-breaking, but it has a meaningful effect on users and should be formalized in a CIP. | ||
1. The limits for PFBs (Pay for Blob transactions) and non-PFBs per block were established using the following process: | ||
1. Benchmarks were conducted in [PR 3904 on celestia-app](https://github.com/celestiaorg/celestia-app/pull/3904) to measure ABCI method processing times for different transaction types. | ||
1. A target processing time of ~0.25 seconds was set to prevent long block times. | ||
1. Based on these benchmarks, run on the recommended validator configuration (4 CPU, 16GB RAM), a soft limiter was implemented in the prepare proposal stage. | ||
1. This limiter sets specific caps on the number of PFB and non-PFB messages allowed in a default block to meet the processing time target. | ||
1. While default blocks adhere to these limits, blocks exceeding them can still be included if they reach consensus, ensuring flexibility. | ||
1. This approach balances network efficiency with block processing speed, directly informing the PFB and non-PFB limits now in place. | ||
|
||
1. 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 | ||
|
||
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 any new security risks. However, it does impact network behavior and user experience, which should be carefully considered during implementation. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://github.com/celestiaorg/CIPs/blob/main/LICENSE). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this in all core devs but IMO there wasn't a clear decision made in the call. I think we could split this into two CIPs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @cmwaters explanation is that these both impact how a block is constructed, so was okay to leave it as 1 CIP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also happy to scrap this and have it split to 2 CIPs by authors of the features. but I worry this will likely just add more delay to these being drafted.