Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Pull apart writeCurrentStakers method - Part 1 #2074
Pull apart writeCurrentStakers method - Part 1 #2074
Changes from 74 commits
1c12d39
c5061a4
b0cd9cb
fe93ba1
34d5602
cddf51c
9b77852
407cb74
8caf284
96d0e56
112a2e2
460d5c9
14b33a0
590bb02
37d1d5e
6373786
3d7cc37
405632e
b281f22
3eaa5c0
25804f4
5bdd4f5
e5fd062
c809c46
4c3f70b
a30a7f8
22e9e57
47a0f8a
fd774e9
6723f87
1ce6610
348bbcd
38d21b1
a159219
5af4b8c
5289800
824c73d
189760b
a894112
eec2f0a
df3f29d
5127e47
5c737ad
c1f43fd
847818f
a3fa4a5
9db4ce5
cbc4b78
18c9c05
3c73950
b837541
f99dd6a
9a2f2c7
789670e
1731817
9fdd336
f528832
bee3ea3
4e915af
04cb730
7b0fe01
3c1bc14
56d9aa3
cb97bd7
7f666ed
5dd86b9
38a2e45
75a74da
6563d8b
fd8ca3f
e622e22
22f1462
c35754a
6794aa4
ed0f398
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
s.currentStakers
and instead be using the returned computed diffs fromprocessCurrentStakers()
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.
As you suggest, the plan is to split writeCurrentStakers into two parts:
The "store it" component won't need to access s.currentStakers; it will only access pulled info, as you suggest.
I just splitted this whole process into three PRs to simplify diffs checking and this is just first one.
See #2079 and #2086 for the final result
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.
Isn't this a behavior change? In the existing code, we continue here if the weight didn't change. In the new code, we call one of
s.cfg.Validators.RemoveWeight
,s.cfg.Validators.AddStaker
ors.cfg.Validators.AddWeight
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.
@danlaine, you're right. I moved this condition to
writeWeightDiffs
but it should have been kept here too since it guards the cfg.Validators set update.Rewritten the if/else as a switch as the linter suggest (and you do too next PR)