0xMiden / 0xMiden/note-transport-service

StreamNotes can silently drop notes for connected subscribers

Đang mở
#122 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).

### Summary

Streaming is lossy even for well-behaved, connected clients. The per-tag cursor is advanced **before** delivery is attempted, and delivery only happens if a waker is currently registered for the subscriber.

### Evidence

- `crates/node/src/node/grpc/streaming.rs:220-226`: `update_timestamps` (cursor advance) runs before `forward_updates` (delivery).
- `streaming.rs:128-135`: a batch is only delivered to a sub if `self.wakers.remove(sub_id)` returns `Some` — otherwise it is skipped for that sub with no `try_send` into the buffer. On `try_send` failure the sub is evicted and the batch is lost.

### Impact

A subscriber whose waker message hasn't been processed yet (new sub between `AddSub` and its first `Waker`, or mid-repoll) misses that tick's notes with no error, and the cursor has already advanced, so they are never re-sent. For private notes (this service is the only carrier of `NoteDetails`) that is silent, unrecoverable loss.

### Recommendation

Advance the tag cursor only past notes actually enqueued to every subscriber (or track per-sub cursors); use the channel buffer regardless of waker registration; on eviction, end the stream with an explicit `Status` carrying the last delivered cursor (see the streaming-hardening issue).

Related: #96 (stream ignores cursor), #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.