Deduplicate domain types across crates
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 28/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- rust
调研方向
首先阅读 core/signeddata.rs、core/types.rs、eth2api/validator_duty.rs、tracker/inclusion.rs 和 testutil/validatormock/attest.rs 中引用的定义,然后跟踪 From 转换和重复的 trait 定义。完成的标准是:列出的每个概念都有一个规范归属位置,重复的表示形式和无操作桥接都已移除,并且有意保留的 wire-version 和 generated-vs-spec 系列保持不变。
由索引模型根据 Issue 内容生成。
描述
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) — plusAttesterDutyDefinition, which exists only because the core struct dropped the pubkey.ProposerDuty/SyncCommitteeDuty: same fields defined ineth2apiandcorewith different newtypes and a field rename (validator_index→v_idx), bridged byFroms.- Validator pubkey: 3 representations (
crypto::PublicKey = [u8;48],eth2api::BLSPubKey = [u8;48],core::PubKey([u8;48])), plus bareVec<u8>pubkeys in 6cluster::distvalidatorfields. Signature: 2 aliases for[u8;96]bridged by no-op converters. - Slot: 3 shapes —
phase0::Slot = u64,core::SlotNumber(u64), and acore::Slotcontext struct sharing the name. - Selections:
BeaconCommitteeSelection/SyncCommitteeSelectionexist in three layers (eth2api canonical, core#[serde(transparent)]newtypes, and independent testutil redefinitions with identical fields). - Duplicate trait names across crates: two unrelated
Consensustraits (consensus::wrappervspriority::consensus) and two unrelatedClocktraits (core::clockvstestutil::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 小时
- 30 天内合并 PR
- 2
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 45/100
NethermindEth/pluto#638 · 1 条评论 ·
-
enhancement rust
难度 5/5 一周以上 新手友好度 35/100
NethermindEth/pluto#635 ·
-
Improve `alpha test peers`: match Charon's probes; reduce timeouts可能已有人在做 @varex83agent 于 32 天前认领。 未关闭bug track:orchestration-cli
难度 5/5 一周以上 新手友好度 28/100
NethermindEth/pluto#632 ·
查看 NethermindEth/pluto 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 70/100
OpenZeppelin/openzeppelin-relayer#967 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
src/runs.rs:1987: a missing --source-run-id now answers 400 "Source run ... does not exist", not 404未关闭nightly-audit
难度 2/5 1-3 小时 新手友好度 62/100
antithesishq/snouty#602 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
libnativeapi/nativeapi#21 ·