{"id":"XE-13361","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"380","source_url":"https://github.com/xeprotocol/xe/issues/380","reporter_id":2132,"title":"[Low] Live supply auditor flags ordinary XUSD blocks as unsupported and invents a ghost XCU asset (live build drift)","area":"ops-testnet","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:11.733137+00:00","updated_at":"2026-11-20T00:07:03.047361+00:00","source_created_at":"2026-11-11T12:08:10+00:00","told_at":"2026-11-20T00:04:55+00:00","status_changed_at":"2026-11-20T00:04:35.276906+00:00","url":"https://bounty.xe.network/XE-13361","body":"### Summary\n\nThe live testnet-0005 `/supply` auditor reports `conserved=false` with 119 notes, permanently: it flags ordinary XUSD blocks (mint/send/lease/lease_accept/lease_renew/receive on the operator minter account `8bc63438d2e9...` and others) as \"unsupported asset\", counts XUSD `minted=0` while XUSD balances total 212,890,638 micro (discrepancy +212,890,638), lists a phantom all-zero `XCU` asset, and then reports ~110 settles as \"no lease block in the census\" (a knock-on: the lease blocks were skipped as unknown, so the cost census is empty). XE itself is `conserved=true` with discrepancy 0. In the audited source this cannot happen: the supply auditor (`core/supply.go`) and the ledger intake (`core/ledger.go`) share the same `IsValidAsset` (\"XE\" and \"XUSD\" only), so a live XUSD block is valid for both, and an XCU block could never enter the chain at all. The live auditor is therefore running different code — consistent with the live node reporting version `xe/3019b76`, a build whose source is not in the published repo (upstream master is still `89a542e`).\n\nDistinct from #336 and #68 (both about lease-renewal escrow accounting in `termsFromChain`): this report is not about renewal blocks being omitted — the flagged blocks are ordinary mint/send/lease/lease_accept XUSD blocks, and the auditor invents an `XCU` asset that exists nowhere in the repo.\n\n### Impact\n\nThe supply auditor is the network's integrity monitor; it now cries wolf permanently. Every `/supply` response carries the same false-positive noise, so a genuine XUSD supply discrepancy — a real mint/escrow accounting error — would be indistinguishable from the noise. Operators cannot use `/supply` to detect actual supply breakage for XUSD, which is the network's only minted asset and the currency of every lease. The report itself is still produced (`stable=true`, computed in 857 ms), so the failure is silent corruption of its contents, not an outage.\n\nSeverity is Low, not higher: this is an observability/integrity-monitoring defect, not a consensus or funds bug — no XUSD was created or lost (balances are consistent; the auditor, not the ledger, is wrong), and XE conservation is unaffected.\n\n### Root cause (repo `github.com/xeprotocol/xe`, commit `89a542ea51d38375299aee54c6c99102e9bfa666`, \"release: testnet-0005 quorum withhold fix\")\n\nIn the audited source, the auditor and the ledger intake cannot disagree about assets. `termsFromChain` (`core/supply.go:84`, `:234`) and ledger intake (`core/ledger.go:828`, `:901`, `:1168`) all gate on the same `IsValidAsset`:\n\n- `core/supply.go:84` — XUSD blocks are counted by the auditor, never flagged unknown.\n- `core/ledger.go:828` — the same validity check admits XUSD blocks into the chain.\n\nLive evidence (testnet-0005 `/supply`, 2026-11-11 ~18:40 WIB, raw response saved by the reporter):\n\n```json\n{\n  \"blocks\": 864872, \"accounts\": 32921, \"pending\": 332011, \"leases\": 113,\n  \"conserved\": false, \"notes\": 119, \"stable\": true, \"duration_ms\": 857,\n  \"assets\": {\n    \"XCU\": {\"genesis\": 0, \"minted\": 0, \"emitted\": 0, \"created\": 0, \"burned\": 0,\n            \"balances\": 0, \"discrepancy\": 0, \"conserved\": true},\n    \"XE\":  {\"genesis\": 42000000000000, \"minted\": 0, \"emitted\": 218724,\n            \"balances\": 41951117094330, \"discrepancy\": 0, \"conserved\": true},\n    \"XUSD\": {\"genesis\": 0, \"minted\": 0, \"emitted\": 0, \"created\": 0,\n             \"balances\": 212890638, \"discrepancy\": 212890638, \"conserved\": false}\n  }\n}\n```\n\nRepresentative notes:\n\n- `account 8bc63438d2e9... holds block(s) with an unsupported asset: [mint 14c2b2584172... asset=\"XUSD\" send 3d7c247c13ef... asset=\"XUSD\" mint 47bb0930b8ec... asset=\"XUSD\" ...]` — the flagged \"unsupported\" blocks include the minter's own opening mint (`14c2b2584172...`, 100 XUSD, FINALIZED).\n- 110 notes of the form: `settle for lease fc28fa50d73e... has no lease block in the census; escrow unaccounted` — the settle census is empty because the underlying lease blocks were skipped as unknown assets.\n\nSo the running auditor classifies XUSD as unsupported and has an `XCU` asset that does not exist anywhere in the repo — neither behaviour is reachable from the audited source. The running binary identifies itself as `xe/3019b76` (node info endpoint), while the published repo HEAD is `89a542e`; the live build's source is unpublished, which is the consistent explanation for the drift.\n\n### Reproduction\n\nPoC tests (pin the repo behaviour; they fail if the audited source ever diverges the way the live auditor has):\n\n- `core/xe03_supply_xusd_test.go` — `TestXE03TermsFromChainCountsXUSD`: `termsFromChain` over a mint/send/lease/lease_accept/receive sequence of XUSD blocks counts `minted[\"XUSD\"] == 100_000_000`, `leaseCost[\"aa03\"] == 517`, and `unknownAssets` empty. `TestXE03TermsFromChainFlagsUnknownAsset`: a single XCU send block is flagged as exactly 1 unknown asset (i.e. the repo auditor knows XUSD but not XCU — the opposite of the live one).\n\nRun:\n\n```bash\ngit clone https://github.com/xeprotocol/xe && cd xe\n# add the PoC test file above, then:\ngo test ./core/ -run XE03 -v   # 2/2 PASS (repo behaviour pinned; live node diverges)\n```\n\nLive observation: `GET https://ldn.core.test.network/supply` (or any testnet-0005 node) returns `conserved=false` with the XUSD/XCU pattern above. No state-changing request was made.\n\n### Suggested fix\n\n- Reconcile the live build with the published source: publish (or rebuild from) the `3019b76` source, or redeploy the nodes from the audited HEAD, so the running auditor is the one in the repo.\n- Until then, treat live `/supply` output for XUSD as untrusted — a genuine XUSD discrepancy is currently hidden inside 119 permanent false-positive notes.\n- Honest limitation: the live auditor's fix cannot be verified from this repo, because the running code is not published here; verification has to happen against the live build once its source is available.\n\n### Environment\n\n- Codebase: `github.com/xeprotocol/xe` @ `89a542e` (2026-11-10)\n- Go 1.25.0, `go test` as above for the repo PoC; live observation on testnet-0005 (LDN node, version `xe/3019b76`), 2026-11-11, read-only GET requests only\n\nXE payout address: e3d3e4407fec5a846201c7ed8560484ffb881cc30068745a110dd8efb824500c","patch_refs":[],"thread":[{"id":12745,"source":"github","source_ref":"7025799535","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13361 and says what differs; it is read like any other.","created_at":"2026-11-20T00:04:55+00:00"}]}