Skip to content

feat: bankd proto definitions + AnyClientState enum dispatch (#39, #42) - #5286

Open
jackzampolin wants to merge 5 commits into
penumbra-zone:mainfrom
mizufinance:39-42-any-client-state-protos
Open

feat: bankd proto definitions + AnyClientState enum dispatch (#39, #42)#5286
jackzampolin wants to merge 5 commits into
penumbra-zone:mainfrom
mizufinance:39-42-any-client-state-protos

Conversation

@jackzampolin

Copy link
Copy Markdown
Contributor

Summary

  • Adds ibc.lightclients.bankd.v1 proto definitions (ClientState, ConsensusState, Header, Misbehaviour) — the wire format for future MsgCreateClient/MsgUpdateClient payloads for the bankd light client
  • Introduces AnyClientState, AnyConsensusState, AnyHeader enum dispatch layer that makes the IBC codebase multi-client-aware, replacing 8 hardcoded Tendermint-only validation functions
  • Creates ClientProvider trait for pluggable header verification
  • Refactors create_client, update_client, and misbehavior handlers to use enum-based dispatch
  • Net ~-40 lines in ics02_validation alone; Bankd match arms bail with "not yet supported" until B06-T3

Test plan

  • cargo check — full workspace compiles clean
  • cargo test -p penumbra-sdk-ibc — all 3 runtime tests pass:
    • test_create_and_update_light_client — exercises the full Tendermint create+update path end-to-end through the refactored handlers
    • test_disabled_ibc_component — validates handler dispatch with IBC disabled
    • test_derive_ibc_denom — IBC token derivation (unrelated but confirms no regressions)
  • AnyClientState::try_from(Any) round-trips for Tendermint types (covered implicitly by existing integration test)
  • Unknown type_url rejected with clear error message
  • Pre-existing doctest failure in client_recovery.rs is unrelated (pseudo-code example missing imports, fails on main too)

🤖 Generated with Claude Code

alexanderbez and others added 5 commits September 3, 2025 19:41
* rm old testnet files

* rm old testnets

* 000-localnet

* optional multiple validators

* fix: simplify to single-validator local network

Removed multi-validator support to simplify the deployment. Single
validator doesn't need peer discovery, so we just clear seeds to
avoid PEX errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…yer (#39, #42)

Introduce multi-client-aware IBC handling by adding bankd light client
proto definitions and an enum-based dispatch layer that replaces
hardcoded Tendermint-only type checks.

- Add `ibc.lightclients.bankd.v1` proto (ClientState, ConsensusState,
  Header, Misbehaviour) and generate Rust types via prost
- Split `.ibc` extern_path in proto-compiler into granular paths so
  bankd types are generated locally while other IBC types still resolve
  to ibc_proto
- Create `AnyClientState`, `AnyConsensusState`, `AnyHeader` enums with
  `TryFrom<Any>` / `Into<Any>` conversions and accessor methods
- Create `ClientProvider` trait for pluggable header verification
- Remove 8 Tendermint-specific validation functions from ics02_validation
  (~65 lines), replacing them with enum-based dispatch in handlers
- Refactor create_client, update_client, and misbehavior handlers to use
  the new enum types
- Existing tests (test_create_and_update_light_client,
  test_disabled_ibc_component) exercise the Tendermint path end-to-end
  and continue to pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants