native: fix Policy's IsBlocked behaviour #3443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Account is blocked when it's in the Policy's storage, not when it's missing from the storage. Introduced in bbbc680.
This bug leads to the fact that during native Neo cache initialization at the last block in the dBFT epoch, all candidates accounts are "blocked", and thus, stand-by committee and validators are used in the subsequent new epoch. Close #3424.
This bug may lead to the consequences described in #3273, but it needs to be confirmed. @fyfyrchik, is it possible for your network to check whether "faulty" node has been restarted in the last block of some dBFT epoch? And then check what the receivers of block rewards in the next dBFT epoch are stand-by validators/committee. If so, then the problem is the same, since this bug leads to the wrong block reward distribution (to stand-by committee instead of elected committee) which may result in the failing OnPersist script if, for example, the sender of some in-block transaction is an elected committee member or validator.