Skip to content

txpool invalidation can double-count a transaction when blacklist and whitelist updates both match #3627

@RekCuy63

Description

@RekCuy63

Describe the bug

Affected crate: tempo-transaction-pool (crates/transaction-pool/src/tempo_pool.rs).

evict_invalidated_transactions() can push the same tx hash twice when one pending AA transaction matches both Check 4 (blacklist addition) and Check 5 (whitelist removal) in the same maintenance scan.

On current HEAD, Checks 1-3 continue after pushing to to_remove, but Checks 4-5 do not. The same hash can therefore be returned twice, while crates/transaction-pool/src/maintain.rs increments metrics.transactions_invalidated with evicted.len(). This can inflate the Prometheus metric and txpool debug counters, and state.untrack(hash) can run twice for the same tx.

Steps to reproduce

  1. Add a pending AA transaction with an explicit fee token whose transfer policy is compound.
  2. In the same maintenance scan, include:
  • a blacklist addition for the fee payer on the sender-side policy
  • a whitelist removal for TIP_FEE_MANAGER_ADDRESS on the recipient-side policy
  1. Run evict_invalidated_transactions().
    1. The same tx hash can be pushed once in Check 4 and again in Check 5 because neither branch exits the outer loop after the first invalidation.

Confirmed by code inspection on current HEAD. I also verified a local fix with a targeted regression test.

Logs


Platform(s)

No response

Container Type

Not running in a container

What version/commit are you on?

Current HEAD on main: d5b27eaa

If you've built from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions