-
Notifications
You must be signed in to change notification settings - Fork 661
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
Change MerklePath
to use bytes
instead of string
#6496
Comments
This issue would also help with
Also here, the link attached to state and path are the same, should they be different? |
After discussing this in slack, we decided to assign it to @damiannolan since he wanted to pick this up next week earlier and I'll be on holiday next week |
yes, updated now 👍 |
After discussing, we opted to reserve the existing merkle path field number and add a new field with the same name and update type for |
Note to update migration docs as part of this issue! |
I think we may be able to make path functions in 24-host private after this. Unsure if we want to continue exposing the path functions or if the key functions are enough |
yaaaay #5670 (comment) |
Discussed with @colin-axner, as this is a breaking api change for 08-wasm client contracts we have introduced a new field The new field is only used when a non-utf8 encoded merkle path is provided. If the merkle path bytes are utf8 encoded then the cc. @benluelo, I think I saw you guys might be working with a native golang client now, but wanted to make you aware of this anyways! edit: One thing I don't particularly like about doing this with the contract api messages is that there is no clear point at which we can ever switch over completely and remove |
FWIW, i think doing a breaking change here is the best bet; there are very few users of 08-wasm light clients currently (compared to native tendermint clients), and i wonder if this backwards compatibility is worth the additional complexity to the types and downstream consumers - it would be nice to just force this breaking change, and provide good documentation on how to do a migration. we are still using 08-wasm clients extensively and would welcome this breaking change (without the two fields) |
Thanks for the feedback @benluelo! Much appreciated, I'll bring this to the team's attention and see if we can just go ahead and rip the bandaid off. I'd prefer that too, personally! |
Opening until #6644 is merged, docs came in first |
Closed by #6644 |
Summary
Change the
MerklePath.KeyPath
field to userepeated bytes
instead ofrepeated strings
.Problem Definition
According to the protobuf specification:
string
bytes
In go, neither strings nor bytes are required to be valid utf8 characters, ref:
Thus trying to prove a key which includes an address (arbitrary bytes) will fail.
Use cases
As requested by @benluelo, it is desirable to verify the following state at this path which is stored under arbiraty bytes (not guaranteed to be valid utf8).
Proposal
Change the commitment proto
MerklePath
type to usebytes
. This is a breaking change to the proto type and thus would require a bump in the package version. This type is only imported in proto byQueryVerifyMembershipProof
which was recently added. I recommend we reserve the existing field number and add a new field number with the new type, reusing themerkle_path
field in that query.It should be noted that contracts relying on this field will need to be updated to use the new field, but as it was recently added, we should be able to inform any users before they deploy contracts using the old value.
I believe this will be a common issue as it is quite lucky that all ibc keys happen to be valid utf8 characters.
For Admin Use
The text was updated successfully, but these errors were encountered: