Skip to content

Conversation

cason
Copy link

@cason cason commented Apr 10, 2024

Closes #2756.

The proposed value is 64 MiB = 16 x default block.max_bytes (consensus parameter).


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

@cason cason self-assigned this Apr 10, 2024
@cason cason marked this pull request as ready for review April 10, 2024 10:46
@cason cason requested a review from a team as a code owner April 10, 2024 10:46
@cason cason requested a review from a team April 10, 2024 10:46
@cason cason added the backport-to-v1.x Tell Mergify to backport the PR to v1.x label Apr 10, 2024
@ancazamfir
Copy link
Contributor

The proposed value is 64 MiB = 16 x default block.max_bytes (consensus parameter).

Looks good.

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/explanation/core/configuration.md needs to be updated as well

@hvanz
Copy link
Member

hvanz commented Apr 10, 2024

I'd say that 64 Gib is a low number but this is just a guess. If it happens that a few big txs are submitted at the same time, that would take up a big chunk of the mempool capacity and leave a reduced space for the regular-sized txs. Cosmwasm smart contracts could take a couple of Mbs (see #1518 (comment)).

@cason
Copy link
Author

cason commented Apr 10, 2024

Cosmwasm smart contracts could take a couple of Mbs

In this case, they have to change the default max_tx_bytes (1MB) as well...

Notice that this is not a consensus parameter, is something pretty easy to tune. The real point here is whether it makes sense to allow 1GB transactions by default with block size of 4MB (default again). It would take 256 rounds to drain all transactions from the mempool.

@cason
Copy link
Author

cason commented Apr 10, 2024

docs/explanation/core/configuration.md needs to be updated as well

Good point, I will fix it.

But should we maintain this document (as well)? Another source to manually update each time we change a config param...

@melekes
Copy link
Contributor

melekes commented Apr 10, 2024

docs/explanation/core/configuration.md needs to be updated as well

Good point, I will fix it.

But should we maintain this document (as well)? Another source to manually update each time we change a config param...

I would probably remove it, yeah. Now that we have config.toml.md

Copy link
Contributor

@sergio-mena sergio-mena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@cason
Copy link
Author

cason commented Apr 10, 2024

I would probably remove it, yeah. Now that we have config.toml.md

#2769

Copy link
Contributor

@andynog andynog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, added a few suggestions.

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
@cason cason enabled auto-merge April 10, 2024 16:05
@cason cason added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit 732ca9a Apr 10, 2024
@cason cason deleted the cason/2756-max_txs_bytes branch April 10, 2024 16:14
mergify bot pushed a commit that referenced this pull request Apr 10, 2024
…#2767)

Closes #2756.

The proposed value is 64 MiB = 16 x default `block.max_bytes` (consensus
parameter).

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Andy Nogueira <me@andynogueira.dev>
(cherry picked from commit 732ca9a)
cason pushed a commit that referenced this pull request Apr 11, 2024
… (backport #2767) (#2770)

Closes #2756.

The proposed value is 64 MiB = 16 x default `block.max_bytes` (consensus
parameter).

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #2767 done by
[Mergify](https://mergify.com).

Co-authored-by: Daniel <daniel.cason@informal.systems>
dynst added a commit to dynst/penumbra that referenced this pull request Jun 12, 2024
Upstream changed the default to a less ludicrous number, 1GB was
way too many bytes.

cometbft/cometbft#2767
erwanor added a commit to penumbra-zone/penumbra that referenced this pull request Jun 13, 2024
## Describe your changes

Lower the default value for `max_txs_bytes` from 1GiB to 10MiB. Upstream
also substantially lowered this default recently.
cometbft/cometbft#2767

See also the [new `nop` mempool
type](cometbft/cometbft#1643) they added to deal
with the mempool being a potential DoS vector a la
[p2p-storms](https://github.com/notional-labs/placid).

## Issue ticket number and link

## Checklist before requesting a review

- [X] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

The mempool and its configuration are outside consensus.

---------

Signed-off-by: Erwan Or <erwan.ounn.84@gmail.com>
Co-authored-by: Erwan Or <erwan.ounn.84@gmail.com>
Co-authored-by: Erwan Or <erwanor@penumbralabs.xyz>
dynst added a commit to dynst/astria that referenced this pull request Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v1.x Tell Mergify to backport the PR to v1.x config mempool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mempool/config: reduce the default max_txs_bytes value
6 participants