Setheum-Labs / Setheum

Setheum: The Unified Web3 Base Layer - Globally Solving Web3ā€™s Fragmentation Problems. Ready for hacking šŸš€
https://setheum.xyz
GNU General Public License v3.0
24 stars 13 forks source link

Error: Thread 'tokio-runtime-worker' panicked at 'attempt to divide by zero' #803

Closed alfellati closed 2 years ago

alfellati commented 2 years ago

Error: Thread 'tokio-runtime-worker' panicked at 'attempt to divide by zero' when I make run. The output is as such:



Thread 'tokio-runtime-worker' panicked at 'attempt to divide by zero', /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/num/mod.rs:853

This is a bug. Please report it at:

        https://github.com/Setheum-Labs/Setheum/issues

2022-03-18 11:33:33 Proposing failed: ClientImport("RuntimeApiError(Application(Execution(RuntimePanicked(\"attempt to divide by zero\"))))")    
2022-03-18 11:33:36 šŸ™Œ Starting consensus session on top of parent 0x216314b79f0ad4e0ad0f198cbc22ab191ba47a259d7861243bc07e0b2f15e663    

====================

Version: 1.0.0-cc24e6ea-x86_64-linux-gnu

   0: sp_panic_handler::panic_hook
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/panic-handler/src/lib.rs:144:18
   1: sp_panic_handler::set::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/panic-handler/src/lib.rs:61:12
   2: std::panicking::rust_panic_with_hook
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:610:17
   3: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:500:13
   4: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/sys_common/backtrace.rs:139:18
   5: rust_begin_unwind
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:498:5
   6: core::panicking::panic_fmt
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panicking.rs:106:14
   7: core::panicking::panic
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panicking.rs:47:5
   8: core::num::<impl u128>::wrapping_div
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/num/uint_macros.rs:1267:13
      core::num::<impl u128>::saturating_div
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/num/uint_macros.rs:1137:13
   9: serp_treasury::<impl module_support::SerpTreasury<<T as frame_system::pallet::Config>::AccountId> for serp_treasury::module::Pallet<T>>::serp_tes_now
             at lib-serml/defi/serp/src/lib.rs:444:39
  10: serp_treasury::<impl serp_treasury::module::Pallet<T>>::stable_inflation_on_initialize
             at lib-serml/defi/serp/src/lib.rs:395:13
  11: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::Hooks<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
             at lib-serml/defi/serp/src/lib.rs:302:5
  12: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::OnInitialize<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
             at lib-serml/defi/serp/src/lib.rs:284:12
  13: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  14: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  15: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  16: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  17: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  18: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  19: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  20: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  21: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  22: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  23: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  24: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  25: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  26: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  27: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  28: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  29: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  30: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  31: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  32: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  33: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  34: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  35: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  36: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  37: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  38: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  39: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  40: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  41: <(TupleElement0,TupleElement1) as frame_support::traits::hooks::OnInitialize<BlockNumber>>::on_initialize
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/support/src/traits/hooks.rs:41:1
  42: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPallets,COnRuntimeUpgrade>::initialize_block_impl
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/executive/src/lib.rs:283:4
  43: frame_executive::Executive<System,Block,Context,UnsignedValidator,AllPallets,COnRuntimeUpgrade>::initialize_block
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/frame/executive/src/lib.rs:251:3
  44: <setheum_runtime::Runtime as sp_api::runtime_decl_for_Core::Core<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u32,sp_runtime::traits::BlakeTwo256>,sp_runtime::generic::unchecked_extrinsic::UncheckedExtrinsic<sp_runtime::multiaddress::MultiAddress<<<setheum_primitives::signature::SetheumMultiSignature as sp_runtime::traits::Verify>::Signer as sp_runtime::traits::IdentifyAccount>::AccountId,u32>,setheum_runtime::Call,setheum_primitives::signature::SetheumMultiSignature,(frame_system::extensions::check_spec_version::CheckSpecVersion<setheum_runtime::Runtime>,frame_system::extensions::check_tx_version::CheckTxVersion<setheum_runtime::Runtime>,frame_system::extensions::check_genesis::CheckGenesis<setheum_runtime::Runtime>,frame_system::extensions::check_mortality::CheckMortality<setheum_runtime::Runtime>,frame_system::extensions::check_nonce::CheckNonce<setheum_runtime::Runtime>,frame_system::extensions::check_weight::CheckWeight<setheum_runtime::Runtime>,module_transaction_payment::ChargeTransactionPayment<setheum_runtime::Runtime>,module_evm::SetEvmOrigin<setheum_runtime::Runtime>)>>>>::initialize_block
             at runtime/src/lib.rs:1715:4
  45: sp_api::runtime_decl_for_Core::initialize_block_native_call_generator::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/api/src/lib.rs:695:1
  46: <sc_service::client::call_executor::LocalCallExecutor<Block,B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call::{{closure}}::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/client/call_executor.rs:285:29
  47: <sc_executor::native_executor::NativeExecutor<D> as sp_core::traits::CodeExecutor>::call::{{closure}}::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:522:61
  48: std::panicking::try::do_call
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:406:40
  49: __rust_try
  50: std::panicking::try
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:370:19
  51: std::panic::catch_unwind
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panic.rs:133:14
  52: sc_executor::native_executor::with_externalities_safe::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:65:3
  53: environmental::using::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/environmental-1.1.3/src/lib.rs:125:3
  54: std::thread::local::LocalKey<T>::try_with
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/local.rs:399:16
  55: std::thread::local::LocalKey<T>::with
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/local.rs:375:9
  56: environmental::using
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/environmental-1.1.3/src/lib.rs:106:2
  57: sp_externalities::scope_limited::ext::using
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/environmental-1.1.3/src/lib.rs:252:5
  58: sp_externalities::scope_limited::set_and_run_with_externalities
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/externalities/src/scope_limited.rs:31:2
  59: sc_executor::native_executor::with_externalities_safe
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:61:2
  60: <sc_executor::native_executor::NativeExecutor<D> as sp_core::traits::CodeExecutor>::call::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:522:17
  61: sc_executor::native_executor::WasmExecutor::with_instance::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:187:5
  62: sc_executor::wasm_runtime::VersionedRuntime::with_instance
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/wasm_runtime.rs:98:18
  63: sc_executor::wasm_runtime::RuntimeCache::with_instance
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/wasm_runtime.rs:290:6
  64: sc_executor::native_executor::WasmExecutor::with_instance
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:176:9
  65: <sc_executor::native_executor::NativeExecutor<D> as sp_core::traits::CodeExecutor>::call
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/executor/src/native_executor.rs:485:16
  66: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_aux
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/state-machine/src/lib.rs:442:31
  67: sp_state_machine::execution::StateMachine<B,H,N,Exec>::execute_using_consensus_failure_handler
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/state-machine/src/lib.rs:563:46
  68: <sc_service::client::call_executor::LocalCallExecutor<Block,B,E> as sc_client_api::call_executor::CallExecutor<Block>>::contextual_call
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/client/call_executor.rs:283:5
  69: <sc_service::client::client::Client<B,E,Block,RA> as sp_api::CallApiAt<Block>>::call_api_at
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/client/client.rs:1834:3
  70: sp_api::runtime_decl_for_Core::initialize_block_call_api_at
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/api/src/lib.rs:695:1
  71: <setheum_runtime::RuntimeApiImpl<__SR_API_BLOCK__,RuntimeApiImplCall> as sp_api::Core<__SR_API_BLOCK__>>::Core_initialize_block_runtime_api_impl::{{closure}}
             at runtime/src/lib.rs:1704:1
  72: setheum_runtime::RuntimeApiImpl<Block,C>::call_api_at
             at runtime/src/lib.rs:1704:1
  73: <setheum_runtime::RuntimeApiImpl<__SR_API_BLOCK__,RuntimeApiImplCall> as sp_api::Core<__SR_API_BLOCK__>>::Core_initialize_block_runtime_api_impl
             at runtime/src/lib.rs:1704:1
  74: sp_api::Core::initialize_block_with_context
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/primitives/api/src/lib.rs:695:1
  75: sc_block_builder::BlockBuilder<Block,A,B>::new
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/block-builder/src/lib.rs:183:3
  76: <sc_service::client::client::Client<B,E,Block,RA> as sc_block_builder::BlockBuilderProvider<B,Block,sc_service::client::client::Client<B,E,Block,RA>>>::new_block_at
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/client/client.rs:1419:3
  77: sc_basic_authorship::basic_authorship::Proposer<B,Block,C,A,PR>::propose_with::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/basic-authorship/src/basic_authorship.rs:316:4
  78: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/mod.rs:80:19
  79: <sc_basic_authorship::basic_authorship::Proposer<B,Block,C,A,PR> as sp_consensus::Proposer<Block>>::propose::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/basic-authorship/src/basic_authorship.rs:274:15
  80: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/mod.rs:80:19
  81: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/future.rs:119:9
  82: <sc_service::task_manager::prometheus_future::PrometheusFuture<T> as core::future::future::Future>::poll
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/task_manager/prometheus_future.rs:61:3
  83: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panic/unwind_safe.rs:289:9
  84: <futures_util::future::future::catch_unwind::CatchUnwind<Fut> as core::future::future::Future>::poll::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.14/src/future/future/catch_unwind.rs:32:42
  85: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panic/unwind_safe.rs:271:9
  86: std::panicking::try::do_call
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:406:40
  87: __rust_try
  88: std::panicking::try
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:370:19
  89: std::panic::catch_unwind
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panic.rs:133:14
  90: <futures_util::future::future::catch_unwind::CatchUnwind<Fut> as core::future::future::Future>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.14/src/future/future/catch_unwind.rs:32:9
  91: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/future.rs:119:9
  92: futures_util::future::future::FutureExt::poll_unpin
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.14/src/future/future/mod.rs:562:9
  93: <futures_util::future::select::Select<A,B> as core::future::future::Future>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-util-0.3.14/src/future/select.rs:101:36
  94: sc_service::task_manager::SpawnTaskHandle::spawn_inner::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/service/src/task_manager/mod.rs:112:11
  95: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/mod.rs:80:19
  96: <tracing_futures::Instrumented<T> as core::future::future::Future>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-futures-0.2.5/src/lib.rs:283:9
  97: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/future/future.rs:119:9
  98: futures_executor::local_pool::block_on::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.14/src/local_pool.rs:317:23
  99: futures_executor::local_pool::run_executor::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.14/src/local_pool.rs:87:37
 100: std::thread::local::LocalKey<T>::try_with
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/local.rs:399:16
 101: std::thread::local::LocalKey<T>::with
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/local.rs:375:9
 102: futures_executor::local_pool::run_executor
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.14/src/local_pool.rs:83:5
 103: futures_executor::local_pool::block_on
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.14/src/local_pool.rs:317:5
 104: sc_cli::runner::Runner<C>::new::{{closure}}::{{closure}}
             at /home/muhammad-jibril/.cargo/git/checkouts/substrate-7e08433d4c370a21/91061a7/client/cli/src/runner.rs:123:29
 105: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/blocking/task.rs:41:21
 106: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/core.rs:173:17
 107: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/loom/std/unsafe_cell.rs:14:9
 108: tokio::runtime::task::core::Core<T,S>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/core.rs:158:13
 109: tokio::runtime::task::harness::Harness<T,S>::poll::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/harness.rs:107:27
 110: core::ops::function::FnOnce::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/ops/function.rs:227:5
 111: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panic/unwind_safe.rs:271:9
 112: std::panicking::try::do_call
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:406:40
 113: __rust_try
 114: std::panicking::try
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:370:19
 115: std::panic::catch_unwind
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panic.rs:133:14
 116: tokio::runtime::task::harness::Harness<T,S>::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/harness.rs:89:19
 117: tokio::runtime::task::raw::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/raw.rs:104:5
 118: tokio::runtime::task::raw::RawTask::poll
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/raw.rs:66:18
 119: tokio::runtime::task::Notified<S>::run
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/task/mod.rs:169:9
 120: tokio::runtime::blocking::pool::Inner::run
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/blocking/pool.rs:250:17
 121: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/blocking/pool.rs:230:21
 122: tokio::runtime::context::enter
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/context.rs:72:5
 123: tokio::runtime::handle::Handle::enter
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/handle.rs:76:9
 124: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at /home/muhammad-jibril/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.25/src/runtime/blocking/pool.rs:229:17
 125: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/sys_common/backtrace.rs:123:18
 126: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/mod.rs:484:17
 127: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/panic/unwind_safe.rs:271:9
 128: std::panicking::try::do_call
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:406:40
 129: __rust_try
 130: std::panicking::try
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panicking.rs:370:19
 131: std::panic::catch_unwind
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/panic.rs:133:14
 132: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/thread/mod.rs:483:30
 133: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/ops/function.rs:227:5
 134: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/alloc/src/boxed.rs:1691:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/alloc/src/boxed.rs:1691:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/std/src/sys/unix/thread.rs:106:17
 135: start_thread
 136: __clone3

Thread 'tokio-runtime-worker' panicked at 'attempt to divide by zero', /rustc/0727994435c75fdedd3e9d226cf434089b0ab585/library/core/src/num/mod.rs:853

This is a bug. Please report it at:

        https://github.com/Setheum-Labs/Setheum/issues

2022-03-18 11:33:36 Proposing failed: ClientImport("RuntimeApiError(Application(Execution(RuntimePanicked(\"attempt to divide by zero\"))))")    
2022-03-18 11:33:37 šŸ’¤ Idle (0 peers), best: #19 (0x2163ā€¦e663), finalized #17 (0x93dcā€¦f8d1), ā¬‡ 0 ā¬† 0    
2022-03-18 11:33:39 šŸ™Œ Starting consensus session on top of parent 0x216314b79f0ad4e0ad0f198cbc22ab191ba47a259d7861243bc07e0b2f15e663    

====================

Version: 1.0.0-cc24e6ea-x86_64-linux-gnu

   0: sp_panic_handler::panic_hook
``` and so on
alfellati commented 2 years ago

I got it, the issue is in lib-serml/defi/serp::serp_tes_now and other SERP impls as highlighted below (taken from the error output submitted above):

9: serp_treasury::<impl module_support::SerpTreasury<<T as frame_system::pallet::Config>::AccountId> for serp_treasury::module::Pallet<T>>::serp_tes_now
             at lib-serml/defi/serp/src/lib.rs:444:39
  10: serp_treasury::<impl serp_treasury::module::Pallet<T>>::stable_inflation_on_initialize
             at lib-serml/defi/serp/src/lib.rs:395:13
  11: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::Hooks<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
             at lib-serml/defi/serp/src/lib.rs:302:5
  12: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::OnInitialize<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
             at lib-serml/defi/serp/src/lib.rs:284:12
alfellati commented 2 years ago

We can introduce a SerpTesPeriod to study it and see if the division by zero comes from the fact that the DEX pools considered in SerpTes are not provided for on genesis, this may be the reason why the saturating_div used there is dividing by zero. If not, a way will be found Insha'Allah

alfellati commented 2 years ago

We can also introduce an if then statement to ensure that the SetSwap DEX Liquidity Pools are noy zero (empty).

alfellati commented 2 years ago

Closed in #804