{"id":"XE-0035","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"57","source_url":"https://github.com/xeprotocol/xe/issues/57","reporter_id":14,"title":"Public release (master @ 9787859) never syncs 289 lease-family blocks (\"lease not found\"), retried every cycle; 18 vs 101 leases against bootstrap nodes","area":"ops-testnet","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":true,"internal_ref":"","internal_url":null,"status":"accepted","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:16.829933+00:00","updated_at":"2026-11-16T10:23:09.853971+00:00","source_created_at":"2026-10-25T11:55:52+00:00","told_at":null,"status_changed_at":"2026-10-29T14:22:11.088738+00:00","url":"https://bounty.xe.network/XE-0035","body":"**Suggested severity:** Minor (log noise, incomplete lease state on a fully synced node); Medium if the divergent `/supply` figure counts as an accounting inconsistency.\n**Area:** `net/sync.go`, lease validation (`core/ledger.go` `lease_*` paths), release process\n**Version:** node built from public `master` @ `9787859` (reports `xe dev`); bootstrap nodes report `xe/92d83d1`, which is not in the public history\n**Network:** `testnet-0005`\n**Host:** Linux x86_64 VPS, 2 vCPU / 3.7 GB, node running >12 h with 5–8 peers (all three bootstraps plus DHT-discovered peers)\n\n## Observation\n\nA node built from the public tree syncs accounts and balances fine (5,542 accounts vs 5,548 on `nyc` at the time of comparison, growing in lockstep since), but it never catches up on leases, and it retries the same blocks every sync cycle:\n\n```\nsync: 289 block(s) could not be added after retries; reasons: map[lease not found: 06a4147c4e62...:2 lease not found: 0ad7493f775d...:2 lease not found: 0ad756700740...:2 lease not found: 1171ad4f666b...:2 ...]\n```\n\n- The count has been **exactly 289** for the whole observation window (>3 h across several samples), i.e. these blocks never resolve.\n- The warning is logged ~16–25 times a minute: 763 lines in 30 min, 239 lines in the last 15 min.\n- `GET /leases?limit=1000`: **18** on my node, **101** on `nyc.core.test.network` (and `ffm`).\n- `GET /ready` fails only on `finality_advancing` / `quorum_reachable`, which fails on the bootstrap nodes at the same moments, so this is not a peering or quorum problem on my side.\n- `block_count` stays ~300–450 behind `nyc` (e.g. 31,675 vs 32,110; 36,055 vs 36,5xx), consistent with a fixed set of unsyncable blocks plus their dependants.\n- The reason strings are all `lease not found: <hash>`, i.e. the `lease_accept`/`lease_renew`/`lease_settle` blocks arrive but the referenced lease is never present locally. The dependency retry in `net/sync.go` (`maxRetries = 10`, then the \"could not be added\" summary) runs again on every periodic sync, so the same 289 blocks are re-validated every ~10 s forever.\n\nSide effect: `GET /supply` on my node reports an XUSD discrepancy of **−4,654** while `nyc`/`ffm` report **−32,318** (the latter is #4, finding 3: the sum of renewal costs). The figure depends on which leases a node happens to know, so two nodes on the same network disagree about supply.\n\n## Why it matters\n\nAnyone who follows Getting Started / `docs/run-a-node.md` and builds the public tree ends up with a node that disagrees with the network about leases, lags in block count, and floods its log. If the public release is expected to lag production (`92d83d1` is not public), the docs should say which commit the live network runs and whether a `9787859` build is supposed to be fully compatible.\n\n## Reproduce\n\n```sh\ngit clone https://github.com/xeprotocol/xe && cd xe && make build      # 9787859\n./xe node --data ./data --genesis-dir ./genesis/testnet-0005 \\\n  --dial <three bootstrap multiaddrs from the README> --port 9000 --api --api-port 8080\n# wait for accounts to match nyc, then:\ncurl -s \"localhost:8080/leases?limit=1000\" | jq length                      # 18\ncurl -s \"https://nyc.core.test.network/leases?limit=1000\" | jq length       # 101\njournalctl -u xe-node --since \"15 min ago\" | grep -c \"could not be added\"   # ~240\n```\n\n## Suggested fixes\n\n1. Publish (or tag) the commit the bootstrap nodes actually run, so a from-source build is known-compatible.\n2. If a lease block's `source` lease is unknown, request it directly from the peer (`block_request`-style targeted pull) instead of waiting for frontier sync to deliver it.\n3. Quarantine blocks whose dependency has not arrived after N full sync passes, and rate-limit the \"could not be added\" summary (once per change, not every cycle).\n\nPayout address: `ead8ad792b4452de17e897155ed6efe9f928d0c8b07bdf6a9cbf4f4d67941dd2`\n","patch_refs":[{"id":168,"repo":"xeprotocol/xe","kind":"pr","ref":"150","title":"fix(net): quarantine unresolvable sync blocks, rate-limit warnings, and fix pagination hasMore (#57)","url":"https://github.com/xeprotocol/xe/pull/150","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"}],"thread":[]}