• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iotaledger / iota / 22811352372

06 Mar 2026 08:35PM UTC coverage: 63.866% (+0.01%) from 63.853%
22811352372

push

github

web-flow
fix(starfish): increase per-block lock limit in header synchronizer to prevent peer starvation (#10532)

# Description of change

Increase `MAX_AUTHORITIES_TO_FETCH_PER_BLOCK_HEADER` from 2 to 3 to fix
header synchronizer starvation when wiped-DB validators saturate
per-block lock slots. `MAX_PERIODIC_SYNC_PEERS` stays at 4.

**Observed Problem in testing:** When 3 validators have wiped DBs and
their blocks are garbage collected and referenced by a certified commit,
the block suspender marks them as "who knows" peers. The header
synchronizer then selects 2 of them as known peers (filling
`MAX_PERIODIC_SYNC_PEERS - MAX_PERIODIC_SYNC_RANDOM_PEERS = 4 - 2 = 2`
slots). With `MAX_AUTHORITIES_TO_FETCH_PER_BLOCK_HEADER = 2`, these 2
known peers saturate all per-block lock slots, blocking random peers
from fetching. Since wiped validators always fail, the system is stuck.

**Fix:** Increase `MAX_AUTHORITIES_TO_FETCH_PER_BLOCK_HEADER` from 2 to
3, allowing 3 concurrent fetchers per block header. Even when both known
peers are wiped-DB validators occupying 2 lock slots, 1 slot remains for
a random peer to reach a healthy validator. This preserves the original
peer count (4) while resolving the starvation.

## Links to any relevant issues

Fixes #10531

## How the change has been tested

- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [x] I have added tests that prove my fix is effective or that my
feature works: I run the same simulation scenario in which some
validator got stuck and were not able to get synced
- [x] I have checked that new and existing unit tests pass locally with
my changes

64 of 66 new or added lines in 1 file covered. (96.97%)

90 existing lines in 18 files now uncovered.

227284 of 355874 relevant lines covered (63.87%)

2759661.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.24
/crates/iota-core/src/execution_cache/writeback_cache.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc