-
Notifications
You must be signed in to change notification settings - Fork 47
Add reward caller (using propose-confirm pattern) #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: delta
Are you sure you want to change the base?
Add reward caller (using propose-confirm pattern) #649
Conversation
Additional notes on the implementation and known problemsLow-01:If the TranscoderA sets TranscoderB as their RewardCaller, the RewardCaller wouldn't be able to claim rewards on behalf of TranscoderA (which the TranscoderA can still directly claim the rewards themselves). This edge case (of using another active transcoder as a RewardCaller) is rather unexpected, but might not be obvious for the users. The security implications for this edge case is the DoS, but only limited to the case where TranscoderB owns private key of the TranscoderA and wise-versa. Note-01:In this implementation it is NOT possible for multiple different transcoders to set the same address as their RewardCaller. Moreover, if a RewardCaller after being confirmed by TranscoderA is wanted to be used by the TranscoderB, TranscoderA first need to remove the RewardCaller. This restriction is added to prevent confusion associated with the expectation that the same RewardCaller can be used for multiple transcoders. Note-02:In this implementation is it possible to set multiple RewardCallers per single transcoder. We found no security issues associated with that. The front-running DoS / address squatting attack is mitigated by requiring Note-03: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 remove 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 multiple addresses they trust to claim the rewards on every round without requiring the main wallet to stay unlocked.
Specific updates (required)
contracts/bonding/BondingManager.sol
contract is modified to includerewardCallerToTranscoderProposed
public mapping to keep self-proposed rewardCallersrewardCallerToTranscoderConfirmed
public mapping to keep RewardCallers confirmed by the relevant transcodersproposeTranscoderForRewardCaller
function to propose RewardCaller for transcodersaddress(0)
confirmRewardCaller
function to confirm previously proposed RewardCallerremoveRewardCaller
, function to remove confirmed RewardCallers by the transcodersrewardWithHint
is modified to also be callable by the confirmed RewardCallerstest/unit/BondingManager.js
test is modified to include new "reward delegation" sectionyarn test:coverage:check
command 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:
reward
reward
Does this pull request close any open issues?
No
Checklist:
README and other documentation updatedyarn test
pass