Unify lock usage; prefer actor ownership over shared locks
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
調査の方向性
まず、crates/consensus/src/qbft/component.rs、crates/core/src/parsigdb/memory.rs、crates/dkg/src/sync/client.rs、crates/p2p/src/p2p_context.rs、crates/eth2util/src/network.rs にある列挙された lock 箇所を読み、その後、既存のスタイルドキュメントを確認します。lock の所有権ルールが文書化され、指摘された箇所が変換されるか、現在の lock の形が適切である理由を注記されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Lock usage is split with no documented rule: std::sync::{Mutex,RwLock} in 41 files, tokio::sync in 22 (parking_lot is not a dependency — the backlog can drop that option). 52 call sites deal with poison (PoisonError::into_inner / expect("... poisoned")).
Several locks guard data with a single logical owner, where a channel/actor removes the lock entirely:
expired_rx: Mutex<Option<mpsc::Receiver<Duty>>>— a mutex wrapping a channel receiver just to make it&self-takeable, the textbook symptom.instances: Arc<Mutex<HashMap<Duty, Arc<InstanceIo<Msg>>>>>— per-duty registry with one owner.parsigdb'sArc<tokio::sync::Mutex<MemDBInner>>— already half-actor (it has an mpsc trim loop).dkg/sync/client.rs#L40-L42mixes astd::sync::RwLockwithwatch::Senders in the same struct;dkg'sMutex + Notifypairs are hand-rolled actors.P2PContext::peer_storereturnsRwLockReadGuard/WriteGuardfrom public methods, leaking guards across the API boundary.SUPPORTED_NETWORKS: LazyLock<RwLock<Vec<Network>>>— a mutable process-global registry.
Proposed change
This is a design task first: pick a general rule (the standard one works: std::sync for short, non-await-crossing critical sections; tokio::sync when a guard is held across .await; actor + channels when data has one logical owner), document it and enforce it. Later, convert the listed actor candidates. Finally:
- Stop returning guards from
P2PContext - Make
SUPPORTED_NETWORKSimmutable-after-init or explicitly injected.
Acceptance
A written rule in the style docs, and the flagged sites either converted or annotated with why the lock is the right shape.
- 主要言語
- Rust
- スター
- 8
- フォーク
- 6
- 平均マージ
- 4日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NethermindEth/pluto のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
NethermindEth/pluto#719 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NethermindEth/pluto#640 ·
メンテナーはふだん 4 日以内に返信
-
rust
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
NethermindEth/pluto#638 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement rust
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
NethermindEth/pluto#635 ·
メンテナーはふだん 4 日以内に返信
-
Improve `alpha test peers`: match Charon's probes; reduce timeouts対応中かも @varex83agent が 7 日前に担当しました。 オープンbug track:orchestration-cli
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
NethermindEth/pluto#632 ·
メンテナーはふだん 4 日以内に返信
NethermindEth/pluto の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pact-foundation/pact-cli#154 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
antithesishq/bombadil#361 ·
メンテナーはふだん 1 日以内に返信
-
test(executor_l0): assert execute() TaskOutcome, not only bus events / 断言 execute() 返回的 TaskOutcomeオープンtype:debt
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
skaiy/wild_agentos#425 ·
メンテナーはふだん 1 日以内に返信
-
Default-import note suggests `import * as process` for velt:process, which does not name the builtinオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
cratestack/cratestack#1154 ·
メンテナーはふだん 1 日以内に返信