Skip to content

Persist skipped tx state paths in database #400

@rpanic

Description

@rpanic

The ordering module currently keeps state paths for failed transaction with failed (and skipped) tx hooks only in memory. This means that this information is lost after each block.
Meaning that even though a transaction cannot succeed (since no inputs changed), it will still be picked up, executed and skipped as long as the mempool ordering doesn't change.
This is a serious attack vector (imagine spamming a few high-value transactions that cannot succeed and therefore occupying the block builder for a long time each block, executing useless transactions)

We can fix this by persisting the input paths and:

  • During mempool fetching, only fetch transactions that have no stored "skipped input paths"
  • After including a successful transaction (or after each block for performance reasons) report changed state paths back to the db and delete all records containing one of the paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions