Skip to content

Latest commit

 

History

History
700 lines (518 loc) · 26.6 KB

CHANGELOG.md

File metadata and controls

700 lines (518 loc) · 26.6 KB

CHANGELOG

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.5.5 - 2024-05-10

Changed

  • cosmwasm-std: Deprecate "compact" serialization of Binary, HexBinary (#2126)

Fixed

  • cosmwasm-std: Fix CWA-2024-002

Added

  • cosmwasm-std: Implement &T + T and &T op &T for Uint64, Uint128, Uint256 and Uint512; improve panic message for Uint64::add and Uint512::add (#2092)
  • cosmwasm-std: Add Uint{64,128,256,512}::strict_add and ::strict_sub which are like the Add/Sub implementations but const. (#2098, #2107)

Changed

  • cosmwasm-std: Let Timestamp::plus_nanos/::minus_nanos use Uint64::strict_add/::strict_sub and document overflows. (#2098, #2107)

Fixed

  • cosmwasm-std: Correctly deallocate vectors that were turned into a Region via release_buffer (#2062)

Changed

  • cosmwasm-vm: Read Region from Wasm memory as bytes and convert to Region afterwards (#2005)

1.5.2 - 2024-01-15

Fixed

  • cosmwasm-vm: Fix memory increase issue (1.3 -> 1.4 regression) by avoiding the use of a long running Wasmer Engine. (#1978)

1.5.1 - 2024-01-10

Fixed

  • cosmwasm-vm: Fix CWA-2023-004.

Added

  • cosmwasm-vm: Add constructor CacheOptions::new

1.5.0 - 2023-10-31

Added

  • cosmwasm-std: Add addr_make and with_prefix for cosmwasm_std::testing::MockApi (#1905).
  • cosmwasm-std: Add abs and unsigned_abs for Int{64,128,256,512} (#1854).
  • cosmwasm-std: Add From<Int{64,128,256}> for Int512, TryFrom<Int{128,256,512}> for Int64, TryFrom<Int{256,512}> for Int128, TryFrom<Int512> for Int256 and Int256::from_i128 for const contexts (#1861).
  • cosmwasm-std: Add Int{64,128,256}::{checked_multiply_ratio, full_mul} (#1866)
  • cosmwasm-std: Add is_negative for Int{64,128,256,512} (#1867).
  • cosmwasm-std: Add TryFrom<Uint{256,512}> for Uint64 and TryFrom<Uint{A}> for Int{B} where A >= B (#1870).
  • cosmwasm-std: Add to_json_{vec,binary,string} and from_json and deprecate to_{vec,binary} in favor of to_json_{vec,binary} and from_{slice,binary} in favor of from_json. (#1886)
  • cosmwasm-std: Add SignedDecimal and SignedDecimal256 (#1807).
  • cosmwasm-vm: Allow float operations with NaN canonicalization (#1864).

Changed

  • cosmwasm-vm: Added .module extension to file names in the file system cache (#1913).

1.4.1 - 2023-10-09

Fixed

  • cosmwasm-vm: Fix a 1.3.x -> 1.4.0 regression bug leading to a Wasmer runtime error: RuntimeError: out of bounds memory access in cases when the Wasm file is re-compiled and used right away. (#1907)

Changed

  • cosmwasm-check: Use "=" for pinning the versions of cosmwasm-vm and cosmwasm-std dependencies. This ensures that you can use an older version of cosmwasm-check together with the VM of the same version by doing cargo install cosmwasm-check@1.4.1. A typical use case would be to check a contract with CosmWasm 1.4, 1.5 and 2.0. Note that other dependencies are still upgraded when using cargo install which may lead to API, behavioural or compiler incompatibilities. The --locked feature allows you use the versions locked when the release was created.

1.4.0 - 2023-09-04

Added

  • cosmwasm-std: Implement Not for Uint{64,128,256} (#1799).
  • cosmwasm-std: Add iterators for Coins (#1806).
  • cosmwasm-std: Make abs_diff const for Uint{256,512} and Int{64,128,256,512}. It is now const for all integer types.
  • cosmwasm-std: Implement TryFrom<Decimal256> for Decimal (#1832)
  • cosmwasm-std: Add StdAck. (#1512)
  • cosmwasm-std: Add new imports db_next_{key, value} for iterating storage keys / values only and make Storage::{range_keys, range_values} more efficient. This requires the cosmwasm_1_4 feature to be enabled. (#1834)
  • cosmwasm-std: Add DistributionQuery::{DelegationRewards, DelegationTotalRewards, DelegatorValidators}. This requires the cosmwasm_1_4 feature to be enabled. (#1788)

Changed

  • cosmwasm-vm: Avoid using loupe for getting the Module size in the file system cache to prepare for the Wasmer 3 upgrade.
  • cosmwasm-vm: When enabling print_debug the debug logs are now printed to STDERR instead of STDOUT by default (#1667).
  • cosmwasm-vm: Add Instance::set_debug_handler/unset_debug_handler to allow customizing the handling of debug messages emitted by the contract (#1667).
  • cosmwasm-vm: Upgrade Wasmer to version 4.1. (#1674, #1693, #1701, #1793)
  • cosmwasm-check: Update clap dependency to version 4 (#1677)
  • cosmwasm-vm: Use wasmparser for initial validation instead of parity-wasm (#1786)
  • cosmwasm-std: Make constructors Decimal{,256}::{percent,permille,bps} const
  • cosmwasm-std: Use new db_next_key import to make skip and nth implementation of range iterators more efficient. This requires the cosmwasm_1_4 feature to be enabled. (#1838)

1.3.3 - 2023-08-22

Added

  • cosmwasm-std: Implement into_empty for QuerierWrapper, Deps and DepsMut.

1.3.2 - 2023-08-15

Fixed

  • cosmwasm-std: Export CoinFromStrError, CoinsError and DivisionError

1.3.1 - 2023-07-26

Fixed

  • cosmwasm-std: Export DelegatorWithdrawAddressResponse, DenomMetadataResponse and AllDenomMetadataResponse which were added in 1.3.0 (#1795).

Changed

  • cosmwasm-std: Query responses are now exported, even if the corresponding cargo feature is not enabled (#1795).

1.3.0 - 2023-07-17

Fixed

  • cosmwasm-vm: Add missing cache stats increment when calling pin.

Added

  • cosmwasm-std: Implement BankQuery::AllDenomMetadata to allow querying all the denom metadata and BankQuery::DenomMetadata to query a specific one. In order to use this query in a contract, the cosmwasm_1_3 feature needs to be enabled for the cosmwasm_std dependency. This makes the contract incompatible with chains running anything lower than CosmWasm 1.3.0. (#1647)
  • cosmwasm-std: Add DistributionQuery::DelegatorWithdrawAddress. Also needs the cosmwasm_1_3 feature (see above). (#1593)
  • cosmwasm-std: Add DistributionMsg::FundCommunityPool. Also needs the cosmwasm_1_3 feature (see above). (#1747)
  • cosmwasm-std: Add FromStr impl for Coin. (#1684)
  • cosmwasm-std: Add Coins helper to handle multiple coins. (#1687)
  • cosmwasm-vm: Add Cache::save_wasm_unchecked to save Wasm blobs that have been checked before. This is useful for state-sync where we know the Wasm code was checked when it was first uploaded. (#1635)
  • cosmwasm-vm: Allow sign extension Wasm opcodes in static validation. This allows contracts to be compiled with Rust 1.70.0 and above. (#1727)
  • cosmwasm-std: Add trait functions Storage::range_keys and Storage::range_values. The default implementations just use Storage::range. Later this can be implemented more efficiently. (#1748)
  • cosmwasm-std: Add Int64, Int128, Int256 and Int512 signed integer types. (#1718)

Changed

  • cosmwasm-vm: Add checks for table section of Wasm blob (#1631).
  • cosmwasm-vm: Limit number of imports during static validation (#1629).
  • cosmwasm-vm: Add target (triple + CPU features) into the module cache directory to avoid using modules compiled for a different system. Bump MODULE_SERIALIZATION_VERSION to "v6". (#1664)
  • cosmwasm-vm: Add .wasm extension to stored wasm files (#1686).

Deprecated

  • cosmwasm-storage: All exports are deprecated because this crate will be removed with CosmWasm 2.0 (#1596).

1.2.7 - 2023-06-19

Added

  • cosmwasm-std: Add << and <<= implementation for Uint{64,128,256,512} types. (#1723)
  • cosmwasm-std: Add Timestamp::{plus,minus}_{minutes, hours, days}. (#1729)
  • cosmwasm-std: Add Decimal::bps and Decimal256::bps to create a decimal from a basis point value (#1715).

Changed

  • cosmwasm-std: Coin uses shorter Coin { 123 "ucosm" } format for Debug (#1704)

1.2.6 - 2023-06-05

Changed

  • cosmwasm-vm: Bumped module serialization version from v4 to v5 to invalidate potentially corrupted caches caused by Rust update. See CosmWasm/wasmvm#426 for more information. (#1708)

1.2.5 - 2023-05-02

Added

  • cosmwasm-std: Implement PartialEq for Addr == &Addr and &Addr == Addr as well as Event == &Event and &Event == Event (#1672).
  • cosmwasm-std: Add #[must_use] annotations to Uint64, Uint128, Uint256, Uint512, Decimal and Decimal256 math operations (#1678)

Deprecated

  • cosmwasm-std: The PartialEq implementations between Addr and &str/String are deprecated because they are not considered to be safe. In almost all cases you want to convert both sides of the equation to Addr first. If you really want to do a string comparison, use Addr::as_str() explicitly. (#1671)

1.2.4 - 2023-04-17

Fixed

  • cosmwasm-vm: Add call depths limit

1.2.3 - 2023-03-22

  • cosmwasm-vm: Use saturating increments for Stats fields to ensure we don't run into overflow issues.

1.2.2 - 2023-03-08

Added

  • cosmwasm-std: Add an IBC querier implementation to testing::MockQuerier (#1620, #1624).
  • cosmwasm-std: Add #[must_use] annotations to Timestamp math functions.

Fixed

  • all: Fix backtraces feature for newer versions of Rust. This still requires Rust nightly (#1613).
  • cosmwasm-std: Add missing export CheckedMultiplyFractionError (#1608).

1.2.1 - 2023-01-30

Added

  • cosmwasm-std: Add Decimal{,256}::to_uint_floor and ::to_uint_ceil for efficient and explicit decimal to uint conversion (#1603).

Fixed

  • cosmwasm-std: Make fields of WeightedVoteOption public to allow constructing it (#1597).

Changed

  • cosmwasm-std: Improve readability of Debug output for Decimal and Decimal256 (#1600).

1.2.0 - 2023-01-24

Added

  • cosmwasm-std: Add GovMsg::VoteWeighted. In order to use this in a contract, the cosmwasm_1_2 feature needs to be enabled for the cosmwasm_std dependency. This makes the contract incompatible with chains running versions of CosmWasm earlier than 1.2.0 (#1481).
  • cosmwasm-std: Add instantiate2_address which allows calculating the predictable addresses for MsgInstantiateContract2 (#1437, #1554).
  • cosmwasm-std: Add WasmMsg::Instantiate2 (requires cosmwasm_1_2, see GovMsg::VoteWeighted above) to instantiate contracts at a predictable address (#1436, #1554)).
  • cosmwasm-schema: In contracts, cosmwasm schema will now output a separate JSON Schema file for each entrypoint in the raw subdirectory (#1478, #1533).
  • cosmwasm-std: Upgrade serde-json-wasm dependency to 0.5.0 which adds map support to to_vec/to_binary and friends.
  • cosmwasm-std: Implement AsRef<[u8]> for Binary and HexBinary (#1550).
  • cosmwasm-std: Allow constructing SupplyResponse via a Default implementation (#1552, #1560).
  • cosmwasm-std: Add Never type which cannot be instantiated. This can be used as the error type for ibc_packet_receive or ibc_packet_ack to gain confidence that the implementations never errors and the transaction does not get reverted. (#1513)
  • cosmwasm-std: Add new WasmQuery::CodeInfo to get the checksum of a code ID (#1561).
  • cosmwasm-vm: Add Cache::remove_wasm to remove obsolete Wasm blobs and their compiled modules.
  • cosmwasm-std: Implement fraction multiplication and division. Assists with Uint & Decimal arithmetic and exposes methods for flooring/ceiling result (#1485, #1566).

Changed

  • cosmwasm-vm: Avoid exposing OS specific file system errors in order to test cosmwasm-vm on Windows. This gives us confidence for integrating cosmwasm-vm in a libwasmvm build on Windows. This change is likely to be consensus breaking as error messages change. (#1406)
  • cosmwasm-vm: Use Display representation for embedding Wasmer InstantiationErrors (#1508).

Fixed

  • cosmwasm-schema: Nested QueryMsg with generics is now supported by the QueryResponses macro (#1516).
  • cosmwasm-schema: A nested QueryMsg no longer causes runtime errors if it contains doc comments.
  • cosmwasm-std/cosmwasm-vm: Increase length limit for address conversion in MockApi to support addresses longer than 54 bytes (#1529).

1.1.9 - 2022-12-06

Fixed

  • cosmwasm-schema: Fix type fully qualified path to symbol QueryResponses in macro cosmwasm_schema::generate_api! (#1527).

1.1.8 - 2022-11-22

Fixed

  • cosmwasm-schema: Fix type params on QueryMsg causing a compiler error when used with the QueryResponses derive macro.

1.1.6 - 2022-11-16

Added

  • cosmwasm-std: Add From implementations to convert between CanonicalAddr/Binary as well as CanonicalAddr/HexBinary (#1463).
  • cosmwasm-std: Add From implementations to convert u8 arrays to CanonicalAddr (#1463).
  • cosmwasm-std: Implement PartialEq between CanonicalAddr and HexBinary/Binary (#1463).

Changed

  • all: Bump a few dependency versions to make the codebase compile with -Zminimal-versions (#1465).
  • cosmwasm-profiler: Package was removed 🪦. It served its job showing us that we cannot properly measure different runtimes for differet Wasm opcodes.
  • cosmwasm-schema: schema generation is now locked to produce strictly draft-07 schemas
  • cosmwasm-schema: QueryResponses derive now sets the JsonSchema trait bound on the generated impl block. This allows the contract dev to not add a JsonSchema trait bound on the type itself.

1.1.5 - 2022-10-17

Added

  • cosmwasm-std: Add wrapping_add, wrapping_sub, wrapping_mul and wrapping_pow to Uint256/Uint512.
  • cosmwasm-schema: Better error messaging when attempting to compile schema generator for wasm32
  • cosmwasm-vm: In the secp256k1_verify, secp256k1_recover_pubkey, ed25519_verify and ed25519_batch_verify import implementations we now exit early if the gas left is not sufficient to perform the operation.

Changed

  • cosmwasm-std: Remove non_exhaustive from IBC types IbcChannelOpenMsg, IbcChannelConnectMsg and IbcChannelCloseMsg in order to allow exhaustive matching over the possible scenarios without an unused fallback case (#1449).

1.1.4 - 2022-10-03

Fixed

  • cosmwasm-schema: Properly analyze schemas generated for untagged enums

1.1.3 - 2022-09-29

Fixed

  • cosmwasm-schema: IntegrityError is now public

1.1.2 - 2022-09-19

Added

  • cosmwasm-std: Add testing macro assert_approx_eq! for comparing two integers to be relatively close to each other (#1417).
  • cosmwasm-std: Add HexBinary which is like Binary but encodes to hex strings in JSON. Add StdError::InvalidHex error case. (#1425)

Fixed

  • cosmwasm-vm: Bump MODULE_SERIALIZATION_VERSION to "v4" because the module serialization format changed between Wasmer 2.2 and 2.3 (#1426).
  • cosmwasm-schema: The QueryResponses derive macro now supports QueryMsgs with generics. (#1429)

1.1.1 - 2022-09-15

Fixed

  • cosmwasm-schema: Using QueryResponses with a QueryMsg containing a unit-like variant will no longer crash. The different variant types in Rust are:
    enum QueryMsg {
        UnitLike,
        Tuple(),
        Struct {},
    }
    It's still recommended to only use struct variants, even if there are no fields.

Changed

  • cosmwasm-schema: It is no longer necessary to specify serde or schemars as a dependency in order to make cosmwasm-schema macros work.

1.1.0 - 2022-09-05

Added

  • cosmwasm-std: Implement PartialEq for Binary and u8 arrays.
  • cosmwasm-std: Add Uint{64,128,256,512}::one.
  • cosmwasm-std: Add Uint{64,128,256,512}::abs_diff and Decimal{,256}::abs_diff (#1334).
  • cosmwasm-std: Implement From<Decimal> for Decimal256.
  • cosmwasm-std: Implement Rem/RemAssign for Decimal/Decimal256.
  • cosmwasm-std: Implement checked_add/_sub/_div/_rem for Decimal/Decimal256.
  • cosmwasm-std: Implement pow/saturating_pow for Decimal/Decimal256.
  • cosmwasm-std: Implement ceil/floor for Decimal/Decimal256.
  • cosmwasm-std: Implement PartialEq for reference on one side and owned value on the other for all Uint and Decimal types
  • cosmwasm-std: Implement saturating_add/sub/mul for Decimal/Decimal256.
  • cosmwasm-std: Implement BankQuery::Supply to allow querying the total supply of a native token. In order to use this query in a contract, the cosmwasm_1_1 feature needs to be enabled for the cosmwasm_std dependency. This makes the contract incompatible with chains running CosmWasm 1.0. (#1356)
  • cosmwasm-std: Implement MIN const value for all Uint and Decimal types
  • cosmwasm-std: Implement checked_div_euclid for Uint256/Uint512
  • cosmwasm-std: Add QuerierWrapper::query_wasm_contract_info - this is just a convenience helper for querying WasmQuery::ContractInfo.
  • cosmwasm-check: This is a new binary package that allows running various CosmWasm compatibility checks on compiled .wasm files. See https://crates.io/crates/cosmwasm-check for usage info.

Changed

  • cosmwasm-vm/cosmwasm-profiler: Upgrade Wasmer to 2.3.0.
  • cosmwasm-std: Enable the abort feature by default. This provides more helpful panic messages via a custom panic handler.
  • cosmwasm-std: Make Decimal{,256}::DECIMAL_PLACES a public u32 value.
  • cosmwasm-crypto: Bumped k256 0.10.4 -> 0.11 and digest 0.9 -> 0.10 (#1374).
  • cosmwasm-vm: Rename features to capabilities, including
    1. features_from_csv to capabilities_from_csv;
    2. CacheOptions::supported_features to CacheOptions::available_capabilities;
    3. MockInstanceOptions::supported_features to MockInstanceOptions::available_capabilities
    4. Instance::required_features to Instance::required_capabilities
    5. AnalysisReport::required_features to AnalysisReport::required_capabilities.

Deprecated

  • cosmwasm-vm: The check_contract example was deprecated. Please use the new crate cosmwasm-check instead (#1371).

1.0.0 - 2022-05-14

Added

  • cosmwasm-std: Export DelegationResponse (#1301).
  • cosmwasm-std: When the new abort feature is enabled, cosmwasm-std installs a panic handler that aborts the contract and passes the panic message to the host. The abort feature can only be used when deploying to chains that implement the import. For this reason, it's not yet enabled by default. (#1299)
  • cosmwasm-vm: A new import abort is created to abort contract execution when requested by the contract. (#1299)
  • cosmwasm-std: Add new ibc3 feature that allows to use IBC-Go V3 features, like version negotiation and exposing relayer address to the contract. Requires a compatible wasmd runtime (v0.27.0+) (#1302)

The CHANGELOG for versions before 1.0.0 was moved to CHANGELOG-pre1.0.0.md.