-
Notifications
You must be signed in to change notification settings - Fork 278
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: ADR021 Restricted Block Size #1759
Conversation
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.
Thanks a ton for documenting the context around this decision! Do you think an additional section for "Goals" or "Desirable criteria" would be helpful?
My opinion is based on the desirable criteria:
Do we want the square size to be governance modifiable?
- if yes we go with option 2 (i.e.
GovMaxSquareSize
) - if no we set
MaxSquareSize=64
and at a later date (i.e. when pruning is implemented) we hard-fork to increaseMaxSquareSize
In my opinion, the answer to this is: |
to quickly update this from the sync, we are moving forward with option 2. option 3 is implemented and would work, however, it introduces more implicit complexity. Option 2 is more explicit and maximally flexible (we can have large squares and small blocks). |
…ze (#1761) ## Overview The base implementation for all ADR021 #1759 options part of #1592 blocked by #1754 ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords
|
||
Currently, block sizes are controlled by three values, the smallest of which will determine what the protocol considers to be a valid block size. | ||
|
||
- `MaxBlockBytes` is a hard coded constant to the maximum total size of the protobuf encoded block, and therefore acts as a cap for `MaxBytes`. Currently set to 100 MB. |
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.
[question] where is MaxBlockBytes
defined? I can't find it in
- https://github.com/search?q=repo%3Acelestiaorg%2Fcelestia-app+MaxBlockBytes&type=code
- https://github.com/search?q=repo%3Acelestiaorg%2Fcelestia-core+MaxBlockBytes&type=code
- https://github.com/search?q=repo%3Acometbft%2Fcometbft+MaxBlockBytes&type=code
It's not obvious that MaxBytes
and MaxBlockBytes
are related and one is governance modifiable. Maybe we consider adopting a similar naming strategy as MaxSquareSize
and GovMaxSquareSize
because those are clearly related. In other words should we consider preserving MaxBlockBytes
and renaming MaxBytes
=> GovMaxBlockBytes
? My hunch is that the diff it will introduce with cometbft is not worth the extra clarity in naming.
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.
yeah, the only reason that I didn't change them is because MaxBytes
is a consensus param, which changing the name might break a few things in the sdk or explorers. We could rename the constant in core
and ahh whoops, the constant is MaxBlockSizeBytes
, will update
i wasn't very involved with these discussions so will defer to others. |
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.
| Parameter | Size | Unit | Description | Value Control | | ||
|------------------|--------|--------|--------------|---------------| | ||
| `MaxBlockSizeBytes` | 100 | MiB | Maximum total size of the protobuf encoded block, a hard coded constant acting as a cap for `MaxBytes`. | Hard coded | | ||
| `MaxBytes` | 21 | MiB | Determines the valid size of the entire protobuf encoded block. Is a governance modifiable parameter and is capped by `MaxBytes`. Used to regulate the amount of data gossiped in the consensus portion of the network (using the current block gossiping mechanism). | Modifiable | |
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.
[nit]
| `MaxBytes` | 21 | MiB | Determines the valid size of the entire protobuf encoded block. Is a governance modifiable parameter and is capped by `MaxBytes`. Used to regulate the amount of data gossiped in the consensus portion of the network (using the current block gossiping mechanism). | Modifiable | | |
| `MaxBytes` | 21 | MiB | Determines the maximum size of the entire protobuf encoded block. Is a governance modifiable parameter. Used to regulate the amount of data gossiped in the consensus portion of the network (using the current block gossiping mechanism). | Modifiable | |
|
||
The second suggestion is to create a new governance parameter, | ||
`GovMaxSquareSize`, which governance could set. Now the protocol would use the | ||
lowest of 4 values to determine the size of a block at a given height. This has |
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.
Now the protocol would use the
lowest of 4 values to determine the size of a block at a given height
[no change needed] I interpret MaxBlockSizeBytes
as a maximum value for MaxBytes
. Similarly, I interpret MaxSquareSize
as a maximum value for GovMaxSquareSize
.
When evaluating if a square is valid, I expect that the proposed block only needs to be compared with MaxSquareSize
and GovMaxSquareSize
and doesn't need to be compared with the caps for those values because the param proposal that attempts to change MaxBytes
or GovMaxSquareSize
above their respective caps should fail.
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.
tendermint will check first using both the bytes params no matter what, and then we check using the gov param in prepare/process proposal. So we actually end up using the lowest value of all 4 each height
| `MaxBlockSizeBytes` | 100 | MiB | Maximum total size of the protobuf encoded block, a hard coded constant acting as a cap for `MaxBytes`. | Hard coded | | ||
| `MaxBytes` | ~1.8 | MiB | Determines the valid size of the entire protobuf encoded block. Is a governance modifiable parameter and is capped by `MaxBytes`. Used to regulate the amount of data gossiped in the consensus portion of the network (using the current block gossiping mechanism). | Modifiable | | ||
| `MaxSquareSize` | ~7.5 | MiB | Determines the maximum size of the original data square. Used to regulate storage requirements for celestia-node, and the size of the data availability header. Default set to 128. | Hard coded | | ||
| `GovMaxSquareSize` | ~1.8 | MiB | Governance modifiable parameter that determines valid square sizes. Must be smaller than the `MaxSquareSize`. Default set to 64. | Modifiable | |
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.
| `GovMaxSquareSize` | ~1.8 | MiB | Governance modifiable parameter that determines valid square sizes. Must be smaller than the `MaxSquareSize`. Default set to 64. | Modifiable | | |
| `GovMaxSquareSize` | ~1.8 | MiB | Governance modifiable parameter that determines the max valid square size. Must be smaller than the `MaxSquareSize`. Default set to 64. | Modifiable | |
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.
merging for the sake of getting this through, but this does make sense to change
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.
💪🎉👏
Codecov Report
@@ Coverage Diff @@
## main #1759 +/- ##
=======================================
Coverage 21.84% 21.84%
=======================================
Files 116 116
Lines 13232 13232
=======================================
Hits 2890 2890
Misses 10050 10050
Partials 292 292 |
Overview
Rendered
Decided to document a synchronous discussion, and open (a hopefully quick) discussion while I implement two options to choose from (option 2 and 3)
Checklist