-
Notifications
You must be signed in to change notification settings - Fork 45
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
[delta-audit] bonding: Provide votes only for registered Ts and their Ds #625
Conversation
7153787
to
4a9a2fc
Compare
4a9a2fc
to
77d4157
Compare
77d4157
to
df2750a
Compare
Not sure if this is already addressed elsewhere, but making a note that there is also a conditional in _handleVoteOverrides() of GovernorCountingOverridable that does not implement the complete registered transcoder check. This doesn't seem to cause any issues in that function at the moment given the changes in this PR, but could be a good idea to add some clarifications there. A few options come to mind: a. Update EDIT: I think #626 kind of addresses this, but a bit more info with b) might still be helpful for a future reader. |
@yondonfu Regarding not having a full check on My rationale in the new version of the code is:
So it'd be an "implementation detail" for the |
Sounds reasonable. |
8847356
to
f61b348
Compare
f61b348
to
ca08ba5
Compare
Just realized tests are failing after the merge. Brb. |
Fixed! |
@yondonfu Fixed |
… Ds (#625) * bonding: Make consistent checks for isTranscoder * bonding: Add tests for isRegisteredTranscoder logic * treasury: Improve docs in vote overriding extension * bonding: Rename getBondingStateAt for accuracy * bonding: Fix BondingVotes test * bonding: Fix retval ordering in docs
… Ds (#625) * bonding: Make consistent checks for isTranscoder * bonding: Add tests for isRegisteredTranscoder logic * treasury: Improve docs in vote overriding extension * bonding: Rename getBondingStateAt for accuracy * bonding: Fix BondingVotes test * bonding: Fix retval ordering in docs
… Ds (#625) * bonding: Make consistent checks for isTranscoder * bonding: Add tests for isRegisteredTranscoder logic * treasury: Improve docs in vote overriding extension * bonding: Rename getBondingStateAt for accuracy * bonding: Fix BondingVotes test * bonding: Fix retval ordering in docs
… Ds (#625) * bonding: Make consistent checks for isTranscoder * bonding: Add tests for isRegisteredTranscoder logic * treasury: Improve docs in vote overriding extension * bonding: Rename getBondingStateAt for accuracy * bonding: Fix BondingVotes test * bonding: Fix retval ordering in docs
What does this pull request do? Explain your changes. (required)
This fixes another issue from the audit regarding voting power provided to delegators. The specific issue is when a delegator has a bond with an account that is not a "registered transcoder" (
delegateAddress == self && bondedAmount > 0
).This can happen when bonding to a random account that is not a transcoder, when the transcoder unbonds or gets slashed 100%. The main problem created from this is that the transcoder would then have
0
voting power, while the delegators would still hold on to their delegated voting power, messing up vote overriding onGovenorCountingOverridable
. Even with the #626 fix, there would still be a problem in casebondedAmount == 0
but stilldelegateAddress == self
(can happen in the slash case).Specific updates (required)
How did you test each of these updates (required)
yarn test
with pending devnet deployDoes this pull request close any open issues?
Fixes:
Checklist:
yarn test
pass