CosmWasm / cosmwasm

Framework for building smart contracts in Wasm for the Cosmos SDK

Home Page:https://www.cosmwasm.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove cosmwasm-storage

webmaster128 opened this issue · comments

The next major version of cosmwasm-* should mark the EOL of cosmwasm-storage. In practice storage-plus is used already almost everywhere. If cosmwasm-storage does or contains anything you need that is not in storage-plus, let us know.

For what it's worth, we've found the helper methods… helpful:

  • to_length_prefixed_nested
  • to_length_prefixed

These are particularly helpful when constructing raw queries. Thanks for flagging the EOL in an issue, which helps makes this visible to outsiders like us.

Do you know if this logic will be moved somewhere else? I think we might copy the helper methods and those they call (with proper attribution to the 👑 authors 👑 ) in the meantime.

We'll copy it mainly because there's a dependency that's not playing nicely with wasm architecture. This is not a question or ticket, but more of a "nice-to-know" I'll drop here:

error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
   --> /Users/mikepurvis/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.2.9/src/lib.rs:281:9
    |
281 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
282 | |                         default, you may need to enable the \"js\" feature. \
283 | |                         For more information see: \
284 | |                         https://docs.rs/getrandom/#webassembly-support");
    | |________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module `imp`
   --> /Users/mikepurvis/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.2.9/src/lib.rs:337:9
    |
337 |         imp::getrandom_inner(dest)?;
    |         ^^^ use of undeclared crate or module `imp`

Do you know if this logic will be moved somewhere else?

If you need them I can easily move them to cosmwasm-std. I'm a bit prod of the key layout schema discussed here.

Actually that might help my dependency problem here where the development contracts currently depend on cosmwasm-storage.

This is also nice because then cw-storage can depend on them instead of copying the functionality.

there's a dependency

Any idea which depenency this is? Those things come up some times if you don't use resolver version 2 or dependencies pull in "rand" or "rand_core" with default features enabled.

if you don't use resolver version 2 or dependencies pull in "rand" or "rand_core" with default features enabled.

Yes! It was a dependency dealing with randomness. I'm afraid I don't know what "resolver version 2" is.

I will note that after a call with an integrating partner from Vectis DAO, I found a path forward without having to use the to_length_prefixed* methods. Really appreciate the time and response

I'm afraid I don't know what "resolver version 2" is.

See https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions and https://blog.rust-lang.org/2021/05/11/edition-2021.html#default-cargo-feature-resolver.

In #1676 you find a writeup about key storage layout that might be of great educational if you are fiddling with those sort of things.