terra-money / terrain

🛠 A Terra development environment for seamless smart contract development
https://docs.terra.money/develop/guides/initial
GNU General Public License v3.0
47 stars 37 forks source link

[BUG] PLEASE BUMP OPTIMIZER VERSION!!!! #156

Open llllllluc opened 10 months ago

llllllluc commented 10 months ago

Recommended solution

Bump optimizer version from 0.12.6 to 0.14.0 or latest.

Issue description

see more detail in my msg in cosmwasm discord

Steps to reproduce the issue

  1. Start a new cosmwasm repo, set cosmwasm-std version to 1.4.1 (latest, or any version >= 1.3)
  2. Use terrain or terrariums to deploy the code
  3. You will see bnum error like below, this is because bnum requires a higher rust version >= 1.65, current version of workspace optimizer use 0.12.6, which use rust 1.6, we need to bump workspace optimizer to 0.14.0 to fix it
   Compiling bnum v0.7.0
   Compiling serde_derive v1.0.189
   Compiling thiserror-impl v1.0.49
error[E0599]: no method named `cast_mut` found for raw pointer `*const [u8; 8]` in the current scope
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/bnum-0.7.0/src/bint/endian.rs:77:47
    |
77  |                     let ptr = uninit.as_ptr().cast_mut() as *mut u8;
    |                                               ^^^^^^^^ help: there is an associated function with a similar name: `as_mut`
...
225 | crate::macro_impl!(endian);
    | -------------------------- in this macro invocation
    |
    = note: try using `<*const T>::as_ref()` to get a reference to the type behind the pointer: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref
    = note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior
    = note: this error originates in the macro `endian` (in Nightly builds, run with -Z macro-backtrace for more info)

Temporary workaround

hardcode cw version to 1.2 cosmwasm-std = "=1.2" so it doesn't contain bnum, this can work with current terrain.

Tools and operating system versions

Additional details / screenshot

llllllluc commented 10 months ago

Please also update terrariums until it's merge it into terrain.