Skip to content

fix(starfish): transaction eviction stalls during fast commit sync#11247

Open
polinikita wants to merge 1 commit intodevelopfrom
starfish/fix/flush-eviction-early-return
Open

fix(starfish): transaction eviction stalls during fast commit sync#11247
polinikita wants to merge 1 commit intodevelopfrom
starfish/fix/flush-eviction-early-return

Conversation

@polinikita
Copy link
Copy Markdown
Member

@polinikita polinikita commented Apr 16, 2026

Description of change

During fast commit sync, evict_transactions() was bottlenecked by calculate_authority_eviction_round(), which depends on recent_headers_refs_by_authority. Fast sync adds only transactions and commits — no headers — so the header-based eviction round stays near a lower value from which fast sync was started, and the min() picks this stale value. Transactions accumulated unboundedly in memory until reinitialization.

Two fixes:

  1. When fast_sync_ongoing is true, bypass the header-based cap in evict_transactions() and evict_tx_ref_to_block_digests() — use the commit-based GC round directly. Normal operation keeps current semantics.
  2. Remove the early return in flush() so eviction runs even when write buffers are empty (needed when last_solid_subdag_base is updated between flushes).

Links to any relevant issues

Fixes #11246

How the change has been tested

  • Basic tests (linting, compilation, formatting, unit/integration tests)
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@polinikita polinikita requested a review from a team as a code owner April 16, 2026 10:25
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Actions Updated (UTC)
apps-backend Ignored Ignored Preview Apr 16, 2026 2:49pm
apps-ui-kit Ignored Ignored Preview, Comment Apr 16, 2026 2:49pm
iota-evm-bridge Ignored Ignored Preview Apr 16, 2026 2:49pm
iota-multisig-toolkit Ignored Ignored Preview Apr 16, 2026 2:49pm
rebased-explorer Ignored Ignored Preview Apr 16, 2026 2:49pm
wallet-dashboard Ignored Ignored Preview, Comment Apr 16, 2026 2:49pm

Request Review

@iota-ci iota-ci added consensus Issues related to the Core Consensus team core-protocol labels Apr 16, 2026
@polinikita polinikita marked this pull request as draft April 16, 2026 10:26
@polinikita polinikita changed the title fix(starfish): run eviction in flush() even without pending writes fix(starfish): transaction eviction stalls during fast commit sync Apr 16, 2026
@polinikita polinikita self-assigned this Apr 16, 2026
@polinikita polinikita force-pushed the starfish/fix/flush-eviction-early-return branch from 1677177 to a2bf5b1 Compare April 16, 2026 14:15
@polinikita polinikita marked this pull request as ready for review April 16, 2026 14:17
During fast sync, evict_transactions() and evict_tx_ref_to_block_digests()
were bottlenecked by calculate_authority_eviction_round(), which depends
on recent_headers_refs_by_authority. Fast sync adds only transactions
and commits — no headers — so the header-based eviction round stays
near GENESIS_ROUND, and the min() picks this stale value, preventing
meaningful eviction. Transactions accumulated unboundedly in memory.

When fast_sync_ongoing is true, use the commit-based GC round directly
for transaction eviction, bypassing the header-based cap. Also remove
the early return in flush() so eviction runs even when write buffers
are empty (needed when last_solid_subdag_base is updated between
flushes).

Fixes #11246
@polinikita polinikita force-pushed the starfish/fix/flush-eviction-early-return branch from a2bf5b1 to cb3a289 Compare April 16, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consensus Issues related to the Core Consensus team core-protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(starfish): transaction eviction stalls during fast commit sync

2 participants