Skip to content

IBC-independent Ethereum light client types#2

Open
yoshidan wants to merge 21 commits into
mainfrom
feature/initial_v0
Open

IBC-independent Ethereum light client types#2
yoshidan wants to merge 21 commits into
mainfrom
feature/initial_v0

Conversation

@yoshidan

@yoshidan yoshidan commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the ethereum-light-client-types repository — a set of shared type definitions, validation utilities, and prover helpers for Ethereum light client implementations.
The goal is to extract the IBC-independent core out of ethereum-ibc-rs so it can be reused by both
ethereum-elc and optimism-elc instead of each ELC re-implementing the same logic.

What this provides

Rust

Crate Description
ethereum-light-client-types (type/) Core types, traits, validation, and error definitions (no_std)
ethereum-light-client-proto (proto/) Protobuf definitions and generated Rust code

Modules in ethereum-light-client-types:

  • client_state / consensus_state — trait definitions shared by the ELCs
  • consensus — consensus update structures and Proto conversions
  • update — sync committee state-transition logic
  • validate — validation utilities for consensus / execution updates
  • commitment — IBC commitment storage-slot calculation and verification
  • membership — membership / non-membership proof verification
  • time — timestamp validation utilities
  • errors — error types for all operations

Go

Prover-side helpers under prover/ (relay, beacon, execution, types, proto) used by the downstream relayer-provers to build proofs and fork parameters.

@yoshidan yoshidan requested a review from Copilot June 22, 2026 09:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds the initial implementation of the ethereum-light-client-types repository, extracting IBC-independent Ethereum light client types, validation, and prover-side helpers for reuse across multiple ELC implementations.

Changes:

  • Introduces the Rust ethereum-light-client-types crate (core types/traits, validation, membership/time utilities) and the ethereum-light-client-proto crate (protobuf definitions + generated Rust).
  • Adds a Go prover helper library (beacon/execution clients, SSZ/Merkle proof helpers, fork schedule/spec helpers, and generated proto types).
  • Adds build/test/lint tooling (workspace setup, CI workflow, proto generation scripts).

Reviewed changes

Copilot reviewed 50 out of 54 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
type/src/lib.rs Defines the ethereum-light-client-types crate surface and module layout.
type/src/client_state.rs Introduces the ClientState trait used by shared verification logic.
type/src/consensus_state.rs Introduces the ConsensusState trait used for proof verification inputs.
type/src/consensus.rs Adds core consensus/execution update structs + proto conversion helpers.
type/src/commitment.rs Adds IBC commitment storage key calculation + account storage root verification.
type/src/membership.rs Adds membership/non-membership verification over MPT proofs with shared arg validation.
type/src/time.rs Adds timestamp construction and header/trusting-period validation utilities.
type/src/update.rs Adds sync committee state-transition helpers and store reader adapter.
type/src/validate.rs Adds execution update (block-hash) validation against finalized execution root.
type/src/errors.rs Centralizes error variants for core operations and conversions.
type/Cargo.toml Declares Rust crate dependencies (no_std-oriented) and dev-deps.
proto/definitions/ibc/lightclients/ethereum/v1/ethereum.proto Defines protobuf messages for ethereum light client types.
proto/src/lib.rs Exposes generated prost modules and IBC commit metadata.
proto/src/prost/ibc.lightclients.ethereum.v1.rs Adds generated Rust prost types for the ethereum light client proto package.
proto/src/IBC_GO_COMMIT Pins the ibc-go commit used for proto generation consistency.
proto/Cargo.toml Declares the ethereum-light-client-proto crate and dependencies.
proto-compiler/src/main.rs Adds a small Rust CLI entrypoint for proto compilation.
proto-compiler/src/cmd/compile.rs Implements proto compilation into Rust using tonic_build.
proto-compiler/src/cmd.rs Wires proto-compiler subcommands.
proto-compiler/src/cmd/clone.rs Placeholder for future clone functionality.
proto-compiler/README.md Documents proto-compiler requirements and usage.
proto-compiler/Cargo.toml Declares proto-compiler tool dependencies.
proto-compiler/.gitignore Ignores proto-compiler build artifacts.
prover/types/ethereum.go Adds basic validation helpers for Go protobuf-generated update types.
prover/relay/update.go Adds helpers to build execution updates (optionally including block hash) for L2s.
prover/relay/update_test.go Tests execution update building with/without block hash.
prover/relay/ssz.go Adds SSZ chunk hashing + generalized merkle proof generation helpers.
prover/relay/ssz_test.go Tests merkle proof generation and SSZ helper outputs.
prover/relay/spec.go Adds fork spec constants and fork schedule parameters for networks.
prover/relay/spec_test.go Tests fork schedule helpers and spec sanity checks.
prover/relay/slot.go Adds slot/epoch/period computation helpers and blockNumber->period derivation.
prover/relay/slot_test.go Tests slot/epoch/period calculations across presets.
prover/relay/proof.go Adds IBC commitment slot/key helpers and proof-building helpers.
prover/relay/proof_test.go Tests IBC commitments slot and storage key derivation.
prover/relay/bootstrap.go Adds bootstrap discovery for a given sync committee period via Beacon API.
prover/relay/bootstrap_test.go Tests bootstrap discovery logic with a mock beacon fetcher.
prover/execution/client.go Introduces an execution client interface abstraction (HeaderByNumber).
prover/execution/helpers.go Adds a helper for fetching execution block timestamps.
prover/beacon/client.go Adds a Beacon API client with a Fetcher abstraction and version gating.
prover/beacon/response.go Defines JSON response types and parsing for the Beacon API.
prover/beacon/types.go Adds type adapters and proto conversion helpers for beacon data.
prover/proto/protocgen.sh Adds buf-driven Go proto generation script and output staging.
prover/proto/buf.yaml Configures buf module deps and lint/breaking settings for Go protos.
prover/proto/buf.gen.gogo.yaml Configures buf plugins for gogo + grpc-gateway generation.
go.mod Declares Go module deps for prover helpers and proto generation runtime.
Cargo.toml Creates a Rust workspace for type + proto crates (excluding proto-compiler).
rust-toolchain Pins the Rust toolchain used for builds.
Makefile Adds proto generation and lint/fmt targets for Rust and Go workflows.
.github/workflows/test.yml Adds CI for Rust tests/lint and Go prover tests.
README.md Documents repository purpose and usage for Rust crates and Go prover packages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread prover/beacon/client.go Outdated
Comment thread prover/beacon/types.go
Comment thread prover/relay/bootstrap.go
Comment thread prover/relay/ssz.go
Comment thread prover/relay/ssz.go Outdated
Comment thread type/src/update.rs
Comment thread type/src/update.rs
Comment thread prover/types/ethereum.go Outdated
Comment thread type/src/consensus.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 54 changed files in this pull request and generated 6 comments.

Comment thread prover/beacon/client.go Outdated
Comment thread type/Cargo.toml Outdated
Comment thread proto/Cargo.toml Outdated
Comment thread Makefile
Comment thread prover/execution/helpers.go Outdated
Comment thread prover/relay/proof.go Outdated
yoshidan and others added 2 commits June 22, 2026 20:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
yoshidan and others added 3 commits June 22, 2026 20:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 50 out of 54 changed files in this pull request and generated 3 comments.

Comment thread type/src/time.rs
Comment thread prover/types/ethereum.go Outdated
Comment thread type/src/consensus.rs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@yoshidan yoshidan marked this pull request as ready for review June 22, 2026 22:16
@yoshidan yoshidan requested review from siburu and removed request for siburu June 23, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants