Skip to content

fix(mempool): inflight notes are considered unauthenticated once pruned#2097

Merged
Mirko-von-Leipzig merged 3 commits into
nextfrom
mirko/fix-mempool
May 22, 2026
Merged

fix(mempool): inflight notes are considered unauthenticated once pruned#2097
Mirko-von-Leipzig merged 3 commits into
nextfrom
mirko/fix-mempool

Conversation

@Mirko-von-Leipzig
Copy link
Copy Markdown
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig commented May 19, 2026

This PR fixes a panic in the mempool which can occur when under extreme load.

The root cause is some missing book keeping around block pruning. What happens is that

  1. transaction A creates note A'
  2. transaction B consumed note A', this succeeds because the mempool knows the note is inflight.
  3. transaction A is committed in block C
  4. block C is eventually pruned, removing note A' from all graphs
  5. transaction B is then selected for inclusion in a batch
  6. batch DAG panic! because B's unauthenticated note A' is now unknown

The fix is to mark all notes from pruned blocks as authenticated (since we know they definitely exist and are committed). The fix was tested and confirmed using TDD.

This only occurred under extreme load because it required enough transactions to delay selection of B to after A was both committed and pruned.

Fixes #2079

Copy link
Copy Markdown
Contributor

@kkovaacs kkovaacs left a comment

Choose a reason for hiding this comment

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

LGTM!

@Mirko-von-Leipzig Mirko-von-Leipzig merged commit 85da13b into next May 22, 2026
20 checks passed
@Mirko-von-Leipzig Mirko-von-Leipzig deleted the mirko/fix-mempool branch May 22, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Block-producer panics on select_batch with unauthenticated input notes are unknown

2 participants