Converge the coexisting subscription mechanisms
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- rust
调研方向
首先比较 crates/core/src/scheduler.rs、crates/app/src/sse/mod.rs、crates/core/src/sigagg.rs 和 app/node/wire.rs 中命名的订阅实现,以 Charon 的 wireX 语义作为对等性参考。定义规范的订阅形态以及生命周期、丢弃、延迟、错误和取消订阅规则,然后迁移不一致的实现,并验证整个 workspace 中记录的语义保持一致。
由索引模型根据 Issue 内容生成。
描述
Summary
The workspace has six mutually incompatible subscription patterns, with divergent semantics for lifetime, drop, lagging, and error propagation:
- tokio
broadcast+ spawned pump — only in the scheduler (the solebroadcastuse in the workspace). Vec<mpsc::Sender<T>>fan-out — SSE listener, with both a builder-time and an actor-round-trip runtimesubscribe(sse/mod.rs#L68).watch::Receiver-returningsubscribe()— p2p peers, dkg sync, readiness.- Sync
Box<dyn Fn>callback vectors — consensus wrapper/qbft/priority; the prioritiser's is documented "Not thread safe relative to a running instance". Arc<dyn Fn> -> BoxFuturecallback vectors — sigagg, parsigdb, fetcher (a consuming-builder variant), bcast, parsigex, validatorapi. Five different receiver forms (&self,&mut self,async &self,self -> Self, interiorMutex).- Charon-style function-pointer wiring in
app/node/wire.rs.
Semantics diverge where it matters:
Laggedis handled only in the scheduler, by silently and permanently unsubscribing the lagging subscriber;Closedalso breaks silently.- Subscriber errors: scheduler logs and continues;
sigaggpropagates 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
wireXsemantics 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.
- 主要语言
- Rust
- 星标
- 8
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NethermindEth/pluto 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
NethermindEth/pluto#722 ·
-
难度 4/5 3-5 天 新手友好度 52/100
NethermindEth/pluto#719 ·
-
enhancement rust
难度 4/5 3-5 天 新手友好度 45/100
NethermindEth/pluto#640 ·
-
rust
难度 5/5 一周以上 新手友好度 45/100
NethermindEth/pluto#638 · 1 条评论 ·
-
enhancement rust
难度 5/5 一周以上 新手友好度 35/100
NethermindEth/pluto#635 ·
查看 NethermindEth/pluto 的全部 Issue
相似的 Issue
-
bug priority: low
难度 2/5 1-3 小时 新手友好度 78/100
storytold/photocraft#12183 · 1 条评论 ·
维护者通常 2 天内回复
-
area:render needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
bherbruck/solvecraft#13138 ·
-
testing
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 86/100
ratatui/ratatui-textarea#39 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
transit-audio/transit#369 ·