{"action":"created","issue":{"url":"https://api.github.com/repos/omisego/plasma-cash/issues/83","repository_url":"https://api.github.com/repos/omisego/plasma-cash","labels_url":"https://api.github.com/repos/omisego/plasma-cash/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/omisego/plasma-cash/issues/83/comments","events_url":"https://api.github.com/repos/omisego/plasma-cash/issues/83/events","html_url":"https://github.com/omisego/plasma-cash/issues/83","id":343929366,"node_id":"MDU6SXNzdWUzNDM5MjkzNjY=","number":83,"title":"Wait for transaction is mined before creating block in plasma chain","user":{"login":"ldmtam","id":8778071,"node_id":"MDQ6VXNlcjg3NzgwNzE=","avatar_url":"https://avatars3.githubusercontent.com/u/8778071?v=4","gravatar_id":"","url":"https://api.github.com/users/ldmtam","html_url":"https://github.com/ldmtam","followers_url":"https://api.github.com/users/ldmtam/followers","following_url":"https://api.github.com/users/ldmtam/following{/other_user}","gists_url":"https://api.github.com/users/ldmtam/gists{/gist_id}","starred_url":"https://api.github.com/users/ldmtam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldmtam/subscriptions","organizations_url":"https://api.github.com/users/ldmtam/orgs","repos_url":"https://api.github.com/users/ldmtam/repos","events_url":"https://api.github.com/users/ldmtam/events{/privacy}","received_events_url":"https://api.github.com/users/ldmtam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-24T08:10:06Z","updated_at":"2018-07-25T11:51:54Z","closed_at":null,"author_association":"NONE","body":"```\r\ndef submit_block(self, sig):\r\n        signature = bytes.fromhex(sig)\r\n        if (signature == b'\\x00' * 65 or\r\n           get_sender(self.current_block.hash, signature) != self.authority):\r\n            raise InvalidBlockSignatureException('failed to submit a block')\r\n\r\n        merkle_hash = self.current_block.merklize_transaction_set()\r\n\r\n        authority_address = w3.toChecksumAddress('0x' + self.authority.hex())\r\n        self.root_chain.functions.submitBlock(merkle_hash, self.current_block_number).transact(\r\n            {'from': authority_address}\r\n        )\r\n\r\n        emit('chain.block', self.current_block_number)\r\n        self.db.save_block(self.current_block, self.current_block_number)\r\n        self.current_block_number = self.db.increment_current_block_num()\r\n        self.current_block = Block()\r\n\r\n        return merkle_hash\r\n```\r\nIn this function, I think we should wait until the block that contains our transaction is mined on Ethereum blockchain before adding new block in the plasma chain. Because of some unforseen reasons, the transaction might fail and that block in plasma chain will become invalid."},"comment":{"url":"https://api.github.com/repos/omisego/plasma-cash/issues/comments/407727700","html_url":"https://github.com/omisego/plasma-cash/issues/83#issuecomment-407727700","issue_url":"https://api.github.com/repos/omisego/plasma-cash/issues/83","id":407727700,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzcyNzcwMA==","user":{"login":"boolafish","id":6198848,"node_id":"MDQ6VXNlcjYxOTg4NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/6198848?v=4","gravatar_id":"","url":"https://api.github.com/users/boolafish","html_url":"https://github.com/boolafish","followers_url":"https://api.github.com/users/boolafish/followers","following_url":"https://api.github.com/users/boolafish/following{/other_user}","gists_url":"https://api.github.com/users/boolafish/gists{/gist_id}","starred_url":"https://api.github.com/users/boolafish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boolafish/subscriptions","organizations_url":"https://api.github.com/users/boolafish/orgs","repos_url":"https://api.github.com/users/boolafish/repos","events_url":"https://api.github.com/users/boolafish/events{/privacy}","received_events_url":"https://api.github.com/users/boolafish/received_events","type":"User","site_admin":false},"created_at":"2018-07-25T11:51:54Z","updated_at":"2018-07-25T11:51:54Z","author_association":"COLLABORATOR","body":"I think I am strongly influenced by the discussion here: https://github.com/omisego/research/issues/29. That's what's kind of in my mind.\r\n\r\nAs for your case, I would prefer to leave this to the user. Let say A and B is having a trade. A should give B 10 token and B provide A some goods. B can always choose to protect him/herself by waiting root chain confirmation before providing the goods. However, if it is just some small value daily life trading, B can just trust things should go smoothly, with some potential but probably pretty low risk.\r\n\r\nHow do you think?"}}
{"actor":{"display_login":"boolafish"}}