Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Unify lock usage; prefer actor ownership over shared locks

未关闭
#607 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 中列出的锁位置,然后查看现有的样式文档。当锁所有权规则已记录,并且标记的位置已完成转换,或已注释说明其当前锁形式为何合适时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

rust

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:

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_NETWORKS immutable-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
派生
5
平均合并
4 天 18 小时
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NethermindEth/pluto 的其他 Issue

查看 NethermindEth/pluto 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。