Files
neuron-tai/.scratch/alpha-hardening/issues/15-h1-commutative-forfeit.md
D.Popov 68e057209c Add alpha-hardening ADRs and issue plan from pre-release audit.
Lock alpha scope, tracker auth, TOPLOC fraud verification, and deferred multi-tracker money-path work; supersede legacy fraud issues with ADR-0018.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 23:12:09 +03:00

28 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Status: ready-for-human
# 15 — H1: Commutative forfeit event ordering (deferred)
## What to build
Define deterministic ordering when `forfeit`, `charge`, and `payout` events replicate concurrently. Forfeit snapshots amount at creation (~287) but apply order can desync pending balances under gossip.
**Code refs:**
- `packages/tracker/meshnet_tracker/billing.py``forfeit_pending` (~280292), `_apply_locked` forfeit branch (~345349)
- `packages/tracker/meshnet_tracker/billing.py``_pending_since.setdefault` (~324), wallet bind direct overwrite (~351)
## Acceptance criteria
- [ ] Documented commit order: charges before forfeit before payout for same wallet epoch
- [ ] Forfeit events carry pending snapshot or `(term, index)` for tie-break
- [ ] `setdefault` replaced with explicit merge rules on out-of-order apply
- [ ] Property tests under shuffled event delivery
## ADR links
- [ADR-0019](../../docs/adr/0019-money-path-consistency-multi-tracker.md) §4
## Blocked by
- `13-c3-c4-consensus-gated-settlement.md`