Skip to content

audit(2026-06-13): forensic reality audit + cost & observability fixes#125

Merged
Satelink-Protocol merged 1 commit into
mainfrom
worktree-audit-2026-06-13
Jun 13, 2026
Merged

audit(2026-06-13): forensic reality audit + cost & observability fixes#125
Satelink-Protocol merged 1 commit into
mainfrom
worktree-audit-2026-06-13

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Owner

Forensic Reality Audit — 2026-06-13

Evidence-based audit (every claim cites file:line / curl / git). Full reports in docs/audit-2026-06-13/.

Key findings (reality vs docs)

  • Epoch revenue is phantom. rpc_gateway.js:247/275 records 0.00003 USDT/call for all traffic; creditGate (rpc_gateway.js:175) only charges x-wallet-address requests and 0 wallets have deposited → no cash collected. 0 on-chain settlement tx ever (/api/settlement/history: every txHash:null).
  • Settlement blocker is NOT a missing signer (contra CLAUDE.md §4). Anchor reports configured:true; the real gate is total_revenue_usdt >= 1.0 (settlement_anchor_job.js:100) — all 4008 epochs are ~0.0025 USDT dust, and the promised dust-rollup code does not exist.
  • Traffic is scanner noise: 1121 active IPs (not 445); 2 IPs = 59% of 610k calls. Upstash Redis at its 500k/day cap → rate-limit degrades to in-memory.
  • Repo hygiene: .gitignore already comprehensive; no build artifacts or secrets committed (audit brief's premise was false).
  • 3 conflicting deploy configs (root railway.json vs apps/api/railway.json vs nixpacks.toml).

Fixes in this PR

  1. start-cloud.sh — Paperclip default model claude-sonnet-4-6claude-haiku-4-5-20251001 (~12× cheaper; Sonnet retained as largeContextModel). Takes effect on next Paperclip rebuild.
  2. rpc_billing.js — record chain/method/source into revenue_events_v2 INSERT (column existed but was never written → traffic was unclassifiable).

Single next action to Customer Zero

Run one wallet-authenticated paid call end-to-end (deposit ≥1 USDT → DepositListener credits credit_balancesPOST /rpc/polygon with x-wallet-address → verify deduction + a settled epoch). See CURRENT_STATE.md.

⚠️ Note: merging triggers a Paperclip Railway rebuild (model switch) and changes the production billing INSERT — review before merge.

🤖 Generated with Claude Code

Forensic findings (evidence in docs/audit-2026-06-13/):
- Epoch revenue is PHANTOM: rpc_gateway records 0.00003 USDT/call for all
  traffic (rpc_gateway.js:247/275); creditGate only charges x-wallet-address
  requests (credit_gate.js:44) and 0 wallets have deposited. No cash collected.
- Settlement never fires: anchor is configured:true (signer IS set, contra
  CLAUDE.md), but all 4008 epochs are below the 1 USDT threshold
  (settlement_anchor_job.js:100); no dust-rollup code exists. 0 on-chain tx.
- Traffic is scanner noise: 1121 active IPs (not 445), 2 IPs = 59% of 610k
  calls; Upstash Redis at 500k/day cap.
- .gitignore already comprehensive; no build artifacts or secrets in git.

Fixes:
- start-cloud.sh: Paperclip default model claude-sonnet-4-6 -> haiku-4-5
  (~12x cheaper; sonnet retained as largeContextModel). Effective next rebuild.
- rpc_billing.js: record chain/method/source into revenue_events_v2 INSERT
  (method column existed but was never written -> traffic was unclassifiable).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Satelink 🟢 Ready View Preview Jun 13, 2026, 8:47 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Jun 13, 2026 8:45am

@Satelink-Protocol Satelink-Protocol merged commit 04fc972 into main Jun 13, 2026
10 of 11 checks passed
@Satelink-Protocol Satelink-Protocol deleted the worktree-audit-2026-06-13 branch June 13, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant