-
Notifications
You must be signed in to change notification settings - Fork 81
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: prevent improper Neo cache invalidation #3279
Conversation
We have cache update mechanism (Neo's cache votesChanged flag), it must be used for current epoch and new epoch cached values update. And the cached current/new epoch values themselves must always contain valid information for the current/new epoch. These cached values must only be changed once per epoch, never set them to nil. This commit prevents CN node panic described in #3253 when dBFT tries to retrieve new epoch validators with some votes modifications made before at the same dBFT epoch. Close #3253. Signed-off-by: Anna Shaleva <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3279 +/- ##
=======================================
Coverage 85.30% 85.31%
=======================================
Files 327 327
Lines 44153 44147 -6
=======================================
- Hits 37664 37662 -2
+ Misses 5001 4998 -3
+ Partials 1488 1487 -1 ☔ View full report in Codecov by Sentry. |
dBFT doesn't use validators got from this call to GetValidators callback, because NeoGo doesn't properly set WithGetConsensusAddress, and thus this call can be safely skipped. Instead, NeoGo fills NextConsensus field by itself in NewBlockFromContext callback. This commit technically doesn't perform any functional changes and doesn't affect the problem described in #3253 in any way. This commit is just a removal of the code that was never used by NeoGo library. This commit is a direct consequence of nspcc-dev/dbft#84. Signed-off-by: Anna Shaleva <[email protected]>
df818d3
to
47aefad
Compare
@fyfyrchik, welcome to review if you'd like to! |
Tested on latest mainnet with WatchOnly consensus node, problem is solved (I was managed to reproduce it earlier with the current master and WatchOnly consensus node):
States match the current mainnet up to:
So @roman-khimov, can be safely merged and\or rolled on mainnet CN. |
Close #3253.