<!-- XE-13350 · Report bug · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13350>. The page is the record; this is the same page for reading.*

XE-13350 · Bounty

# Report bug

Closed · duplicate
—
[xe#495](https://github.com/xeprotocol/xe/issues/495)
filed 2026-11-12 03:18 UTC
by Gib230223

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Node / API

Duplicate of
:   [XE-0748](https://bounty.xe.network/XE-0748) triaging

Tracked
:   —

Updated
:   2026-11-20 00:38 UTC

Told
:   2026-11-20 00:34 UTC

### Patches

- [xe#524](https://github.com/xeprotocol/xe/pull/524) open by arturbarszcz78
  fix(node): schedule retry for transient lease auto-accept failures (#495)

### History

- [554019](https://bounty.xe.network/log/554019) 2026-11-20 00:34 UTC reply.mirrored
- [553600](https://bounty.xe.network/log/553600) 2026-11-20 00:34 UTC github.state\_pushed
- [553502](https://bounty.xe.network/log/553502) 2026-11-20 00:34 UTC github.labels
- [552473](https://bounty.xe.network/log/552473) 2026-11-20 00:33 UTC proposal.adopted
- [552472](https://bounty.xe.network/log/552472) 2026-11-20 00:33 UTC reply.sent
- [552471](https://bounty.xe.network/log/552471) 2026-11-20 00:33 UTC ticket.status new → closed
- [551862](https://bounty.xe.network/log/551862) 2026-11-20 00:33 UTC proposal.adopted
- [551861](https://bounty.xe.network/log/551861) 2026-11-20 00:33 UTC ticket.facts area
- [551860](https://bounty.xe.network/log/551860) 2026-11-20 00:33 UTC proposal.adopted
- [551859](https://bounty.xe.network/log/551859) 2026-11-20 00:33 UTC ticket.facts
- [551858](https://bounty.xe.network/log/551858) 2026-11-20 00:33 UTC proposal.adopted
- [551857](https://bounty.xe.network/log/551857) 2026-11-20 00:33 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-13350) · [JSON](https://bounty.xe.network/v1/tickets/XE-13350) · [markdown](https://bounty.xe.network/XE-13350.md)

### Report

# XE Bounty — Laporan siap file (temuan pass 3 #3)

File issue baru di: https://github.com/xeprotocol/xe/issues/new
Paste judul \+ isi di bawah. Akun GitHub: Gib230223.

---

## Judul

\[Low-Medium\] Failed lease auto-accept is never retried by the watch loop

## Isi

## Summary

In `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.

## Evidence

```
// node/node.go:1465 (autoAcceptLease)
retry := false
defer func() { n.acceptSched.record(leaseBlock.Hash, retry, time.Now()) }()

// node/node.go:1726-1740 (record)
if !retry { st.done = true; return }
// (retry==true only: delay := acceptRetryDelay(st.failures); st.next = now.Add(delay))

// node/node.go:1719-1724 (due)
return !ok || (!st.done && !now.Before(st.next))

// node/node.go:1670-1680 (leaseWatchTick)
if !n.acceptSched.due(p.SendHash, now) || n.acceptRunning(p.SendHash) { continue }
```

`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.

## Impact (Low-Medium, liveness)

A 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).

## Reproduction (PoC)

Unit test against `acceptSchedule` (`node` package):

```
BUG: after one non-retryable accept failure, due()=false forever; leaseWatchTick will never re-attempt this lease even if stake/cert/VM recovers
Lease abc123: retrying accept in 5s
retryable failure does schedule a retry (control case OK)
--- PASS: TestPoc3AcceptScheduleDoneForever
```

`record(h, false, now)` → `due(h, now+1h)` is false; control `record(h, true, …)` does schedule a retry.

## Suggested fix

Do 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.

## Novelty note

No 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.

Repo: github.com/xeprotocol/xe, HEAD 89a542e, testnet-0005.

### Thread

**Joseph Denne**team2026-11-20 00:34 UTCgithub

Thanks. This is the same finding as https://bounty.xe.network/XE-0748, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-13350 and says what differs; it is read like any other.
