Skip to content

WIP: Change the meaning of MaxBytes to be like MaxDataBytes#3045

Closed
jaekwon wants to merge 1 commit intodevelopfrom
jae/maxbytes_fix
Closed

WIP: Change the meaning of MaxBytes to be like MaxDataBytes#3045
jaekwon wants to merge 1 commit intodevelopfrom
jae/maxbytes_fix

Conversation

@jaekwon
Copy link
Contributor

@jaekwon jaekwon commented Dec 18, 2018

Related: cosmos/game-of-stakes#242

NOTE: DO NOT DELETE THIS PR/BRANCH -- I'm going to create a release candidate and find a volunteer to test this on the live network for a softfork. Keep the PR/BRANCH to retain the commit.

@ebuchman
Copy link
Contributor

Can we delete this now? Looks like it's not going to be used.

Also, I think we should stick with MaxBytes, not MaxDataBytes.

MaxBytes provides a clear limit on the total size of a block that requires no additional calculation if you want to use it to bound resource usage, and there has been considerable discussions about optimizing tendermint around 1MB blocks. Regardless, we need some maximum on the size of a block so we can avoid unmarshalling blocks that are too big during the consensus, and it seems more straightforward to provide a single fixed number for this rather than a computation of "MaxDataBytes + everything else you need to make room for (signatures, evidence, header)". MaxBytes provides a simple bound so we can always say "blocks are less than X MB".

Having both MaxBytes and MaxDataBytes feels like unnecessary complexity. I don't think it's particularly surprising for MaxBytes to imply the maximum size of the entire block (not just txs), one just has to know that a block includes header, txs, evidence, votes. For more fine grained control over the txs included in the block, we have the MaxGas. In practice, I would expect the MaxGas to do most of the tx throttling, and the MaxBytes to just serve as an upper bound on the total size. Applications can use MaxGas as a MaxDataBytes by just taking the gas for every tx to be its size in bytes.

This reasoning should be included in ADR-020

@ebuchman ebuchman mentioned this pull request Jan 13, 2019
4 tasks
@ebuchman
Copy link
Contributor

I think this can be closed - transferred the rationale to ADR-020 in #3116

@ebuchman ebuchman closed this Jan 13, 2019
@tac0turtle tac0turtle deleted the jae/maxbytes_fix branch June 24, 2019 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants