livepeer / protocol

Livepeer protocol
MIT License
152 stars 45 forks source link

[delta-audit] bonding: Only provide voting power for active stake #621

Closed victorges closed 1 year ago

victorges commented 1 year ago

What does this pull request do? Explain your changes. (required) This is to fix the totalSupply = sum(getVotes(*)) invariant from BondingVotes, which wasn't held before when we provided voting power to both active and inactive transcoders and their delegators.

With this change, we make sure the transcoder active stake is also taken into account and provide zero voting power when the transcoder is not active.

Specific updates (required)

How did you test each of these updates (required) yarn test

Does this pull request close any open issues? Fixes PRO-39

Also ended up being a potential fix for https://github.com/code-423n4/2023-08-livepeer-findings/issues/194

Checklist:

linear[bot] commented 1 year ago

PRO-39 Fix the totalSupply = sum(getVotes(*) invariant on BondingVotes

victorges commented 1 year ago

we're going with #625 for now. this can be reopen in the future as a separate improvement