The load-shedding list names routes that do not exist and misses the heavy ones
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, postgresql, typescript
調査の方向性
src/middleware/globalRateLimit.ts と src/__tests__/globalRateLimit.test.ts を読み、次に src/app.ts のルート登録と onRoute オプションを調べてください。負荷の高いルートのプレフィックスを更新し、登録済みルートとの比較、新たに追加した負荷の高いルートを少なくとも2つ使ったテスト、ヘルスチェックパスの除外と既存のしきい値の維持を確認するテストを追加してください。これらの確認と npm test が通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Background
When the instance is close to its request ceiling, src/middleware/globalRateLimit.ts sheds "expensive" routes first. It decides by the first path segment (line 52) against EXPENSIVE_ROUTE_PREFIXES (lines 5 to 24).
Three entries match no route: route, history and oracle. (The real paths are /price/:assetA/:assetB/route, /prices/history and /compare/:asset, whose first segments are price, prices and compare.)
And several routes that do run large queries are missing: /tvl, /movers, /correlation, /pegs, /impact/..., /dispersion, /snapshot, /coverage, /rates. Under load these keep being served while cheap price reads are shed.
Nothing ties the list to the real routes, so it drifts every time a route is added.
What to build
- Remove the dead entries and add the heavy routes. Give a short reason for each group.
- Add a test that boots the real app, collects the registered routes, and fails if an entry in the list matches no route.
- Keep the ceiling, the 80% threshold and the health-path exemption exactly as they are.
Where to look
src/middleware/globalRateLimit.ts,src/__tests__/globalRateLimit.test.tssrc/app.tsfor the route list and theonRouteoption
Done when
- Every entry in the list matches at least one registered route, proved by a test
- The heavy routes named above are shed at the expensive threshold, with a test for at least two of them
-
/status,/liveand/readyare still never shed - No limit was loosened and
npm testpasses
Drips Wave · Complexity: Easy · 100 points
Repo: Divinity-Labs/Lens. Install with npm ci, typecheck with npx tsc --noEmit, test with npm test. Tests are vitest. Do not run jest: it reports zero tests and proves nothing.
You cannot reach the production service. Prove your change with local tests and fixtures. Mock the database (pgPool, prisma) the way the existing tests in src/__tests__/ and tests/ do.
Generated files are checked byte for byte by CI. If you add or change a route, edit openapi.yaml by hand and then regenerate the generated files and commit them: npm run openapi:gen (writes openapi.json and the README sections), npm run client:gen (the TypeScript client schema) and, if you touched the GraphQL schema, npm run graphql:schema:gen (writes schema.graphql). The full list is in the scripts section of package.json; also read CONTRIBUTING.md. If a check fails and the diff looks empty, it is line endings: commit with LF.
Prices are high-precision decimals. Do not add a new place where a price or amount goes through parseFloat, Number() or ::float before it reaches the caller.
MCP tools must return exactly the fields the matching REST route returns (tests/mcp-lens.test.ts asserts equality), and the MCP tool modules must not import the database driver directly. Reads are injected.
Do not remove or loosen an existing API-key scope, CORS rule or rate limit, and do not replace src/app.ts wholesale. Past pull requests did both by accident.
Do not weaken a test to make it pass. No real user data, wallet addresses of real users, keys, tokens or connection strings in code, tests or fixtures. Never shorten a Stellar address or contract id; copy it in full from the file that defines it.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
- 主要言語
- TypeScript
- スター
- 4
- フォーク
- 71
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Divinity-Labs/Lens のほかの issue
-
area:database difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Divinity-Labs/Lens#688 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
`/price/:assetA/:assetB/history` turns a bad `limit` into a 500 and an unknown pair into an empty 200対応中かも @I-frenzy が今日担当しました。 オープンarea:api difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Divinity-Labs/Lens#664 ·
メンテナーはふだん 3 日以内に返信
-
`/status?network=mainnet` is rate limited although `/status` is exempt対応中かも @Joyful12-tech が 1 日前に担当しました。 オープンarea:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Divinity-Labs/Lens#662 ·
メンテナーはふだん 3 日以内に返信
-
area:ingest difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Divinity-Labs/Lens#633 ·
メンテナーはふだん 3 日以内に返信
-
Webhook retries have no jitter, so failures synchronise対応中かも @Richard-tobi が 35 日前に担当しました。 オープンarea:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Divinity-Labs/Lens#341 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
Divinity-Labs/Lens の issue をすべて見る
似ている issue
-
CLI OAuth login fails behind an authenticating proxy: GET /api/v1/user omits Proxy-Authorizationオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
lightdash/lightdash#33086 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[功能请求] 设置选项语言调整オープン功能请求
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
antithesishq/bombadil#473 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ardia-browser/ardia#3291 ·
メンテナーはふだん 1 日以内に返信
-
The structured output reference promises null results for refusals that carry validation detailsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信