Skip to content

feat: Oracle Batch Result Submission Preview and Progress - #1747

Merged
Olowodarey merged 1 commit into
Arena1X:mainfrom
sammax34:oracle
Aug 27, 2026
Merged

feat: Oracle Batch Result Submission Preview and Progress#1747
Olowodarey merged 1 commit into
Arena1X:mainfrom
sammax34:oracle

Conversation

@sammax34

@sammax34 sammax34 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

. Leaderboard history pagination (leaderboard.service.ts, leaderboard.controller.ts, dto/leaderboard-history.dto.ts)

  • GET /leaderboard/history already had offset pagination; hardened it with a @max(100) validator on limit (previously only clamped server-side, not validated).
  • getHistoryForAddress (the ?address= path) previously returned an unbounded raw array with no pagination or total count — now takes page/limit, caps at 100, and returns { data, total, page, limit } via a new PaginatedAddressHistoryResponse DTO.
  • Tests added proving pages are non-overlapping, correctly ordered (by snapshot_date DESC, rank ASC), and that oversized limits get capped at 100 — for both the main history query and the per-address query.

. Oracle submission authorization (oracle/entities/oracle-assignment.entity.ts, new migration, oracle/guards/oracle-assignment.guard.ts, oracle.controller.ts, oracle.module.ts)

  • Found that submissions were only authenticated (via WebhookAuthGuard's shared HMAC secret) but never authorized against a specific match/event — any valid signature could report a result for any match.
  • Added an oracle_assignments table mapping a data_source to the one event it's allowed to report for (is_active flag to revoke without deleting history).
  • New OracleAssignmentGuard runs after WebhookAuthGuard on POST /oracle/webhooks/match-result: resolves the match's event, rejects unregistered data sources and cross-event submissions with a clear 403, and defers to existing validation/404 handling for malformed bodies or unknown matches.
  • 6 new guard tests cover: missing fields, unknown match, unauthorized submitter, cross-event rejection, and the happy path.

Full test suite (105 suites / 1367 tests) passes, and tsc --noEmit shows the same 50 pre-existing (unrelated) errors as the main baseline — no new type errors introduced.

closes #1526
closes #1612
closes #1615
closes #1613

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@sammax34 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview Aug 27, 2026 7:27am

@Olowodarey
Olowodarey merged commit 6d997ca into Arena1X:main Aug 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants