The load-shedding list names routes that do not exist and misses the heavy ones
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, postgresql, typescript
Direzione di ricerca
Leggi src/middleware/globalRateLimit.ts e src/__tests__/globalRateLimit.test.ts, poi esamina la registrazione delle route e l’opzione onRoute in src/app.ts. Aggiorna i prefissi delle route costose e aggiungi test che li confrontino con le route registrate, verifichino almeno due nuove route pesanti e mantengano le eccezioni per i percorsi di stato e le soglie esistenti. Il lavoro è completato quando questi controlli hanno esito positivo e npm test passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 71
- Merge medio
- 2g 6h
- PR unite (30g)
- 24
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Divinity-Labs/Lens
-
area:database difficulty:easy help wanted points:100 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Divinity-Labs/Lens#688 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
`/price/:assetA/:assetB/history` turns a bad `limit` into a 500 and an unknown pair into an empty 200Forse già presa @I-frenzy l’ha presa oggi. Apertaarea:api difficulty:easy help wanted points:100 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Divinity-Labs/Lens#664 ·
I maintainer di solito rispondono entro 3 giorni
-
`/status?network=mainnet` is rate limited although `/status` is exemptForse già presa @Joyful12-tech l’ha presa 1 giorno fa. Apertaarea:reliability difficulty:easy help wanted points:100 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Divinity-Labs/Lens#662 ·
I maintainer di solito rispondono entro 3 giorni
-
area:ingest difficulty:easy help wanted points:100 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Divinity-Labs/Lens#633 ·
I maintainer di solito rispondono entro 3 giorni
-
Webhook retries have no jitter, so failures synchroniseForse già presa @Richard-tobi l’ha presa 35 giorni fa. Apertaarea:reliability difficulty:easy help wanted points:100 Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
Divinity-Labs/Lens#341 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di Divinity-Labs/Lens
Issue simili
-
CLI OAuth login fails behind an authenticating proxy: GET /api/v1/user omits Proxy-AuthorizationAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lightdash/lightdash#33086 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[功能请求] 设置选项语言调整Aperta功能请求
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
antithesishq/bombadil#473 ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ardia-browser/ardia#3291 ·
I maintainer di solito rispondono entro 1 giorno
-
The structured output reference promises null results for refusals that carry validation detailsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno