Skip to content

feat(sequencer)!: add limit to total amount of transactions in parked #1638

Merged
lobstergrindset merged 10 commits intomainfrom
lilyjjo/limit_parked_size
Oct 8, 2024
Merged

feat(sequencer)!: add limit to total amount of transactions in parked #1638
lobstergrindset merged 10 commits intomainfrom
lilyjjo/limit_parked_size

Conversation

@lobstergrindset
Copy link
Contributor

@lobstergrindset lobstergrindset commented Oct 7, 2024

Summary

Adds a limit to the total amount of transactions in the 'parked' mempool structure. We made it configurable as it should change if the CometBFT consensus mempool parameters are modified.

Sane values would limit the max to less than half of the space in the CometBFT mempool. For example, the CometBFT mempool has the following parameters:

  # Maximum number of transactions in the mempool
  size: 2000
  # Maximum size of a single transaction in the mempool
  maxTxBytes: 250000
  # Maximum size of all transactions in the mempool
  maxTxsBytes: 100000000
  cacheSize: 10000

It would make sense to set the max pending size to a value like 200 transactions. The max size the 200 transactions could take is 50000000 bytes (200 txs * 250000 max bytes per tx), which is half of the available space in the mempool.

Background

We want to ensure that there is always space in the mempool for pending transactions so the chain can make progress.

Changes

  • Added a limit to the number of transactions able to be placed in the parked transaction container structure.

Testing

Unit tests and ran locally.

Metrics

  • Added TRANSACTIONS_IN_MEMPOOL_PARKED which gets triggered after successful adds to the parked queue.

Breaking Changelist

  • A new config variable was added to the sequencer's config file: ASTRIA_SEQUENCER_MEMPOOL_PARKED_MAX_TX_COUNT
  • A new ABCI error code was added: PARKED_FULL.

@github-actions github-actions bot added sequencer pertaining to the astria-sequencer crate cd labels Oct 7, 2024
@lobstergrindset lobstergrindset marked this pull request as ready for review October 7, 2024 13:40
@lobstergrindset lobstergrindset requested review from a team as code owners October 7, 2024 13:40
Copy link
Contributor

@quasystaty1 quasystaty1 left a comment

Choose a reason for hiding this comment

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

Charts LGTM

@lobstergrindset lobstergrindset added this pull request to the merge queue Oct 8, 2024
Merged via the queue into main with commit bcb3b3f Oct 8, 2024
@lobstergrindset lobstergrindset deleted the lilyjjo/limit_parked_size branch October 8, 2024 09:08
quasystaty1 pushed a commit that referenced this pull request Oct 8, 2024
…#1638)

Adds a limit to the total amount of transactions in the 'parked' mempool
structure. We made it configurable as it should change if the CometBFT
consensus mempool parameters are modified.

Sane values would limit the max to less than half of the space in the
CometBFT mempool. For example, the CometBFT mempool has the following
parameters:
```
  # Maximum number of transactions in the mempool
  size: 2000
  # Maximum size of a single transaction in the mempool
  maxTxBytes: 250000
  # Maximum size of all transactions in the mempool
  maxTxsBytes: 100000000
  cacheSize: 10000
```
It would make sense to set the max pending size to a value like 200
transactions. The max size the 200 transactions could take is 50000000
bytes (200 txs * 250000 max bytes per tx), which is half of the
available space in the mempool.

We want to ensure that there is always space in the mempool for pending
transactions so the chain can make progress.

- Added a limit to the number of transactions able to be placed in the
parked transaction container structure.

Unit tests and ran locally.

- Added `TRANSACTIONS_IN_MEMPOOL_PARKED` which gets triggered after
successful adds to the parked queue.

- A new config variable was added to the sequencer's config file:
`ASTRIA_SEQUENCER_MEMPOOL_PARKED_MAX_TX_COUNT`
- A new ABCI error code was added: `PARKED_FULL`.

---------

Co-authored-by: Fraser Hutchison <fraser@astria.org>
steezeburger added a commit that referenced this pull request Oct 11, 2024
* main:
  feat(sequencer)!: enforce block ordering by transaction group  (#1618)
  fix(cli): ensure checkTx passes before waiting for inclusion (#1636)
  chore(sequencer)!: update storage keys locations and values (ENG-898) (#1616)
  chore: cargo audit warning (#1644)
  chore(proto, core)!: remove action suffix from all action types (#1630)
  feat(sequencer)!: add limit to total amount of transactions in parked  (#1638)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cd sequencer pertaining to the astria-sequencer crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants