Skip to content

Computing a secret contract at a nonexistent address throws exception in core, but never returns error #10

Open
@lacabra

Description

@lacabra

Describe the bug
This is a Rainy Day Scenario in that when requesting a secret computation for an address that doesn't exist, core throws an exception with Err(DBErr { command: "read", kind: MissingKey } but never returns an error, so the task remains in a pending state forever.

To Reproduce
Steps to reproduce the behavior:

  1. Launch the network
  2. Run the following tests:
01_init.spec.js
20_execute_fail_nonexistent.spec.js
  1. Look at the network output

Expected behavior
The request should error out properly, so that the final state of that task is FAILURE.

Backtrace

core_1       | 17:51:49 [INFO] LOG DERIVE: Err(DBErr { command: "read", kind: MissingKey }
core_1       | 
core_1       | stack backtrace:
core_1       |    0: failure::backtrace::internal::InternalBacktrace::new::hd54d52db2f9fbb87 (0x55cb3513b08e)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
core_1       |    1: failure::backtrace::Backtrace::new::h18f3254a81d719d4 (0x55cb3513ab5d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
core_1       |    2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from::h4692336be5d447c0 (0x55cb346c61cd)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
core_1       |    3: <failure::error::Error as core::convert::From<F>>::from::h8154022ce05a9bcd (0x55cb346c5eb0)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
core_1       |    4: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::{{closure}}::{{closure}}::ha2ee73746281d2de (0x55cb347b95f1)
core_1       |              at src/lib.rs:1
core_1       |    5: <enigma_core_app::db::primitives::DeltaKey as enigma_core_app::db::primitives::SplitKey>::as_split::h04f892585d67a184 (0x55cb3473a709)
core_1       |              at src/db/primitives.rs:76
core_1       |    6: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::{{closure}}::h05dc351d9d7a6ff1 (0x55cb347b9c8f)
core_1       |              at src/lib.rs:1
core_1       |    7: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::h2ca1867e3c167421 (0x55cb347b8c31)
core_1       |              at src/db/dal.rs:180
core_1       |    8: <enigma_core_app::db::dal::DB as enigma_core_app::db::iterator::P2PCalls<alloc::vec::Vec<u8>>>::get_contract::{{closure}}::h0a3a6f79e5b0e76b (0x55cb34741459)
core_1       |              at src/db/iterator.rs:330
core_1       |    9: <enigma_core_app::db::dal::DB as enigma_core_app::db::iterator::P2PCalls<alloc::vec::Vec<u8>>>::get_contract::hc09b2fd538ff2312 (0x55cb347cf409)
core_1       |              at src/db/iterator.rs:330
core_1       |   10: enigma_core_app::networking::ipc_listener::handling::compute_task::{{closure}}::ha338c150af4ed5ab (0x55cb347cdd38)
core_1       |              at src/networking/ipc_listener.rs:336
core_1       |   11: enigma_core_app::networking::ipc_listener::handling::compute_task::h058a4549ad01db07 (0x55cb3476c78b)
core_1       |              at src/networking/ipc_listener.rs:336
core_1       |   12: enigma_core_app::networking::ipc_listener::handle_message::h3f5adaddd536f32a (0x55cb346c7882)
core_1       |              at src/networking/ipc_listener.rs:49
core_1       |   13: enigma_core_app::main::{{closure}}::h5744d50936109675 (0x55cb3469cab4)
core_1       |              at src/main.rs:35
core_1       |   14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once::hcf7c0f2b47908368 (0x55cb3469c97a)
core_1       |              at libcore/ops/function.rs:286
core_1       |   15: <core::option::Option<T>>::map::h237480fcfaf6263e (0x55cb346a3ddc)
core_1       |              at libcore/option.rs:424
core_1       |   16: <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll::h1e8235f68e9f7305 (0x55cb346b156a)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/stream/map.rs:79
core_1       |   17: <futures::stream::forward::Forward<T, U> as futures::future::Future>::poll::h4554ffc22ec46928 (0x55cb346bdc03)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/stream/forward.rs:94
core_1       |   18: <futures::future::map::Map<A, F> as futures::future::Future>::poll::h75346e05205ddd6d (0x55cb346b478d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/map.rs:30
core_1       |   19: <futures::future::chain::Chain<A, B, C>>::poll::hf410276b64149c8e (0x55cb346aada5)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/chain.rs:32
core_1       |   20: <futures::future::and_then::AndThen<A, B, F> as futures::future::Future>::poll::h0c64a4fb438e9a6f (0x55cb346b15f9)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/and_then.rs:32
core_1       |   21: <futures::task_impl::Spawn<T>>::poll_future_notify::{{closure}}::h83002d15fad3d344 (0x55cb3469bbc9)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:329
core_1       |   22: <futures::task_impl::Spawn<T>>::enter::{{closure}}::h66a2d0026a36b16e (0x55cb3469bd46)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:399
core_1       |   23: futures::task_impl::std::set::h70b3f4895d44099e (0x55cb346b0cec)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:78
core_1       |   24: <futures::task_impl::Spawn<T>>::enter::h916cb72a10e7e3de (0x55cb3469bcd2)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:399
core_1       |   25: <futures::task_impl::Spawn<T>>::poll_fn_notify::hc61bab2497b524dc (0x55cb3469baf4)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:291
core_1       |   26: <futures::task_impl::Spawn<T>>::poll_future_notify::hd5a0ad3b8cf2777f (0x55cb3469bb9d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:329
core_1       |   27: futures::task_impl::std::<impl futures::task_impl::Spawn<F>>::wait_future::{{closure}}::h8c2e40417b008568 (0x55cb346b0dc8)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:231
core_1       |   28: futures::task_impl::std::ThreadNotify::with_current::{{closure}}::h4c997fba60a124ca (0x55cb346b0bfe)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:478
core_1       |   29: <std::thread::local::LocalKey<T>>::try_with::h4721f58518e66853 (0x55cb346c25a3)
core_1       |              at libstd/thread/local.rs:294
core_1       |   30: <std::thread::local::LocalKey<T>>::with::h6ff60dc1922a8cff (0x55cb346c23a0)
core_1       |              at libstd/thread/local.rs:248
core_1       |   31: futures::task_impl::std::ThreadNotify::with_current::hb9d6c3df323f100d (0x55cb346b0bbd)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:478
core_1       |   32: futures::task_impl::std::<impl futures::task_impl::Spawn<F>>::wait_future::hd6741df2c48fa017 (0x55cb3469bd73)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:228
core_1       |   33: futures::future::Future::wait::h45dff97b88a20965 (0x55cb346b17f1)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/mod.rs:299
core_1       |   34: enigma_core_app::main::h7df6c523b46a0de9 (0x55cb346bf0c4)
core_1       |              at src/main.rs:34
core_1       |   35: std::rt::lang_start::{{closure}}::h827b14236ce6abd4 (0x55cb346a101f)
core_1       |              at libstd/rt.rs:74
core_1       |   36: std::rt::lang_start_internal::{{closure}}::hdc2a896aeffb5179 (0x55cb35656a22)
core_1       |              at libstd/rt.rs:59
core_1       |       std::panicking::try::do_call::h5a4eb2ce70a501f5
core_1       |              at libstd/panicking.rs:310
core_1       |   37: __rust_maybe_catch_panic (0x55cb35677979)
core_1       |              at libpanic_unwind/lib.rs:102
core_1       |   38: std::panicking::try::h97436c380f30f437 (0x55cb35658ee5)
core_1       |              at libstd/panicking.rs:289
core_1       |       std::panic::catch_unwind::h9c28ef6e0c478c5d
core_1       |              at libstd/panic.rs:392
core_1       |       std::rt::lang_start_internal::h6abd6befa9748e41
core_1       |              at libstd/rt.rs:58
core_1       |   39: std::rt::lang_start::h90eb684130af95e9 (0x55cb346a0ff7)
core_1       |              at libstd/rt.rs:74
core_1       |   40: main (0x55cb346bf259)
core_1       |   41: __libc_start_main (0x7f98bc4d3b96)
core_1       |   42: _start (0x55cb3469b6c9)
core_1       |   43: <unknown> (0x0))
core_1       | 17:51:49 [ERROR] Unwrapped p2p Message failed: DBErr { command: "read", kind: MissingKey }
core_1       | 
core_1       | stack backtrace:
core_1       |    0: failure::backtrace::internal::InternalBacktrace::new::hd54d52db2f9fbb87 (0x55cb3513b08e)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
core_1       |    1: failure::backtrace::Backtrace::new::h18f3254a81d719d4 (0x55cb3513ab5d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
core_1       |    2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from::h4692336be5d447c0 (0x55cb346c61cd)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
core_1       |    3: <failure::error::Error as core::convert::From<F>>::from::h8154022ce05a9bcd (0x55cb346c5eb0)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
core_1       |    4: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::{{closure}}::{{closure}}::ha2ee73746281d2de (0x55cb347b95f1)
core_1       |              at src/lib.rs:1
core_1       |    5: <enigma_core_app::db::primitives::DeltaKey as enigma_core_app::db::primitives::SplitKey>::as_split::h04f892585d67a184 (0x55cb3473a709)
core_1       |              at src/db/primitives.rs:76
core_1       |    6: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::{{closure}}::h05dc351d9d7a6ff1 (0x55cb347b9c8f)
core_1       |              at src/lib.rs:1
core_1       |    7: <enigma_core_app::db::dal::DB as enigma_core_app::db::dal::CRUDInterface<failure::error::Error, &'a K, alloc::vec::Vec<u8>, &'a [u8]>>::read::h2ca1867e3c167421 (0x55cb347b8c31)
core_1       |              at src/db/dal.rs:180
core_1       |    8: <enigma_core_app::db::dal::DB as enigma_core_app::db::iterator::P2PCalls<alloc::vec::Vec<u8>>>::get_contract::{{closure}}::h0a3a6f79e5b0e76b (0x55cb34741459)
core_1       |              at src/db/iterator.rs:330
core_1       |    9: <enigma_core_app::db::dal::DB as enigma_core_app::db::iterator::P2PCalls<alloc::vec::Vec<u8>>>::get_contract::hc09b2fd538ff2312 (0x55cb347cf409)
core_1       |              at src/db/iterator.rs:330
core_1       |   10: enigma_core_app::networking::ipc_listener::handling::compute_task::{{closure}}::ha338c150af4ed5ab (0x55cb347cdd38)
core_1       |              at src/networking/ipc_listener.rs:336
core_1       |   11: enigma_core_app::networking::ipc_listener::handling::compute_task::h058a4549ad01db07 (0x55cb3476c78b)
core_1       |              at src/networking/ipc_listener.rs:336
core_1       |   12: enigma_core_app::networking::ipc_listener::handle_message::h3f5adaddd536f32a (0x55cb346c7882)
core_1       |              at src/networking/ipc_listener.rs:49
core_1       |   13: enigma_core_app::main::{{closure}}::h5744d50936109675 (0x55cb3469cab4)
core_1       |              at src/main.rs:35
core_1       |   14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once::hcf7c0f2b47908368 (0x55cb3469c97a)
core_1       |              at libcore/ops/function.rs:286
core_1       |   15: <core::option::Option<T>>::map::h237480fcfaf6263e (0x55cb346a3ddc)
core_1       |              at libcore/option.rs:424
core_1       |   16: <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll::h1e8235f68e9f7305 (0x55cb346b156a)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/stream/map.rs:79
core_1       |   17: <futures::stream::forward::Forward<T, U> as futures::future::Future>::poll::h4554ffc22ec46928 (0x55cb346bdc03)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/stream/forward.rs:94
core_1       |   18: <futures::future::map::Map<A, F> as futures::future::Future>::poll::h75346e05205ddd6d (0x55cb346b478d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/map.rs:30
core_1       |   19: <futures::future::chain::Chain<A, B, C>>::poll::hf410276b64149c8e (0x55cb346aada5)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/chain.rs:32
core_1       |   20: <futures::future::and_then::AndThen<A, B, F> as futures::future::Future>::poll::h0c64a4fb438e9a6f (0x55cb346b15f9)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/and_then.rs:32
core_1       |   21: <futures::task_impl::Spawn<T>>::poll_future_notify::{{closure}}::h83002d15fad3d344 (0x55cb3469bbc9)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:329
core_1       |   22: <futures::task_impl::Spawn<T>>::enter::{{closure}}::h66a2d0026a36b16e (0x55cb3469bd46)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:399
core_1       |   23: futures::task_impl::std::set::h70b3f4895d44099e (0x55cb346b0cec)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:78
core_1       |   24: <futures::task_impl::Spawn<T>>::enter::h916cb72a10e7e3de (0x55cb3469bcd2)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:399
core_1       |   25: <futures::task_impl::Spawn<T>>::poll_fn_notify::hc61bab2497b524dc (0x55cb3469baf4)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:291
core_1       |   26: <futures::task_impl::Spawn<T>>::poll_future_notify::hd5a0ad3b8cf2777f (0x55cb3469bb9d)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/mod.rs:329
core_1       |   27: futures::task_impl::std::<impl futures::task_impl::Spawn<F>>::wait_future::{{closure}}::h8c2e40417b008568 (0x55cb346b0dc8)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:231
core_1       |   28: futures::task_impl::std::ThreadNotify::with_current::{{closure}}::h4c997fba60a124ca (0x55cb346b0bfe)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:478
core_1       |   29: <std::thread::local::LocalKey<T>>::try_with::h4721f58518e66853 (0x55cb346c25a3)
core_1       |              at libstd/thread/local.rs:294
core_1       |   30: <std::thread::local::LocalKey<T>>::with::h6ff60dc1922a8cff (0x55cb346c23a0)
core_1       |              at libstd/thread/local.rs:248
core_1       |   31: futures::task_impl::std::ThreadNotify::with_current::hb9d6c3df323f100d (0x55cb346b0bbd)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:478
core_1       |   32: futures::task_impl::std::<impl futures::task_impl::Spawn<F>>::wait_future::hd6741df2c48fa017 (0x55cb3469bd73)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/task_impl/std/mod.rs:228
core_1       |   33: futures::future::Future::wait::h45dff97b88a20965 (0x55cb346b17f1)
core_1       |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.26/src/future/mod.rs:299
core_1       |   34: enigma_core_app::main::h7df6c523b46a0de9 (0x55cb346bf0c4)
core_1       |              at src/main.rs:34
core_1       |   35: std::rt::lang_start::{{closure}}::h827b14236ce6abd4 (0x55cb346a101f)
core_1       |              at libstd/rt.rs:74
core_1       |   36: std::rt::lang_start_internal::{{closure}}::hdc2a896aeffb5179 (0x55cb35656a22)
core_1       |              at libstd/rt.rs:59
core_1       |       std::panicking::try::do_call::h5a4eb2ce70a501f5
core_1       |              at libstd/panicking.rs:310
core_1       |   37: __rust_maybe_catch_panic (0x55cb35677979)
core_1       |              at libpanic_unwind/lib.rs:102
core_1       |   38: std::panicking::try::h97436c380f30f437 (0x55cb35658ee5)
core_1       |              at libstd/panicking.rs:289
core_1       |       std::panic::catch_unwind::h9c28ef6e0c478c5d
core_1       |              at libstd/panic.rs:392
core_1       |       std::rt::lang_start_internal::h6abd6befa9748e41
core_1       |              at libstd/rt.rs:58
core_1       |   39: std::rt::lang_start::h90eb684130af95e9 (0x55cb346a0ff7)
core_1       |              at libstd/rt.rs:74
core_1       |   40: main (0x55cb346bf259)
core_1       |   41: __libc_start_main (0x7f98bc4d3b96)
core_1       |   42: _start (0x55cb3469b6c9)
core_1       |   43: <unknown> (0x0)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions