Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Deduplicate domain types across crates

オープン
#617 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust

調査の方向性

まず core/signeddata.rs、core/types.rs、eth2api/validator_duty.rs、tracker/inclusion.rs、testutil/validatormock/attest.rs にある引用された定義を読み、次に From 変換と重複した trait 定義をたどります。完了の条件は、列挙された各概念に canonical な配置場所があり、重複した表現と no-op ブリッジが削除され、意図的に維持される wire-version ファミリーと generated-vs-spec ファミリーが変更されていないことです。

索引モデルが issue の本文から書いたものです。

説明

rust

Summary

Follow-up evidence for #127 ("Centralize helper at core") — the concrete duplicates:

  • AttesterDuty: 4 near-identical structs — core/signeddata.rs#L1200-L1213 (no pubkey), testutil/validatormock/attest.rs (same + pubkey), eth2api/validator_duty.rs (3-field subset), tracker/inclusion.rs (2-field subset) — plus AttesterDutyDefinition, which exists only because the core struct dropped the pubkey.
  • ProposerDuty / SyncCommitteeDuty: same fields defined in eth2api and core with different newtypes and a field rename (validator_index → v_idx), bridged by Froms.
  • Validator pubkey: 3 representations (crypto::PublicKey = [u8;48], eth2api::BLSPubKey = [u8;48], core::PubKey([u8;48])), plus bare Vec<u8> pubkeys in 6 cluster::distvalidator fields. Signature: 2 aliases for [u8;96] bridged by no-op converters.
  • Slot: 3 shapes — phase0::Slot = u64, core::SlotNumber(u64), and a core::Slot context struct sharing the name.
  • Selections: BeaconCommitteeSelection/SyncCommitteeSelection exist in three layers (eth2api canonical, core #[serde(transparent)] newtypes, and independent testutil redefinitions with identical fields).
  • Duplicate trait names across crates: two unrelated Consensus traits (consensus::wrapper vs priority::consensus) and two unrelated Clock traits (core::clock vs testutil::validatormock::clock — different time types; relates #306).

Deliberate non-duplicates to leave alone: the cluster wire-version struct families (DistValidatorV1x..., LockV1x...) encode real format versions, and the generated-vs-spec split in eth2api is the eth2api replacement issue's territory (#611).

Proposed change

Pick the canonical home per concept (core for domain types, eth2api spec types at the API boundary), collapse the copies, and give the survivors the fields their consumers actually need (e.g. put pubkey back on AttesterDuty, deleting AttesterDutyDefinition). Rename one of the Consensus/Clock trait pairs.

主要言語
Rust
スター
8
フォーク
5
平均マージ
3日 1時間
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NethermindEth/pluto のほかの issue

NethermindEth/pluto の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。