Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Problem: non-determinism in reward distribution #1835

Open
tomtau opened this issue Jun 29, 2020 · 2 comments
Open

Problem: non-determinism in reward distribution #1835

tomtau opened this issue Jun 29, 2020 · 2 comments
Assignees

Comments

@tomtau
Copy link
Contributor

tomtau commented Jun 29, 2020

(being investigated on 0.5)
some nodes randomly after reward distribution ended up with a different app hash

@yihuang
Copy link
Collaborator

yihuang commented Jun 29, 2020

current observations from logs, where issue happens:

  • minted amount and total staking is good.
  • but the staking diffs returned by the begin_block is inconsistent.

Two possible reasons for that:

  1. period_bonus is already inconsistent.
  2. period_bonus is good, but the reward distribution code is non-determinism.

By reading the code, I think the second case is quite unlikely.
Currently we added more logs to try to rule out the first case.
If it's the first case, then problem space further split into two directions:

  1. fee accumulation non-determinism
  2. slashing accumulation non-determinism

@tomtau
Copy link
Contributor Author

tomtau commented Jun 29, 2020

for fee accumulation, it's only here:
https://github.com/crypto-com/chain/blob/release/v0.5/chain-abci/src/app/mod.rs#L239
and the TX order should be the same / deterministic (unless something strange happens with tokio async reading/writing on the socket: https://github.com/tendermint/rust-abci/blob/develop/src/server.rs#L38 )

yihuang added a commit to yihuang/chain that referenced this issue Jul 1, 2020
Solution:
- Add block height assertion in begin block to prevent consensus
  connection re-connect
yihuang added a commit to yihuang/chain that referenced this issue Jul 1, 2020
Solution:
- Add block height assertion in begin block to prevent consensus
  connection re-connect
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants