Add reward caller (using transcoder-to-reward caller mapping direction)#648
Conversation
Additional notes on the implementationNote-01:It is possible for a transcoder to set the RewardCaller as themself and call functions designated for RewardCallers. By doing so, the transcoder itself will be able to use the Note-02:It is possible for a TranscoderA to set the TranscoderB as RewardCaller. In this case, TranscoderB will be able to claim reward for themself by calling Note-03:In this implementation it is possible that multiple different transcoders set the same address as their RewardCaller. It will allow the same RewardCaller to call Note-04:It is not part of the current implementation, but it's possible to add a functionality to self-revoke RewardCaller. Currently, only the transcoder which set the RewardCaller can unset it by calling |
What does this pull request do? Explain your changes. (required)
This PR adds a new feature to the livepeer protocol which will allow transcoders to set a single address they trust to claim the rewards every on round without requiring the main wallet to stay unlocked.
Specific updates (required)
contracts/bonding/BondingManager.solcontract is modified to includetranscoderToRewardCallerpublic mappingsetRewardCallerfunction to set or unset arewardCallerrewardForTranscoder,rewardForTranscoderWithHintfunctions to claim rewards usingrewardCalleraccounttest/unit/BondingManager.jstest is modified to include new "reward delegation" sectionyarn test:coverage:checkcommand is added to the CI to insure 100% test coverageHow did you test each of these updates (required)
A new "reward delegation" section contains tests that ensure:
rewardForTranscoderrewardForTranscoderDoes this pull request close any open issues?
No
Checklist:
README and other documentation updatedyarn testpass