-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify logics in FP set rotation (#188)
Resolves #145 Resolves #191 (fuzzed locally and it's not flaky anymore) This PR simplifies the logics in FP set rotation, including: - Moving event emitting to msg handlers whereever possible (mostly for jailing/unjailing). - Removing the handling of special case `len(events) == 0`. This is not necessary and can be handled altogether in `ProcessAllPowerDistUpdateEvents` with same complexity. - Splitting `recordVotingPowerAndCache` into two functions, one for recording voting power table/cache and the other for emitting events/hooks for Fp state update. - Some minor abstraction for separating event emitting and voting power rotation algorithm. Will do a second round of refactoring in another PR, together with #72
- Loading branch information
1 parent
089917e
commit 35610ce
Showing
4 changed files
with
87 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters