-
Notifications
You must be signed in to change notification settings - Fork 612
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
Deduplicate ICA controller/host keeper code #563
Comments
I tried the above out in #565 by creating a prefixed store for both controller/host based on a top level ICA Keeper. This works great except there is uncertainty in ensuring there are no collisions in store prefixes. The code duplication is fairly minimal and thus the trade off doesn't seem worth it atm. If the SDK could somehow allow you to register prefixed stores, then the changes would be worthwhile After the SDK releases a stable release (v1.0.0), we could revisit this discussion. However, by this time period, a migration would likely be required to change things |
Thanks for trying, @colin-axner! |
I think we can close this issue for now. The existing solution works fine. There has continued to be a divergence in behaviour between controller/host |
…osmos#563) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v3.2.0...v3.3.0) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
After splitting host/controller code into 2 submodules (amazing work by @damiannolan), we have some duplicated code. We also have 2 keepers. 2 keepers is nice for dividing storage space so the 2 submodules don't overlap.
Edit: I tried the proposed solution and ran into a couple issues that would require increasing the complexity of the implementation
I propose we combine the keepers into 1 keepers and use 2 key prefixes (host and controller) and allow host/controller to use these prefixed stores. This way we can deduplicate a lot of code (functions like GetAllActiveChannels), we require less code in the app.go file (only 1 keeper needs to be created, no pointer needed), and shared functionality like on-chain parameters can be set at the top level of the ica module.
The controller/host IBC modules will remained split (of course). The ICA keeper would instantiate a controller/host keeper. So in the app.go file, the changes would look something like:
This works well with #523 since it would allow the params to be set by the ICA keeper, rather than individually in both host/controller. Controller or host can statically be disabled by not registering a IBC route.
For Admin Use
The text was updated successfully, but these errors were encountered: