<!-- XE-13261 · [Consensus/High] core/quorum: staged lease block validation defaults empty asset to XE, measuring XUSD costs against XE balances and triggering false promotion quarantine · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13261>. The page is the record; this is the same page for reading.*

XE-13261 · Bounty

# \[Consensus/High\] core/quorum: staged lease block validation defaults empty asset to XE, measuring XUSD costs against XE balances and triggering false promotion quarantine

Closed · duplicate
—
[xe#401](https://github.com/xeprotocol/xe/issues/401)
filed 2026-11-11 17:44 UTC
by telas929

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   [XE-0028](https://bounty.xe.network/XE-0028) accepted

Tracked
:   internally

Updated
:   2026-11-20 00:06 UTC

Told
:   2026-11-20 00:04 UTC

### Patches

- [xe#406](https://github.com/xeprotocol/xe/pull/406) open by arturbarszcz78
  fix(core/quorum): derive asset from block type on staged lease validation and unify parent balance (#401)

### History

- [543808](https://bounty.xe.network/log/543808) 2026-11-20 00:06 UTC github.state\_pushed
- [543807](https://bounty.xe.network/log/543807) 2026-11-20 00:05 UTC github.labels
- [543750](https://bounty.xe.network/log/543750) 2026-11-20 00:04 UTC reply.mirrored
- [543076](https://bounty.xe.network/log/543076) 2026-11-20 00:04 UTC proposal.adopted
- [543075](https://bounty.xe.network/log/543075) 2026-11-20 00:04 UTC reply.sent
- [543074](https://bounty.xe.network/log/543074) 2026-11-20 00:04 UTC ticket.status new → closed
- [541222](https://bounty.xe.network/log/541222) 2026-11-20 00:03 UTC proposal.adopted
- [541221](https://bounty.xe.network/log/541221) 2026-11-20 00:03 UTC ticket.facts area
- [541220](https://bounty.xe.network/log/541220) 2026-11-20 00:03 UTC proposal.adopted
- [541219](https://bounty.xe.network/log/541219) 2026-11-20 00:03 UTC ticket.facts
- [541218](https://bounty.xe.network/log/541218) 2026-11-20 00:03 UTC proposal.adopted
- [541217](https://bounty.xe.network/log/541217) 2026-11-20 00:03 UTC ticket.facts

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

### Report

## Summary

In `core/quorum.go`, both `promotable()` (lines 253–257) and `confirmConflict()` (lines 297–302) attempt to determine the asset type of a staged block to compute `parentBalance` via `qm.ledger.GetAssetBalanceAtBlock(account, asset, previous)`. When `staged.Asset` is empty (`""`), both functions default the asset to `"XE"`:

```
asset := staged.Asset
if asset == "" {
    asset = "XE"
}
var parentBalance uint64
if previous != "0" {
    parentBalance = qm.ledger.GetAssetBalanceAtBlock(account, asset, previous)
}
return qm.ledger.ValidateStagedBlock(staged, parentBalance) == nil
```

However, all compute lease operations (`BlockLease`, `BlockLeaseAccept`, `BlockLeaseSettle`, `BlockLeaseCancel`, `BlockLeaseForceSettle`) are strictly denominated in `XUSD`. When an empty-asset lease block enters conflict resolution, this fallback causes the node to fetch the account's **XE balance** rather than its **XUSD balance**, and validates the lease cost/stake against the XE balance in `ValidateStagedBlock`.

Furthermore, in `core/ledger.go` (lines 830–845), the pre-conflict staging path computes `parentBalance` using an ad-hoc loop that does not handle default assets (`cb.Asset == ""`) or add `lease.Stake` on `BlockLeaseSettle` (unlike `GetAssetBalanceAtBlock`), causing divergence between the pre-conflict staging gate and quorum promotion validation.

---

## Root Cause Analysis

1. **`core/quorum.go:253-255` \& `core/quorum.go:297-302`**:
   `staged.Asset` is defaulted to `"XE"` without inspecting `staged.Type`. For any lease block, defaulting to `"XE"` evaluates the account's native XE balance for an operation that deducts or escrows XUSD.
2. **False Promotion \& Quarantine Trigger**:
   An account holding sufficient XE but 0 XUSD can construct a conflicting lease block. `promotable()` reports `true` because `ValidateStagedBlock` passes against the XE `parentBalance`. Consequently, the node votes for or considers the block eligible for promotion. When `confirmConflict()` proceeds to promote the staged winner:

   ```
   if err := qm.ledger.swapBlockLocked(result.ConflictAccount, loserHash, result.WinnerHash, winnerBlock); err != nil {
       if errors.Is(err, ErrWinnerFullValidation) && !IsRetryableError(err) {
           qm.failedPromotions[failedPromotionKey(...)] = Now()
           log.Printf("confirmConflict: winner %s ... failed full validation deterministically: quarantining for %s...", ...)
       }
   }
   ```

   `swapBlockLocked` invokes the full `validateAndAddLease*` path, which checks actual XUSD balances and fails deterministically. This enters the `ErrWinnerFullValidation` quarantine (`failedPromotionTTL = 30s`), causing the node's position to withhold and stalling consensus progress on the conflicting account chain.
3. **Divergent Balance Resolution in `core/ledger.go:830-842`**:

   ```
   var parentBalance uint64
   if chain != nil && b.Previous != "0" {
       for _, cb := range chain.Blocks {
           if cb.Asset == b.Asset {
               parentBalance = cb.Balance
           }
           if cb.Hash == b.Previous {
               break
           }
       }
   }
   ```

   This inline search does not normalize `cb.Asset == ""` to `"XE"`, and does not credit `lease.Stake` returned on `BlockLeaseSettle` (which `GetAssetBalanceAtBlock` in lines 3019–3034 explicitly accounts for).

---

## Impact

- **Consensus / Quorum Denial of Service**: Malicious or malformed conflicting lease blocks bypass lightweight pre-promotion staging checks by substituting XE balance for XUSD requirements, repeatedly poisoning quorum resolution and locking the account chain into 30-second withheld quarantine states.
- **Discrepancy between Staged Ingest and Promotion**: Honest nodes can accept staged blocks that cannot be applied during conflict settlement.

---

## Recommended Remediation

1. In `core/quorum.go` (`promotable` and `confirmConflict`), derive the expected asset from the block type:

```
asset := staged.Asset
if asset == "" {
    if isLeaseStateTransition(staged.Type) {
        asset = "XUSD"
    } else {
        asset = "XE"
    }
}
```

2. In `core/ledger.go` (line 830), replace the inline chain scan with `l.GetAssetBalanceAtBlock(b.Account, b.Asset, b.Previous)` to ensure consistent handling of default assets and settled lease escrow stakes.

### Thread

**Joseph Denne**team2026-11-20 00:04 UTCgithub

Thanks. This is the same finding as https://bounty.xe.network/XE-0028, 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-13261 and says what differs; it is read like any other.
