0xMiden / 0xMiden/note-transport-service

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

Đang mở
#130 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug production-readiness
Ngôn ngữ chính
Rust
Star
3
Fork
10
Merge trung bình
2 giờ 23 phút
Pull request đã merge (30 ngày)
4

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.