-
Notifications
You must be signed in to change notification settings - Fork 975
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
New merkle tree that is compatible with ICS23 / IBC proofs #279
Conversation
pls update 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.
LGTM! (it looks like it needs fmt, we can base this on #250 to get a working CI on this)
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.
LGTM! Thank you!
The IBC packet timeout works well with this merkle tree's proof (for checking the receipt absence).
pls update wasm |
6752ebb
to
e617cf9
Compare
for some reason the CI is not running on the last commit after rebase |
…ts (instead of changing the tests)
…ded professionalization and I made a change to minimize heap allocations and vector copies
…d non-existence proofs
ecdb8ec
to
b6b6491
Compare
* bat/new-merkle-tree: changelog: add #279 apps/dev-deps: remove unused cargo-watch update checksums wasm [fix]: Fixed a small bug in existence proofs [fix]: Updated Cargo.lock files [feat]: Change the ibc-leaf-spec to be the same for both existence and non-existence proofs [fix]: Updating the .lock file [feat]: Downstreaming changes from arse-merkle-tree. That library needed professionalization and I made a change to minimize heap allocations and vector copies [fix]: Fixed map of ibc keys into fixed keyspace and fixed tests [fix]: Fixed new merkle trees to be compatible with existing unit tests (instead of changing the tests) [fix]: Fixed the proof specs. Tests now passing [feat]: Integrated in new merkle tree for ibc. Proofs are not correct yet
Closes #92
depends on #351
We are using a new implementation of merkle trees from our sparse-merkle-tree fork (this is also worth reviewing). The merkle tree uses a fixed key space (parameterized by a const set at compile time), but does not give any particular mapping from the app side key space into the tree's key space. Before, this mapping was given by a hash function. Now it is up to the application side to make this choice.
For the IBC subtree, our keys are strings, so the function we use is utf8 encodings which are right padded with 0xFF (an invalid utf8 character) to fill out a 120 byte array. (This 120 can be changed later). Then every byte is incremented by one, modulo 256. This is an order preserving, collision resistant mapping. It's not randomizing across the codomain however, so there is still reason to switch back to a tradition SMT once possible.
Our other subtrees use a Sha256 hash to map into their respective keyspaces. We have ensured that inclusion proofs works for all trees. Futhermore, non-inclusion proofs have been tested and verified for the IBC subtree.