<!-- XE-16714 · [High] SwapBlock unwinding a settled BlockLease refunds the full escrow while the XE settle emission stands (inflation, live on BadgerStore) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16714>. The page is the record; this is the same page for reading.*

XE-16714 · Bounty

# \[High\] SwapBlock unwinding a settled BlockLease refunds the full escrow while the XE settle emission stands (inflation, live on BadgerStore)

Closed · duplicate
—claimed High
[xe#652](https://github.com/xeprotocol/xe/issues/652)
filed 2026-11-17 05:17 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   Leasing / ledger

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770282](https://bounty.xe.network/log/770282) 2026-11-22 23:26 UTC reply.mirror\_failed
- [770100](https://bounty.xe.network/log/770100) 2026-11-22 23:26 UTC proposal.adopted
- [770099](https://bounty.xe.network/log/770099) 2026-11-22 23:26 UTC reply.sent
- [770098](https://bounty.xe.network/log/770098) 2026-11-22 23:26 UTC ticket.status new → closed
- [769329](https://bounty.xe.network/log/769329) 2026-11-22 23:26 UTC proposal.adopted
- [769328](https://bounty.xe.network/log/769328) 2026-11-22 23:26 UTC ticket.facts area
- [769327](https://bounty.xe.network/log/769327) 2026-11-22 23:26 UTC proposal.adopted
- [769326](https://bounty.xe.network/log/769326) 2026-11-22 23:26 UTC ticket.facts
- [769325](https://bounty.xe.network/log/769325) 2026-11-22 23:26 UTC proposal.adopted
- [769324](https://bounty.xe.network/log/769324) 2026-11-22 23:26 UTC ticket.facts
- [769323](https://bounty.xe.network/log/769323) 2026-11-22 23:26 UTC proposal.adopted
- [769322](https://bounty.xe.network/log/769322) 2026-11-22 23:26 UTC ticket.facts

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

### Report

## Summary

When a fork wins a conflict whose loser is a settled lease's root `BlockLease`, `SwapBlock` unwinds the lease block \-- restoring the consumer's balance and deleting the lease record \-- while the XE settle emission minted by burning the escrow stays minted. Net: the escrow is back in circulation AND the emission still exists. Repeatable per lease. Reproduces identically on MemStore AND BadgerStore (the production store).

## Relationship to XE-6375

XE-6375 ("SwapBlock unwinding a BlockLeaseRenew after settle...") was closed 2026-11-16 as a duplicate of an earlier non-public report. The team wrote: "If you believe it is a different bug, file a new report that links XE-6375 and says what differs; it is read like any other." This report links XE-6375 and states what differs:

1. **Different unwound block:** `BlockLease` (lease root) vs `BlockLeaseRenew`; different undo arm (`buildBlockUndo` BlockLease arm); no `ReducePending` involved at all.
2. **Reproduces on BadgerStore (the production store).** XE-6375's renewal variant FAILS on Badger (`addToPendingAmount: pending not found`, the XE-5826 wedge); its own text calls the inflation "currently latent on production". This variant is LIVE on production.
3. **Bigger blast radius:** the ENTIRE lease record is deleted and the FULL escrow refunded with the FULL emission standing; XE-6375 refunds only one renewal segment.

## Root Cause

- `planSwap` (`core/ledger.go:3316-3321`) \-- only `BlockSend` old blocks get cross-chain cascade planning (`planCascade`); a `BlockLease` old block is appended unchecked, with no settled-state guard.
- `buildBlockUndo` BlockLease arm (`core/rollback.go:227-229`) \-- deletes pending escrow \+ lease record unconditionally (`deletePendingID = b.Hash; deleteLeaseHash = b.Hash`).
- `confirmConflict` (`core/quorum.go:329`) \-- the production trigger via `swapBlockLocked`.
- The swap cascade only unwinds the loser's own chain. A settled lease's provider-side effects (accept, settle block, XE emission minted by burning the escrow) live on the provider's chain and are never touched.

## Impact

Inflation: the escrow burned at settle returns to circulation while the XE emission stands. Precondition: the fork must win \>\=67% final-vote weight and the lease block must be unfinalized; deterministic once met.

## Verification (executed PoC)

Lease 40,000 XCU, accept, settle at expiry -\> 40,000 XE emission, escrow burned; then `SwapBlock(consumer, leaseHash, forkSend)`. Identical on MemStore and BadgerStore:

- Before swap: provider XE\=40,000, total XCU\=1,060,000 (40k burned)
- After swap: consumer XCU\=960,000, provider XE\=40,000 (kept), total XCU\=1,100,000, lease record\=nil
- Net: the 40,000 XCU burned at settle is back in circulation AND the 40,000 XE emission still exists. Repeatable per lease. Audited at HEAD `8cc209d` (testnet-0006).

## Suggested fix

Refuse to unwind any lease-family block when the lease is Settled or its escrow pending is gone, or extend the cascade to unwind the provider chain's accept/settle and claw back the emission.

### Thread

**Joseph Denne**team2026-11-22 23:26 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-16714 and says what differs; it is read like any other.
