Skip to content

feat: migrate anti-abuse oracle from apps to pedalboard#29

Merged
dylanjeffers merged 3 commits into
mainfrom
feat/anti-abuse-oracle-migration
May 15, 2026
Merged

feat: migrate anti-abuse oracle from apps to pedalboard#29
dylanjeffers merged 3 commits into
mainfrom
feat/anti-abuse-oracle-migration

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Brings the anti-abuse oracle (AAO) service over from apps/packages/discovery-provider/plugins/pedalboard/apps/anti-abuse-oracle into pedalboard, the same way solana-relay lives here. Source files are updated to parity with the apps version; the apps copy is left in place until this image is deployed and verified.

  • apps/anti-abuse-oracle/src/server.tsx — Hono routes (/attestation/check, POST /attestation/:handle, block/unblock admin) + admin UI on port 6003
  • apps/anti-abuse-oracle/src/actionLog.ts — discovery DB queries + scoring (now includes has_profile_picture, queryUsers)
  • apps/anti-abuse-oracle/src/identity.ts — fingerprint/email lookups from identity DB (now also exposes useEmail)
  • apps/anti-abuse-oracle/src/sdk.ts — new SDK wrapper for getUserByHandle
  • apps/anti-abuse-oracle/src/config.tsEnvironment type for SDK env mapping
  • apps/anti-abuse-oracle/package.json — bumped deps to mirror apps: @audius/sdk@5.0.0 + @audius/sdk-legacy (npm:@audius/sdk@5.0.0 alias), @solana/web3.js, bn.js, envalid

Service is already registered in .github/config/services.json and the root docker:anti-abuse-oracle script, so the multiarch image build picks it up automatically.

Follow-ups (separate PRs)

  • apps repo: apps/packages/identity-service/src/config.js:689 defaults aaoEndpoint to http://anti-abuse-oracle_anti_abuse_oracle_1:8000. Once the pedalboard image is deployed, this needs to point at the new k8s Service hostname.
  • audius-k8s: Deployment/Service/Pulumi wiring for the pedalboard image (separate PR).
  • apps repo: Delete apps/packages/discovery-provider/plugins/pedalboard/apps/anti-abuse-oracle/ after this is verified in prod.

Test plan

  • CI: amd64 + arm64 image builds succeed for audius/anti-abuse-oracle:<sha>
  • CI: lint passes (turbo run lint --filter=@pedalboard/anti-abuse-oracle)
  • Local: npm run docker:anti-abuse-oracle builds clean
  • Local: run the built image with audius_db_url + IDENTITY_DB_URL and hit /attestation/check?wallet=…; should return {data: "allowed"} or {data: "blocked"}
  • Local: hit /attestation/ui with basic auth; recent claims table renders
  • Local: POST /attestation/<handle> with {challengeId, challengeSpecifier, amount} returns a signed attestation hex string

🤖 Generated with Claude Code

dylanjeffers and others added 3 commits May 13, 2026 14:05
Track listens are no longer recorded on-chain. Removes the listen endpoint,
rate limiting, Solana instruction builders, and all related config/env vars.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Brings the AAO service to parity with the version in
apps/packages/discovery-provider/plugins/pedalboard/apps/anti-abuse-oracle:

- Adds sdk.ts wrapper around @audius/sdk for getUserByHandle lookups
- Adds useEmail + queryUsers to identity/actionLog so the UI can show
  the user's email and resolve fingerprint cohort handles
- Adds block-user / unblock-user admin endpoints + UI (ensures the
  anti_abuse_blocked_users table at boot)
- Renders has_profile_picture in the score breakdown
- HashId.parse on SDK user.id when computing normalized score
- Bumps deps to match apps version: @audius/sdk@5.0.0 +
  @audius/sdk-legacy alias, adds @solana/web3.js, bn.js, envalid

The apps copy is left in place until the pedalboard image is deployed
and verified. Follow-up: update aaoEndpoint default in
apps/packages/identity-service/src/config.js (currently points to the
old docker-compose hostname http://anti-abuse-oracle_anti_abuse_oracle_1:8000).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`sdk.users.getUserByHandle` returns `{ data: User }` in @audius/sdk v5,
not `{ data: User[] }` as in legacy. Drop the array indexing so the
build's tsc step succeeds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dylanjeffers dylanjeffers merged commit 9a8f194 into main May 15, 2026
35 checks passed
@dylanjeffers dylanjeffers deleted the feat/anti-abuse-oracle-migration branch May 15, 2026 20:48
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