{"id":"XE-16713","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"651","source_url":"https://github.com/xeprotocol/xe/issues/651","reporter_id":2920,"title":"[High] Lease-block validity depends on the node's local off-chain certset; certificate eviction makes historical lease blocks unvalidatable (consensus non-determinism + permanent sync breakage)","area":"leasing-ledger","claimed_tier":"high","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":true,"internal_ref":"#1060","internal_url":"https://github.com/xeprotocol/core/issues/1060","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T05:19:34.175717+00:00","updated_at":"2026-11-22T23:26:16.968781+00:00","source_created_at":"2026-11-17T05:17:38+00:00","told_at":"2026-11-22T23:26:16.985803+00:00","status_changed_at":"2026-11-22T23:26:16.976023+00:00","url":"https://bounty.xe.network/XE-16713","body":"## Summary\nPerformance certificates are not on-chain -- a lease block stores only the cert hash. But the ledger validates the lease/accept/renew cost against the cert's `PriceMultiplierMilli`, fetched from the node's local, gossiped, capped certset (256 per provider). Two honest nodes with different certsets reach opposite verdicts on the identical block, and a cert evicted network-wide can never be recovered (it lives nowhere else). A new node syncing from scratch stalls at the first lease block whose cert was evicted -- it cannot validate that account chain past that point, ever.\n\n## Root Cause\n- `validateAndAddLease` (`core/ledger.go:1656-1662`), `validateAndAddLeaseAccept` (`core/ledger.go:1821-1826`), `validateAndAddLeaseRenew` (`core/lease_renew.go:65-70`) all reject with \"certificate not found\" when `certificateLookupFn` returns nil.\n- `certificateInfoByHash` (`node/perf.go:295-305`) reads only the node's local in-memory certset.\n- `certSet.put` (`node/certset.go:25-55`) evicts oldest-by-`IssuedAt` past `certRetentionPerProvider = 256`.\n- `retainCertificate` (`node/perf.go:358-377`) DELETES evicted certs from the persistent store (`DeleteCertificate`, line 371), so eviction is permanent, not just in-memory.\n- The sync path (`AddSyncedBlock` -> `addBlock` -> `dispatchValidateAndAdd`, `core/ledger.go:793-795`) runs the same cert-lookup validation; nothing skips it.\n\n## Impact\n- **Consensus non-determinism:** the same lease block is valid on nodes holding the cert and invalid on nodes that evicted it.\n- **Permanent sync breakage:** a new node syncing from scratch stalls at the first lease block whose cert was evicted.\n- **Deliberate history poisoning (cheap):** a provider mints 256+ self-asserted certs (trivial -- `VerifyCertificateContent`, `perf/certificate.go:156-216`, never verifies PoW or the attestation roots; that enabler is already reported as #392/#594) and gossips them; every node ingests them, evicts the target cert, and deletes it from its store. The provider can thereby make any of its leases' history unvalidatable network-wide.\n\n## Verification (executed PoC)\nStandalone Go harness (map-backed cert lookup): builds a ledger, mints XCU, creates a lease block referencing a cert -- ACCEPTED on node A. Then deletes the cert from the map (simulating eviction) and replays the identical mint+lease via `AddSyncedBlock` on a fresh ledger (node B): mint replays fine, the same lease block is REJECTED with `certificate aaaaaaaaaaaa... not found`. \"RESULT: consensus non-determinism confirmed -- identical block, opposite verdicts depending on local off-chain cert state.\" Audited at HEAD `8cc209d` (testnet-0006).\n\n## Note on related reports\nAdjacent, not duplicate: XE-13481 (\"Certificate eviction makes `holdLease` throw on the missing opening certificate\") is an SDK/client helper (`holdLease` does not exist in this repo) with a client-liveness impact; it does not cover ledger consensus validation or sync breakage, and its fix would not fix this finding. #387 (no global cap -> store/RAM exhaustion) is an adjacent, distinct root cause.\n\n## Suggested fix\nPersist the cert's pricing inputs (at minimum `PriceMultiplierMilli`, provider, expiry) in the lease block / lease record at creation so historical validation never needs the gossiped cert; or exempt already-finalized historical lease blocks from the cert lookup; and/or never delete certs referenced by on-chain leases from the store.","patch_refs":[],"thread":[{"id":18878,"source":"desk","source_ref":"reply:16555","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-16713 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:16.968781+00:00"}]}