[Bug] /supply reports XCU as not conserved — SupplyAuditor never counts lease renewal burns (discrepancy −8789 micro-XCU)
Report
Suggested tier: Low (below Medium — no user funds are lost or created; this is an accounting-data integrity issue. The bounty article lists Critical/Severe/High/Medium; final tier is at the core team's discretion.)
Summary
GET /supply on public testnet nodes reports "conserved": false for XCU with discrepancy: -8789 (micro-XCU = 0.008789 XCU). Root cause: the SupplyAuditor in core/supply.go counts only the INITIAL lease cost as escrow_burned, while lease_renew adds the renewal fee to the same escrow (TopUpPendingAmount, core/lease_renew.go) and lease_settle deletes the ENTIRE escrow (DeletePendingID, core/ledger.go validateAndAddLeaseSettle) — so renewal fees really are destroyed, but the auditor never counts them as destroyed. The ledger itself is consistent; the published supply report is what is wrong.
Reproduction (live, testnet-0006, 2026-11-17)
GET /supply on THREE independent public nodes — IDENTICAL results:
- https://ldn.core.test.network/supply
- https://ffm.core.test.network/supply
- https://nyc.core.test.network/supply
Each: "conserved": false, "stable": true, "attempts": 1, and for XCU: created=201000000, accounted=200991211, discrepancy=-8789, conserved=false, escrow_burned=15510, locked_stake=0, stake_forfeited=0, balances=200975701, in_flight=0. XE on all three nodes: discrepancy=0, conserved=true.
GET /leases?limit=100 (ldn): 30 leases, ALL settled, each cost=517; 17 leases have 1 renewal @ cost=517.
- 30 × 517 = 15,510 = the reported
escrow_burned(initial costs only). - 17 × 517 = 8,789 = EXACTLY the
discrepancy(−8,789). - Recompute: balances 200,975,701 + actual destroyed (15,510 + 8,789 = 24,299) = 201,000,000 = created. Conservation holds exactly once renewals are counted — proving the ledger is right and the auditor undercounts.
Code flow (source testnet-0006, commit 8cc209d)
core/supply.gofold(): onlyBlockLeaseis recorded intoleaseCost, onlyBlockLeaseAcceptintoacceptStake, onlyBlockLeaseSettleintosettleEmission.BlockLeaseRenewis NEVER recorded.core/supply.gowalk():EscrowBurned += costs[h]only for settled (orLeaseExpired) leases. Renewal fees never enterEscrowBurned,LockedStake, orStakeForfeited.core/lease_renew.go: renewal debits the lessee byb.Amountand setscommit.TopUpPendingID = b.Source/TopUpPendingAmount = b.Amount— the pending escrow grows. Applied instore/badger_store.goandstore/mem_store.go.core/ledger.govalidateAndAddLeaseSettle:commit.DeletePendingID = b.Source— the whole escrow (initial cost + all renewal top-ups) is deleted; the provider receives only the XE emission + stake refund (AssetCreditXCU =lease.Stake). The renewal fee is destroyed without the auditor ever counting it.
Impact
/supply— the only published source of supply truth — permanently reportsconserved: falseon any network that has lease renewals. Every dashboard/integration reading this endpoint sees a phantom supply leak that grows with each renewal.- This is not inflation: no XCU is created from nothing; instead, legitimately destroyed XCU is not recorded as destroyed.
- Scale: the gap grows linearly with renewals (here 17 × 517 micro-XCU). On a network with large/frequently renewed leases, the reported gap grows without bound.
Suggested fix
In core/supply.go fold(), also record BlockLeaseRenew (e.g. a renewCost[leaseHash] += b.Amount map), then in walk() add total renewals to EscrowBurned for settled leases (and to LockedStake/the appropriate classification for still-live leases). Alternative: compute EscrowBurned from the escrow amount actually deleted at settle, not from the initial lease cost alone.
Related observation (NOT part of this finding — not yet reproduced)
validateAndAddLeaseCancel refunds only leaseBlock.Amount (the initial cost) while deleting the entire pending escrow — unlike lease_force_settle, which refunds the full pending.Amount (including renewal top-ups). Cancelling a renewed lease may therefore burn the consumer's renewal fees. The cancel window for accepted leases is narrow (accept must not be final) and there are currently NO cancelled leases on testnet, so there is no live reproduction yet — noted as a candidate for a future run, not as a finding.
Reward address (XE wallet 1)
a121fc8bc899fd12bb760fb1f0ecfc3ad0e6c9e572d9eedce29f43136c7b8d97
Thread
Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-16994.