{"id":"XE-7631","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":30,"title":"GET /ready is blind to open conflicts and to per-account finality — the documented finality gate stays ready:true through a 54-hour permanent account freeze","area":"node-api","claimed_tier":"high","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-11T18:09:14.087480+00:00","updated_at":"2026-11-16T01:14:30.909037+00:00","source_created_at":null,"told_at":"2026-11-16T01:09:24.667187+00:00","status_changed_at":"2026-11-16T01:09:07.744104+00:00","url":"https://bounty.xe.network/XE-7631","body":"# `/ready` is blind to open conflicts and to per-account finality — the documented finality gate stays `ready: true` through a 54-hour permanent account freeze\n\n**Area:** Node / API (`GET /ready`)\n**Claimed tier:** High — the one endpoint the docs designate as the probe for broken finality reports a pass while a chain position is permanently dead, so nothing in the shipped readiness surface distinguishes \"finality works\" from \"finality is advancing for somebody else\".\n**Network:** `testnet-0005`, node `ldn.core.test.network`, build `xe/3019b76`\n**Method:** read-only GETs plus one rejected `POST /blocks/send` (no funds needed)\n\n## Summary\n\n`docs/api.md` positions `/ready` as *the* endpoint that catches this system's worst failure:\n\n> **`/health` being green means almost nothing about the network** […] Liveness is green throughout. `/ready` is the endpoint that catches it.\n\n> Two of these deserve their reasoning stated, because the obvious formulation of each fails open […] an unchecked invariant that looks identical to a passed one is how a gate fails open.\n\nBut `/ready` answers only node-global questions, and both of its finality checks are satisfied by *other people's* progress:\n\n- `quorum_reachable` passes while any backlog exists if voting weight ≥ 67% of delegated weight — independent of whether the specific stuck position can ever reach quorum.\n- `finality_advancing` passes if the **global** final-height watermark moved within 90 s. Any unrelated account finalizing resets the timer.\n\n`conflicts_open` is computed, published in the very same JSON body, and asserted by no check. So a node can report `ready: true, 200` while carrying conflicts that are permanently unresolvable on it.\n\nLive right now on `ldn`: **5 open conflicts**, one of them 54.7 hours old, and `/ready` is `200 ready:true` on every sample.\n\n## Evidence\n\n**1. The documented probe, green:**\n\n```\nGET https://ldn.core.test.network/ready  ->  HTTP 200\n  ready          : True\n  conflicts_open : 5\n  checks         : [live, sample_present, sample_fresh, peers, synced,\n                    delegated_weight, quorum_reachable, finality_advancing]\n  any check about conflicts: False\n```\n\n**2. The account the gate says nothing about is dead, and has been for 54.7 h:**\n\n```\nGET /accounts/46635bb7567e9568b03824317736ecdc0f0ea858ba2f74bd8a39d6c88148afd5/chain\n  chain length 3, tip 898a8691…, finalized=false\nGET /conflicts/46635bb756…\n  200, 1 open conflict, age 54.7 h\n```\n\nIt cannot take a block at all — the conflict gate in `core/ledger.go:815-817` rejects every add on the account:\n\n```\nPOST /blocks/send -> 400 {\"error\":\"block rejected: signature: …\"}\nGET  /ready       -> 200   (before and after)\n```\n\n(the rejection here is a *later* gate than the conflict gate; a correctly signed send from that account stops at `account has unresolved conflict — block rejected pending resolution`, source-cited below and demonstrated in XE-0022's thread. The point of this ticket is that `/ready` answers `200` either way.)\n\n**3. Why the stall timer never fires — the watermark moves from unrelated finality:**\n\n```\nadvances=258937  stall_s=11  unfinalized=8\nadvances=258937  stall_s=17  unfinalized=8\nadvances=258942  stall_s=9   unfinalized=7   <- advanced, timer reset\n```\n\n`unfinalized_positions` actually *fell* while the 54-hour account stayed stuck. `recordFinalityAdvance()` (`core/ledger.go:2533`) is a single global counter: any account finalizing resets `finality_stall_seconds` for all of them.\n\n## Why the gap matters\n\n- `/ready` is documented as safe for a load balancer to drain on (`docs/api.md`: *\"Safe for a load balancer to drain on\"*). A pool that drains on `/ready` keeps routing to a node on which the affected accounts can never commit — the split becomes user-visible instead of internal.\n- The operator's own alert path (`xe_ready`, `xe_ready_check_*`) inherits the blindness: nothing pages for a position that has been dead for two days.\n- `conflicts_open` already exists in the response and in `/metrics` (`xe_conflicts_open`, `docs/api.md:414` \"Unresolved conflicts\"), so the signal is present and simply unasserted — this is the \"unchecked invariant that looks identical to a passed one\" the docs warn about, in their own words.\n- It also masks the difference between the two node populations: at the same moment `ldn` carried 5 conflicts and `ffm`/`nyc` carried 4, and all three reported `ready: true`.\n\n## Reproduction\n\n`poc_ready_blind.sh` (read-only except one rejected POST; output attached as `poc_ready_blind.log`):\n\n1. `GET /ready`, print `ready`, `conflicts_open` and the check names; assert no check name contains \"conflict\".\n2. `GET /accounts/46635bb7…/chain` and `GET /conflicts/46635bb7…`, print chain length, tip finality and conflict age.\n3. `POST /blocks/send` for that account, then `GET /ready` again — `200` both times.\n4. Sample `/ready` three times 6 s apart and show `finality_advances` climbing while the frozen account stays frozen.\n\n## Fix sketch\n\nA ninth check mirroring the existing shape, e.g. `conflicts_advancing`: pass when `conflicts_open == 0`, else fail when the oldest open conflict exceeds a bound (`--ready-conflict-stall`, default on the order of minutes) — or at minimum fail when `conflicts_open > 0` and no conflict has resolved within the window while the watermark only moves elsewhere. Per the docs' own rule for `quorum_reachable`, a quiet network should still pass on direct evidence, so the check should key off conflict age rather than off voting margin.\n\n## Dedup\n\n- **XE-5592** — representatives withhold votes on unfetched dependencies (why positions stall). Does not touch `/ready`.\n- **XE-7172** — the three phantom conflicts are stuck for 15 min–52 h (the stall itself). Does not touch `/ready`.\n- **XE-6354** — ldn is stuck on the losing fork of that 50-hour conflict (the divergence). Does not touch `/ready`.\n- **XE-0022 / XE-1756** — swap cannot unwind lease/multisig descendants; the account is bricked. Does not touch `/ready`.\n- **XE-1081** — `GetReadiness` uint64 overflow and undeduplicated netcheck features. Different checks.\n- **XE-0037 / XE-2793 / XE-6400** — statechain timestamp/epoch bounds. Unrelated.\n- No ticket in the 1,253-ticket corpus mentions `conflicts_open` in a readiness context or claims that the gate is per-account blind (`grep` over all bodies: `readiness conflict` 0, `/ready conflict` 0, `conflicts not in ready` 0, `unchecked invariant` 0).","patch_refs":[],"thread":[{"id":2419,"source":"web","source_ref":"reporter:30:4c2b2331e21a54a5","author":"targammm","team":false,"body":"Dedup cross-reference, filed after checking the corpus so triage does not have to.\n\nClosest tickets and why this is not a duplicate:\n\n- XE-7172 (open, Minor) - the stall: three phantom conflicts stuck 15 min-52 h, no FINAL vote, no sweep trim. Establishes that positions halt. Says nothing about /ready.\n- XE-6354 (open, Medium) - the divergence: ldn stuck on the losing fork of the 50-hour conflict, ffm/nyc finalized the winner. Says nothing about /ready.\n- XE-5592 - representatives withhold votes on unfetched dependencies, i.e. the mechanism behind the halt. Does not touch /ready.\n- XE-0022 (accepted, High) / XE-1756 (closed dup) - swap cannot unwind lease/multisig descendants; the account is bricked. Does not touch /ready.\n- XE-1081 (closed, High) - GetReadiness uint64 overflow and undeduplicated netcheck features. Different checks entirely.\n- XE-7170 (mine) - the split attribution consequence of the same conflict. Does not touch /ready.\n\nWhat none of them says, and this ticket does: conflicts_open is computed and returned in the /ready body (metric xe_conflicts_open, documented at docs/api.md:414) and NO check references it, so the endpoint the docs designate as the probe for broken finality returns 200 ready:true for 54 hours while a position is permanently dead on that node. Corpus grep over all 1,253 ticket bodies: \"readiness conflict\" 0 hits, \"/ready conflict\" 0, \"conflicts not in ready\" 0, \"unchecked invariant\" 0.\n\nRoot cause is the shape of the two existing finality checks, not the conflict bug: finality_advancing keys off the GLOBAL watermark (core/ledger.go:2533 recordFinalityAdvance), so any unrelated account finalizing resets the 90 s timer; quorum_reachable keys off the live voting margin globally. Both stay green while an individual position can never resolve, and unfinalized_positions even FELL during the sample (8 -> 7) with the frozen account still frozen.\n\nSuggested check, matching the docs' own rule that a quiet network must pass on direct evidence: conflicts_advancing - pass on conflicts_open == 0, else fail when the oldest open conflict exceeds --ready-conflict-stall; equivalently, fail when conflicts_open > 0 and the watermark only advances for other accounts inside the window.","created_at":"2026-11-11T18:10:08.631235+00:00"},{"id":7211,"source":"desk","source_ref":"reply:5831","author":"Joseph Denne","team":true,"body":"Thanks for the report. It has been read against the code and the documentation and is with the team for review.","created_at":"2026-11-16T01:09:24.658724+00:00"}]}