Rewrite `core/qbft` to async-Rust-friendly API
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- rust
調査の方向性
まず crates/core/src/qbft/mod.rs とその internal_test.rs から始め、Go のリファレンスと strategysim_internal_test.go を比較してください。並行性モデルを変更する前に、既存の QBFT テストを実行してください。完了の条件は、非同期の公開 API、strategysim とのパリティを含む同等の非同期テスト、問題のない clippy とフォーマット、そしてドキュメント化された公開項目が揃っていることです。
索引モデルが issue の本文から書いたものです。
説明
Context
The current Rust port of core/qbft (crates/core/src/qbft/mod.rs) is a faithful translation of the Go reference but built on synchronous, thread-based primitives:
crossbeam::channelfor transportstd::thread::scopefor spawning per-process workers- A blocking
pub fn run(...)entry point cancellation::CancellationToken(third-party crate, nottokio_util)
This is at odds with the rest of Pluto, which is tokio-async end to end. Every consumer that will eventually wire QBFT in (core/consensus, core/scheduler, the duty pipeline) is async. The current shape forces either (a) bridging via spawn_blocking and ad-hoc channel adapters, or (b) blocking inside async tasks — both bad.
Closes the gap left by #13, which produced the initial sync port.
Goal
Rewrite core/qbft with an async-Rust-native API that integrates cleanly with the rest of the workspace and preserves the Byzantine-safety guarantees of the Go reference.
Scope
API
runbecomespub async fn run(...) -> Result<Decision, QbftError>Transporttrait methods returnimpl Future<Output = Result<...>> + Send(or areasync fnvia trait async)- Cancellation uses
tokio_util::sync::CancellationToken(already used elsewhere in Pluto) - Channels:
tokio::sync::mpsc(andoneshotwhere appropriate) - No
std::thread, nocrossbeam, nostd::sync::mpscanywhere in the public or internal API
Internals
- Replace
thread::scopewithtokio::spawn+JoinSet(orselect!for per-instance loops) - Replace blocking sleeps/timers with
tokio::time::sleep/Interval - Clock abstraction (
fake_clock.rs) becomes async-aware so deterministic tests still work — likely usingtokio::time::pause()+advance()rather than the current fake clock - Keep the algorithm shape (rounds, justifications, message bookkeeping) bit-for-bit identical to the Go reference — only the concurrency primitives change
Safety net (mandatory)
- Port
charon/core/consensus/qbft/strategysim_internal_test.go(~1040 LOC) as the parity gate. This is the test that catches BFT correctness regressions; without it we cannot trust the rewrite. - All current
crates/core/src/qbft/internal_test.rscases pass (or are replaced by equivalent async versions)
Acceptance criteria
- Public API is fully async; no
pub fn runblocking entry point remains - No
crossbeam,std::thread, or third-partycancellationcrate usage incrates/core/src/qbft/ - All existing QBFT unit tests pass (rewritten as async where needed)
- Strategysim parity test ported from Go and green
-
cargo clippy --workspace --all-targets --all-features -- -D warningsclean -
cargo +nightly fmt --all --checkclean - Public API documented;
missing_docswarning re-enabled for the module
References
- Go source: https://github.com/ObolNetwork/charon/blob/main/core/qbft/qbft.go
- Go strategysim test: https://github.com/ObolNetwork/charon/blob/main/core/consensus/qbft/strategysim_internal_test.go
- Current Rust port:
crates/core/src/qbft/mod.rs(1305 LOC) - Predecessor issue: #13 (closed — produced the initial sync port)
Notes
This is on the critical path for the duty-flow pipeline. core/consensus (#157) and downstream modules (core/scheduler #176, etc.) will consume the new async API directly, so this should land before consensus framework integration begins.
- 主要言語
- Rust
- スター
- 8
- フォーク
- 5
- 平均マージ
- 3日 1時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NethermindEth/pluto のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
NethermindEth/pluto#719 ·
-
enhancement rust
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NethermindEth/pluto#640 ·
-
rust
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
NethermindEth/pluto#638 · コメント 1 件 ·
-
enhancement rust
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NethermindEth/pluto#635 ·
-
Improve `alpha test peers`: match Charon's probes; reduce timeouts対応中かも @varex83agent が 29 日前に担当しました。 オープンbug track:orchestration-cli
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
NethermindEth/pluto#632 ·
NethermindEth/pluto の issue をすべて見る
似ている issue
-
bug priority: low ui
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
storytold/photocraft#10370 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:doc bug in progress needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bherbruck/solvecraft#9634 · コメント 2 件 · リアクション 1 件 ·
-
inflate: total_in uses plain += on c_ulong (32-bit on Windows), panics in debug for streams > 4 GiBオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
trifectatechfoundation/zlib-rs#570 · コメント 1 件 ·
-
bug discord-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
LanternOps/breeze#10755 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
aranya-project/aranya#803 ·