Skip to content

feat(config): new default value for mempool.max_txs_bytes parameter - #2767

Merged
cason merged 11 commits into
mainfrom
cason/2756-max_txs_bytes
Apr 10, 2024
Merged

cason merged 11 commits into
mainfrom
cason/2756-max_txs_bytes

Conversation

@cason

@cason cason commented Apr 10, 2024 •

Copy link
Copy Markdown

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

Comment thread docs/references/config/config.toml.md Resolved
@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
@ancazamfir

Copy link
Copy Markdown
Collaborator

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

Looks good.

Comment thread config/config.go Resolved

@melekes melekes left a comment

Copy link
Copy Markdown
Collaborator

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

hvanz commented Apr 10, 2024

Copy link
Copy Markdown
Collaborator

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

cason commented Apr 10, 2024

Copy link
Copy Markdown
Author

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

cason commented Apr 10, 2024

Copy link
Copy Markdown
Author

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

melekes commented Apr 10, 2024

Copy link
Copy Markdown
Collaborator

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

Comment thread docs/explanation/core/configuration.md Resolved

@sergio-mena sergio-mena left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🙏

@cason

cason commented Apr 10, 2024

Copy link
Copy Markdown
Author

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

#2769

@andynog andynog left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread config/config.go Resolved
Comment thread config/config.go Resolved
Comment thread docs/references/config/config.toml.md Resolved
Comment thread docs/references/config/config.toml.md Resolved
Comment thread docs/references/config/config.toml.md Resolved
@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 <[email protected]>
(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 <[email protected]>
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 <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
Co-authored-by: Erwan Or <[email protected]>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mempool/config: reduce the default max_txs_bytes value

6 participants