0xMiden / 0xMiden/note-transport-service

Legacy-cursor reset never converges (rcursor computed from original cursor)

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

Descripción

Severity: high (correctness bug).

### Summary

The DB layer treats a cursor > 10^12 (pre-`seq` microsecond timestamps) as 0 (`crates/node/src/database/sqlite/mod.rs:160-166`), but the gRPC handler computes the response cursor from the **original** request cursor: `let mut rcursor = cursor;` then `max` with the returned seqs (`crates/node/src/node/grpc/mod.rs:261`).

### Impact

A client sending a legacy cursor (~1.7e15) gets the oldest 500 notes plus `rcursor ≈ 1.7e15`; its next fetch sends the same cursor, gets the same 500 notes again — forever. It never advances past the first batch and permanently re-downloads duplicates.

### Recommendation

Perform the legacy reset in the handler (or return the effective cursor from the DB layer) so `rcursor = max(effective_cursor, max_seq)`.

Related: #101.

---
Part of #114.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.