Skip to content

Commit c5eb22d

Browse files
authored
Merge pull request #2288 from CosmWasm/co/reference-types
Add reference types support
2 parents 0402335 + 849701a commit c5eb22d

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.circleci/config.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ commands:
3535
- run:
3636
name: Run cosmwasm-check (<< parameters.min_version >>)
3737
command: |
38-
cargo install cosmwasm-check@~<< parameters.min_version >> --locked --force
38+
# Try installing min_version, but fall back to latest main version.
39+
# This allows us to test contracts against the latest cosmwasm-check before releasing it.
40+
cargo install cosmwasm-check@~<< parameters.min_version >> --locked --force \
41+
|| cargo install --path ../../packages/check --locked --force
3942
cosmwasm-check --version
4043
cosmwasm-check target/wasm32-unknown-unknown/release/*.wasm
4144
# Run clippy after wasm build to ensure target/wasm32-unknown-unknown/release/<contract>.wasm exists
@@ -92,7 +95,7 @@ workflows:
9295
matrix:
9396
parameters:
9497
# Run with MSRV and some modern stable Rust
95-
rust-version: ["1.74.0", "1.78.0"]
98+
rust-version: ["1.74.0", "1.82.0"]
9699
- benchmarking:
97100
requires:
98101
- package_vm
@@ -652,7 +655,8 @@ jobs:
652655

653656
contract_hackatom:
654657
docker:
655-
- image: rust:1.74
658+
# We compile this contract with the upper bound to detect issues with new Rust versions early
659+
- image: rust:1.82
656660
environment:
657661
RUST_BACKTRACE: 1
658662
working_directory: ~/cosmwasm/contracts/hackatom
@@ -664,10 +668,9 @@ jobs:
664668
command: rustc --version; cargo --version; rustup --version
665669
- restore_cache:
666670
keys:
667-
- cargocache-v2-contract_hackatom-rust:1.74-{{ checksum "Cargo.lock" }}
671+
- cargocache-v2-contract_hackatom-rust:1.82-{{ checksum "Cargo.lock" }}
668672
- check_contract:
669-
min_version: "1.4"
670-
skip_cosmwasm_check: true
673+
min_version: "2.2"
671674
- save_cache:
672675
paths:
673676
- /usr/local/cargo/registry
@@ -677,7 +680,7 @@ jobs:
677680
- target/wasm32-unknown-unknown/release/.fingerprint
678681
- target/wasm32-unknown-unknown/release/build
679682
- target/wasm32-unknown-unknown/release/deps
680-
key: cargocache-v2-contract_hackatom-rust:1.74-{{ checksum "Cargo.lock" }}
683+
key: cargocache-v2-contract_hackatom-rust:1.82-{{ checksum "Cargo.lock" }}
681684

682685
contract_ibc_callbacks:
683686
docker:
@@ -722,10 +725,8 @@ jobs:
722725
- restore_cache:
723726
keys:
724727
- cargocache-v2-contract_ibc_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
725-
# TODO: enable again once 2.2 is released
726728
- check_contract:
727729
min_version: "2.2"
728-
skip_cosmwasm_check: true
729730
- save_cache:
730731
paths:
731732
- /usr/local/cargo/registry
@@ -864,10 +865,8 @@ jobs:
864865
- restore_cache:
865866
keys:
866867
- cargocache-v2-contract_reflect-rust:1.74-{{ checksum "Cargo.lock" }}
867-
# TODO: enable again once 2.2 is released
868868
- check_contract:
869869
min_version: "2.2"
870-
skip_cosmwasm_check: true
871870
- save_cache:
872871
paths:
873872
- /usr/local/cargo/registry
@@ -1144,7 +1143,7 @@ jobs:
11441143

11451144
coverage:
11461145
docker:
1147-
- image: rust:1.78.0-alpine3.19
1146+
- image: rust:1.82.0-alpine3.19
11481147
environment:
11491148
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
11501149
RUST_TEST_THREADS: 8

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ and this project adheres to
2626
- cosmwasm-vm: Export a new `migrate_with_info` function ([#2212])
2727
- cosmwasm-derive: Add support for migrate method with
2828
`migrate_info: MigrateInfo` argument. ([#2212])
29+
- cosmwasm-vm: Enable support for reference-types proposal, required since Rust
30+
1.82 ([#2288])
2931

3032
[#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118
3133
[#2196]: https://github.com/CosmWasm/cosmwasm/pull/2196
3234
[#2220]: https://github.com/CosmWasm/cosmwasm/pull/2220
3335
[#2212]: https://github.com/CosmWasm/cosmwasm/pull/2212
36+
[#2288]: https://github.com/CosmWasm/cosmwasm/pull/2288
3437

3538
### Changed
3639

packages/vm/src/parsed_wasm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> ParsedWasm<'a> {
7979
multi_value: true,
8080
floats: true,
8181

82-
reference_types: false,
82+
reference_types: true,
8383
bulk_memory: false,
8484
simd: false,
8585
relaxed_simd: false,

packages/vm/src/wasm_backend/gatekeeper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl Default for Gatekeeper {
5959
Self::new(GatekeeperConfig {
6060
allow_floats: true,
6161
allow_feature_bulk_memory_operations: false,
62-
allow_feature_reference_types: false,
62+
allow_feature_reference_types: true,
6363
allow_feature_simd: false,
6464
allow_feature_exception_handling: false,
6565
allow_feature_threads: false,

0 commit comments

Comments
 (0)