Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native: fix Policy's IsBlocked behaviour #3443

Merged
merged 2 commits into from
May 17, 2024
Merged

Conversation

AnnaShaleva
Copy link
Member

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.

Account is blocked when it's in the Policy's storage, not when it's
missing from the Policy 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.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Supply the account with expected balance.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.16%. Comparing base (2d4993a) to head (82a7c1b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3443      +/-   ##
==========================================
+ Coverage   86.12%   86.16%   +0.03%     
==========================================
  Files         331      331              
  Lines       38442    38442              
==========================================
+ Hits        33110    33123      +13     
+ Misses       3804     3795       -9     
+ Partials     1528     1524       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnnaShaleva
Copy link
Member Author

And then check what the receivers of block rewards in the next dBFT epoch are stand-by validators/committee.

Probably that will be easier to check than the node restart. So if an elected committee drives the network, and then occasionally (without voting or NEO transfer transactions) the "faulty" node starts to reward stand-by accounts in OnPersist/PostPersist (may be checked by Transfer notifications for blocks applog), then that's the case.

@AnnaShaleva AnnaShaleva merged commit b5bb605 into master May 17, 2024
21 checks passed
@AnnaShaleva AnnaShaleva deleted the fix-blocked-accounts branch May 17, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mainnet state difference at *some* of the RPC nodes at *empty* block 5282529
2 participants