You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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::Slotcontext 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 Unify time mocking strategy across the codebase #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.
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.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.phase0::Slot = u64,core::SlotNumber(u64), and acore::Slotcontext struct sharing the name.BeaconCommitteeSelection/SyncCommitteeSelectionexist in three layers (eth2api canonical, core#[serde(transparent)]newtypes, and independent testutil redefinitions with identical fields).Consensustraits (consensus::wrappervspriority::consensus) and two unrelatedClocktraits (core::clockvstestutil::validatormock::clock— different time types; relates Unify time mocking strategy across the codebase #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 ineth2apiis 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
pubkeyback onAttesterDuty, deletingAttesterDutyDefinition). Rename one of theConsensus/Clocktrait pairs.