fix(api): clamp postgres extrinsics pagination#4846
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-data-api | 139e0ed | Commit Preview URL Branch Preview URL |
Jul 11 2026, 06:43 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4846 +/- ##
=======================================
Coverage 97.71% 97.71%
=======================================
Files 162 162
Lines 18587 18587
Branches 6939 6939
=======================================
Hits 18162 18162
Misses 59 59
Partials 366 366
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-11 17:10:23 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Motivation
limit/offsetparams cannot trigger deep OFFSET scans.Description
/api/v1/extrinsicshandler inworkers/data-api.mjsto use the block-explorer pagination profile by replacingclampLimit(...)withclampBlockLimit(...), preserving the shared offset clamp.tests/data-api.test.mjsthat requests oversizedlimitandoffsetand asserts the SQL-bound values contain the clampedBLOCK_PAGINATION.maxLimitandMAX_OFFSET(and not the raw huge values).workers/data-api.mjs,tests/data-api.test.mjs.Testing
npm test -- tests/data-api.test.mjs, and all tests in that file passed.npm run format:check -- tests/data-api.test.mjs workers/data-api.mjs, and Prettier reported no style issues.limit/offsetare clamped before the Postgres query is composed.Codex Task