Skip to content

Commit

Permalink
Small fix in shouldValidatorReport getter
Browse files Browse the repository at this point in the history
  • Loading branch information
varasev committed Dec 29, 2020
1 parent 1c86654 commit 5b8b4a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion contracts/ValidatorSetAuRa.sol
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,9 @@ contract ValidatorSetAuRa is UpgradeabilityAdmin, IValidatorSetAuRa {
uint256 _blockNumber
) public view returns(bool) {
uint256 currentBlock = _getCurrentBlockNumber();
if (_blockNumber > currentBlock) {
if (_blockNumber > currentBlock + 1) {
// we added +1 in the condition to let validator next to the malicious one correctly report
// because that validator will use the previous block state when calling this getter
return false;
}
if (currentBlock > 100 && currentBlock - 100 > _blockNumber) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posdao-contracts",
"version": "0.2.0",
"version": "0.2.1",
"description": "Smart contracts for POSDAO consensus",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5b8b4a3

Please sign in to comment.