Supply Conservation Accounting Discrepancy: termsFromChain omits BlockLeaseForceSettle breaking supply invariants on force-settled leases
Report
Vulnerability Summary
In core/supply.go:74-115, termsFromChain parses all historical blocks across lattice account chains to tally macroeconomic token supply invariants (Genesis, Minted, Burned, EscrowBurned, and Emissions):
func termsFromChain(blocks []*Block) *chainTerms {
...
switch b.Type {
case BlockGenesis:
c.genesis[b.Asset] += b.Balance
case BlockMint:
c.minted[b.Asset] += b.Amount
case BlockBurn:
c.burned[b.Asset] += b.Amount
case BlockLease:
c.leaseCost[b.Hash] = b.Amount
case BlockLeaseAccept:
c.acceptStake[b.Source] = b.Amount
case BlockLeaseSettle:
c.settleEmission[b.Source] = b.Amount
default:
// other block types do not affect macro terms directly
}
}
return c
}
Notice that termsFromChain accounts for BlockLeaseSettle, but completely omits BlockLeaseForceSettle (core/ledger.go:1880-1990).
When a consumer force-settles a failed or non-responsive lease via BlockLeaseForceSettle:
- The burned portion of the lease escrow (consumed during uptime prior to the failure) is permanently burned from circulation.
- The remaining unused escrow balance is refunded to the consumer.
- The provider's locked stake is forfeited and slashed.
Because termsFromChain has no case for BlockLeaseForceSettle:
c.settleEmissionis never populated for force-settled leases.- In
SupplyAuditor.walk()(lines 240-252), the consumed escrow portion is never added toAssetXUSD.EscrowBurned. - The supply conservation check (
a.Accounted == a.Created) fails, reporting a permanent false-negative supply discrepancy (rep.Conserved = false).
Impact & Severity
- Supply Audit Desynchronization:
GET /supplyand automated consensus health monitors will perpetually report broken supply conservation invariants on any node once a lease is force-settled. - Macro Monitoring Invalidation: False alarms mask genuine inflation or double-spend exploits because the supply auditor's conservation status is permanently corrupted.
Proposed Remediation
In core/supply.go, add handling for BlockLeaseForceSettle within termsFromChain:
case BlockLeaseSettle, BlockLeaseForceSettle:
c.settleEmission[b.Source] = b.Amount
Thread
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-10235 and says what; it is read like any other.