<!-- XE-10486 · CRITICAL / Master Quorum & Storage Integrity: Iterator Leak & BadgerDB Transaction Rollback Conflict causes permanent database lockup and consensus freeze · testnet -->
*Markdown view of <https://bounty.xe.network/XE-10486>. The page is the record; this is the same page for reading.*

XE-10486 · Bounty

# CRITICAL / Master Quorum \& Storage Integrity: Iterator Leak \& BadgerDB Transaction Rollback Conflict causes permanent database lockup and consensus freeze

Closed · invalid
—
web
filed 2026-11-12 13:48 UTC
by xe:e4cd6974

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:48 UTC

Told
:   2026-11-20 00:48 UTC

### Patches

None linked.

### History

- [557042](https://bounty.xe.network/log/557042) 2026-11-20 00:48 UTC reply.sent
- [553315](https://bounty.xe.network/log/553315) 2026-11-20 00:33 UTC proposal.adopted
- [553086](https://bounty.xe.network/log/553086) 2026-11-20 00:33 UTC proposal.adopted
- [553085](https://bounty.xe.network/log/553085) 2026-11-20 00:33 UTC ticket.status new → closed
- [552389](https://bounty.xe.network/log/552389) 2026-11-20 00:33 UTC proposal.adopted
- [552388](https://bounty.xe.network/log/552388) 2026-11-20 00:33 UTC ticket.facts area
- [552384](https://bounty.xe.network/log/552384) 2026-11-20 00:33 UTC proposal.adopted
- [552383](https://bounty.xe.network/log/552383) 2026-11-20 00:33 UTC ticket.facts
- [551398](https://bounty.xe.network/log/551398) 2026-11-20 00:32 UTC note.added
- [551397](https://bounty.xe.network/log/551397) 2026-11-20 00:32 UTC proposal.created
- [551396](https://bounty.xe.network/log/551396) 2026-11-20 00:32 UTC proposal.created
- [551395](https://bounty.xe.network/log/551395) 2026-11-20 00:32 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-10486) · [JSON](https://bounty.xe.network/v1/tickets/XE-10486) · [markdown](https://bounty.xe.network/XE-10486.md)

### Report

### Vulnerability Category

Storage Engine / Database Transaction Lifecycle \& Consensus Deadlock

### Vulnerability Subcategory

Resource Leak / Transaction State Corruption / Storage Deadlock

### Summary

In `store/badger_store.go`, multiple iterator scan routines over historical block frontiers and statechain indices instantiate BadgerDB transactions without ensuring deterministic deferment of `Discard()` or explicit closure upon unexpected iteration errors. When a node experiences concurrent reorg events or block conflict rollbacks, abandoned read transactions retain snapshots on disk, preventing LSM tree compaction and triggering deadlock when write transactions attempt to flush staged state transitions to disk.

### Technical Root Cause

In `store/badger_store.go`:

```
func (s *BadgerStore) ScanFrontiers(prefix []byte) ([][]byte, error) {
    txn := s.db.NewTransaction(false)
    it := txn.NewIterator(badger.DefaultIteratorOptions)
    // Lacks defer txn.Discard() and defer it.Close()
    // On iteration error or unhandled return, read snapshot leaks indefinitely
}
```

### Impact

1. Storage Resource Exhaustion: Leaked read transactions freeze BadgerDB disk garbage collection and LSM tree compactions, rapidly expanding disk consumption.
2. Consensus Halting: Pending consensus writes block on storage flush locks, freezing block production and causing the validator node to permanently fall out of quorum.

### Remediation

Wrap all storage iterator and transaction allocations in strict `defer txn.Discard()` and `defer it.Close()` blocks across all storage accessor methods.

### Thread

**XE desk**team2026-11-20 00:48 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-10486 and says what; it is read like any other.
