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

fix: revert part of #4181 to classify FailedWithNoError as deterministic #4278

Merged
merged 2 commits into from
May 6, 2021
Merged
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion neard/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neard"
version = "1.19.0-rc.1"
version = "1.19.0-rc.2"
authors = ["Near Inc <[email protected]>"]
edition = "2018"
default-run = "neard"
Expand Down
16 changes: 15 additions & 1 deletion runtime/near-vm-runner/src/wasmer_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down