Skip to content
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

Add reference types support #2288

Merged
merged 5 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ commands:
- run:
name: Run cosmwasm-check (<< parameters.min_version >>)
command: |
cargo install cosmwasm-check@~<< parameters.min_version >> --locked --force
# Try installing min_version, but fall back to latest main version.
# This allows us to test contracts against the latest cosmwasm-check before releasing it.
cargo install cosmwasm-check@~<< parameters.min_version >> --locked --force \
|| cargo install --path ../../packages/check --locked --force
cosmwasm-check --version
cosmwasm-check target/wasm32-unknown-unknown/release/*.wasm
# Run clippy after wasm build to ensure target/wasm32-unknown-unknown/release/<contract>.wasm exists
Expand Down Expand Up @@ -92,7 +95,7 @@ workflows:
matrix:
parameters:
# Run with MSRV and some modern stable Rust
rust-version: ["1.74.0", "1.78.0"]
rust-version: ["1.74.0", "1.82.0"]
- benchmarking:
requires:
- package_vm
Expand Down Expand Up @@ -652,7 +655,8 @@ jobs:

contract_hackatom:
docker:
- image: rust:1.74
# We compile this contract with the upper bound to detect issues with new Rust versions early
- image: rust:1.82
environment:
RUST_BACKTRACE: 1
working_directory: ~/cosmwasm/contracts/hackatom
Expand All @@ -664,10 +668,9 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-v2-contract_hackatom-rust:1.74-{{ checksum "Cargo.lock" }}
- cargocache-v2-contract_hackatom-rust:1.82-{{ checksum "Cargo.lock" }}
- check_contract:
min_version: "1.4"
skip_cosmwasm_check: true
min_version: "2.2"
- save_cache:
paths:
- /usr/local/cargo/registry
Expand All @@ -677,7 +680,7 @@ jobs:
- target/wasm32-unknown-unknown/release/.fingerprint
- target/wasm32-unknown-unknown/release/build
- target/wasm32-unknown-unknown/release/deps
key: cargocache-v2-contract_hackatom-rust:1.74-{{ checksum "Cargo.lock" }}
key: cargocache-v2-contract_hackatom-rust:1.82-{{ checksum "Cargo.lock" }}

contract_ibc_callbacks:
docker:
Expand Down Expand Up @@ -722,10 +725,8 @@ jobs:
- restore_cache:
keys:
- cargocache-v2-contract_ibc_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
# TODO: enable again once 2.2 is released
- check_contract:
min_version: "2.2"
skip_cosmwasm_check: true
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down Expand Up @@ -864,10 +865,8 @@ jobs:
- restore_cache:
keys:
- cargocache-v2-contract_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
# TODO: enable again once 2.2 is released
- check_contract:
min_version: "2.2"
skip_cosmwasm_check: true
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down Expand Up @@ -1144,7 +1143,7 @@ jobs:

coverage:
docker:
- image: rust:1.78.0-alpine3.19
- image: rust:1.82.0-alpine3.19
environment:
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
RUST_TEST_THREADS: 8
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ and this project adheres to
- cosmwasm-vm: Export a new `migrate_with_info` function ([#2212])
- cosmwasm-derive: Add support for migrate method with
`migrate_info: MigrateInfo` argument. ([#2212])
- cosmwasm-vm: Enable support for reference-types proposal, required since Rust
1.82 ([#2288])

[#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118
[#2196]: https://github.com/CosmWasm/cosmwasm/pull/2196
[#2220]: https://github.com/CosmWasm/cosmwasm/pull/2220
[#2212]: https://github.com/CosmWasm/cosmwasm/pull/2212
[#2288]: https://github.com/CosmWasm/cosmwasm/pull/2288

### Changed

Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/parsed_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<'a> ParsedWasm<'a> {
multi_value: true,
floats: true,

reference_types: false,
reference_types: true,
bulk_memory: false,
simd: false,
relaxed_simd: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/src/wasm_backend/gatekeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Default for Gatekeeper {
Self::new(GatekeeperConfig {
allow_floats: true,
allow_feature_bulk_memory_operations: false,
allow_feature_reference_types: false,
allow_feature_reference_types: true,
allow_feature_simd: false,
allow_feature_exception_handling: false,
allow_feature_threads: false,
Expand Down
Loading