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

iotaledger / iota / 22744921528

05 Mar 2026 03:51PM UTC coverage: 63.854% (+0.002%) from 63.852%
22744921528

push

github

web-flow
fix(consensus): fix flaky simtest (#10534)

# Description of change

Fixes flaky `test_sequential_restarts_persistent_db_short_run_long_stop`
simtest caused by the `fast_sync_ongoing` flag not being reliably
persisted to storage.

The `flush()` early-return guard in `DagState` checked whether blocks,
transactions, commits, and voting headers were empty — but did **not**
check the `fast_sync_ongoing` flag. When fast sync completed and set the
flag to `false`, if there was no other buffered data to write, `flush()`
would bail out early and
never persist the flag change. On restart, the authority still believed
fast sync was ongoing, causing `recover_and_send_commits` to skip Phase
2 recovery and leaving the commit pipeline in an inconsistent state.

A secondary issue was that `fast_sync_ongoing_flag_to_write` was a plain
`bool` (always carrying a value), making it impossible to distinguish
"flag was explicitly changed" from "flag is unchanged". This prevented a
clean inclusion in the early-return check.

 ### Fix

- **Make `fast_sync_ongoing_flag_to_write` an `Option<bool>`**:
initialized to `None`, only set to `Some(...)` when
`set_fast_sync_ongoing_flag()` is called. `flush()` uses `.take()` so
it's only written when actually dirty.
- **Include the flag in the flush early-return check**:
`fast_commit_sync_flag.is_none()` is now part of the "nothing to flush"
guard, so a pending flag change is never silently skipped.
- **Flush `DagState` on authority stop**: added
`dag_state.write().flush()` in `ConsensusAuthority::stop()` to ensure
all buffered data (including the flag) is persisted before shutdown.

 ### Additional improvements

- **Better logging for missing transactions**:
`build_committed_subdag_from_commit` now logs a `warn!` with the count
and list of missing transaction refs instead of silently returning
`None`.
- **`last_solid_subdag_base` fallback**: in
`resend_unprocessed_solid_commits`, if all unprocessed commits fail to
build (due to missi... (continued)

33 of 39 new or added lines in 7 files covered. (84.62%)

75 existing lines in 22 files now uncovered.

227215 of 355833 relevant lines covered (63.85%)

2763778.33 hits per line

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

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


Source Not Available

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

© 2026 Coveralls, Inc