Skip to content

Persist p2p mempool #3365

@alexghr

Description

@alexghr

The P2P mempool stores pending transactions in memory until a sequencer can pick execute and submit them in a rollup. If a node is shutdown then it loses all pending transaction that it got from the mempool. Normally this would be fine as it would pick them back up as soon as it rejoins the network but if its the only node in the network then the transactions are lost.

Add an alternative mempool implementation alongside InMemoryTxPool that stores pending transactions in a persistent database.

On boot the p2p client should validate this data against:

  1. the state on chain and remove any transactions that have been processed while the node was offline
  2. Update the p2p network with any pending transactions it knows about that haven't been processed and don't exist in the pool (e.g. if the node gets a pending tx but is shutdown before it had a chance to push it out)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions