livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

bonding: Skip fee calculation for voting power #633

Closed victorges closed 11 months ago

victorges commented 11 months ago

What does this pull request do? Explain your changes. (required) This fixes a bug observed after deploying the new BondingVotes to production.

It happens when trying to calculate voting power for a delegator whose transcoder hadn't initialized their cumulativeFeeFactor on the corresponding round.

This causes the voting power calculation to underflow, because we don't initialize the cumulativeFeeFactor of the endPool like BondingManager does. Even though we don't really care about fees for voting power, the underflow causes a revert on any transaction that needs to access the delegator votes at the uninitialized round.

Specific updates (required)

How did you test each of these updates (required) yarn test that it didnt change any existing behavior on BondingManager New tests on BondingVotes May do a tenderly fork test before actual deploy

Does this pull request close any open issues? N/A

Checklist:

coveralls commented 11 months ago

Pull Request Test Coverage Report for Build 6513140765


Totals Coverage Status
Change from base Build 6497587953: 0.07%
Covered Lines: 1010
Relevant Lines: 1013

💛 - Coveralls
victorges commented 11 months ago

@yondonfu added tests to the EarningsPoolLIP36 new funcs! Getting 100% coverage on those now