Skip to content

Commit

Permalink
native: never set Neo's newEpoch* cache values to nil
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AnnaShaleva committed Dec 21, 2023
1 parent de98b39 commit d7d850a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/core/native/native_neo.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,6 @@ func (n *NEO) ModifyAccountVotes(acc *state.NEOBalance, d *dao.Simple, value *bi
return nil
}
}
cache.newEpochNextValidators = nil
return putConvertibleToDAO(n.ID, d, key, cd)
}
return nil
Expand Down

0 comments on commit d7d850a

Please sign in to comment.