livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

L2 BondingManager with deprecated code removed #496

Closed yondonfu closed 2 years ago

yondonfu commented 2 years ago

What does this pull request do? Explain your changes. (required)

Removes code from the BondingManager that is not needed for a fresh deployment on L2 including:

Also, fixes some additional event tests in 8bb731d using the same event testing pattern that was introduced in https://github.com/livepeer/protocol/commit/6b402030394a7c9e3c641728812208b1c5b4921f. Prior to this commit, tests with coverage enabled would fail due to the same problem that the aforementioned commit fixed elsewhere.

Specific updates (required)

See commit history.

How did you test each of these updates (required)

Updated unit and integration tests.

Does this pull request close any open issues?

Fixes #491

Checklist:

yondonfu commented 2 years ago

wdyt about removing MathUtils and using PreciseMathUtils everywhere too?

I was planning to take a pass at cleaning up the usage of MathUtils/PreciseMathUtils libraries separately (can create an issue) because at the moment commission rates are defined as X out of MathUtils.PERC_DIVISOR (1000000) and there is off-chain code (i.e. the explorer and go-livepeer) that assume commission rates are out of that value as well. So, if we're going to change how commission rates are defined then we'll need to make sure to make the necessary updates in all of those off-chain codebases as well. In the interest of doing all of those things at once to make sure no individual tool breaks and of not increasing the scope of this PR for now I suggest handling the usage cleanup separately.

yondonfu commented 2 years ago

Let's track the preciseMath issue and get this merged in

Tracking in https://github.com/livepeer/protocol/issues/506