0

I am running substrate based solo chain using AURA and GRANDPA. I have upgraded the runtime to use polkadot v0.9.27 branch and it was working fine for some days. now suddenly my nodes are getting this error message:

   0: sp_panic_handler::set::{{closure}}
   1: std::panicking::rust_panic_with_hook
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
   2: std::panicking::begin_panic_handler::{{closure}}
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:586:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:138:18
   4: rust_begin_unwind
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
   5: core::panicking::panic_fmt
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   7: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
   8: <sc_service::task_manager::prometheus_future::PrometheusFuture<T> as core::future::future::Future>::poll
   9: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
  10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  11: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  12: tokio::runtime::task::core::CoreStage<T>::poll
  13: tokio::runtime::task::harness::poll_future
  14: tokio::runtime::task::harness::Harness<T,S>::poll
  15: std::thread::local::LocalKey<T>::with
  16: tokio::runtime::thread_pool::worker::Context::run_task
  17: tokio::runtime::thread_pool::worker::Context::run
  18: tokio::macros::scoped_tls::ScopedKey<T>::set
  19: tokio::runtime::thread_pool::worker::run
  20: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  21: tokio::runtime::task::harness::Harness<T,S>::poll
  22: tokio::runtime::blocking::pool::Inner::run
  23: std::sys_common::backtrace::__rust_begin_short_backtrace
  24: core::ops::function::FnOnce::call_once{{vtable.shim}}
  25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
      std::sys::unix::thread::Thread::new::thread_start
             at rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys/unix/thread.rs:108:17
  26: <unknown>
  27: __clone


Thread 'tokio-runtime-worker' panicked at 'Integer overflow when casting to u64', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/primitive-types-0.10.1/src/lib.rs:38

How can I fix this bug?

1 Answer 1

1

The path github.com-1ecc6299db9ec823/primitive-types-0.10.1/src/lib.rs:38 seems to link to U256 type.

You probably triggered this error: https://github.com/paritytech/parity-common/blob/1d3a3d5138403bbf07d42978b29d8ac7d3fff53b/uint/src/uint.rs#L655

So I guess some code is using a U256 and is calling as_u64 on a value which overflows u64 type.

Try using TryFrom trait instead of as_u64 in your code maybe or look where this could triggered I guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.