From 68e8e07edb1c1ae30f840b601fdea716f972edf4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 May 2021 13:49:35 +0300 Subject: [PATCH 1/2] fix: revert part of #4181 to classify FailedWithNoError as deterministic --- runtime/near-vm-runner/src/wasmer_runner.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/runtime/near-vm-runner/src/wasmer_runner.rs b/runtime/near-vm-runner/src/wasmer_runner.rs index 32026e71924..645d1c7ff14 100644 --- a/runtime/near-vm-runner/src/wasmer_runner.rs +++ b/runtime/near-vm-runner/src/wasmer_runner.rs @@ -101,7 +101,21 @@ impl IntoVMError for wasmer_runtime::error::RuntimeError { // Failed unwinder may happen in the case of deep recursion/stack overflow. // Also can be thrown on unreachable instruction, which is quite unfortunate. InvokeError::FailedWithNoError => VMError::FunctionCallError( - FunctionCallError::Nondeterministic("FailedWithNoError".to_string()), + // XXX: this is a hot-fix. Initially, we treated this error + // case as a normal one (so, we stored this error in our + // state, etc.) + // + // Then, in + // https://github.com/near/nearcore/pull/4181#discussion_r606267838 + // we reasoned that this error actually happens + // non-deterministically, so it's better to panic in this + // case. + // + // However, when rolling this out, we noticed that this + // error happens deterministically for at least one + // contract, so here we flip it back to some deterministic + // error, which won't cause the node to panic. + FunctionCallError::WasmTrap(WasmTrap::Unreachable) ), // Indicates that a trap occurred that is not known to Wasmer. // As of 0.17.0, thrown only from Cranelift BE. From 1b71720b3370c0965b4ed04f388174715d9fadf2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 6 May 2021 14:04:00 +0300 Subject: [PATCH 2/2] bump version --- Cargo.lock | 2 +- neard/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 985227c0572..89017edf9f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3679,7 +3679,7 @@ dependencies = [ [[package]] name = "neard" -version = "1.19.0-rc.1" +version = "1.19.0-rc.2" dependencies = [ "actix", "actix-rt", diff --git a/neard/Cargo.toml b/neard/Cargo.toml index 7fabd51bc49..74216ce5281 100644 --- a/neard/Cargo.toml +++ b/neard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "neard" -version = "1.19.0-rc.1" +version = "1.19.0-rc.2" authors = ["Near Inc "] edition = "2018" default-run = "neard"