{"action":"created","comment":{"url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/comments/238161693","pull_request_review_id":180634758,"id":238161693,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODE2MTY5Mw==","diff_hunk":"@@ -262,6 +262,48 @@ contract RootChain is Ownable {\n         return true;\n     }\n \n+    // Validator of any block can call this function to exit the fees collected\n+    // for that particular block. The validator declares the fee amount, and the exit\n+    // is added to exit queue with the lowest priority for that block.\n+    // In case of a wrong fee amount specified, users on the Plasma chain would mass exit.\n+    // In case of the fee UTXO already spent, anyone can challenge the fee exit by providing\n+    // the spend of the fee UTXO.\n+    // @param blockNumber      the block for which the validator wants to exit fees\n+    // @param feeAmount        the amount of the fee collected in block blockNumber\n+    function startFeeExit(uint256 blockNumber, uint256 feeAmount)\n+        public\n+        payable\n+        onlyOwner\n+    {\n+        // specified blockNumber must exist in child chain\n+        bytes32 empty;\n+        require(childChain[blockNumber].root != empty, \"specified block does not exist in child chain.\");\n+\n+        require(msg.value >= minExitBond, \"insufficient exit bond\");\n+        if (msg.value > minExitBond) {\n+            uint256 excess = msg.value.sub(minExitBond);\n+            balances[msg.sender] = balances[msg.sender].add(excess);\n+            totalWithdrawBalance = totalWithdrawBalance.add(excess);\n+        }\n+\n+        // a fee UTXO has explicitly defined position [blockNumber, 2**16 - 1, 0]\n+        uint256 txIndex = 2**16 - 1;","path":"contracts/rootchain/RootChain.sol","position":29,"original_position":29,"commit_id":"8bae6bb347da7fba0fc4e96d73752836e26faf92","original_commit_id":"8bae6bb347da7fba0fc4e96d73752836e26faf92","user":{"login":"legengliu","id":7606454,"node_id":"MDQ6VXNlcjc2MDY0NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7606454?v=4","gravatar_id":"","url":"https://api.github.com/users/legengliu","html_url":"https://github.com/legengliu","followers_url":"https://api.github.com/users/legengliu/followers","following_url":"https://api.github.com/users/legengliu/following{/other_user}","gists_url":"https://api.github.com/users/legengliu/gists{/gist_id}","starred_url":"https://api.github.com/users/legengliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legengliu/subscriptions","organizations_url":"https://api.github.com/users/legengliu/orgs","repos_url":"https://api.github.com/users/legengliu/repos","events_url":"https://api.github.com/users/legengliu/events{/privacy}","received_events_url":"https://api.github.com/users/legengliu/received_events","type":"User","site_admin":false},"body":"@hamdiallam from the discord discussion, I understand that we're not going to enforce maximum block size in `submitBlock`?","created_at":"2018-12-03T07:14:27Z","updated_at":"2018-12-03T07:14:27Z","html_url":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80#discussion_r238161693","pull_request_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/comments/238161693"},"html":{"href":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80#discussion_r238161693"},"pull_request":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80"}},"in_reply_to_id":238113967},"pull_request":{"url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80","id":235276907,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1Mjc2OTA3","html_url":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80","diff_url":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80.diff","patch_url":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80.patch","issue_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/80","number":80,"state":"open","locked":false,"title":"[Audit milestone] Fee withdrawal for validators ","user":{"login":"legengliu","id":7606454,"node_id":"MDQ6VXNlcjc2MDY0NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7606454?v=4","gravatar_id":"","url":"https://api.github.com/users/legengliu","html_url":"https://github.com/legengliu","followers_url":"https://api.github.com/users/legengliu/followers","following_url":"https://api.github.com/users/legengliu/following{/other_user}","gists_url":"https://api.github.com/users/legengliu/gists{/gist_id}","starred_url":"https://api.github.com/users/legengliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legengliu/subscriptions","organizations_url":"https://api.github.com/users/legengliu/orgs","repos_url":"https://api.github.com/users/legengliu/repos","events_url":"https://api.github.com/users/legengliu/events{/privacy}","received_events_url":"https://api.github.com/users/legengliu/received_events","type":"User","site_admin":false},"body":"Added `startFeeExit` method on the rootchain contract to allow a validator to claim a fee for a block.\r\n\r\nNote that in the current implementation, if the validator attempts to exit a fee UTXO that has already been spent in a later block, the exit can be challenged through `startTransactionExit` the same way as a regular transaction exit. However, if the fee UTXO has not been spent, but the validator claims the incorrect fee amount for a block, users should watch and exit (there's no explicit check for the correct fee amount on the contract).\r\n","created_at":"2018-12-02T18:48:33Z","updated_at":"2018-12-03T07:14:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c5d62c60f4ed3adc93c9a898ecbd5d30a4e9f78","assignee":null,"assignees":[],"requested_reviewers":[{"login":"laskdaf","id":7388580,"node_id":"MDQ6VXNlcjczODg1ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/7388580?v=4","gravatar_id":"","url":"https://api.github.com/users/laskdaf","html_url":"https://github.com/laskdaf","followers_url":"https://api.github.com/users/laskdaf/followers","following_url":"https://api.github.com/users/laskdaf/following{/other_user}","gists_url":"https://api.github.com/users/laskdaf/gists{/gist_id}","starred_url":"https://api.github.com/users/laskdaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laskdaf/subscriptions","organizations_url":"https://api.github.com/users/laskdaf/orgs","repos_url":"https://api.github.com/users/laskdaf/repos","events_url":"https://api.github.com/users/laskdaf/events{/privacy}","received_events_url":"https://api.github.com/users/laskdaf/received_events","type":"User","site_admin":false},{"login":"AdityaSripal","id":14364734,"node_id":"MDQ6VXNlcjE0MzY0NzM0","avatar_url":"https://avatars2.githubusercontent.com/u/14364734?v=4","gravatar_id":"","url":"https://api.github.com/users/AdityaSripal","html_url":"https://github.com/AdityaSripal","followers_url":"https://api.github.com/users/AdityaSripal/followers","following_url":"https://api.github.com/users/AdityaSripal/following{/other_user}","gists_url":"https://api.github.com/users/AdityaSripal/gists{/gist_id}","starred_url":"https://api.github.com/users/AdityaSripal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdityaSripal/subscriptions","organizations_url":"https://api.github.com/users/AdityaSripal/orgs","repos_url":"https://api.github.com/users/AdityaSripal/repos","events_url":"https://api.github.com/users/AdityaSripal/events{/privacy}","received_events_url":"https://api.github.com/users/AdityaSripal/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80/commits","review_comments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80/comments","review_comment_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/80/comments","statuses_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/statuses/8bae6bb347da7fba0fc4e96d73752836e26faf92","head":{"label":"FourthState:feeExit","ref":"feeExit","sha":"8bae6bb347da7fba0fc4e96d73752836e26faf92","user":{"login":"FourthState","id":37393185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzkzMTg1","avatar_url":"https://avatars1.githubusercontent.com/u/37393185?v=4","gravatar_id":"","url":"https://api.github.com/users/FourthState","html_url":"https://github.com/FourthState","followers_url":"https://api.github.com/users/FourthState/followers","following_url":"https://api.github.com/users/FourthState/following{/other_user}","gists_url":"https://api.github.com/users/FourthState/gists{/gist_id}","starred_url":"https://api.github.com/users/FourthState/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FourthState/subscriptions","organizations_url":"https://api.github.com/users/FourthState/orgs","repos_url":"https://api.github.com/users/FourthState/repos","events_url":"https://api.github.com/users/FourthState/events{/privacy}","received_events_url":"https://api.github.com/users/FourthState/received_events","type":"Organization","site_admin":false},"repo":{"id":125313868,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUzMTM4Njg=","name":"plasma-mvp-rootchain","full_name":"FourthState/plasma-mvp-rootchain","private":false,"owner":{"login":"FourthState","id":37393185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzkzMTg1","avatar_url":"https://avatars1.githubusercontent.com/u/37393185?v=4","gravatar_id":"","url":"https://api.github.com/users/FourthState","html_url":"https://github.com/FourthState","followers_url":"https://api.github.com/users/FourthState/followers","following_url":"https://api.github.com/users/FourthState/following{/other_user}","gists_url":"https://api.github.com/users/FourthState/gists{/gist_id}","starred_url":"https://api.github.com/users/FourthState/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FourthState/subscriptions","organizations_url":"https://api.github.com/users/FourthState/orgs","repos_url":"https://api.github.com/users/FourthState/repos","events_url":"https://api.github.com/users/FourthState/events{/privacy}","received_events_url":"https://api.github.com/users/FourthState/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/FourthState/plasma-mvp-rootchain","description":"Rootchain contract implementation according to the Plasma MVP.","fork":false,"url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain","forks_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/forks","keys_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/teams","hooks_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/hooks","issue_events_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/events{/number}","events_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/events","assignees_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/assignees{/user}","branches_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/branches{/branch}","tags_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/tags","blobs_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/statuses/{sha}","languages_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/languages","stargazers_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/stargazers","contributors_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/contributors","subscribers_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/subscribers","subscription_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/subscription","commits_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/contents/{+path}","compare_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/merges","archive_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/downloads","issues_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues{/number}","pulls_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls{/number}","milestones_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/milestones{/number}","notifications_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/labels{/name}","releases_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/releases{/id}","deployments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/deployments","created_at":"2018-03-15T04:52:10Z","updated_at":"2018-12-03T01:30:04Z","pushed_at":"2018-12-03T01:30:36Z","git_url":"git://github.com/FourthState/plasma-mvp-rootchain.git","ssh_url":"git@github.com:FourthState/plasma-mvp-rootchain.git","clone_url":"https://github.com/FourthState/plasma-mvp-rootchain.git","svn_url":"https://github.com/FourthState/plasma-mvp-rootchain","homepage":"","size":1034,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":17,"open_issues":7,"watchers":64,"default_branch":"master"}},"base":{"label":"FourthState:master","ref":"master","sha":"b7ddf5c30fedfa98e2de0d12f457fae063a93459","user":{"login":"FourthState","id":37393185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzkzMTg1","avatar_url":"https://avatars1.githubusercontent.com/u/37393185?v=4","gravatar_id":"","url":"https://api.github.com/users/FourthState","html_url":"https://github.com/FourthState","followers_url":"https://api.github.com/users/FourthState/followers","following_url":"https://api.github.com/users/FourthState/following{/other_user}","gists_url":"https://api.github.com/users/FourthState/gists{/gist_id}","starred_url":"https://api.github.com/users/FourthState/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FourthState/subscriptions","organizations_url":"https://api.github.com/users/FourthState/orgs","repos_url":"https://api.github.com/users/FourthState/repos","events_url":"https://api.github.com/users/FourthState/events{/privacy}","received_events_url":"https://api.github.com/users/FourthState/received_events","type":"Organization","site_admin":false},"repo":{"id":125313868,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUzMTM4Njg=","name":"plasma-mvp-rootchain","full_name":"FourthState/plasma-mvp-rootchain","private":false,"owner":{"login":"FourthState","id":37393185,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MzkzMTg1","avatar_url":"https://avatars1.githubusercontent.com/u/37393185?v=4","gravatar_id":"","url":"https://api.github.com/users/FourthState","html_url":"https://github.com/FourthState","followers_url":"https://api.github.com/users/FourthState/followers","following_url":"https://api.github.com/users/FourthState/following{/other_user}","gists_url":"https://api.github.com/users/FourthState/gists{/gist_id}","starred_url":"https://api.github.com/users/FourthState/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FourthState/subscriptions","organizations_url":"https://api.github.com/users/FourthState/orgs","repos_url":"https://api.github.com/users/FourthState/repos","events_url":"https://api.github.com/users/FourthState/events{/privacy}","received_events_url":"https://api.github.com/users/FourthState/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/FourthState/plasma-mvp-rootchain","description":"Rootchain contract implementation according to the Plasma MVP.","fork":false,"url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain","forks_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/forks","keys_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/teams","hooks_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/hooks","issue_events_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/events{/number}","events_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/events","assignees_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/assignees{/user}","branches_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/branches{/branch}","tags_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/tags","blobs_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/refs{/sha}","trees_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/statuses/{sha}","languages_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/languages","stargazers_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/stargazers","contributors_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/contributors","subscribers_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/subscribers","subscription_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/subscription","commits_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/commits{/sha}","git_commits_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/git/commits{/sha}","comments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/comments{/number}","issue_comment_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/comments{/number}","contents_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/contents/{+path}","compare_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/merges","archive_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/downloads","issues_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues{/number}","pulls_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls{/number}","milestones_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/milestones{/number}","notifications_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/labels{/name}","releases_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/releases{/id}","deployments_url":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/deployments","created_at":"2018-03-15T04:52:10Z","updated_at":"2018-12-03T01:30:04Z","pushed_at":"2018-12-03T01:30:36Z","git_url":"git://github.com/FourthState/plasma-mvp-rootchain.git","ssh_url":"git@github.com:FourthState/plasma-mvp-rootchain.git","clone_url":"https://github.com/FourthState/plasma-mvp-rootchain.git","svn_url":"https://github.com/FourthState/plasma-mvp-rootchain","homepage":"","size":1034,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":17,"open_issues":7,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80"},"html":{"href":"https://github.com/FourthState/plasma-mvp-rootchain/pull/80"},"issue":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/80"},"comments":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/FourthState/plasma-mvp-rootchain/statuses/8bae6bb347da7fba0fc4e96d73752836e26faf92"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"legengliu"}}