-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
staking endblock /tick upgrade #800
Conversation
... ...
Codecov Report
@@ Coverage Diff @@
## develop #800 +/- ##
===========================================
+ Coverage 63% 65.18% +2.18%
===========================================
Files 65 65
Lines 3538 3550 +12
===========================================
+ Hits 2229 2314 +85
+ Misses 1142 1049 -93
- Partials 167 187 +20 |
if err != nil { | ||
panic(err) | ||
} | ||
validators[i] = val | ||
validators[i] = validator |
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.
This function claims to return most recent updated validator set, but this loop iterates over the validators in order of power descending, then the function returns the head of that array?
I presume you mean the current "top validator set", as opposed to the set of the most recently updated validators (which would be retrieved using GetRecentValidatorsKey
?) - maybe worth clarifying comment?
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.
Good point, I will expand the comments - the most recent updated validator set IS the "top" candidates... there are no other validators - the "Recent Validators" is just a duplicate of the results from the last time GetValidators
was called - this way we can easily determine if a candidate is a validator without needing to iterate over the subspace as we do in GetValidators
x/stake/types.go
Outdated
Address sdk.Address `json:"address"` // Address of validator | ||
VotingPower sdk.Rat `json:"voting_power"` // Voting power if considered a validator | ||
Address sdk.Address `json:"address"` | ||
PubKey crypto.PubKey `json:"PubKey"` |
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.
Why does "PubKey" not follow the case spec of the other fields?
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.
whoops this is a typo good catch (should be pub_key)
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
tick uses time
staking has an endblock
closes #290
closes #736
replaces #752