Skip to content

Commit

Permalink
Remove interface version 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Nov 17, 2023
1 parent 8a652d7 commit 3743684
Show file tree
Hide file tree
Showing 3 changed files with 8 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
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 3743684

Please sign in to comment.