Skip to content
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

Implement LIP-9: Service Registry #223

Merged
merged 2 commits into from
Jun 8, 2018
Merged

Implement LIP-9: Service Registry #223

merged 2 commits into from
Jun 8, 2018

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Jun 5, 2018

* @dev Stores service URI endpoint for the caller that can be used to send requests to the caller off-chain
* @param _serviceURI Service URI endpoint for the caller
*/
function setServiceURI(string _serviceURI) external {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any potential negative externalities for the rest of the network if a bunch of non-transcoders set their service URI records here?

Copy link
Member Author

@yondonfu yondonfu Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm since a broadcaster client would only care about the service URI record for the transcoder address that was assigned to the broadcaster's transcode job if non-transcoder users set their own service URI record they would pay the tx cost, but at least in the current proposed networking architecture those records will never be used in practice unless the non-transcoder user becomes a transcoder in the future. Perhaps something to be wary about though is if a transcoder's key is compromised such that an attacker can change the service URI record right before a broadcaster looks it up to send requests to the transcoder

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, keeping the transcoder's keys keys cold would entail something like the discussion in livepeer/LIPs#7 which probably should be done separately from this change.

I was mostly wondering if filling the record mapping with unneeded entries could lead to higher costs for the network down the road, eg during a migration or with any enactment of 'data rents', but that's all fairly speculative. LGTM.

Copy link

@j0sh j0sh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, but looks really great otherwise.

*/
contract ServiceRegistry is ManagerProxyTarget {
// Store service metadata
struct Record {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we changed the Record struct in the future, the storage layout will be screwy right? If that's the case, I prefer to have the mapping from address to string, that way this potential mistake doesn't happen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding additional fields to the Record struct in an upgrade is safe as long as 1) we do not remove/replace existing fields 2) the Record struct is not used in an array (it is only used in a mapping right now)

@yondonfu yondonfu merged commit 5cb7d62 into master Jun 8, 2018
@yondonfu yondonfu deleted the yf/registry branch June 8, 2018 13:53
@yondonfu yondonfu mentioned this pull request Aug 13, 2018
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants