feat: USDT reward system — billing ledger, devnet treasury, settlement loop, forfeiture PoW, tracker dashboard (US-030…US-035, ADR-0015)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -704,12 +704,13 @@
|
||||
"Commit only this story's changes"
|
||||
],
|
||||
"priority": 30,
|
||||
"status": "open",
|
||||
"status": "done",
|
||||
"notes": "Source issue: .scratch/distributed-inference-network/issues/30-manual-route-and-hop-benchmark.md. Design decisions grilled 2026-07-01: route via body field, explicit-only benchmark trigger, auth stub, routing algorithm unchanged, persist to JSON file.",
|
||||
"dependsOn": [
|
||||
"US-014",
|
||||
"US-019"
|
||||
]
|
||||
],
|
||||
"completionNotes": "Pinned routes: optional \"route\": [node_id,...] in POST /v1/chat/completions (400 on unknown/invalid ids; absent field unchanged). POST /v1/benchmark/hop-penalty + GET /v1/benchmark/results, both auth-gated (non-empty Authorization). Fans out to 1/2/3-node routes via _find_pinned_route; per-hop latency derived incrementally (k-node total minus (k-1)-node total); appends to benchmark_results.json (path configurable). 6 tests in tests/test_manual_route_benchmark.py."
|
||||
},
|
||||
{
|
||||
"id": "US-031",
|
||||
@@ -745,11 +746,12 @@
|
||||
"Deterministic local adapter still works for CI without any validator"
|
||||
],
|
||||
"priority": 32,
|
||||
"status": "open",
|
||||
"status": "done",
|
||||
"notes": "Supersedes 'testnet never devnet' note in issue 06. solana-py + spl-token client libs.",
|
||||
"dependsOn": [
|
||||
"US-031"
|
||||
]
|
||||
],
|
||||
"completionNotes": "SolanaCustodialTreasury in packages/contracts/meshnet_contracts/solana_adapter.py: urllib JSON-RPC client + solders signing (installed solana-py 0.40 has no sync client), deposit parsing from jsonParsed token balances, batched payouts, devnet helpers (create_mock_usdt_mint, mint_mock_usdt). scripts/devnet_setup.py writes .env.devnet. POST /v1/wallet/register binds wallet→api_key (replicated ledger 'bind' events). Deposit watcher thread credits exactly-once via deposit-<signature> event ids. Tests: fake-treasury watcher tests + skipif-gated solana-test-validator e2e."
|
||||
},
|
||||
{
|
||||
"id": "US-033",
|
||||
@@ -764,12 +766,13 @@
|
||||
"End-to-end devnet test: fund client → run inference → observe node wallet USDT balance increase"
|
||||
],
|
||||
"priority": 33,
|
||||
"status": "open",
|
||||
"status": "done",
|
||||
"notes": "Mining-pool standard: threshold + max-interval, dust floor. Treasury key only on settlement-capable trackers.",
|
||||
"dependsOn": [
|
||||
"US-019",
|
||||
"US-032"
|
||||
]
|
||||
],
|
||||
"completionNotes": "Settlement loop in TrackerServer: leader-only (raft.is_leader; standalone settles), trigger pending≥threshold OR pending age≥settle_period, dust floor. Pending debited via payout events referencing settlement id BEFORE send; unconfirmed batches resent with same id → no double-pay. confirm via 'settlement' event with tx signature. GET /v1/billing/settlements. CLI: --settle-period/--payout-threshold/--payout-dust-floor (prod 24h/5/0.01; dev 60/0). Banned wallets skipped. 6 tests in tests/test_settlement_loop.py incl. non-leader-never-signs."
|
||||
},
|
||||
{
|
||||
"id": "US-034",
|
||||
@@ -784,11 +787,12 @@
|
||||
"Slash/forfeiture events visible in tracker logs and settlement history"
|
||||
],
|
||||
"priority": 34,
|
||||
"status": "open",
|
||||
"status": "done",
|
||||
"notes": "No stake deposit — pending balance IS the collateral. Amends ADR-0003 penalty; sampling mechanics unchanged.",
|
||||
"dependsOn": [
|
||||
"US-031"
|
||||
]
|
||||
],
|
||||
"completionNotes": "ValidatorProcess(billing=ledger) forfeits entire pending balance on divergence (same cycle as strike). Tracker POST /v1/billing/forfeit (auth stub) for remote validators: forfeit + strike + ban state. Probation wired into _bill_completed: wallets with probationary_jobs_remaining>0 have their share redirected to protocol cut; record_completed_job per request. Penalty math in packages/validator/README.md. 5 tests in tests/test_forfeiture_penalty.py; banned-never-paid asserted in settlement tests."
|
||||
},
|
||||
{
|
||||
"id": "US-035",
|
||||
@@ -802,12 +806,13 @@
|
||||
"Works against a 3-tracker hive in the two-machine LAN test setup"
|
||||
],
|
||||
"priority": 35,
|
||||
"status": "open",
|
||||
"status": "done",
|
||||
"notes": "CLI dashboard already exists from US-016; this is the web counterpart. Write ops (price config, manual settle) deferred.",
|
||||
"dependsOn": [
|
||||
"US-031",
|
||||
"US-033"
|
||||
]
|
||||
],
|
||||
"completionNotes": "GET /dashboard served from embedded dashboard.html (package-data, no build step) by any tracker. Panels: hive/leader (raft status), nodes+coverage grouped by model, client balances, node pending + protocol cut, settlement history with devnet explorer links, strikes/bans/forfeitures (GET /v1/registry/wallets + snapshot forfeits), RPM stats. 4s auto-refresh via fetch polling. 3 tests in tests/test_dashboard.py."
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user