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

docs: update migration docs for merkle path v2 changes #6757

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

damiannolan
Copy link
Contributor

Description

Migration documentation for merkle path v2 in 08-wasm contract apis.

ref: #6496


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.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

@damiannolan damiannolan marked this pull request as ready for review July 3, 2024 14:23
docs/docs/03-light-clients/04-wasm/09-migrations.md Outdated Show resolved Hide resolved
Comment on lines 47 to 53
#[cw_serde]
pub struct MerklePath {
+ #[schemars(with = "String")]
+ #[serde(with = "Base64", default)]
+ pub key_path: Vec<Bytes>,
- pub key_path: Vec<String>,
}
Copy link
Contributor Author

@damiannolan damiannolan Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srdtrk, could you confirm if this is correct unmarshalling syntax for []string -> [][]byte? I can also modify the composable-ibc grandpa-cw contract and try to test this

this was based on code here: https://github.com/ComposableFi/composable-ibc/blob/main/light-clients/ics10-grandpa-cw/src/msg.rs#L150-L167

I'm unsure if Bytes is some kind of alias or not. Is Vec<Vec<u8>> valid syntax also? Maybe with the alias is fine...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the right way to do it, @srdtrk?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've decided to replace the usage of Bytes with cosmwasm_std::Binary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.rs/cosmwasm-std/2.0.4/cosmwasm_std/struct.Binary.html

Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.

This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs looks great to me!

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs, pending just figuring out how to decode this on the contract side...

@damiannolan damiannolan added this pull request to the merge queue Jul 9, 2024
Merged via the queue into main with commit d2a579e Jul 9, 2024
26 checks passed
@damiannolan damiannolan deleted the damian/6496-merkle-path-migration-docs-for-wasm branch July 9, 2024 13:13
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 this pull request may close these issues.

5 participants