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

Add a workspace test to prevent incompatible wasm issue happend last week #35

Closed
ailisp opened this issue Jun 19, 2023 · 7 comments · Fixed by #46
Closed

Add a workspace test to prevent incompatible wasm issue happend last week #35

ailisp opened this issue Jun 19, 2023 · 7 comments · Fixed by #46

Comments

@ailisp
Copy link
Collaborator

ailisp commented Jun 19, 2023

Problem
We hit a incompatible wasm compilation by rustc 1.70 issue. As a result, the incompatible wasm cannot be loaded by nearcore and we cannot call self_upgrade to update it. This can only be caught by deploying the contract to a node and test it on CI, before deploy to production.

Acceptance Criteria

  • Add a workspace test that deploy the contract and call self_upgrade method as sanity check.
  • Add it to CI, using the exactly same configuration that uses for build and deploy to production
@jaswinder6991
Copy link
Contributor

I am starting to learn the workspaces-rs project. I can take this up. I might take more time than expected. If this is not a priority, I want to work on this.

@frol
Copy link
Collaborator

frol commented Jul 20, 2023

Just for the context, I touched a little bit on the topic of workspaces-rs on the call working on the state migration: https://drive.google.com/file/d/182K4BPJdHZw-TjqqTvSgnnLKBs9j7tt8/view?usp=drivesdk

@jaswinder6991
Copy link
Contributor

I actually got the inspiration to work on this after watching the video. I also want to start contributing to the workspaces project. So I feel like using it for a contract might be the best way to get to know it.

@jaswinder6991
Copy link
Contributor

I know this issue is only for the self_upgrade functions testing but I feel like we should have a foundation to start writing workspaces tests for all upcoming functionality and we can also maybe in parallel write tests for features which are already present.

@jaswinder6991
Copy link
Contributor

I wrote a simple branch to setup workspaces-rs test suits. It is not PR ready but would want to get your comments.

I have a question too. I compiled the contract with rust 1.71.0 and deployed it to testnet and it worked. I am assuming the self_upgrade won't work though. I am not sure why it would successfully deploy. Some information for my personal knowledge here.

In the test, I wrote. If the code is compiled with 1.71.0, workspaces won't even let it deploy. So if we are putting a test for rust version incompatibility, we don't really have to do self_upgrade function for sanity check. Unless there is something I am missing.
Here is error that I see on workspaces if I deploy a 1.71.0 version -
status: Failure(ActionError(ActionError { index: Some(0), kind: FunctionCallError(CompilationError(PrepareError(Deserialization))) }))

@jaswinder6991
Copy link
Contributor

@frol could you help here.

@ailisp
Copy link
Collaborator Author

ailisp commented Jul 26, 2023

@jaswinder6991 workspace needs an update to support post rust 1.70 contracts. For now you can pin your rustc to 1.69 and run the test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants