-
Notifications
You must be signed in to change notification settings - Fork 628
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
feat: create 08-wasm-light-clients structure #7603
feat: create 08-wasm-light-clients structure #7603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think this needs to have it's own feature branch since it contains only a template at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want to publish and continue to maintain this, we could also use tonic's build macros instead of generating the code ourselves. This also hides all the generated code (similar to how alloy's sol macro works). But I'm fine with this as is.
I understand why we need this, but we should either use ibc-proto in the future, or move ibc-proto here. In the mean time, tonic macros could be used if it works...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was that this should could replace ibc-proto eventually. Tonic is an option, but to be honest I don't love hidden generated code because it makes it a lot harder to understand underlying types and what is really going on (too much magic for my taste).
"contracts/*", | ||
"packages/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using *
, you probably want to point to the exact directory instead since this is a multi language repo.
"contracts/*", | |
"packages/*", | |
"contracts/ethereum-light-client", | |
"packages/ibc-go-proto", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a multi language repo, but the folder we're in is for the rust code. If we suddenly add anything there, builds will fail and then we can adjust, no?
push: | ||
branches: | ||
- main | ||
- feat/ibc-eureka # TODO: Remove before merging to main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should have it's own feature branch and not be merged directly to feat/ibc-eureka in my opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible to get things merged in smaller increments, it will be easier than having to maintain yet another feature branch. I would prefer to avoid another branch if smaller PRs can do the job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible to get things merged in smaller increments, it will be easier than having to maintain yet another feature branch. I would prefer to avoid another branch if smaller PRs can do the job
Having been dealing with multiple feature branches for a while now, I 100% agree!
modules/light-clients/08-wasm-light-clients/contracts/ethereum-light-client/src/error.rs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,4 @@ | |||
pub mod contract; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should enforce documentation in all public API in this crate like we do in ibc-go (since people and future devs might want to read). We can also add stricter linting as follows:
pub mod contract; | |
#![deny(clippy::nursery, clippy::pedantic, warnings, missing_docs)] | |
pub mod contract; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I will do that in a separate task: #7604
Makefile
Outdated
@@ -141,6 +141,11 @@ build-docker-wasm: | |||
|
|||
.PHONY: build-docker-wasm | |||
|
|||
build-wasm-light-clients: | |||
cd modules/light-clients/08-wasm-light-clients && cargo wasm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we have a build script that uses cosmwasm optimizer? I think this is the only one we need since we want reproducible builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to add that when this is together with e2e integration, but it does take quite a bit longer to run, and it is not strictly necessary for CI right now.
Co-authored-by: srdtrk <[email protected]>
…-light-client/src/error.rs Co-authored-by: srdtrk <[email protected]>
I'm keen to hear other people's opinion on this, but my personal take is that I would love to avoid feature branches as much as possible unless there is a very good reason to keep the code out of main or feat/ibc-eureka. I have tried to structure the work in such a way that it can be merged as smaller PRs and not break anything along the way. Getting things merged sooner and more often feels better than having a lot of feature branches all over the place. |
Co-authored-by: srdtrk <[email protected]>
@@ -0,0 +1,299 @@ | |||
use cosmwasm_std::entry_point; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to include cosmwasm module to use this?
Or we just use the wasm runtime to execute the code, but not require the module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a hard dependency right now on ibc wasm light clients with cosmwasm (through the 08-wasm go proxy module).
As discussed, this is being moved to the solidity repo instead. PR will be opened there. |
Description
closes: #7595
From the ibc-go devs I am looking mostly for structure feedback. @srdtrk can provide the rust specific feedback.
I played around with a few different options for folder structure, but ended up with the current structure, which has the main benefit of being close to everything light clients in the repo. An alternative I also tried was a root level "rust" folder, which also works, but the naming of the sub-folders felt more natural when it was under the light-clients folder.
Happy to hear other ideas and other naming suggestions in general.
This PR just aims to set up the structure to start moving code over from the Union light client repo. The 08-wasm light client that is there now is essentially a "mock" light client that will accept anything and always return true.
I also tried to move the api_contract into proto files to get them generated - and it is possible. It does require quite a bit of custom handling, especially for the rust generated code. In the end, I decided it might not be worth it due to both implementation really only needing JSON/serde. We could do this at a later point if we think it might be useful to also publish that contract api as a rust crate for easier implementation.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.