Skip to content

Commit

Permalink
Merge pull request #1952 from CosmWasm/remove-allow-interface-7
Browse files Browse the repository at this point in the history
Remove interface version 7 support
  • Loading branch information
chipshort committed Nov 20, 2023
2 parents 4caa9f0 + 58791c5 commit 888552a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,15 @@ jobs:
- run:
name: Build with all features
working_directory: ~/project/packages/vm
command: cargo build --locked --features allow_interface_version_7,iterator,staking,stargate
command: cargo build --locked --features iterator,staking,stargate
- run:
name: Test
working_directory: ~/project/packages/vm
command: cargo test --locked
- run:
name: Test with all features
working_directory: ~/project/packages/vm
command: cargo test --locked --features allow_interface_version_7,iterator,staking,stargate
command: cargo test --locked --features iterator,staking,stargate
- run:
name: Test multi threaded cache
working_directory: ~/project/packages/vm
Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
- run:
name: Test with all features
working_directory: ~/project/packages/vm
command: cargo test --locked --features allow_interface_version_7,iterator,staking,stargate
command: cargo test --locked --features iterator,staking,stargate
- save_cache:
paths:
# ".." is the easiest way to get $HOME here (pwd is $HOME\project)
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ and this project adheres to
`IbcReceiveResponse::new` instead. ([#1942])
- cosmwasm-vm: Remove `InstanceOptions::print_debug` flag. Set your own handler
using `Instance::set_debug_handler`. ([#1953])
- cosmwasm-vm: Remove `allow_interface_version_7` feature and all related
functionality. ([#1952])

[cw-storage-plus]: https://github.com/CosmWasm/cw-storage-plus
[#1875]: https://github.com/CosmWasm/cosmwasm/pull/1875
[#1890]: https://github.com/CosmWasm/cosmwasm/pull/1890
[#1896]: https://github.com/CosmWasm/cosmwasm/pull/1896
[#1936]: https://github.com/CosmWasm/cosmwasm/pull/1936
[#1942]: https://github.com/CosmWasm/cosmwasm/pull/1942
[#1952]: https://github.com/CosmWasm/cosmwasm/pull/1952
[#1953]: https://github.com/CosmWasm/cosmwasm/pull/1953

## [1.5.0] - 2023-10-31
Expand Down
13 changes: 4 additions & 9 deletions packages/vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@ staking = ["cosmwasm-std/staking"]
stargate = ["cosmwasm-std/stargate"]
# Use cranelift backend instead of singlepass. This is required for development on Windows.
cranelift = ["wasmer/cranelift"]
# It's a bit unclear if interface_version_7 (CosmWasm 0.16) contracts are fully compatible
# with newer hosts. If old contracts are important to you and you are willing to take the risk,
# activate this feature.
# See also https://gist.github.com/webmaster128/3cd1988680843ecaf7548050821e1e6f.
allow_interface_version_7 = []

[lib]
# See https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
bench = false

[dependencies]
bytes = "1.4.0" # need a higher version than the one required by Wasmer for the Bytes -> Vec<u8> implementation
bytes = "1.4.0" # need a higher version than the one required by Wasmer for the Bytes -> Vec<u8> implementation
clru = "0.6.1"
crc32fast = "1.3.2"
# Uses the path when built locally; uses the given version from crates.io when published
Expand All @@ -54,8 +49,8 @@ wasmer-middlewares = "=4.2.2"
# Dependencies that we do not use ourself. We add those entries
# to bump the min version of them.
bytecheck = "0.6.3" # With this version the simdutf8 dependency became optional
enumset = "1.0.2" # Fixes https://github.com/Lymia/enumset/issues/17 (https://github.com/Lymia/enumset/commit/a430550cd6a3c9b1ef636d37f75dede7616f5b62)
bitflags = "1.1.0" # https://github.com/CensoredUsername/dynasm-rs/pull/74
enumset = "1.0.2" # Fixes https://github.com/Lymia/enumset/issues/17 (https://github.com/Lymia/enumset/commit/a430550cd6a3c9b1ef636d37f75dede7616f5b62)
bitflags = "1.1.0" # https://github.com/CensoredUsername/dynasm-rs/pull/74

# Wasmer git/local (used for quick local debugging or patching)
# wasmer = { git = "https://github.com/wasmerio/wasmer", rev = "877ce1f7c44fad853c", default-features = false, features = ["cranelift", "singlepass"] }
Expand All @@ -64,7 +59,7 @@ bitflags = "1.1.0" # https://github.com/CensoredUsername/dynasm-rs/pull/74
# wasmer-middlewares = { path = "../../../wasmer/lib/middlewares" }

[dev-dependencies]
criterion = { version = "0.4", features = [ "html_reports" ] }
criterion = { version = "0.4", features = ["html_reports"] }
glob = "0.3.1"
hex-literal = "0.3.1"
tempfile = "3.1.0"
Expand Down
25 changes: 1 addition & 24 deletions packages/vm/src/compatibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ const REQUIRED_EXPORTS: &[&str] = &[
];

const INTERFACE_VERSION_PREFIX: &str = "interface_version_";
const SUPPORTED_INTERFACE_VERSIONS: &[&str] = &[
"interface_version_8",
#[cfg(feature = "allow_interface_version_7")]
"interface_version_7",
];
const SUPPORTED_INTERFACE_VERSIONS: &[&str] = &["interface_version_8"];

const MEMORY_LIMIT: u32 = 512; // in pages
/// The upper limit for the `max` value of each table. CosmWasm contracts have
Expand Down Expand Up @@ -443,25 +439,6 @@ mod tests {
let module = ParsedWasm::parse(&wasm).unwrap();
check_interface_version(&module).unwrap();

#[cfg(feature = "allow_interface_version_7")]
{
// valid legacy version
let wasm = wat::parse_str(
r#"(module
(type (func))
(func (type 0) nop)
(export "add_one" (func 0))
(export "allocate" (func 0))
(export "interface_version_7" (func 0))
(export "deallocate" (func 0))
(export "instantiate" (func 0))
)"#,
)
.unwrap();
let module = ParsedWasm::parse(&wasm).unwrap();
check_interface_version(&module).unwrap();
}

// missing
let wasm = wat::parse_str(
r#"(module
Expand Down

0 comments on commit 888552a

Please sign in to comment.