Jormungandr: 0.8 rc3 - rewards still not working due to leader_logs.total or subsequent panic

Created on 1 Dec 2019  路  1Comment  路  Source: input-output-hk/jormungandr

Had a chat with Nicolas Di Prima about this earlier this evening.

When epoch roll-over happens the distribute_rewards doesn't trigger necessary reward payouts due to self.leader_logs.total() being 0. Making changes to the LeadersParticipationRecord::increase_for to persist the changes to the total resulted in a different issue, panic on node startup:

Dec 01 21:58:56.583 INFO Starting jormungandr 0.8.0-rc3 (master-b88e2be2+, release, macos [x86_64]) - [rustc 1.39.0 (4560ea788 2019-11-04)], task: init
Dec 01 21:58:56.595 INFO storing blockchain in '"/Users/myuser/cardano/newGenesis1Dec1/blocks.sqlite"', task: init

distribute_rewards - self.leaders_log.total is 95
expected_epoch_reward 10000
total_reward 10000
after fees - total_reward 10000
pool b50ba3a3a6b699994b75a139a1b63215448d60803e76742ca8cf2ee90a46c531 had 95 blocks
inside distribute_poolid_rewards
delegator account 73eea06825eacf611188b37f32ff06f9ddb1cddc1d0233309a83e9bc986ee8d5, stake 2000000000, distribution.total.total_stake 1000000000

thread 'main' panicked at 'assertion failed: stake <= total', chain-deps/chain-impl-mockchain/src/stake/stake.rs:62:9
stack backtrace:
0: 0x10267a1a5 - ::fmt::h66f38d4abb2e41c1
1: 0x10269d330 - core::fmt::write::h4f487e714088986d
2: 0x1026746ab - std::io::Write::write_fmt::h7bd7b6fe8b47c5fb
3: 0x10267c4aa - std::panicking::default_hook::{{closure}}::heee79636c241547c
4: 0x10267c1b5 - std::panicking::default_hook::hfcbd07059d15441e
5: 0x10267cc07 - std::panicking::rust_panic_with_hook::h0c4b67125f55410a
6: 0x1023fb4b5 - std::panicking::begin_panic::hf4163034aa32b0d7
7: 0x10242de11 - chain_impl_mockchain::ledger::ledger::Ledger::distribute_rewards::h584f90a8f7aa4136
8: 0x101cce75a - jormungandr::blockchain::chain::new_epoch_leadership_from::hddc2d600de84f80f
9: 0x101ccc8ac - jormungandr::blockchain::chain::Blockchain::post_check_header::h1a4e9013529845fa
10: 0x101c2de0b - futures::future::chain::Chain::poll::h125a75b90e666c17
11: 0x101c629ea - futures::future::chain::Chain::poll::h6da2e7689128804e
12: 0x101c30025 - futures::future::chain::Chain::poll::h1bdf81488c0a07ab
13: 0x101fa982e - as futures::future::Future>::poll::hcb2861923ea3c200
14: 0x1020061e4 - as futures::future::Future>::poll::hb8f2ede8053d96fa
15: 0x101c7a945 - futures::future::chain::Chain::poll::h9d1b3e4d08a23f08
16: 0x101c9216d - futures::future::chain::Chain::poll::hc9fb293ab5c7cd71
17: 0x101e54620 - futures::task_impl::std::set::h5d758e9f57926816
18: 0x1020f07a9 - std::thread::local::LocalKey::with::h970e0106ad1873e5
19: 0x101d10021 - futures::future::Future::wait::h4a4ea2d5bdd80522
20: 0x101d9ecee - jormungandr::start_up::load_blockchain::h3083dd690a779901
21: 0x1020da8de - jormungandr::start::h1b14d10a3ca2ed6e
22: 0x1020def38 - jormungandr::main::h72675773698785f0
23: 0x101fdaf16 - std::rt::lang_start::{{closure}}::h827c179de4114314
24: 0x10267c5c8 - std::panicking::try::do_call::ha1a4587e2a4eb439
25: 0x10268089f - __rust_maybe_catch_panic
26: 0x10267d06e - std::rt::lang_start_internal::hcf96e32a124891dc
27: 0x1020dfb29 - main

bug

Most helpful comment

for the record: This came after applying: input-output-hk/chain-libs#184

>All comments

for the record: This came after applying: input-output-hk/chain-libs#184

Was this page helpful?
0 / 5 - 0 ratings