{"id":"XE-13350","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"495","source_url":"https://github.com/xeprotocol/xe/issues/495","reporter_id":1981,"title":"Report bug","area":"node-api","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0748","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:10.321972+00:00","updated_at":"2026-11-20T00:38:16.191047+00:00","source_created_at":"2026-11-12T03:18:59+00:00","told_at":"2026-11-20T00:34:53+00:00","status_changed_at":"2026-11-20T00:33:18.911688+00:00","url":"https://bounty.xe.network/XE-13350","body":"# XE Bounty — Laporan siap file (temuan pass 3 #3)\n\nFile issue baru di: https://github.com/xeprotocol/xe/issues/new\nPaste judul + isi di bawah. Akun GitHub: Gib230223.\n\n---\n\n## Judul\n\n[Low-Medium] Failed lease auto-accept is never retried by the watch loop\n\n## Isi\n\n## Summary\n\nIn `node/node.go`, `autoAcceptLease` records the outcome of each accept attempt in `acceptSched`. The `retry` flag is set `true` only on attestation-gather failure and on retryable `AddBlock` errors. Every other failure — policy reject, insufficient XUSD stake, certificate error, VM provision failure, non-retryable `AddBlock` error — records `done=true`, and `due()` is then false forever while the lease stays pending. So a provider who tops up XUSD, renews its certificate, or frees VM capacity never re-attempts that lease under normal operation.\n\n## Evidence\n\n```go\n// node/node.go:1465 (autoAcceptLease)\nretry := false\ndefer func() { n.acceptSched.record(leaseBlock.Hash, retry, time.Now()) }()\n\n// node/node.go:1726-1740 (record)\nif !retry { st.done = true; return }\n// (retry==true only: delay := acceptRetryDelay(st.failures); st.next = now.Add(delay))\n\n// node/node.go:1719-1724 (due)\nreturn !ok || (!st.done && !now.Before(st.next))\n\n// node/node.go:1670-1680 (leaseWatchTick)\nif !n.acceptSched.due(p.SendHash, now) || n.acceptRunning(p.SendHash) { continue }\n```\n\n`retry` is set `true` only on attestation-gather failure and retryable `AddBlock` errors. Policy reject, no stake, cert error (`acceptCertificateHash`), VM provision failure (\"VM provision failed, not accepting\"), and non-retryable `AddBlock` errors all leave `retry == false`, so `record` sets `done = true` and `due()` returns false forever.\n\n## Impact (Low-Medium, liveness)\n\nA lease whose first auto-accept failed for a transient reason (provider out of XUSD, expired cert, VM capacity full) is never re-attempted by the watch loop even after the provider recovers — the provider silently loses that lease. Nuance: the lease *can* still be re-attempted if the lease block is re-gossiped/received (`handleIncoming`, `node.go:725`, calls `autoAcceptLease` directly, bypassing `due()`), e.g. after a restart/re-sync — so this is \"no retry under normal operation\", not \"never, ever\". That makes it liveness, not a stuck-funds bug (escrow still settles/expires via the normal paths).\n\n## Reproduction (PoC)\n\nUnit test against `acceptSchedule` (`node` package):\n```\nBUG: after one non-retryable accept failure, due()=false forever; leaseWatchTick will never re-attempt this lease even if stake/cert/VM recovers\nLease abc123: retrying accept in 5s\nretryable failure does schedule a retry (control case OK)\n--- PASS: TestPoc3AcceptScheduleDoneForever\n```\n`record(h, false, now)` → `due(h, now+1h)` is false; control `record(h, true, …)` does schedule a retry.\n\n## Suggested fix\n\nDo not mark the lease `done` on failures whose cause can change (policy, stake, cert, VM capacity): either re-arm `due()` when the underlying condition changes, or schedule a bounded retry (with backoff) for all accept failures instead of only attestation-gather / retryable-AddBlock ones.\n\n## Novelty note\n\nNo ticket covers the accept-retry schedule. Board \"retry\" search (High+Medium and Minor views) returns only HTTP-retryable flags, sync retry loops, and SDK retry counts — none about the lease auto-accept schedule. GitHub repo issue search for the auto-accept schedule returns only #175 (emission terms) and #283 (MaxConcurrent race) — neither about retry gating. Checked the live bounty board and the GitHub repo issues, 2026-11-12.\n\nRepo: github.com/xeprotocol/xe, HEAD 89a542e, testnet-0005.\n","patch_refs":[{"id":570,"repo":"xeprotocol/xe","kind":"pr","ref":"524","title":"fix(node): schedule retry for transient lease auto-accept failures (#495)","url":"https://github.com/xeprotocol/xe/pull/524","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.233353+00:00"}],"thread":[{"id":13220,"source":"github","source_ref":"7026488066","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0748, 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-13350 and says what differs; it is read like any other.","created_at":"2026-11-20T00:34:53+00:00"}]}