<!-- XE-10098 · Lease Allocation Failure & Rejection: pickProvider hardcodes stake to 1 selecting undercapitalized providers rejected by consensus · testnet -->
*Markdown view of <https://bounty.xe.network/XE-10098>. The page is the record; this is the same page for reading.*

XE-10098 · Bounty

# Lease Allocation Failure \& Rejection: pickProvider hardcodes stake to 1 selecting undercapitalized providers rejected by consensus

Closed · duplicate
—
web
filed 2026-11-12 09:53 UTC
by xe:e4cd6974

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:33 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

None linked.

### History

- [552603](https://bounty.xe.network/log/552603) 2026-11-20 00:33 UTC proposal.adopted
- [552602](https://bounty.xe.network/log/552602) 2026-11-20 00:33 UTC reply.sent
- [552601](https://bounty.xe.network/log/552601) 2026-11-20 00:33 UTC ticket.status new → closed
- [552024](https://bounty.xe.network/log/552024) 2026-11-20 00:33 UTC proposal.adopted
- [552023](https://bounty.xe.network/log/552023) 2026-11-20 00:33 UTC ticket.facts area
- [552022](https://bounty.xe.network/log/552022) 2026-11-20 00:33 UTC proposal.adopted
- [552021](https://bounty.xe.network/log/552021) 2026-11-20 00:33 UTC ticket.facts
- [552020](https://bounty.xe.network/log/552020) 2026-11-20 00:33 UTC proposal.adopted
- [552019](https://bounty.xe.network/log/552019) 2026-11-20 00:33 UTC ticket.facts
- [550934](https://bounty.xe.network/log/550934) 2026-11-20 00:31 UTC note.added
- [550933](https://bounty.xe.network/log/550933) 2026-11-20 00:31 UTC proposal.created
- [550932](https://bounty.xe.network/log/550932) 2026-11-20 00:31 UTC proposal.created

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

### Report

## Vulnerability Summary

In `cmd/xe/main.go:1024-1045` and `1719-1743`, `cmdLease` automatically selects a provider for consumer leases when `--provider` is not explicitly supplied:

```
	if providerAddr == "" {
		providerAddr = pickProvider(c, vcpus, memory, disk, 1)
	}
...
	cost, err := core.LeaseCost(vcpus, memory, disk, duration, certMult)
	if err != nil {
		fatal("cost calculation: %v", err)
	}
	stake := core.LeaseStake(cost)
```

In `pickProvider`:

```
func pickProvider(c *client.Client, vcpus, memoryMB, diskGB, stake uint64) string {
...
	for i := range providers {
		p := &providers[i]
		if !providerFits(p, vcpus, memoryMB, diskGB) {
			continue
		}
		bals, _ := c.GetBalances(p.Account)
		if bals["XUSD"] >= stake && bals["XUSD"] > bestXUSD {
			best = p
			bestXUSD = bals["XUSD"]
		}
	}
	if best == nil {
		fatal("no provider with sufficient resources and stake")
	}
	return best.Account
}
```

The stake parameter passed to `pickProvider` is hardcoded to literal `1` (`pickProvider(c, vcpus, memory, disk, 1)`) instead of computing `core.LeaseStake(cost)` beforehand.

In the XE protocol consensus rules (`core/ledger.go:1675-1725`), when a provider attempts to accept a lease (`BlockLeaseAccept`), consensus requires the provider to hold a minimum balance of `LeaseStake(cost)` (which is 10% to 50% of the total lease cost in XUSD).

Because `pickProvider` only checks `bals["XUSD"] >= 1`:

1. It selects providers holding nominal balances (e.g., 0.000001 XUSD) who cannot satisfy `LeaseStake(cost)`.
2. The consumer commits XUSD escrow to a lease block that the selected provider cannot accept.
3. The lease enters an unfillable pending state until timeout or cancellation, locking up consumer funds.

Additionally, `pickSubmitNode` (lines 1744-1760) hardcodes legacy testnet domains (`https://ldn.core.test.network`, `https://ffm.core.test.network`, `https://nyc.core.test.network`), causing block submission failures on mainnet or custom RPC networks.

## Proposed Remediation

1. Compute cost and stake before calling `pickProvider`:

   ```
   // Pre-calculate estimated cost and stake with default or target multiplier
   estCost, _ := core.LeaseCost(vcpus, memory, disk, duration, core.PriceMultiplierDefault)
   reqStake := core.LeaseStake(estCost)
   providerAddr = pickProvider(c, vcpus, memory, disk, reqStake)
   ```
2. Refactor `pickSubmitNode` to dynamically query node peers from `c.NodeInfo()` instead of static testnet hostnames.

### Thread

**Joseph Denne**team2026-11-20 00:33 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-10098 and says what differs; it is read like any other.
