Description
We currently redefine Ethereum consensus (Phase0 and Spec) structs across crates, which makes reuse difficult and leads to duplication.
In Go, github.com/attestantio/go-eth2-client/spec provides a shared package for consensus spec types (including spec/phase0). We do not have an equivalent foundational crate in Rust.
We can introduces a new eth2-spec crate under eth2api to centralize consensus data structures. We will only port the types we need (not the full spec) and extend it incrementally as other crates require more Phase0 types.
This crate will serve as the shared foundation for consensus-related structs across the codebase.
Acceptance Criteria
- Follow the structure of
github.com/attestantio/go-eth2-client/spec.
- Move existing self-defined spec-related structs into this crate (e.g.):
- Other crates use
eth2-spec instead of redefining these types.
Description
We currently redefine Ethereum consensus (Phase0 and Spec) structs across crates, which makes reuse difficult and leads to duplication.
In Go,
github.com/attestantio/go-eth2-client/specprovides a shared package for consensus spec types (includingspec/phase0). We do not have an equivalent foundational crate in Rust.We can introduces a new
eth2-speccrate undereth2apito centralize consensus data structures. We will only port the types we need (not the full spec) and extend it incrementally as other crates require more Phase0 types.This crate will serve as the shared foundation for consensus-related structs across the codebase.
Acceptance Criteria
github.com/attestantio/go-eth2-client/spec.GweiBLSPubKeyeth2-specinstead of redefining these types.