Skip to content

Do not count validators who do not proposed in additional reward calculation#1982

Merged
majecty merged 1 commit intoCodeChain-io:masterfrom
majecty:f/fixing-divide-by-zero
Aug 12, 2020
Merged

Do not count validators who do not proposed in additional reward calculation#1982
majecty merged 1 commit intoCodeChain-io:masterfrom
majecty:f/fixing-divide-by-zero

Conversation

@majecty
Copy link

@majecty majecty commented Aug 11, 2020

In the additional reward calculation, we divide a validator's missed precommits by the validator's proposed count. Some validators may not proposed in a term. To avoid "divide by zero" error, ignore the validators who did not proposed any block.

The "divide by zero" error happens after this commit: 79322e1
The 2.x releases do not have the commit. Only the master branch has the problem.

…ulation

In the additional reward calculation, we divide a validator's missed
precommits by the validator's proposed count. Some validators may not
proposed in a term. To avoid "divide by zero" error, ignore the
validators who did not proposed any block.
@majecty majecty added the bug Something isn't working label Aug 11, 2020
@majecty majecty requested a review from sgkim126 August 11, 2020 05:39
@majecty majecty merged commit e644f7e into CodeChain-io:master Aug 12, 2020
@majecty majecty deleted the f/fixing-divide-by-zero branch August 12, 2020 04:46
@majecty majecty mentioned this pull request Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants