0xMiden / 0xMiden/note-transport-service

No rate limiting or per-client request quotas

Aperta
#117 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement production-readiness
Lingua principale
Rust
Stelle
3
Fork
10
Merge medio
2h 23m
PR unite (30g)
4

Descrizione

Severity: critical (for an internet-facing deployment).

### Summary

There is no per-IP, per-client, or per-RPC rate limiting. The only throttle is a global 4096 in-flight-request limit (`GlobalConcurrencyLimitLayer::new`, `crates/node/src/node/grpc/mod.rs:121`). Remote peer address is never inspected. A single client can saturate the write, read, and stream paths at line rate.

This is the concrete mechanism behind placeholder #44 (spam protection).

### Recommendation

- Add per-IP rate limiting (tower middleware, or document a mandatory upstream proxy/WAF) with separate budgets for writes (`SendNote`) vs reads (`FetchNotes`/`StreamNotes`).
- Add a global write-rate cap.
- Reject with `RESOURCE_EXHAUSTED` rather than queueing (see the concurrency/timeout-ordering note in the papercuts issue).

Related: #44, and the auth-model issue (rate limits are only meaningful once "who is a client" is defined).

---
Part of #114.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.