bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
36 stars 22 forks source link

Ledger reports number of active validators incorrectly #3314

Closed hewison-chris closed 2 years ago

hewison-chris commented 2 years ago

As can be seen here taken from the log output the Active count is 26 yet the number of validators that signed is 33 (count of the bits set).

2022-04-20 06:44:34,866 Info [agora.consensus.state.Ledger.Ledger.addValidatedBlock] - Validators: Active: 26 - Signing: 111111111111111111111111111111111 - Slashed: 0
omerfirmak commented 2 years ago

That happens on blocks with re-enrollments.

hewison-chris commented 2 years ago

After fixing I realize that the Active was showing the count of validators still enrolled next block excluding those enrolled in the block.

2022-04-20 06:49:46,36 Info [agora.consensus.state.Ledger.Ledger.addValidatedBlock] - Transactions: 1 - Enrollments: 6
2022-04-20 06:49:46,37 Info [agora.consensus.state.Ledger.Ledger.addValidatedBlock] - Validators: Active: 27 - Signing: 111111111111111111111111111111111 - Slashed: 0
hewison-chris commented 2 years ago

I still think it is better to log the count of active validators in the block being added. Any other opinions?