0xMiden / 0xMiden/note-transport-service

Production-readiness papercuts (bundle)

Abierto
#136 2 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement production-readiness
Lenguaje dominante
Rust
Estrellas
3
Forks
10
Merge medio
2 h 23 min
PR fusionados (30 d)
4

Descripción

Severity: low/medium (bundle of independent papercuts).

Small hardening items, grouped to avoid issue sprawl. Each is independent.

- **Internal error details leak to clients.** `Status::internal(format!("… {e:?}"))` forwards Debug-formatted `DatabaseError` (SQLite strings, pool/path info) to callers (`crates/node/src/node/grpc/mod.rs:199,259,308,321`). Log server-side, return generic statuses.
- **Stats runs unauthenticated full-table scans.** `get_stats` does `COUNT(*)` + `COUNT(DISTINCT tag)` on every call (`crates/node/src/database/sqlite/mod.rs:216-232`), exposed to anyone (`grpc/mod.rs:313-330`). Cache/rate-limit it; note per-tag counts are also a privacy consideration. (`notes_per_tag` is also declared in the proto but returned empty — `grpc/mod.rs:326` `// TODO`.)
- **Health/reflection sit behind the global concurrency limit + 4 s timeout** (`grpc/mod.rs:117-125`), so probes queue/fail exactly when the service is saturated. Layer limit/timeout on the app service only.
- **Concurrency-limit / timeout ordering** (`grpc/mod.rs:121-122`): the timeout is *inside* the concurrency limit, so once 4096 permits are exhausted, new requests queue with no timeout. Move the timeout outside, or use `LoadShed` to reject rather than queue. Also, tower timeout errors surface as transport errors, not `DEADLINE_EXCEEDED`.
- **IPv6 bind can't be expressed.** `format!("{host}:{port}").parse::()` (`grpc/mod.rs:111-113`) fails for `--host ::`. Parse host as `IpAddr` and use `SocketAddr::new`.
- **No env-var config.** clap args have no `env=` fallback (`bin/node/src/main.rs:11-39`); several operationally important knobs are hardcoded (maintenance interval, poll interval, batch size, pool size). Add `env` fallbacks and promote the important knobs to flags.
- **Startup log omits version/commit** (`bin/node/src/main.rs:52-62`); expose `CARGO_PKG_VERSION` at startup and as a build-info metric.
- **Broken doc link:** `docs/src/operator/installation.md` links `./usage.md#bootstrapping`, which doesn't exist.
- **No end-to-end smoke test in CI.** `build-docker.yml` builds with `push: false` and stops; no workflow runs the image and does a health + send/fetch round-trip. (Distinct from #75 load testing.)
- **`max_connections` is misnamed** — it configures request concurrency, not TCP connections or live streams (`grpc/mod.rs:62-63,121`). Rename or actually enforce a connection cap.

---
Part of #114.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

El issue enumera archivos y líneas específicas (por ejemplo, crates/node/src/node/grpc/mod.rs, bin/node/src/main.rs). Comience examinando el código alrededor de esas líneas para comprender cada papercut. Para cada elemento, verifique si hay pruebas existentes (como para endpoints gRPC) y considere escribir una pequeña corrección. Ejecutar la suite de pruebas existente después de los cambios es esencial. Los cambios son independientes, por lo que puede abordarlos uno a la vez.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Área
backend, devops, documentation
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
65/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.