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

Decide on a convention for naming wasm byte code/byte code hash. #4852

Closed
2 of 3 tasks
DimitrisJim opened this issue Oct 6, 2023 · 4 comments
Closed
2 of 3 tasks
Assignees
Labels
08-wasm needs discussion Issues that need discussion before they can be worked on

Comments

@DimitrisJim
Copy link
Contributor

DimitrisJim commented Oct 6, 2023

Summary

This is unfortunately a messy situation at the moment.

For the wasm code, specifically:

For the codeHash/checkSum:

The mockVM added also introduced some names that are used in wasmd: WasmCode/CheckSum as the types and codeID/checksum as names, there's some discrepancy here that can be cleaned easily (codeID being used for both code/codeHash in these funcs, PinFn having it named checksum).


All these names make it difficult to follow along and make it easy to make subtle mistakes. It would be nice if all we had some form of consistency.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@DimitrisJim DimitrisJim added needs discussion Issues that need discussion before they can be worked on 08-wasm labels Oct 6, 2023
@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented Oct 6, 2023

Note that codeID is also a separate concept in wasmd and is used for storing CodeInfo's in state.

@crodriguezvega
Copy link
Contributor

For the wasm code, specifically:

code_bytes in Contract stored in GenesisState.
wasm_byte_code in MsgStoreCode.
For the codeHash/checkSum:

checkSum in MsgStoreCodeResponse
codeHash in both ClientState and used in messages/names for the CodeHashes rpc.

In this PR I chose those names to follow wasmd's convention. During the walkthrough we agreed to keep the naming like that.

I agree though that it's probably a good idea to change the naming in the mock functions to avoid the codeId / codeHash confusion.

@DimitrisJim
Copy link
Contributor Author

yeah, for one I think maybe the response for StoreCode should be the same as what is then used directly in ClientState?

@DimitrisJim DimitrisJim modified the milestone: v8.0.0 Oct 9, 2023
@crodriguezvega crodriguezvega added this to the 08-wasm/v0.1.0 milestone Oct 16, 2023
@crodriguezvega crodriguezvega self-assigned this Oct 27, 2023
@colin-axner colin-axner removed this from the 08-wasm/v0.1.0 milestone Oct 31, 2023
@crodriguezvega
Copy link
Contributor

Closed by #5030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
08-wasm needs discussion Issues that need discussion before they can be worked on
Projects
Archived in project
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants