<!-- XE-13256 · [Medium] lease_cancel staged vs full balance formulas disagree for renewed leases — conflict can never resolve in favour of cancel · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13256>. The page is the record; this is the same page for reading.*

XE-13256 · Bounty

# \[Medium\] lease\_cancel staged vs full balance formulas disagree for renewed leases — conflict can never resolve in favour of cancel

Closed · duplicate
—claimed Medium
[xe#395](https://github.com/xeprotocol/xe/issues/395)
filed 2026-11-11 15:41 UTC
by DICKY KUSUMA WARDHANI

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   Leasing / ledger

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-20 00:06 UTC

Told
:   2026-11-20 00:04 UTC

### Patches

- [xe#407](https://github.com/xeprotocol/xe/pull/407) open by arturbarszcz78
  fix(core/ledger): refund full escrow pending amount on lease\_cancel for renewed leases (#395, #391)

### History

- [543793](https://bounty.xe.network/log/543793) 2026-11-20 00:05 UTC github.state\_pushed
- [543791](https://bounty.xe.network/log/543791) 2026-11-20 00:05 UTC github.labels
- [543756](https://bounty.xe.network/log/543756) 2026-11-20 00:04 UTC reply.mirrored
- [543419](https://bounty.xe.network/log/543419) 2026-11-20 00:04 UTC proposal.adopted
- [543418](https://bounty.xe.network/log/543418) 2026-11-20 00:04 UTC reply.sent
- [543417](https://bounty.xe.network/log/543417) 2026-11-20 00:04 UTC ticket.status new → closed
- [541865](https://bounty.xe.network/log/541865) 2026-11-20 00:04 UTC proposal.adopted
- [541864](https://bounty.xe.network/log/541864) 2026-11-20 00:04 UTC ticket.facts area
- [541863](https://bounty.xe.network/log/541863) 2026-11-20 00:04 UTC proposal.adopted
- [541862](https://bounty.xe.network/log/541862) 2026-11-20 00:04 UTC ticket.facts
- [541861](https://bounty.xe.network/log/541861) 2026-11-20 00:04 UTC proposal.adopted
- [541860](https://bounty.xe.network/log/541860) 2026-11-20 00:04 UTC ticket.facts

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

### Report

Repo: https://github.com/xeprotocol/xe @ 89a542e
Suggested severity: Medium
Payout XE address: da2ad2483b592cb5a35224cec5529bf0c48f4770ed6fe40a455c312b5c1dcbcf

# ledger — lease\_cancel staged vs full balance formulas disagree for renewed leases (conflict can never resolve in favour of cancel)

- **Repo:** `https://github.com/xeprotocol/xe`, HEAD `89a542e`
- **Area:** `core/ledger.go` — `ValidateStagedBlock` vs `validateAndAddLeaseCancel`
- **Tier yang disarankan:** Medium (liveness / permanent conflict stall for a renewed lease)
- **Status:** DIVERIFIKASI dengan `go test` (2 test PASS, lihat PoC di bawah). Tidak ada laporan yang difile-kan (sesuai larangan tugas).

## Ringkasan

Untuk lease yang sudah di-renew, TIDAK ADA satu pun blok `lease_cancel` yang bisa lolos
kedua gerbang validasi sekaligus:

| Gerbang | Rumus saldo yang dituntut | Kode |
| --- | --- | --- |
| Staged (`ValidateStagedBlock`, konflik) | `Balance = parentBalance + pending.Amount` (escrow PENUH: base \+ semua renewal top-up) | `core/ledger.go` \~baris 2800-an, case `BlockLeaseCancel` |
| Full (`validateAndAddLeaseCancel`, admission) | `Balance = oldBal + leaseBlock.Amount` (biaya BASE saja) | `core/ledger.go:1845-1850` |

Begitu sebuah lease punya ≥1 renewal, `pending.Amount > leaseBlock.Amount`, jadi
kedua rumus saling meniadakan. Akibatnya:

1. Cancel yang dibuat menurut aturan full (refund base) **ditolak di gerbang staged**
   → tidak pernah bisa masuk sebagai kandidat konflik.
2. Cancel yang dibuat menurut aturan staged (refund penuh) **lolos staged tapi
   selalu gagal saat promosi** (`SwapBlock` → `dispatchValidateAndAdd` →
   `ErrWinnerFullValidation`, "loser kept").
3. Jika sudah ada SATU blok sibling di posisi cancel itu (konflik aktif), akun
   consumer terkunci konflik secara permanen untuk jalur cancel: tidak ada versi
   cancel yang bisa menang, dan `AddBlock` menolak blok baru selama konflik
   belum terselesaikan (`"account has unresolved conflict — block rejected pending resolution"`, `core/ledger.go` \~baris 850-an). Escrow consumer
   (base \+ renewal) tidak bisa ditarik kembali lewat cancel selama konflik itu hidup.

Cancel tanpa kontestasi (tidak ada konflik) TIDAK terdampak — jalur langsung
memakai rumus full dan berhasil. Itu sebabnya ini liveness, bukan kehilangan dana
langsung.

## Lokasi persis

**Gerbang staged — `core/ledger.go`, `ValidateStagedBlock`, case `BlockLeaseCancel`:**

```
pending, err := l.store.GetPendingSend(b.Source)
// ...
expectedBal := parentBalance + pending.Amount   // escrow PENUH (base + renewals)
if b.Balance != expectedBal {
    return fmt.Errorf("staged lease_cancel: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
}
```

`pending.Amount` memang berisi base \+ renewals: tiap `lease_renew` melakukan
`commit.TopUpPendingID / TopUpPendingAmount` (`core/lease_renew.go:137-138`) dan
store menambahkannya ke pending (`store/mem_store.go`, `applyCommitLocked`,
case `TopUpPendingID`).

**Gerbang full — `core/ledger.go:1845-1850`, `validateAndAddLeaseCancel`:**

```
oldBal := l.getAssetBalanceOverlay(b.Account, "XUSD")
expectedBal := oldBal + leaseBlock.Amount   // biaya BASE saja
if b.Balance != expectedBal {
    return fmt.Errorf("balance mismatch: expected %d, got %d", expectedBal, b.Balance)
}
```

Perhatikan: `pending` sempat di-fetch di fungsi ini tapi hanya dicek nil
(`"no pending send for lease"`), jumlahnya tidak pernah dipakai. Satu-satunya
penyebut refund adalah `leaseBlock.Amount`.

**Jalur yang mempertemukan keduanya — `core/ledger.go`:**

- `addBlock` (jalur konflik): sibling terdeteksi → `ValidateStagedBlock(b, parentBalance)`
  (di sini `parentBalance` \= saldo XUSD pada blok parent, sama dengan `oldBal`
  pada gerbang full — keduanya saldo sebelum cancel).
- `swapBlockLocked` (promosi pemenang): `dispatchValidateAndAdd(newBlock, true)` →
  `validateAndAddLeaseCancel`.

Karena `parentBalance == oldBal` pada titik yang sama, kesetaraan kedua rumus
mensyaratkan `pending.Amount == leaseBlock.Amount`, yang hanya benar bila lease
BELUM pernah di-renew. Dengan ≥1 renewal, mustahil.

## Dampak

- **Skenario pemicu:** lease di-renew ≥1x, lalu ada blok sibling di posisi
  cancel (double-sign oleh consumer sendiri, retry client yang menandatangani
  dua versi cancel, atau quorum multisig yang berbeda menandatangani cancel
  berbeda). Sibling itu sah secara tanda tangan — konfliknya nyata.
- **Akibat:** konflik di posisi itu tidak pernah bisa dimenangkan oleh cancel.
  `SwapBlock` selalu gagal (`ErrWinnerFullValidation`). Akun tetap
  conflict-locked; escrow (base \+ semua renewal) tidak bisa dicairkan lewat
  cancel sampai konflik selesai dengan cara lain. Satu-satunya jalan keluar
  adalah force-settle setelah expiry \+ grace \+ gap (yang memakai
  `pending.Amount` penuh dan konsisten di kedua gerbang) — jadi dana tidak
  hilang permanen, tapi cancel sebagai jalan keluar cepat mati total.
- **Bukan:** ini BUKAN soal refund yang kurang (itu XE-0067) dan BUKAN soal
  overflow (itu XE-0661 / XE-2636). Ini murni divergensi rumus antara dua
  gerbang validasi untuk tipe blok yang sama.

## Perbaikan yang disarankan

Samakan rumusnya di satu sisi (pilih salah satu, konsisten dengan niat desain):

- Opsi A (refund penuh — konsisten dengan force-settle yang memakai
  `pending.Amount`): ubah `validateAndAddLeaseCancel` menjadi
  `expectedBal := oldBal + pending.Amount`, dan samakan pula
  `commit` refund-nya. Catatan: ini mengubah perilaku refund cancel
  (saat ini base-only, lihat XE-0067) — perlu diputuskan bersamaan.
- Opsi B (refund base — pertahankan perilaku saat ini): ubah
  `ValidateStagedBlock` case `BlockLeaseCancel` menjadi
  `expectedBal := parentBalance + leaseBlock.Amount` (baca lease block
  lewat `l.GetBlock(b.Source)` seperti yang dilakukan gerbang full).

## PoC (terverifikasi)

Setup: `MemStore` \+ `Ledger` (difficulty 0, 1 timekeeper, cert multiplier 1000,
`ExpiresAt` jauh). Consumer didanai 200.000 XUSD, provider 100.000 XUSD.
Lease 1 vCPU / 1024 MB / 10 GB / 3600 dtk → cost 40.000 (dihitung
`LeaseCost`); accept (stake 0, `LeaseStakeDivisor == 0`); renew \+3600 dtk
→ cost 40.000 lagi; escrow pending \= 80.000; saldo consumer \= 120.000.

Perintah (Go 1.23.4 di `/tmp/go/bin/go`, cache dipindah karena `/tmp` penuh):

```
export PATH=/tmp/go/bin:$PATH
export GOCACHE=$HOME/.cache/go-build GOMODCACHE=$HOME/go/pkg/mod GOTMPDIR=$HOME/.cache/go-tmp
go test -vet=off ./core/ -run 'TestPocCancel' -v -count=1
```

Hasil aktual (11 Nov 2026):

```
=== RUN   TestPocCancelStagedVsFullMismatch
    base cost=40000 renew cost=40000 pending escrow=80000 consumer XUSD=120000
    staged rejects base-refund cancel (expected): staged lease_cancel: balance mismatch: expected 200000, got 160000
    full admission rejects full-refund cancel (expected): balance mismatch: expected 160000, got 200000
    MUTUAL EXCLUSIVITY PROVEN: no cancel satisfies both gates for a renewed lease
--- PASS: TestPocCancelStagedVsFullMismatch (0.07s)
=== RUN   TestPocCancelConflictNeverResolves
    SwapBlock fails as predicted: SwapBlock: winner failed full validation 3ca54a628543..., loser kept: balance mismatch: expected 160000, got 200000
--- PASS: TestPocCancelConflictNeverResolves (0.00s)
PASS
```

Test 1 membuktikan mutual exclusivity kedua rumus pada lease yang sama.
Test 2 membuktikan ujungnya: cancel refund-penuh berhasil di-stage sebagai
kandidat konflik, tapi `SwapBlock` selalu gagal dan loser tetap menjadi tip —
konflik tidak pernah selesai lewat cancel.

Catatan PoC: pada test 1, percobaan `AddBlock(cancelFull)` yang gagal sempat
meng-unwind accept provider dulu (log `"cancel-wins over a racing accept"`).
Itu efek samping dari XE-0017 (sudah dilaporkan, bukan bagian temuan ini).

File test sementara (`core/zz_audit_cancel_poc_test.go`, package `core_test`)
sudah dihapus dari repo setelah run; salinan lengkapnya di bawah agar bisa
direproduksi — simpan sebagai `core/zz_audit_cancel_poc_test.go` lalu jalankan
perintah di atas.

```
package core_test

import (
	"github.com/xeprotocol/xe/core"
)

// TEMPORARY PoC test for the ledger audit (delete after run).
// Proves: for a RENEWED lease, no lease_cancel block can satisfy BOTH
// ValidateStagedBlock (expects oldBal + pending.Amount, i.e. base+renewals)
// and validateAndAddLeaseCancel (expects oldBal + leaseBlock.Amount, base only).
import (
	"strings"
	"testing"
	"time"

	"github.com/xeprotocol/xe/store"
)

type pocEnv struct {
	l            *core.Ledger
	ms           *store.MemStore
	consumer     *core.KeyPair
	provider     *core.KeyPair
	tk           *core.KeyPair
	certHash     string
	leaseHash    string
	consumerXUSD uint64 // balance after renew
	baseCost     uint64
	renewCost    uint64
}

func pocNow() int64 { return time.Now().UnixNano() }

func pocSetup(t *testing.T) *pocEnv {
	t.Helper()
	consumer, err := core.GenerateKeyPair()
	if err != nil {
		t.Fatal(err)
	}
	provider, err := core.GenerateKeyPair()
	if err != nil {
		t.Fatal(err)
	}
	tk, err := core.GenerateKeyPair()
	if err != nil {
		t.Fatal(err)
	}
	ms := store.NewMemStore()
	certHash := strings.Repeat("ab", 32)
	future := pocNow() + int64(365*24*time.Hour)
	provAddr := provider.Address()
	l := core.NewLedger(ms, core.LedgerConfig{
		Difficulty:      0,
		TimestampWindow: 0,
		TimekeeperConfigFn: func() *core.TimekeeperConfig {
			return &core.TimekeeperConfig{Keys: []string{tk.PubKeyHex()}, Threshold: 1}
		},
		CertificateLookupFn: func(hash string) *core.CertificateInfo {
			if hash != certHash {
				return nil
			}
			return &core.CertificateInfo{Provider: provAddr, ExpiresAt: future, PriceMultiplierMilli: 1000}
		},
	})
	e := &pocEnv{l: l, ms: ms, consumer: consumer, provider: provider, tk: tk, certHash: certHash}

	// Fund consumer 200_000 XUSD and provider 100_000 XUSD via SeedAssetForTesting.
	fund := func(kp *core.KeyPair, amount uint64) string {
		t.Helper()
		b := &core.Block{Type: core.BlockMint, Account: kp.Address(), Previous: "0",
			Balance: amount, Amount: amount, Asset: "XUSD", Timestamp: pocNow()}
		if err := core.SignBlock(b, kp); err != nil {
			t.Fatal(err)
		}
		if err := l.SeedAssetForTesting(b); err != nil {
			t.Fatalf("seed %s: %v", kp.Address()[:8], err)
		}
		return b.Hash
	}
	fund(consumer, 200_000)
	fund(provider, 100_000)

	// Lease: 1 vCPU, 1024 MB, 10 GB, 3600s @ multiplier 1000.
	cost, err := core.LeaseCost(1, 1024, 10, 3600, 1000)
	if err != nil {
		t.Fatal(err)
	}
	e.baseCost, e.renewCost = cost, cost
	lease := &core.Block{Type: core.BlockLease, Account: consumer.Address(), Previous: l.GetChain(consumer.Address())[0].Hash,
		Balance: 200_000 - cost, Amount: cost, Asset: "XUSD", Destination: provider.Address(),
		VCPUs: 1, MemoryMB: 1024, DiskGB: 10, Duration: 3600,
		CertificateHash: certHash, Timestamp: pocNow() + int64(time.Second)}
	if err := core.SignBlock(lease, consumer); err != nil {
		t.Fatal(err)
	}
	if err := l.AddBlock(lease); err != nil {
		t.Fatalf("lease: %v", err)
	}
	e.leaseHash = lease.Hash

	// Accept (stake 0: LeaseStakeDivisor == 0).
	start := pocNow()
	att, err := core.SignAttestation(lease.Hash, start, tk)
	if err != nil {
		t.Fatal(err)
	}
	accept := &core.Block{Type: core.BlockLeaseAccept, Account: provider.Address(),
		Previous: l.GetChain(provider.Address())[0].Hash,
		Balance: 100_000, Amount: 0, Asset: "XUSD", Source: lease.Hash,
		CertificateHash: certHash, LockedR: 2000,
		Attestations: []core.TimekeeperAttestation{*att}, Timestamp: pocNow() + 2*int64(time.Second)}
	if err := core.SignBlock(accept, provider); err != nil {
		t.Fatal(err)
	}
	if err := l.AddBlock(accept); err != nil {
		t.Fatalf("accept: %v", err)
	}

	// Renew +3600s. Escrow pending becomes base+renew.
	renewTime := pocNow()
	att2, err := core.SignAttestation(lease.Hash, renewTime, tk)
	if err != nil {
		t.Fatal(err)
	}
	renew := &core.Block{Type: core.BlockLeaseRenew, Account: consumer.Address(), Previous: lease.Hash,
		Balance: 200_000 - cost - cost, Amount: cost, Asset: "XUSD", Source: lease.Hash,
		Duration: 3600, CertificateHash: certHash, LockedR: 2000,
		Attestations: []core.TimekeeperAttestation{*att2}, Timestamp: pocNow() + 3*int64(time.Second)}
	if err := core.SignBlock(renew, consumer); err != nil {
		t.Fatal(err)
	}
	if err := l.AddBlock(renew); err != nil {
		t.Fatalf("renew: %v", err)
	}
	e.consumerXUSD = 200_000 - cost - cost
	return e
}

func (e *pocEnv) cancel(t *testing.T, balance uint64) *core.Block {
	t.Helper()
	b := &core.Block{Type: core.BlockLeaseCancel, Account: e.consumer.Address(),
		Previous: e.leaseHash, // placeholder, fixed by caller via frontier
		Balance: balance, Asset: "XUSD", Source: e.leaseHash,
		Timestamp: pocNow() + 5*int64(time.Second)}
	// Previous must be the consumer frontier (the renew block).
	chain := e.l.GetChain(e.consumer.Address())
	b.Previous = chain[len(chain)-1].Hash
	if err := core.SignBlock(b, e.consumer); err != nil {
		t.Fatal(err)
	}
	return b
}

func TestPocCancelStagedVsFullMismatch(t *testing.T) {
	e := pocSetup(t)
	pending, err := e.ms.GetPendingSend(e.leaseHash)
	if err != nil || pending == nil {
		t.Fatalf("pending: %v %v", pending, err)
	}
	t.Logf("base cost=%d renew cost=%d pending escrow=%d consumer XUSD=%d",
		e.baseCost, e.renewCost, pending.Amount, e.consumerXUSD)
	if pending.Amount != e.baseCost+e.renewCost {
		t.Fatalf("expected escrow %d, got %d", e.baseCost+e.renewCost, pending.Amount)
	}

	// Cancel built per the STAGED formula: oldBal + full pending.
	cancelFull := e.cancel(t, e.consumerXUSD+pending.Amount)
	// Cancel built per the FULL formula: oldBal + base cost only.
	cancelBase := e.cancel(t, e.consumerXUSD+e.baseCost)

	// 1. Staged gate: full-refund passes, base-refund fails.
	if err := e.l.ValidateStagedBlock(cancelFull, e.consumerXUSD); err != nil {
		t.Fatalf("staged should ACCEPT full-refund cancel: %v", err)
	}
	if err := e.l.ValidateStagedBlock(cancelBase, e.consumerXUSD); err == nil {
		t.Fatalf("staged should REJECT base-refund cancel, but accepted it")
	} else {
		t.Logf("staged rejects base-refund cancel (expected): %v", err)
	}

	// 2. Full gate (direct admission): full-refund fails, base-refund succeeds.
	// NOTE: the failed cancelFull attempt unwinds the provider accept first
	// (cancel-wins before validation) — that side effect is XE-0017, already
	// reported, and is NOT part of this finding.
	if err := e.l.AddBlock(cancelFull); err == nil {
		t.Fatalf("full admission should REJECT full-refund cancel, but accepted it")
	} else {
		t.Logf("full admission rejects full-refund cancel (expected): %v", err)
	}
	if err := e.l.AddBlock(cancelBase); err != nil {
		t.Fatalf("full admission should ACCEPT base-refund cancel: %v", err)
	}
	t.Logf("MUTUAL EXCLUSIVITY PROVEN: no cancel satisfies both gates for a renewed lease")
}

func TestPocCancelConflictNeverResolves(t *testing.T) {
	e := pocSetup(t)
	pending, _ := e.ms.GetPendingSend(e.leaseHash)
	ch := e.l.GetChain(e.consumer.Address())
	renewHash := ch[len(ch)-1].Hash

	// Sibling block S1 (a 1-unit send) becomes the canonical tip at the
	// cancel's position (Previous == renew block).
	send := &core.Block{Type: core.BlockSend, Account: e.consumer.Address(), Previous: renewHash,
		Balance: e.consumerXUSD - 1, Amount: 1, Asset: "XUSD",
		Destination: e.provider.Address(), Timestamp: pocNow() + 4*int64(time.Second)}
	if err := core.SignBlock(send, e.consumer); err != nil {
		t.Fatal(err)
	}
	if err := e.l.AddBlock(send); err != nil {
		t.Fatalf("send S1: %v", err)
	}

	// cancelFull stages fine as the conflict candidate...
	cancelFull := &core.Block{Type: core.BlockLeaseCancel, Account: e.consumer.Address(), Previous: renewHash,
		Balance: e.consumerXUSD + pending.Amount, Asset: "XUSD", Source: e.leaseHash,
		Timestamp: pocNow() + 5*int64(time.Second)}
	if err := core.SignBlock(cancelFull, e.consumer); err != nil {
		t.Fatal(err)
	}
	if err := e.l.AddBlock(cancelFull); err != nil {
		t.Fatalf("cancelFull should STAGE as conflict candidate: %v", err)
	}
	if e.l.GetConflict(e.consumer.Address(), renewHash) == nil {
		t.Fatalf("expected a recorded conflict at renew frontier")
	}

	// ...but promoting it as the winner always fails full validation.
	if err := e.l.SwapBlock(e.consumer.Address(), send.Hash, cancelFull.Hash, cancelFull); err == nil {
		t.Fatalf("SwapBlock should FAIL (winner fails full validation), but it succeeded")
	} else {
		t.Logf("SwapBlock fails as predicted: %v", err)
	}
	// Loser kept, account stays conflict-locked: the cancel can never win.
	tip := e.l.GetChain(e.consumer.Address())
	if tip[len(tip)-1].Hash != send.Hash {
		t.Fatalf("expected loser S1 to stay tip")
	}
	_ = pending
}
```

## Catatan cek-duplikat (grep `tickets.md`)

Tiket-tiket berikut diperiksa dan dinyatakan BERBEDA / sudah tercakup sehingga
temuan ini bukan duplikatnya:

- **XE-0067** — "LeaseCancel after LeaseRenew refunds only the base cost —
  renewal top-up funds vanish". Itu soal JUMLAH refund (dana hilang).
  Temuan ini soal DIVERGENSI RUMUS antara dua gerbang validasi (staged vs
  full) yang membuat cancel tidak bisa menang konflik. Akar masalah, lokasi
  kode, dan dampak berbeda (liveness konflik vs kehilangan dana).
- **XE-5241 / XE-5859 / XE-5867** — varian XE-0067 yang sama (refund base-only).
- **XE-0661** — overflow `uint64` di `validateAndAddLeaseCancel` (gerbang full).
  Temuan ini tidak memakai overflow sama sekali.
- **XE-2636** — `ValidateStagedBlock` lease\_cancel / force-settle kekurangan
  cek overflow. Temuan ini soal rumus saldo (pending vs base), bukan overflow.
- **XE-0028** — "staged-block validation accepts lease blocks that full
  admission rejects, arming quorum decoys" (umum, soal lease block yang lolos
  staged). Temuan ini spesifik dan dua arah: cancel refund-base DITOLAK
  staged padahal DITERIMA full, dan cancel refund-penuh DITERIMA staged tapi
  DITOLAK full — dengan rumus dan baris yang persis, plus bukti konflik
  tidak pernah bisa resolve. Bukan sekadar "staged lebih longgar".
- **XE-4145** — "staged-valid / full-invalid winner stalls a chain position"
  (mekanisme quorum-withhold umum). Temuan ini memberi SATU penyebab
  deterministik yang konkret (rumus cancel) yang selama ini tidak bernama.
- **XE-2613** — "conflicting lease\_renew can never be staged" (case
  `BlockLeaseRenew` hilang dari `ValidateStagedBlock`). Beda tipe blok, beda
  mekanisme (case hilang vs rumus bertentangan).
- **XE-0017** — "Invalid lease\_cancel still unwinds provider accept".
  Efek samping itu muncul di log PoC dan eksplisit DIKECUALIKAN dari temuan ini.
- **XE-0105** — race merge renew/settle antar node. Temuan ini lokal dan
  deterministik (bukan race), dan tidak melibatkan settle.
- **XE-4066 / XE-6375** — staleness escrow saat reorg / unwind renew pasca
  settle. Beda akar masalah (overlay `ReducePendingID` / urutan unwind).

## Ruang lingkup yang diperiksa (tidak ada temuan tambahan yang difile-kan)

File area dibaca menyeluruh: `core/ledger.go` (3.093 baris),
`core/multisig.go`, `core/lease_renew.go`, `core/spendable.go`,
`core/supply.go`, `core/mint.go`, `core/amount.go`, `core/rollback.go`,
`core/retryable.go`, `node/lease_renew.go`, plus `core/store.go`,
`core/cascade_commit.go`, `core/crypto.go`, `core/encoding.go`,
`core/attestation.go`, `core/types.go`, `store/mem_store.go`,
`store/badger_store.go` (bagian Commit/Undo) untuk verifikasi.

Kandidat yang diperiksa lalu DIBUANG (alasan di laporan akhir ke parent):
ExpiresAt\=\=0 di lease\_accept (XE-2615); IsSpendingOp omits lease ops
(XE-4002/XE-5926/XE-2614/XE-3058); SpendableBalances stake (XE-3430/XE-2375);
supply auditor renew/genesis (XE-4023/XE-4779/XE-2754); VerifyMultisig
`pk[:12]` panic (XE-0096) — varian nil-keyset ternyata TIDAK reachable
(`MarshalBlockCanonical` menolak keyset nil sebelum `VerifyBlock`);
`MintForTesting` tanpa cek minter — tidak ada caller non-test di repo;
renew tidak pegang lease-lock — diserialisasi oleh cek `ExpectLease*` di
commit store (aspek antar-node \= XE-0105); underflow `ReducePending` di
MemStore — tidak ada interleaving reachable yang terbukti (jalur normal
menjaga reduce ≤ pending).

### Thread

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

Thanks. This is the same finding as an earlier report that is not public, 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-13256 and says what differs; it is read like any other.
