0xMiden / 0xMiden/note-transport-service

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

未關閉
#130 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug production-readiness
主要語言
Rust
星號
3
分支
10
平均合併
2 小時 23 分鐘
30 天內合併 PR
4

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。