Define and enforce `CancellationToken` conventions
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/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 việc đọc .claude/skills/rust-style/SKILL.md và xem xét cách sử dụng CancellationToken hiện có trong tracker, validatorapi, sse và prioritiser. So sánh các vị trí drop_guard được liên kết trong privkeylock.rs và wire.rs với các trường hợp token mồ côi, sau đó ghi lại các quy ước và điều chỉnh các vị trí được đánh dấu cho phù hợp. Công việc được xem là hoàn tất khi các tiêu chí chấp nhận được đáp ứng, bao gồm cả chú thích cho mọi token mồ côi được cố ý giữ độc lập.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
CancellationToken is the most pervasive abstraction in the workspace (550 lines across 74 files) with no written rules, and usage has drifted:
clone()vschild_token()is ~141:52. A clone shares the same scope, so any holder calling.cancel()tears down the whole tree; children are the right default for subordinate tasks. Disciplinedchild_tokenuse exists only indkg; large subsystems (tracker: 19 CT lines, validatorapi: 25, sse: 15) use zero.drop_guard()appears exactly twice (privkeylock.rs#L123,wire.rs#L1140). Everywhere else an early-returning task leaves siblings running with no signal.- Orphan tokens with no parent link (cancel never propagates from the caller):
prioritiser'squit, deadliner's internal token, dkg'slock_ct. - Three vocabularies coexist:
select! { _ = ct.cancelled() => ... }(~41 sites),ct.run_until_cancelled(fut)(24 sites, nearly all in one file), and the third-partycancellationcrate's callback API in the QBFT core (goes away with draft05a). - Naming (
ct,cancel,cancellation,token,quit) and by-value vs&CancellationTokenpassing are unstandardized, forcing gratuitous clones at boundaries.
Proposed change
Update the current set of conventions: when to child_token vs clone, when a task owns a DropGuard, one preferred waiting idiom, parameter naming and passing. Then sweep the flagged sites — in particular giving subordinate tasks child tokens and auditing the orphan tokens for missed shutdown propagation.
Acceptance
Documented rules plus a pass over tracker/validatorapi/sse/prioritiser aligning them; no orphan token without a comment explaining its independence.
- 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
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NethermindEth/pluto
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
NethermindEth/pluto#719 ·
-
enhancement rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
NethermindEth/pluto#640 ·
-
rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
NethermindEth/pluto#638 · 1 bình luận ·
-
enhancement rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NethermindEth/pluto#635 ·
-
Improve `alpha test peers`: match Charon's probes; reduce timeoutsCó thể đã có người làm @varex83agent đã nhận 25 ngày trước. Đang mởbug track:orchestration-cli
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
NethermindEth/pluto#632 ·
Tất cả issue của NethermindEth/pluto
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
rust-embedded/heapless#694 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
farion1231/cc-switch#8899 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
manuscript-lang/manuscript#1364 ·
Maintainer thường phản hồi trong vòng 1 ngày