{"action":"created","comment":{"url":"https://api.github.com/repos/livepeer/protocol/pulls/comments/151178250","pull_request_review_id":76844193,"id":151178250,"diff_hunk":"@@ -287,7 +282,8 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {\n         if (delegatorStatus(msg.sender) == DelegatorStatus.Unbonded) {\n             // Withdraw bonded amount which is now unbonded\n             amount = amount.add(delegators[msg.sender].bondedAmount);\n-            delete delegators[msg.sender];\n+            delegators[msg.sender].bondedAmount = 0;\n+            delegators[msg.sender].withdrawRound = 0;","path":"contracts/bonding/BondingManager.sol","position":59,"original_position":59,"commit_id":"fb18d6b9e8e0ddd42a197929d875fa5103cafba1","original_commit_id":"fb18d6b9e8e0ddd42a197929d875fa5103cafba1","user":{"login":"yondonfu","id":5933273,"avatar_url":"https://avatars0.githubusercontent.com/u/5933273?v=4","gravatar_id":"","url":"https://api.github.com/users/yondonfu","html_url":"https://github.com/yondonfu","followers_url":"https://api.github.com/users/yondonfu/followers","following_url":"https://api.github.com/users/yondonfu/following{/other_user}","gists_url":"https://api.github.com/users/yondonfu/gists{/gist_id}","starred_url":"https://api.github.com/users/yondonfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yondonfu/subscriptions","organizations_url":"https://api.github.com/users/yondonfu/orgs","repos_url":"https://api.github.com/users/yondonfu/repos","events_url":"https://api.github.com/users/yondonfu/events{/privacy}","received_events_url":"https://api.github.com/users/yondonfu/received_events","type":"User","site_admin":false},"body":"Didn't set `delegatedAmount` to 0 here for consistency - if delegator A is delegated to delegator B and delegator B withdraws, delegator A is still delegated to delegator B since we don't have a way to automatically remove delegator A's delegate. Since delegator A remains delegated to delegator B we can keep `delegatedAmount` for delegator B and only change it if delegator A bonds to another delegator or unbonds","created_at":"2017-11-15T16:27:08Z","updated_at":"2017-11-15T16:27:08Z","html_url":"https://github.com/livepeer/protocol/pull/116#discussion_r151178250","pull_request_url":"https://api.github.com/repos/livepeer/protocol/pulls/116","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/comments/151178250"},"html":{"href":"https://github.com/livepeer/protocol/pull/116#discussion_r151178250"},"pull_request":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/116"}},"in_reply_to_id":151173611},"pull_request":{"url":"https://api.github.com/repos/livepeer/protocol/pulls/116","id":152604886,"html_url":"https://github.com/livepeer/protocol/pull/116","diff_url":"https://github.com/livepeer/protocol/pull/116.diff","patch_url":"https://github.com/livepeer/protocol/pull/116.patch","issue_url":"https://api.github.com/repos/livepeer/protocol/issues/116","number":116,"state":"open","locked":false,"title":"Slashing post conditions","user":{"login":"yondonfu","id":5933273,"avatar_url":"https://avatars0.githubusercontent.com/u/5933273?v=4","gravatar_id":"","url":"https://api.github.com/users/yondonfu","html_url":"https://github.com/yondonfu","followers_url":"https://api.github.com/users/yondonfu/followers","following_url":"https://api.github.com/users/yondonfu/following{/other_user}","gists_url":"https://api.github.com/users/yondonfu/gists{/gist_id}","starred_url":"https://api.github.com/users/yondonfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yondonfu/subscriptions","organizations_url":"https://api.github.com/users/yondonfu/orgs","repos_url":"https://api.github.com/users/yondonfu/repos","events_url":"https://api.github.com/users/yondonfu/events{/privacy}","received_events_url":"https://api.github.com/users/yondonfu/received_events","type":"User","site_admin":false},"body":"A proposed solution for #115 \r\n\r\nWhen a transcoder is slashed:\r\n- The broadcaster is fully refunded for the job and all escrowed fees are returned\r\n- The transcoder is removed from the active set and the total active set is reduced by the transcoder's active total stake\r\n- The transcoder is removed from the transcoder pools\r\n- Transcoder's delegators remain bonded\r\n- As a result of the above, if the transcoder maintains a sufficient total stake (such that delegators do not delegate to someone else), it can rejoin the transcoder pools next round\r\n\r\nThe alternative was to implement a threshold such that a transcoder could trigger slashing conditions a certain number of times before it is actually slashed, but that would require additional state management and complexity. This approach is imperfect, but is simpler and does not introduce much additional logic.","created_at":"2017-11-14T20:07:38Z","updated_at":"2017-11-15T16:27:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23347b263b2709f8100d8b2572e7cd613a9655ea","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/livepeer/protocol/pulls/116/commits","review_comments_url":"https://api.github.com/repos/livepeer/protocol/pulls/116/comments","review_comment_url":"https://api.github.com/repos/livepeer/protocol/pulls/comments{/number}","comments_url":"https://api.github.com/repos/livepeer/protocol/issues/116/comments","statuses_url":"https://api.github.com/repos/livepeer/protocol/statuses/fb18d6b9e8e0ddd42a197929d875fa5103cafba1","head":{"label":"livepeer:yf/slashing-post-conditions","ref":"yf/slashing-post-conditions","sha":"fb18d6b9e8e0ddd42a197929d875fa5103cafba1","user":{"login":"livepeer","id":25355022,"avatar_url":"https://avatars2.githubusercontent.com/u/25355022?v=4","gravatar_id":"","url":"https://api.github.com/users/livepeer","html_url":"https://github.com/livepeer","followers_url":"https://api.github.com/users/livepeer/followers","following_url":"https://api.github.com/users/livepeer/following{/other_user}","gists_url":"https://api.github.com/users/livepeer/gists{/gist_id}","starred_url":"https://api.github.com/users/livepeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livepeer/subscriptions","organizations_url":"https://api.github.com/users/livepeer/orgs","repos_url":"https://api.github.com/users/livepeer/repos","events_url":"https://api.github.com/users/livepeer/events{/privacy}","received_events_url":"https://api.github.com/users/livepeer/received_events","type":"Organization","site_admin":false},"repo":{"id":89298984,"name":"protocol","full_name":"livepeer/protocol","owner":{"login":"livepeer","id":25355022,"avatar_url":"https://avatars2.githubusercontent.com/u/25355022?v=4","gravatar_id":"","url":"https://api.github.com/users/livepeer","html_url":"https://github.com/livepeer","followers_url":"https://api.github.com/users/livepeer/followers","following_url":"https://api.github.com/users/livepeer/following{/other_user}","gists_url":"https://api.github.com/users/livepeer/gists{/gist_id}","starred_url":"https://api.github.com/users/livepeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livepeer/subscriptions","organizations_url":"https://api.github.com/users/livepeer/orgs","repos_url":"https://api.github.com/users/livepeer/repos","events_url":"https://api.github.com/users/livepeer/events{/privacy}","received_events_url":"https://api.github.com/users/livepeer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/livepeer/protocol","description":"Livepeer protocol","fork":false,"url":"https://api.github.com/repos/livepeer/protocol","forks_url":"https://api.github.com/repos/livepeer/protocol/forks","keys_url":"https://api.github.com/repos/livepeer/protocol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/livepeer/protocol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/livepeer/protocol/teams","hooks_url":"https://api.github.com/repos/livepeer/protocol/hooks","issue_events_url":"https://api.github.com/repos/livepeer/protocol/issues/events{/number}","events_url":"https://api.github.com/repos/livepeer/protocol/events","assignees_url":"https://api.github.com/repos/livepeer/protocol/assignees{/user}","branches_url":"https://api.github.com/repos/livepeer/protocol/branches{/branch}","tags_url":"https://api.github.com/repos/livepeer/protocol/tags","blobs_url":"https://api.github.com/repos/livepeer/protocol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/livepeer/protocol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/livepeer/protocol/git/refs{/sha}","trees_url":"https://api.github.com/repos/livepeer/protocol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/livepeer/protocol/statuses/{sha}","languages_url":"https://api.github.com/repos/livepeer/protocol/languages","stargazers_url":"https://api.github.com/repos/livepeer/protocol/stargazers","contributors_url":"https://api.github.com/repos/livepeer/protocol/contributors","subscribers_url":"https://api.github.com/repos/livepeer/protocol/subscribers","subscription_url":"https://api.github.com/repos/livepeer/protocol/subscription","commits_url":"https://api.github.com/repos/livepeer/protocol/commits{/sha}","git_commits_url":"https://api.github.com/repos/livepeer/protocol/git/commits{/sha}","comments_url":"https://api.github.com/repos/livepeer/protocol/comments{/number}","issue_comment_url":"https://api.github.com/repos/livepeer/protocol/issues/comments{/number}","contents_url":"https://api.github.com/repos/livepeer/protocol/contents/{+path}","compare_url":"https://api.github.com/repos/livepeer/protocol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/livepeer/protocol/merges","archive_url":"https://api.github.com/repos/livepeer/protocol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/livepeer/protocol/downloads","issues_url":"https://api.github.com/repos/livepeer/protocol/issues{/number}","pulls_url":"https://api.github.com/repos/livepeer/protocol/pulls{/number}","milestones_url":"https://api.github.com/repos/livepeer/protocol/milestones{/number}","notifications_url":"https://api.github.com/repos/livepeer/protocol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/livepeer/protocol/labels{/name}","releases_url":"https://api.github.com/repos/livepeer/protocol/releases{/id}","deployments_url":"https://api.github.com/repos/livepeer/protocol/deployments","created_at":"2017-04-25T00:22:38Z","updated_at":"2017-11-10T21:14:23Z","pushed_at":"2017-11-14T20:10:31Z","git_url":"git://github.com/livepeer/protocol.git","ssh_url":"git@github.com:livepeer/protocol.git","clone_url":"https://github.com/livepeer/protocol.git","svn_url":"https://github.com/livepeer/protocol","homepage":null,"size":507,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":26,"forks":7,"open_issues":26,"watchers":32,"default_branch":"master"}},"base":{"label":"livepeer:master","ref":"master","sha":"9fe889d0a97d4bf94433b384b370b8dafda33373","user":{"login":"livepeer","id":25355022,"avatar_url":"https://avatars2.githubusercontent.com/u/25355022?v=4","gravatar_id":"","url":"https://api.github.com/users/livepeer","html_url":"https://github.com/livepeer","followers_url":"https://api.github.com/users/livepeer/followers","following_url":"https://api.github.com/users/livepeer/following{/other_user}","gists_url":"https://api.github.com/users/livepeer/gists{/gist_id}","starred_url":"https://api.github.com/users/livepeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livepeer/subscriptions","organizations_url":"https://api.github.com/users/livepeer/orgs","repos_url":"https://api.github.com/users/livepeer/repos","events_url":"https://api.github.com/users/livepeer/events{/privacy}","received_events_url":"https://api.github.com/users/livepeer/received_events","type":"Organization","site_admin":false},"repo":{"id":89298984,"name":"protocol","full_name":"livepeer/protocol","owner":{"login":"livepeer","id":25355022,"avatar_url":"https://avatars2.githubusercontent.com/u/25355022?v=4","gravatar_id":"","url":"https://api.github.com/users/livepeer","html_url":"https://github.com/livepeer","followers_url":"https://api.github.com/users/livepeer/followers","following_url":"https://api.github.com/users/livepeer/following{/other_user}","gists_url":"https://api.github.com/users/livepeer/gists{/gist_id}","starred_url":"https://api.github.com/users/livepeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/livepeer/subscriptions","organizations_url":"https://api.github.com/users/livepeer/orgs","repos_url":"https://api.github.com/users/livepeer/repos","events_url":"https://api.github.com/users/livepeer/events{/privacy}","received_events_url":"https://api.github.com/users/livepeer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/livepeer/protocol","description":"Livepeer protocol","fork":false,"url":"https://api.github.com/repos/livepeer/protocol","forks_url":"https://api.github.com/repos/livepeer/protocol/forks","keys_url":"https://api.github.com/repos/livepeer/protocol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/livepeer/protocol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/livepeer/protocol/teams","hooks_url":"https://api.github.com/repos/livepeer/protocol/hooks","issue_events_url":"https://api.github.com/repos/livepeer/protocol/issues/events{/number}","events_url":"https://api.github.com/repos/livepeer/protocol/events","assignees_url":"https://api.github.com/repos/livepeer/protocol/assignees{/user}","branches_url":"https://api.github.com/repos/livepeer/protocol/branches{/branch}","tags_url":"https://api.github.com/repos/livepeer/protocol/tags","blobs_url":"https://api.github.com/repos/livepeer/protocol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/livepeer/protocol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/livepeer/protocol/git/refs{/sha}","trees_url":"https://api.github.com/repos/livepeer/protocol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/livepeer/protocol/statuses/{sha}","languages_url":"https://api.github.com/repos/livepeer/protocol/languages","stargazers_url":"https://api.github.com/repos/livepeer/protocol/stargazers","contributors_url":"https://api.github.com/repos/livepeer/protocol/contributors","subscribers_url":"https://api.github.com/repos/livepeer/protocol/subscribers","subscription_url":"https://api.github.com/repos/livepeer/protocol/subscription","commits_url":"https://api.github.com/repos/livepeer/protocol/commits{/sha}","git_commits_url":"https://api.github.com/repos/livepeer/protocol/git/commits{/sha}","comments_url":"https://api.github.com/repos/livepeer/protocol/comments{/number}","issue_comment_url":"https://api.github.com/repos/livepeer/protocol/issues/comments{/number}","contents_url":"https://api.github.com/repos/livepeer/protocol/contents/{+path}","compare_url":"https://api.github.com/repos/livepeer/protocol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/livepeer/protocol/merges","archive_url":"https://api.github.com/repos/livepeer/protocol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/livepeer/protocol/downloads","issues_url":"https://api.github.com/repos/livepeer/protocol/issues{/number}","pulls_url":"https://api.github.com/repos/livepeer/protocol/pulls{/number}","milestones_url":"https://api.github.com/repos/livepeer/protocol/milestones{/number}","notifications_url":"https://api.github.com/repos/livepeer/protocol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/livepeer/protocol/labels{/name}","releases_url":"https://api.github.com/repos/livepeer/protocol/releases{/id}","deployments_url":"https://api.github.com/repos/livepeer/protocol/deployments","created_at":"2017-04-25T00:22:38Z","updated_at":"2017-11-10T21:14:23Z","pushed_at":"2017-11-14T20:10:31Z","git_url":"git://github.com/livepeer/protocol.git","ssh_url":"git@github.com:livepeer/protocol.git","clone_url":"https://github.com/livepeer/protocol.git","svn_url":"https://github.com/livepeer/protocol","homepage":null,"size":507,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":26,"forks":7,"open_issues":26,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/116"},"html":{"href":"https://github.com/livepeer/protocol/pull/116"},"issue":{"href":"https://api.github.com/repos/livepeer/protocol/issues/116"},"comments":{"href":"https://api.github.com/repos/livepeer/protocol/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/livepeer/protocol/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/livepeer/protocol/statuses/fb18d6b9e8e0ddd42a197929d875fa5103cafba1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"yondonfu"}}