Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Converge the coexisting subscription mechanisms

Đang mở
#606 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
distributed-systems

Hướng nghiên cứu

Bắt đầu bằng cách so sánh các triển khai subscription được nêu trong crates/core/src/scheduler.rs, crates/app/src/sse/mod.rs, crates/core/src/sigagg.rs và app/node/wire.rs, sử dụng ngữ nghĩa wireX của Charon làm tham chiếu parity. Xác định các dạng subscription được chuẩn hóa cùng với các quy tắc về vòng đời, loại bỏ, độ trễ, lỗi và hủy đăng ký, sau đó di chuyển các triển khai lệch chuẩn và xác minh rằng ngữ nghĩa được ghi lại là nhất quán trên toàn bộ workspace.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement rust

Summary

The workspace has six mutually incompatible subscription patterns, with divergent semantics for lifetime, drop, lagging, and error propagation:

  1. tokio broadcast + spawned pump — only in the scheduler (the sole broadcast use in the workspace).
  2. Vec<mpsc::Sender<T>> fan-out — SSE listener, with both a builder-time and an actor-round-trip runtime subscribe (sse/mod.rs#L68).
  3. watch::Receiver-returning subscribe() — p2p peers, dkg sync, readiness.
  4. Sync Box<dyn Fn> callback vectors — consensus wrapper/qbft/priority; the prioritiser's is documented "Not thread safe relative to a running instance".
  5. Arc<dyn Fn> -> BoxFuture callback vectors — sigagg, parsigdb, fetcher (a consuming-builder variant), bcast, parsigex, validatorapi. Five different receiver forms (&self, &mut self, async &self, self -> Self, interior Mutex).
  6. Charon-style function-pointer wiring in app/node/wire.rs.

Semantics diverge where it matters:

  • Lagged is handled only in the scheduler, by silently and permanently unsubscribing the lagging subscriber; Closed also breaks silently.
  • Subscriber errors: scheduler logs and continues; sigagg propagates with ?, so one failing subscriber aborts the remaining ones (same in parsigdb) — this asymmetry is load-bearing for duty completion.
  • No subscribe() anywhere returns an unsubscribe handle (scheduler TODO), and the scheduler documents a known leak of detached tasks for stuck handlers.

Related: #84 (make sub calling non-blocking).

Proposed change

This is a design task first: pick one or two blessed shapes (e.g. broadcast/watch channels for events, an async-callback registry with defined error semantics for duty pipeline stages), and document lifetime/drop/lag/error rules. Then migrate the outliers. Concrete decisions to make:

  • Should a subscriber error abort sibling subscribers (current sigagg/parsigdb) or be isolated (current scheduler)? Charon's wireX semantics are the parity reference.
  • What happens on lag: drop events, kill the subscription (current), or apply backpressure?
  • Unsubscribe/drop story: handles vs relying on channel closure.
Ngôn ngữ chính
Rust
Star
8
Fork
5
Merge trung bình
4 ngày 18 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NethermindEth/pluto

Tất cả issue của NethermindEth/pluto

Issue tương tự

Thêm issue về Rust

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.