input-output-hk / jormungandr

privacy voting blockchain node
https://input-output-hk.github.io/jormungandr/
Apache License 2.0
366 stars 132 forks source link

Treasury receiving random rewards despite being disabled in genesis block #1358

Open adascanBovich opened 4 years ago

adascanBovich commented 4 years ago

Describe the bug

Continuing issue #1348 All config parameters (genesis.yaml and pool/accounts) remain the same as described in #1348 This time I've enabled JORMUNGANDR_REWARD_DUMP_DIRECTORY and recored rewards.

Epoch 642, 643 - 1 lovelace went to treasury. Epoch 644 - 7 lovelaces, epoch 645 - 2.

Mandatory Information

  1. jcli 0.8.1 (HEAD-e94ea3d, release, linux [x86_64]) - [rustc 1.39.0 (4560ea788 2019-11-04)]
  2. jormungandr 0.8.1 (HEAD-e94ea3d, release, linux [x86_64]) - [rustc 1.39.0 (4560ea788 2019-11-04)]

To Reproduce Steps to reproduce the behavior:

  1. Setup new network with same settings provided in genesis.yaml
  2. Enable JORMUNGANDR_REWARD_DUMP_DIRECTORY.
  3. Wait for rewards to be distributed.
  4. Check rewards folder

Expected behavior Treasury should not receive any rewards, because it is disabled in genesis.yaml

Additional context rewards.zip

vincenthz commented 4 years ago

So those random rewards are the undistributed lovelaces that cannot be splitted between multiples parties.

There was supposed to be a setting to put back the undistributed values back to the rewards pot (for later distribution depending on settings), but unfortunately it didn't get implemented (yet) and for now the treasury get assigned the undistributed value.

adascanBovich commented 4 years ago

Epoch's reward is 1000, pool tax - 10%, and total number of delegators is 2. Seems like no leftovers should be present in the first place. But they are. And every time with different amounts, however there were no new pools or delegators added between 642-645 epochs.