{"action":"created","issue":{"url":"https://api.github.com/repos/ethereumjs/testrpc/issues/155","repository_url":"https://api.github.com/repos/ethereumjs/testrpc","labels_url":"https://api.github.com/repos/ethereumjs/testrpc/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/ethereumjs/testrpc/issues/155/comments","events_url":"https://api.github.com/repos/ethereumjs/testrpc/issues/155/events","html_url":"https://github.com/ethereumjs/testrpc/pull/155","id":174728472,"number":155,"title":"Add ability to toggle mining","user":{"login":"area","id":311812,"avatar_url":"https://avatars.githubusercontent.com/u/311812?v=3","gravatar_id":"","url":"https://api.github.com/users/area","html_url":"https://github.com/area","followers_url":"https://api.github.com/users/area/followers","following_url":"https://api.github.com/users/area/following{/other_user}","gists_url":"https://api.github.com/users/area/gists{/gist_id}","starred_url":"https://api.github.com/users/area/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/area/subscriptions","organizations_url":"https://api.github.com/users/area/orgs","repos_url":"https://api.github.com/users/area/repos","events_url":"https://api.github.com/users/area/events{/privacy}","received_events_url":"https://api.github.com/users/area/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-02T10:26:58Z","updated_at":"2016-09-14T16:05:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ethereumjs/testrpc/pulls/155","html_url":"https://github.com/ethereumjs/testrpc/pull/155","diff_url":"https://github.com/ethereumjs/testrpc/pull/155.diff","patch_url":"https://github.com/ethereumjs/testrpc/pull/155.patch"},"body":"Firstly, **do not merge!**. This depends on #153, and moreover needs some discussion before getting merged.\r\n\r\nAs mentioned in #153, we've found ourselves want to make sure transactions are included in the same block for testing, which is not possible with `testrpc` yet because as soon as a transaction is received, it is mined into a block. ~~This PR is a possible implementation of a flag `--noMineAfterTransaction` that toggles this behaviour.~~\r\n\r\nThe block-building logic becomes more complicated with multiple possible transactions, and is where the majority of the changes in this PR are found. In summary, when a block is mined:\r\n\r\n- Each transaction is added to the block in turn, starting with the first pending transaction. If the first pending transaction fails, the bad transaction is removed from the pool, then an error is thrown.\r\n- If subsequent transactions cause the block to fail when added, they _might_ be okay, but the block is getting full due to the block gas limit, or they might be bad transactions themselves. An error is not thrown, the transaction is not yet removed from the pool, and the remaining transactions are tried in turn.\r\n- In any of these cases, the state trie is reverted after the block is tested.\r\n- Finally, the block is mined with the transactions that it was able to include in this greedy fashion, and the transactions successfully included are removed from the list of pending transactions.\r\n\r\nThis implementation doesn't currently break any existing behaviour (the tests that pass on master still pass here). Some tests should be written for this new functionality, however.\r\n\r\nThe code needs some cleanup (notably failing DRY quite badly), but I thought it prudent to get any other comments at this point that would be able to improve this new feature to the level needed to get it released."},"comment":{"url":"https://api.github.com/repos/ethereumjs/testrpc/issues/comments/247064466","html_url":"https://github.com/ethereumjs/testrpc/pull/155#issuecomment-247064466","issue_url":"https://api.github.com/repos/ethereumjs/testrpc/issues/155","id":247064466,"user":{"login":"tcoulter","id":92629,"avatar_url":"https://avatars.githubusercontent.com/u/92629?v=3","gravatar_id":"","url":"https://api.github.com/users/tcoulter","html_url":"https://github.com/tcoulter","followers_url":"https://api.github.com/users/tcoulter/followers","following_url":"https://api.github.com/users/tcoulter/following{/other_user}","gists_url":"https://api.github.com/users/tcoulter/gists{/gist_id}","starred_url":"https://api.github.com/users/tcoulter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcoulter/subscriptions","organizations_url":"https://api.github.com/users/tcoulter/orgs","repos_url":"https://api.github.com/users/tcoulter/repos","events_url":"https://api.github.com/users/tcoulter/events{/privacy}","received_events_url":"https://api.github.com/users/tcoulter/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T16:05:35Z","updated_at":"2016-09-14T16:05:35Z","body":"Hi @area. I want to emphasize that this sounds -- and looks -- awesome. Since devcon is looming, and this is a big change, it's unlikely I'll be able to give it the attention it deserves until afterward. But I do want to communicate my support. Thanks a ton for working on this.\r\n\r\nSpeaking of devcon, will you or any of your team be there? I'd love to meet you guys in person if I can. Very much appreciate all your hard work."}}
{"actor":{"display_login":"tcoulter"}}