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

chore: update wasmtime #12890

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
224 changes: 127 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ tracing-subscriber = { version = "0.3.18", features = [
] }
trybuild = "1.0.11"
turn = "0.6"
wasm-encoder = "0.218.0"
wasm-encoder = "0.221.0"
wasmer-compiler = { package = "wasmer-compiler-near", version = "=2.4.1" }
wasmer-compiler-singlepass = { package = "wasmer-compiler-singlepass-near", version = "=2.4.1" }
wasmer-engine = { package = "wasmer-engine-near", version = "=2.4.1" }
Expand All @@ -398,9 +398,9 @@ wasmer-runtime-core = { version = "0.18.2", package = "wasmer-runtime-core-near"
wasmer-types = { package = "wasmer-types-near", version = "=2.4.1" }
wasmer-vm = { package = "wasmer-vm-near", version = "=2.4.1" }
wasmparser = "0.78" # TODO: unify at least the versions of wasmparser we have in our codebase
wasmprinter = "0.218"
wasm-smith = "0.218"
wasmtime = { version = "26.0.1", default-features = false, features = [
wasmprinter = "0.221"
wasm-smith = "0.221"
wasmtime = { version = "29.0.1", default-features = false, features = [
"cranelift",
] }
wast = "40.0"
Expand Down
7 changes: 1 addition & 6 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ skip = [

# Need this specific version of pwasm-utils for backwards-compatible
# stack limiting.
{ name = "pwasm-utils", version = "=0.12.0" },
{ name = "parity-wasm", version = "=0.41.0" },
# old version used by wasmer et al
{ name = "dynasm", version = "=1.2.3" },
Expand All @@ -57,7 +56,6 @@ skip = [
{ name = "object", version = "=0.30.4" },
{ name = "memoffset", version = "=0.6.5" },
{ name = "memoffset", version = "=0.8.0" },
{ name = "addr2line", version = "=0.19.0" },
{ name = "gimli", version = "=0.27.2" },

# wasm-tools
Expand All @@ -69,6 +67,7 @@ skip = [
{ name = "wasmprinter", version = "=0.2.57" },

# wasmer 0.17.x
{ name = "target-lexicon", version = "^0.12.0" },
{ name = "parking_lot", version = "=0.10.2" },
{ name = "parking_lot_core", version = "=0.7.2" },
{ name = "lock_api", version = "=0.3.4" },
Expand All @@ -89,7 +88,6 @@ skip = [
{ name = "getrandom", version = "=0.1.16" },

# criterion and criterion-plot use conflicting versions
{ name = "semver-parser", version = "=0.7.0" },
{ name = "semver", version = "=0.9.0" },

# criterion, wasmer-runtime-core-near, rocksdb depend on this older version of the crate.
Expand All @@ -109,9 +107,6 @@ skip = [
# prometheus depends on an old version of protobuf
{ name = "protobuf", version = "=2.27.1" },

# rust-s3 is using an old version of smartstring
{ name = "smartstring", version = "=0.2.10" },

# Various packages haven’t upgraded to 0.base64 21 yet.
{ name = "base64", version = "=0.13.0" },
{ name = "ahash", version = "=0.7.8" },
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-runner/src/near_vm_runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#[derive(Hash, PartialEq, Debug)]
#[allow(unused)]
enum NearVmCompiler {
Singlepass = 1,

Check warning on line 31 in runtime/near-vm-runner/src/near_vm_runner/mod.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Singlepass)
Cranelift = 2,
Llvm = 3,
}
Expand All @@ -38,9 +38,9 @@
// major version << 6
// minor version
const VM_CONFIG: NearVmConfig = NearVmConfig {
seed: (2 << 29) | (2 << 6) | 4,
seed: (2 << 29) | (2 << 6) | 5,
engine: NearVmEngine::Universal,
compiler: NearVmCompiler::Singlepass,

Check warning on line 43 in runtime/near-vm-runner/src/near_vm_runner/mod.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Singlepass)
};

pub(crate) fn near_vm_vm_hash() -> u64 {
Expand Down
56 changes: 28 additions & 28 deletions runtime/near-vm-runner/src/tests/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
let code = [42; 1000];
let code = ContractCode::new(code.to_vec(), None);
let code_hash = *code.hash();
let terragas = 1000000000000u64;

Check warning on line 33 in runtime/near-vm-runner/src/tests/cache.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (terragas)
assert_eq!(cache.len(), 0);
let outcome1 = make_cached_contract_call_vm(
Arc::clone(&config),
Expand All @@ -38,7 +38,7 @@
code_hash,
Some(&code),
"method_name1",
terragas,

Check warning on line 41 in runtime/near-vm-runner/src/tests/cache.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (terragas)
vm_kind,
)
.expect("bad failure");
Expand All @@ -50,7 +50,7 @@
code_hash,
None,
"method_name2",
terragas,

Check warning on line 53 in runtime/near-vm-runner/src/tests/cache.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (terragas)
vm_kind,
)
.expect("bad failure");
Expand Down Expand Up @@ -148,23 +148,23 @@
// fall through the cracks here, but hopefully it should catch most of the fish just fine.
let seeds = [2, 3, 5, 7, 11, 13, 17];
let prepared_hashes = [
7891448467132053449,
9113804040784454744,
15987320570619072032,
7232953852262286521,
7536220052944640509,
13392993251733921322,
4364804287818604246,
10570074354427437071,
112822494854026494,
8923373422804896330,
7482465259708658318,
17593373341226268225,
16574762561946343960,
6263133173262547027,
];
let mut got_prepared_hashes = Vec::with_capacity(seeds.len());
let compiled_hashes = [
17577916829021396775,
8041373570933915084,
6630926580728989211,
4387381945665529622,
4511251750786693810,
4599571621125708978,
18136310787576767811,
13571899357794997814,
3529004220149248510,
12618963124682967106,
17344326048993250539,
9020736083169133944,
6686183491943308521,
12077631041629763505,
];
let mut got_compiled_hashes = Vec::with_capacity(seeds.len());
for seed in seeds {
Expand Down Expand Up @@ -227,24 +227,24 @@
let seeds = [2, 3, 5, 7, 11, 13, 17];
let prepared_hashes = [
// See the above comment if you want to change this
1949662663451079349,
2708994788591458264,
5012156334458820956,
9920955889305541399,
18300200182157745360,
870351225951448146,
2224723427035408206,
2827992185785358581,
17421797339778310713,
16714934007236574397,
1884675227101889895,
10936343070920321432,
10728749071033926115,
8212262804128939827,
];
let mut got_prepared_hashes = Vec::with_capacity(seeds.len());
let compiled_hashes = [
// See the above comment if you want to change this
17541855811103092909,
11151026003357116368,
6536268071368571568,
3800417228716434560,
12640841643239683751,
10206902649207070630,
14540739231666637305,
1182021398207161502,
905660765117347293,
16348151278815489293,
4289237417580123383,
13920596352648058761,
6324750771081683425,
4237611324950808774,
];
let mut got_compiled_hashes = Vec::with_capacity(seeds.len());
for seed in seeds {
Expand Down
6 changes: 5 additions & 1 deletion runtime/near-vm-runner/src/tests/test_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ impl TestBuilder {

if let Some(err) = outcome.aborted {
let err_str = err.to_string();
assert!(err_str.len() < 1000, "errors should be bounded in size to prevent abuse via exhausting the storage space");
assert!(
err_str.len() < 1000,
"errors should be bounded in size to prevent abuse \
via exhausting the storage space. Got: {err_str}"
);
if self.opaque_error {
writeln!(&mut got, "Err: ...").unwrap();
} else {
Expand Down
2 changes: 1 addition & 1 deletion runtime/near-vm-runner/src/wasmer2_runner.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::cache::{CompiledContract, CompiledContractInfo, ContractRuntimeCache};
use crate::errors::ContractPrecompilatonResult;

Check warning on line 2 in runtime/near-vm-runner/src/wasmer2_runner.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Precompilaton)
use crate::logic::errors::{
CacheError, CompilationError, FunctionCallError, MethodResolveError, VMRunnerError, WasmTrap,
};
Expand All @@ -11,14 +11,14 @@
use crate::runner::VMResult;
use crate::{get_contract_cache_key, imports, ContractCode};
use crate::{prepare, Contract};
use memoffset::offset_of;

Check warning on line 14 in runtime/near-vm-runner/src/wasmer2_runner.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (memoffset)
use near_parameters::vm::VMKind;
use near_parameters::RuntimeFeesConfig;
use std::borrow::Cow;
use std::hash::Hash;
use std::mem::size_of;
use std::sync::Arc;
use wasmer_compiler_singlepass::Singlepass;

Check warning on line 21 in runtime/near-vm-runner/src/wasmer2_runner.rs

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (singlepass)
use wasmer_engine::{Engine, Executable};
use wasmer_engine_universal::{
Universal, UniversalEngine, UniversalExecutable, UniversalExecutableRef,
Expand Down Expand Up @@ -218,7 +218,7 @@
// major version << 6
// minor version
const WASMER2_CONFIG: Wasmer2Config = Wasmer2Config {
seed: (1 << 29) | (12 << 6) | 3,
seed: (1 << 29) | (12 << 6) | 4,
engine: WasmerEngine::Universal,
compiler: WasmerCompiler::Singlepass,
};
Expand Down
4 changes: 3 additions & 1 deletion runtime/near-vm-runner/src/wasmtime_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ impl IntoVMError for anyhow::Error {
};
return Err(VMRunnerError::Nondeterministic(nondeterministic_message.into()));
}
Ok(FunctionCallError::LinkError { msg: format!("{:#?}", cause) })
// FIXME: this can blow up in size and would get stored in the storage in case this was a
// production runtime. Something more proper should be done here.
Ok(FunctionCallError::LinkError { msg: format!("{:?}", cause) })
}
}

Expand Down
Loading