-
Notifications
You must be signed in to change notification settings - Fork 42
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
refactor: simplify logics in FP set rotation #188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! @jrwbabylonlab fyi, seems we will change slashing status change to a tx event
Oh is having FP state change as block event mandatory for BE? |
I don't think it's mandatory but let's hear from @jrwbabylonlab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Not really mandatory, but property we wanted to preserve is that one type of event - |
Alright, for the sake of simplifying BE development I moved back the slashed/jailed FP events back, but added some helper functions for emitting these events. In addition, I tightened the interfaces exposed in |
Resolves #145
Resolves #191 (fuzzed locally and it's not flaky anymore)
This PR simplifies the logics in FP set rotation, including:
len(events) == 0
. This is not necessary and can be handled altogether inProcessAllPowerDistUpdateEvents
with same complexity.recordVotingPowerAndCache
into two functions, one for recording voting power table/cache and the other for emitting events/hooks for Fp state update.Will do a second round of refactoring in another PR, together with #72