-
Notifications
You must be signed in to change notification settings - Fork 286
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
chore: bump the max tx bytes in the mempool config #2219
Conversation
// Given that there is a stateful transaction size check in CheckTx, | ||
// We set a loose upper bound on what we expect the transaction to | ||
// be based on the upper bound size of the entire block for the given | ||
// version. This acts as a first line of DoS protection | ||
upperBoundBytes := appconsts.DefaultSquareSizeUpperBound * appconsts.DefaultSquareSizeUpperBound * appconsts.ContinuationSparseShareContentSize | ||
cfg.Mempool.MaxTxBytes = upperBoundBytes |
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 this change makes sense b/c otherwise when governance bumps the gov max square size param from 64 to 128, a transaction that occupies (roughly) more than half the new square size will be rejected by all validators with the default max tx bytes. Validators can accept by modifying their local MaxTxBytes in config.toml
but it seems prescient to bump the default now.
[optional]
- Do we want to change it here?
celestia-app/test/util/testnode/config.go
Lines 156 to 159 in a495d40
// set the mempool's MaxTxBytes to allow the testnode to accept a // transaction that fills the entire square. Any blob transaction larger // than the square size will still fail no matter what. tmCfg.Mempool.MaxTxBytes = appconsts.DefaultMaxBytes - Do we want to extract an
appconst
const for it?
[discussion]
stateful transaction size check in CheckTx
The stateful check in CheckTx uses appconsts.ShareSize
instead of appconsts.ContinuationSparseShareContentSize
here:
// squareBytes returns the number of bytes in a square for the given squareSize.
func squareBytes(squareSize int) int {
numShares := squareSize * squareSize
return numShares * appconsts.ShareSize
}
Mostly because the upper bound max blob size doesn't need to be exact. Similarly, MaxTxBytes
doesn't need to be exact and I think it's slightly cleaner to rely on appconsts.ShareSize
which is much less likely to change than appconsts.ContinuationSparseShareContentSize
which could change with a share version bump. So we may consider changing appconsts.DefaultMaxBytes
and cfg.Mempool.MaxTxBytes
to calculate based on appconsts.ShareSize
but definitely optional.
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 could see the benefit of switching to something simpler for readability. I'm also fine with using a more accurate value
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.
Do we want to change it here?
Yeah that makes sense
Do we want to extract an appconst const for it?
I'm indifferent. If it were used in more places I'd probably be for it
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 like appconsts for this but definitely not blocking on it.
Codecov Report
@@ Coverage Diff @@
## main #2219 +/- ##
==========================================
- Coverage 21.54% 21.53% -0.01%
==========================================
Files 127 127
Lines 14329 14335 +6
==========================================
Hits 3087 3087
- Misses 10939 10945 +6
Partials 303 303
|
do we need to update this branch for the backport to work? |
No description provided.