Repository navigation
Any client can send any query #378
Description
Background
The endpoint accepts arbitrary documents from anyone. Depth (L190) and cost
(L191) limits bound how expensive a single document can be, but they do not
change the fact that an unauthenticated caller composes the query.
For a public exploratory API that is the right trade. For the paid surface — and
after L188, most of this is the paid surface — an allow-list of known documents
is the stronger position: it makes cost predictable, makes caching possible, and
removes the whole class of adversarial-query problems rather than bounding it.
What to build
- Support persisted queries: a client sends a hash, the server executes the
document it already knows. - Decide whether arbitrary documents stay allowed — in development yes, in
production it is a judgement call. Make it configurable and default to the
safer option. - A documented workflow for registering a query, or nobody will use it.
- Persisted queries make response caching tractable, since the document is known
ahead of time — note that even if you do not implement it.
Acceptance criteria
- A client can execute a registered query by hash
- Whether arbitrary documents are accepted is configurable, with a safe default
- An unknown hash is a clear error
- Registering a query is documented end to end
- Tests cover a registered hash, an unknown hash, and the arbitrary-document toggle
Drips Wave · Complexity: Intermediate · 150 points
Repo: Divinity-Labs/Lens. Node + TypeScript, Fastify, mercurius for
GraphQL at POST /graphql, Prisma on Postgres, Redis, Prometheus.
Run the tests: npm test. The tests are vitest, not jest. Running jest
here reports "66 suites, 0 tests" and means nothing. A single file is
npx vitest run src/__tests__/graphqlSubscription.test.ts.
Load test (prices) is already failing on main and has been for some
time. It is not your PR. Everything else should be green.
Read src/__tests__/graphqlSubscription.test.ts before you start. It is the
house pattern for testing this surface and it is good — it drives a real
subscription through a real server and asserts on what a client receives.
This service prices real assets on Stellar mainnet. A wrong number is worse
than a missing one, because the caller cannot tell.
Never elide an address, a contract id or a key in code, comments or test
fixtures. A previous batch shortened a contract id in an issue and five
contributors invented plausible-looking ids to fill the gap. Write it in full or
not at all.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
Activity
KingDavid9999 commentedon Oct 16, 2026
@KingDavid9999 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @KingDavid9999 to this issue.
Senia-Lovo commentedon Oct 16, 2026
@Senia-Lovo has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Senia-Lovo to this issue.
laxjovial commentedon Oct 16, 2026
@laxjovial has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @laxjovial to this issue.
VeronicDev commentedon Oct 16, 2026
@VeronicDev has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @VeronicDev to this issue.
CollinsKRO commentedon Oct 16, 2026
@CollinsKRO has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @CollinsKRO to this issue.
nonchalanttee22-lgtm commentedon Oct 16, 2026
@nonchalanttee22-lgtm has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @nonchalanttee22-lgtm to this issue.
drips-wave commentedon Oct 16, 2026
Congratulations, @nonchalanttee22-lgtm! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.
🧑💻 @nonchalanttee22-lgtm: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
drips-wave commentedon Oct 25, 2026
This issue has been completed by @nonchalanttee22-lgtm as part of the Stellar Wave Program's 10th Wave 🥳
😎 @nonchalanttee22-lgtm: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
Miracle656 commentedon Oct 25, 2026
Reopening — this was closed automatically when #478 merged, but #478 does not deliver it.
That PR routes price subscriptions per pair (#373) and is good work. It adds nothing that restricts which documents a client may send: there is no persisted-query mechanism and no operation allow-list in
src/api/graphql.ts, and the new.env.exampleentries are knobs for the subscription benchmark script, read byscripts/benchmarkSubscriptions.tsrather than the server.The depth and cost limits already on
mainbound how expensive one document can be. This issue is the separate question of whether an unauthenticated caller composes the document at all, which is still open.Related: #357 is also still open and was correctly left open —
findPairinsrc/api/graphql.tsstill discards the issuer.