[Consensus] Lease mutations from different accounts have no deterministic merge rule — renew/settle and settle/force-settle races permanently split honest nodes
Report
Suggested severity: High (10,000 XE) Area: ledger / lease state machine / cross-node convergence Repo pin: 9787859 (testnet-0005)
Summary
Lease mutations issued from different accounts (consumer chain vs provider chain) mutate one shared lease object with order-dependent outcomes and no deterministic merge rule. Two honest nodes following the protocol can permanently disagree on the lease state, on the provider's XE payout, and on the consumer's escrow — with no reconciliation path. The conflict system cannot merge these pairs: conflicts key on (account, previous), and the two blocks live on different accounts with no competing block at the same position, so there is no conflict object to vote on, and per-conflict finality votes cannot rewrite the other camp's lease state.
Two pairs of this single deviation source are proven:
- Pair 1: renew vs settle. Renew (consumer chain, while the lease is live) vs settle (provider chain, after expiry).
- Pair 2: settle vs force-settle. Two terminal transitions. Their windows are non-overlapping by design (settle in [expiry, expiry+grace], force-settle in [expiry+grace+gap, expiry+365d]), but gossip arrival order is not time order: a node that receives the later-authored force-settle before the delayed settle applies force-settle and then rejects settle forever, and vice versa.
No direct fund theft is claimed. This is a consensus / state-integrity failure: permanent balance disagreement and a consumer-chain stall.
Mechanism
Renew requires renewTime < EffectiveExpiry and keeps state Accepted while extending duration (core/lease_renew.go). Settle requires settleTime >= EffectiveExpiry and pins ExpectLeaseState = LeaseAccepted + ExpectLeaseEffectiveDurationSecs at commit time (core/ledger.go:2228-2231, enforced in store/mem_store.go CommitBlock under one lock). Per-node behaviour fails closed both ways, which is correct in isolation. The bug is the absence of a merge rule across camps.
The settle validator's "retry after sync" branches (core/ledger.go:2168/2180, renewalMayBeMissing) show the sync-direction ordering gap was considered — but nothing handles the settled-camp direction: a node that applied settle can never apply the renew afterwards, even via sync, because the Expect checks are not skew-gated (AddSyncedBlock runs the same dispatch). The cross-submit rejections ("lease already settled", "lease not yet expired") are not in the retryable-error patterns (core/retryable.go), so sync treats them as permanent failures. Permanence contrast: dependency-ordered blocks fail with retryable errors and heal via sync retries; these pairs fail with non-retryable state errors — the disagreement is permanent.
Same-account pairs are explicitly out of scope and are not claimed: renew-vs-force-settle share the consumer chain (the previous pointer orders them), and accept-vs-cancel has the designed resolveCancelWinsOverAccept handler.
Trigger
No privilege, no forging, no victim funds, no threshold bypass. Either party to the lease can create the race with honest actions: the consumer times a renew near expiry and the provider settles promptly after expiry (pair 1), or the provider settles promptly and the consumer force-settles in-window while unaware of (or partitioned from) the settle (pair 2), with gossip propagation delivering the two blocks in different orders to different nodes.
Proof of concept
Both PoCs run against the pinned tree (scratch copy; repo tree left clean), two local ledgers on the live AddBlock path. All blocks are built ONCE with fixed timestamps and deterministic signatures and shared by both ledgers, so the cross-submits judge the SAME block under two arrival orders. Setup: consumer and provider funded 10,000,000 XUSD (test mint), single-key timekeeper, certificate multiplier 1000, epoch (R=1000, cap=1500, TWAP=1000), 60s lease.
Pair 1 — renew vs settle (independently re-run and reproduced)
- Both ledgers receive identical mint → lease → accept. They agree fully.
- Positive control: ledger A accepts renew while live → OK.
- Positive control: ledger B (never saw renew) accepts settle after expiry → OK, provider XE minted 50,000.
- Negative control: B's settle submitted to A → rejected, "lease not yet expired" (renewed expiry).
- Negative control: A's renew submitted to B → rejected, "lease already settled".
- Stall proof: a consumer send built on renew (previous = renew hash) applies on A, is rejected on B (previous mismatch — B lacks renew, so B's view of the consumer chain stalls behind every later consumer block).
- Final states — A: Accepted + 1 renewal, provider XE 0, consumer XUSD 9,899,999, consumer chain 4 / provider chain 2. B: Settled, 0 renewals, provider XE 50,000, consumer XUSD 9,950,000, consumer chain 2 / provider chain 3. The ledgers permanently disagree.
Reproduce: go test ./core -run TestLeaseOrderDivergence -v -count=1 (test and store helper available in the finding archive; the test FAILS if the ledgers agree).
Pair 2 — settle vs force-settle
Timeline compressed via genesis timing configuration (grace=10s, gap=5s — a legitimate network configuration set from genesis timing fields in ApplyGenesisLeaseTiming; the mechanism is window-size-independent). Ledger A accepts settle → provider XE 50,000. Ledger B (never saw settle) accepts force-settle in-window → consumer refunded to the full 10,000,000. Cross-submits rejected both ways ("already settled"). Final: A = Settled, provider XE 50,000, consumer XUSD 9,950,000. B = Unfulfilled, provider XE 0, consumer XUSD 10,000,000.
Reproduce: go test ./core -run TestSettleVsForceSettleOrderDivergence -v -count=1
Impact
Permanent balance disagreement across honest nodes: provider XE minted on settle-camp nodes only; consumer escrow topped up / refunded differently per camp. Consumer-chain stall on settle-camp nodes: every later consumer block built on the renew is rejected there. No funds are stolen by an attacker directly.
Honest limits
Proven at ledger level (two local ledgers, live AddBlock path), NOT executed across real nodes on a live network. Gossip misordering and the settled-camp sync refusal are traced from code, not executed live. Harness simplifications (single-key timekeeper, test-mint seeding) do not touch the ordering logic: the Expect checks decide the outcome. No testnet transaction was made; no other user's funds, keys, or workloads were involved.
Duplicate check
No match in the repo's open issues/PRs or the programme record. Distinguished from: #4 item 3 (single-node locking/staging omission during BlockLeaseRenew addBlock, not cross-node order dependence); #4 renewed-lease supply conservation (accounting consequence of settling renewed leases, not ordering divergence); #38 (cancel unwinding an accept — a designed cascade path, different pair and mechanism); #43 (SwapBlock cannot unwind lease descendants); #64/#42/#96 (finality/vote machinery, not lease-state coupling — #96 concerns conflicting blocks at the same account position, where a conflict object exists; here none ever forms); #90/#21/#97/#162 (settle/renew validation strictness, not cross-node convergence); #155, #92 (renewed escrow accounting); #167 (sync quarantine suppression — a sync-layer filter, not state-expect rejection).
Suggested fix
Define a deterministic merge/tiebreak rule for cross-account lease transitions (e.g. a canonical ordering of terminal transitions, or reconciliation of the shared lease object on sync that can rewrite a camp's lease state), and make the settled-camp direction recoverable instead of failing with a non-retryable state error that sync quarantines.
Reporter
XE payout address: 24b1be6a99de922902aceccce2456abc3769e4ab1cac463ea86fb23496b868b3 Discovered: 2026-10-29, against the public testnet implementation at the pinned commit. Reproduction was local only; no other users' funds, keys or workloads were touched.
Thread
Thanks for the detailed report. We have confirmed the behaviour you describe and it is being handled; we will update this ticket when there is more to share.
Payout address update
Hi team — a quick correction to the Reporter section of this report.
The XE payout address previously listed here (24b1be6a99de922902aceccce2456abc3769e4ab1cac463ea86fb23496b868b3) is no longer accessible to me — I no longer control the key for that wallet. Please disregard it.
My current XE payout address is:
5dc48847412ffe94e4f7097b81ee111b9e207b47c9c1f3bab988f08b63bcc7e3
Please use this address for any award for this report. I am posting the same update on my other reports (#175, #183, #184, #191). Thank you.