IBC-independent Ethereum light client types#2
Open
yoshidan wants to merge 21 commits into
Open
Conversation
Signed-off-by: yoshidan <naohiro.y@gmail.com>
There was a problem hiding this comment.
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-typescrate (core types/traits, validation, membership/time utilities) and theethereum-light-client-protocrate (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.
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>
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
ethereum-light-client-typesrepository — 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-rsso it can be reused by bothethereum-elcandoptimism-elcinstead of each ELC re-implementing the same logic.What this provides
Rust
ethereum-light-client-types(type/)no_std)ethereum-light-client-proto(proto/)Modules in
ethereum-light-client-types:client_state/consensus_state— trait definitions shared by the ELCsconsensus— consensus update structures and Proto conversionsupdate— sync committee state-transition logicvalidate— validation utilities for consensus / execution updatescommitment— IBC commitment storage-slot calculation and verificationmembership— membership / non-membership proof verificationtime— timestamp validation utilitieserrors— error types for all operationsGo
Prover-side helpers under
prover/(relay,beacon,execution,types,proto) used by the downstream relayer-provers to build proofs and fork parameters.