{"id":"XE-13383","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"540","source_url":"https://github.com/xeprotocol/xe/issues/540","reporter_id":2,"title":"[Core] Cross-block transitions accept timestamps predating causal predecessors across live and staged ledger validation","area":"leasing-ledger","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:14.531935+00:00","updated_at":"2026-11-20T13:01:18.721062+00:00","source_created_at":"2026-11-13T06:29:07+00:00","told_at":"2026-11-20T13:00:19+00:00","status_changed_at":"2026-11-20T12:59:46.057792+00:00","url":"https://bounty.xe.network/XE-13383","body":"### Summary\nCross-block transitions in `core/ledger.go` and `core/lease_renew.go` validate per-account sequential timestamps (`b.Timestamp >= prev.Timestamp`), but do not enforce causal predecessor timestamp monotonicity across accounts or active lease state in either direct ledger addition (`validateAndAdd*`) or staged conflict evaluation (`ValidateStagedBlock`).\n\n### Impact & Affected Transitions\n1. **`BlockReceive` (`validateAndAddReceive` / `ValidateStagedBlock`)**: An account can record a `receive` block with `b.Timestamp < src.Timestamp` (`send` block timestamp), violating cross-account causal ordering.\n2. **`BlockLeaseAccept` & `BlockLeaseCancel`**: Can record `b.Timestamp < leaseBlock.Timestamp`.\n3. **`BlockLeaseRenew`**: Can record `b.Timestamp < max(lease.StartTime, leaseBlock.Timestamp, renewals)`; additionally, `ValidateStagedBlock` previously omitted `BlockLeaseRenew` balance and causal validation.\n4. **`BlockLeaseSettle` & `BlockLeaseForceSettle`**: Enforce wall-clock / expiry bounds against `StartTime` + duration, but if `leaseBlock.Timestamp` or a renewal timestamp exceeds those values, transitions could still carry timestamps predating their causal predecessor.\n\n### Rule-First Fix\n- **Rule**: Any block referencing or transitioning a causal predecessor (via `b.Source` or active lease state) must carry `b.Timestamp >= predecessor.Timestamp` across both direct addition (`validateAndAdd*`) and staged conflict evaluation (`ValidateStagedBlock`).\n- **Verification**: `go test -count=1 ./...` and `go vet ./...` pass with 6 unit tests covering live and staged causal rejection across all 6 block transitions.","patch_refs":[{"id":575,"repo":"xeprotocol/xe","kind":"pr","ref":"541","title":"core: enforce causal predecessor timestamps on all cross-block transitions","url":"https://github.com/xeprotocol/xe/pull/541","note":"","state":"open","author":"Khanhtnq","added_by":"desk","created_at":"2026-11-14T20:42:20.278721+00:00"},{"id":744,"repo":"xeprotocol/xe","kind":"pr","ref":"916","title":"fix(xe): core--cross-block-transitions (fixes #540)","url":"https://github.com/xeprotocol/xe/pull/916","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-20T01:07:42.091912+00:00"}],"thread":[{"id":3147,"source":"github","source_ref":"6845942952","author":"Khanhtnq","team":false,"body":"Fix PR submitted in #541.","created_at":"2026-11-13T06:29:10+00:00"},{"id":14112,"source":"github","source_ref":"7040168068","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-13383 and says what differs; it is read like any other.","created_at":"2026-11-20T13:00:19+00:00"}]}