Bounty
XE-13383 · Bounty

[Core] Cross-block transitions accept timestamps predating causal predecessors across live and staged ledger validation

Closed · duplicate — xe#540 filed 2026-11-13 06:29 UTC by Khanhtnq

Report

Summary

Cross-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).

Impact & Affected Transitions

  1. BlockReceive (validateAndAddReceive / ValidateStagedBlock): An account can record a receive block with b.Timestamp < src.Timestamp (send block timestamp), violating cross-account causal ordering.
  2. BlockLeaseAccept & BlockLeaseCancel: Can record b.Timestamp < leaseBlock.Timestamp.
  3. BlockLeaseRenew: Can record b.Timestamp < max(lease.StartTime, leaseBlock.Timestamp, renewals); additionally, ValidateStagedBlock previously omitted BlockLeaseRenew balance and causal validation.
  4. 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.

Rule-First Fix

  • 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).
  • Verification: go test -count=1 ./... and go vet ./... pass with 6 unit tests covering live and staged causal rejection across all 6 block transitions.

Thread

Khanhtnq2026-11-13 06:29 UTCgithub

Fix PR submitted in #541.

Joseph Denneteam2026-11-20 13:00 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-13383 and says what differs; it is read like any other.