Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lightclient module structuring and internal keeper usage #6186

Open
3 tasks
damiannolan opened this issue Apr 18, 2024 · 1 comment
Open
3 tasks

Lightclient module structuring and internal keeper usage #6186

damiannolan opened this issue Apr 18, 2024 · 1 comment
Assignees
Labels
change: api breaking Issues or PRs that break Go API (need to be release in a new major version) needs discussion Issues that need discussion before they can be worked on type: code hygiene Clean up code but without changing functionality or interfaces type: refactor Architecture, code or CI improvements that may or may not tackle technical debt.

Comments

@damiannolan
Copy link
Member

damiannolan commented Apr 18, 2024

Summary

Historically light client modules have had a very open ended code structure with most if not all code existing within package types or since ibc-go/v7 within the root of the lightclient module, e.g. package tendermint.
Since #5806 and decoupling client encoding from routing within ibc-go there is now a more unrestricted opportunity to provide more structure and code organisation to lightclient modules - as we do not rely on all functionality being tightly coupled with the client state type/interface implementation.

See: #5806 (comment)

Problem Definition

Currently, there is little to no code organisation within the majority of lightclient modules. The 08-wasm module contains a similar structure, reminiscent to that of a regular sdk module and has seen much improvements and benefits from the refactor linked above.

With the refactor we introduced an internal/keeper to 07-tendermint with intensions for this to be useful for things such as msg server execution, in particular governance authorised requests such as changing client state parameters.

Proposal

Explore some paths for providing a simple and organised structure for lightclient modules.

  • Using internal/keeper for state management. For example, usage of storeProvider for get/set operations of client/consensus states and metadata.
  • Ideally keepers could be internal, but maybe they do not need to be.
  • Maybe types such as client state and consensus state should be moved back to package types as they were previously.

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@damiannolan damiannolan added needs discussion Issues that need discussion before they can be worked on type: code hygiene Clean up code but without changing functionality or interfaces type: refactor Architecture, code or CI improvements that may or may not tackle technical debt. labels Apr 18, 2024
@DimitrisJim
Copy link
Contributor

Nice! In addition, a re-org like this would also be a great op for an internal pkg for all the types that might now need to be exported (if we split each light client into multiple go pkgs)

@DimitrisJim DimitrisJim added the change: api breaking Issues or PRs that break Go API (need to be release in a new major version) label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change: api breaking Issues or PRs that break Go API (need to be release in a new major version) needs discussion Issues that need discussion before they can be worked on type: code hygiene Clean up code but without changing functionality or interfaces type: refactor Architecture, code or CI improvements that may or may not tackle technical debt.
Projects
Status: Backlog 🕐
Development

No branches or pull requests

3 participants