Skip to content

Create eth2-spec crate #222

@iamquang95

Description

@iamquang95

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.):
    • Gwei
    • BLSPubKey
    • etc.
  • Other crates use eth2-spec instead of redefining these types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions