livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

Read l1CirculatingSupply in L2 Minter for bonding rate calculation #518

Closed yondonfu closed 2 years ago

yondonfu commented 2 years ago

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

This PR updates the Minter (which will be deployed on L2 since this on the confluence branch track) to read the L1 circulating supply from a L2LPTDataCache contract (implemented in https://github.com/livepeer/arbitrum-lpt-bridge/pull/41) when calculating the bonding rate (i.e. participation rate). The L1 circulating supply is added to the L2 LPT total supply in order to calculate the global total supply across L1 and L2.

Refer to https://github.com/livepeer/arbitrum-lpt-bridge/pull/41 for details on how the L1 circulating supply is calculated by the L2LPTDataCache.

Specific updates (required)

How did you test each of these updates (required)

Updated unit tests and fixed integration tests.

An integration test where the L2LPTDataCache is not stubbed with a GenericMock contract is left to be addressed separately.

Does this pull request close any open issues?

Fixes #501

Checklist: