{"action":"created","comment":{"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/comments/88419895","pull_request_review_id":8992354,"id":88419895,"diff_hunk":"@@ -12,17 +12,231 @@\n from test_framework.test_framework import BitcoinTestFramework\n from test_framework.util import assert_equal\n from test_framework.util import *\n+from test_framework.blocktools import *\n+import test_framework.script as script\n import pdb\n+import sys\n+import logging\n+logging.basicConfig(format='%(asctime)s.%(levelname)s: %(message)s', level=logging.INFO)\n \n class ExcessiveBlockTest (BitcoinTestFramework):\n+    def __init__(self,extended=False):\n+      self.extended = extended\n+      BitcoinTestFramework.__init__(self)\n \n-    def run_test (self):\n-        BitcoinTestFramework.run_test (self)\n+    def setup_network(self, split=False):\n+        self.nodes = start_nodes(4, self.options.tmpdir,timewait=60*10)\n+        interconnect_nodes(self.nodes)\n+        self.is_network_split=False\n+        self.sync_all()\n+\n+        if 0:  # Use to create wallet with lots of addresses\n+          TEST_SIZE=10000\n+          print \"Creating addresses...\"\n+          addrs = [ self.nodes[0].getnewaddress() for _ in range(TEST_SIZE+1)]\n+          with open(\"walletAddrs.json\",\"w\") as f: \n+            f.write(str(addrs))\n+            pdb.set_trace()\n+\n+    def run_test(self):\n+      BitcoinTestFramework.run_test (self)\n+\n+      # exact point in chain is not required\n+      #tips = self.nodes[0].getchaintips ()\n+      #assert_equal (len (tips), 1)\n+      #assert_equal (tips[0]['branchlen'], 0)\n+      #assert_equal (tips[0]['height'], 200)\n+      #assert_equal (tips[0]['status'], 'active')\n+\n+      self.testExcessiveBlock()\n+      self.testExcessiveTx()","path":"qa/rpc-tests/excessive.py","position":43,"original_position":43,"commit_id":"150c86e427187a71bc17ccd32483c98dc9dbfba2","original_commit_id":"150c86e427187a71bc17ccd32483c98dc9dbfba2","user":{"login":"ftrader","id":16613123,"avatar_url":"https://avatars.githubusercontent.com/u/16613123?v=3","gravatar_id":"","url":"https://api.github.com/users/ftrader","html_url":"https://github.com/ftrader","followers_url":"https://api.github.com/users/ftrader/followers","following_url":"https://api.github.com/users/ftrader/following{/other_user}","gists_url":"https://api.github.com/users/ftrader/gists{/gist_id}","starred_url":"https://api.github.com/users/ftrader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftrader/subscriptions","organizations_url":"https://api.github.com/users/ftrader/orgs","repos_url":"https://api.github.com/users/ftrader/repos","events_url":"https://api.github.com/users/ftrader/events{/privacy}","received_events_url":"https://api.github.com/users/ftrader/received_events","type":"User","site_admin":false},"body":"File length & class/method length are quantitative ones which favors splitting up into smaller modules.\r\nOne could argue the excessive.py is getting excessively long :-)","created_at":"2016-11-17T09:56:53Z","updated_at":"2016-11-17T09:56:53Z","html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164#discussion_r88419895","pull_request_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/comments/88419895"},"html":{"href":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164#discussion_r88419895"},"pull_request":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164","id":94044705,"html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164","diff_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164.diff","patch_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164.patch","issue_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/164","number":164,"state":"open","locked":false,"title":"Add emergent consensus to sigop and transaction size ","user":{"login":"gandrewstone","id":89979,"avatar_url":"https://avatars.githubusercontent.com/u/89979?v=3","gravatar_id":"","url":"https://api.github.com/users/gandrewstone","html_url":"https://github.com/gandrewstone","followers_url":"https://api.github.com/users/gandrewstone/followers","following_url":"https://api.github.com/users/gandrewstone/following{/other_user}","gists_url":"https://api.github.com/users/gandrewstone/gists{/gist_id}","starred_url":"https://api.github.com/users/gandrewstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandrewstone/subscriptions","organizations_url":"https://api.github.com/users/gandrewstone/orgs","repos_url":"https://api.github.com/users/gandrewstone/repos","events_url":"https://api.github.com/users/gandrewstone/events{/privacy}","received_events_url":"https://api.github.com/users/gandrewstone/received_events","type":"User","site_admin":false},"body":"For non-excessive blocks, Sigops are \"limited\" to < 20000 (core's number) for blocks < 1MB.  For blocks > 1MB the sigops is a configurable number (net.excessiveSigOp, default 20000) expressed in an amount per rounded-up block size in megabytes.  For example, a 1,000,001 byte block can contain 2*net.excessiveSigOp sigops before it is designated as \"excessive\".\r\n\r\nIts actually more succinctly explained in code:\r\nuint64_t blockMbSize = 1+((blockSize-1)/1000000); \r\nif (nSigOps > sigOpsPerMb.value*blockMbSize) { EXCESSIVE(); }\r\n\r\nsighashes are limited by limiting transaction size.  For compatibility with today's blockchain, any transaction size is allowed in block <= 1MB.  In blocks whose size is > 1MB, a block is excessive if it contains a transaction with a length >= net.excessiveTxn (which is 100KB by default).\r\n\r\n","created_at":"2016-11-16T20:35:48Z","updated_at":"2016-11-17T09:56:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"583d5fe7d453e6fe58793a37435f8df2eb82afe2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164/commits","review_comments_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164/comments","review_comment_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/164/comments","statuses_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/statuses/150c86e427187a71bc17ccd32483c98dc9dbfba2","head":{"label":"gandrewstone:sigop_sighash","ref":"sigop_sighash","sha":"150c86e427187a71bc17ccd32483c98dc9dbfba2","user":{"login":"gandrewstone","id":89979,"avatar_url":"https://avatars.githubusercontent.com/u/89979?v=3","gravatar_id":"","url":"https://api.github.com/users/gandrewstone","html_url":"https://github.com/gandrewstone","followers_url":"https://api.github.com/users/gandrewstone/followers","following_url":"https://api.github.com/users/gandrewstone/following{/other_user}","gists_url":"https://api.github.com/users/gandrewstone/gists{/gist_id}","starred_url":"https://api.github.com/users/gandrewstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandrewstone/subscriptions","organizations_url":"https://api.github.com/users/gandrewstone/orgs","repos_url":"https://api.github.com/users/gandrewstone/repos","events_url":"https://api.github.com/users/gandrewstone/events{/privacy}","received_events_url":"https://api.github.com/users/gandrewstone/received_events","type":"User","site_admin":false},"repo":{"id":53461587,"name":"BitcoinUnlimited","full_name":"gandrewstone/BitcoinUnlimited","owner":{"login":"gandrewstone","id":89979,"avatar_url":"https://avatars.githubusercontent.com/u/89979?v=3","gravatar_id":"","url":"https://api.github.com/users/gandrewstone","html_url":"https://github.com/gandrewstone","followers_url":"https://api.github.com/users/gandrewstone/followers","following_url":"https://api.github.com/users/gandrewstone/following{/other_user}","gists_url":"https://api.github.com/users/gandrewstone/gists{/gist_id}","starred_url":"https://api.github.com/users/gandrewstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gandrewstone/subscriptions","organizations_url":"https://api.github.com/users/gandrewstone/orgs","repos_url":"https://api.github.com/users/gandrewstone/repos","events_url":"https://api.github.com/users/gandrewstone/events{/privacy}","received_events_url":"https://api.github.com/users/gandrewstone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gandrewstone/BitcoinUnlimited","description":"Bitcoin Unlimited integration/staging tree","fork":true,"url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited","forks_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/forks","keys_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/teams","hooks_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/hooks","issue_events_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/issues/events{/number}","events_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/events","assignees_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/assignees{/user}","branches_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/branches{/branch}","tags_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/tags","blobs_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/git/refs{/sha}","trees_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/statuses/{sha}","languages_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/languages","stargazers_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/stargazers","contributors_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/contributors","subscribers_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/subscribers","subscription_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/subscription","commits_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/commits{/sha}","git_commits_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/git/commits{/sha}","comments_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/comments{/number}","issue_comment_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/issues/comments{/number}","contents_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/contents/{+path}","compare_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/merges","archive_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/downloads","issues_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/issues{/number}","pulls_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/pulls{/number}","milestones_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/milestones{/number}","notifications_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/labels{/name}","releases_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/releases{/id}","deployments_url":"https://api.github.com/repos/gandrewstone/BitcoinUnlimited/deployments","created_at":"2016-03-09T02:28:24Z","updated_at":"2016-11-11T10:51:02Z","pushed_at":"2016-11-16T20:24:55Z","git_url":"git://github.com/gandrewstone/BitcoinUnlimited.git","ssh_url":"git@github.com:gandrewstone/BitcoinUnlimited.git","clone_url":"https://github.com/gandrewstone/BitcoinUnlimited.git","svn_url":"https://github.com/gandrewstone/BitcoinUnlimited","homepage":"http://www.bitcoinunlimited.info/download.html","size":62643,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":0,"default_branch":"XpeditedBlocks"}},"base":{"label":"BitcoinUnlimited:0.12.1bu","ref":"0.12.1bu","sha":"f3314b656a20d08f8c37d58959a28d92858ef393","user":{"login":"BitcoinUnlimited","id":14125627,"avatar_url":"https://avatars.githubusercontent.com/u/14125627?v=3","gravatar_id":"","url":"https://api.github.com/users/BitcoinUnlimited","html_url":"https://github.com/BitcoinUnlimited","followers_url":"https://api.github.com/users/BitcoinUnlimited/followers","following_url":"https://api.github.com/users/BitcoinUnlimited/following{/other_user}","gists_url":"https://api.github.com/users/BitcoinUnlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/BitcoinUnlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitcoinUnlimited/subscriptions","organizations_url":"https://api.github.com/users/BitcoinUnlimited/orgs","repos_url":"https://api.github.com/users/BitcoinUnlimited/repos","events_url":"https://api.github.com/users/BitcoinUnlimited/events{/privacy}","received_events_url":"https://api.github.com/users/BitcoinUnlimited/received_events","type":"Organization","site_admin":false},"repo":{"id":18613259,"name":"BitcoinUnlimited","full_name":"BitcoinUnlimited/BitcoinUnlimited","owner":{"login":"BitcoinUnlimited","id":14125627,"avatar_url":"https://avatars.githubusercontent.com/u/14125627?v=3","gravatar_id":"","url":"https://api.github.com/users/BitcoinUnlimited","html_url":"https://github.com/BitcoinUnlimited","followers_url":"https://api.github.com/users/BitcoinUnlimited/followers","following_url":"https://api.github.com/users/BitcoinUnlimited/following{/other_user}","gists_url":"https://api.github.com/users/BitcoinUnlimited/gists{/gist_id}","starred_url":"https://api.github.com/users/BitcoinUnlimited/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitcoinUnlimited/subscriptions","organizations_url":"https://api.github.com/users/BitcoinUnlimited/orgs","repos_url":"https://api.github.com/users/BitcoinUnlimited/repos","events_url":"https://api.github.com/users/BitcoinUnlimited/events{/privacy}","received_events_url":"https://api.github.com/users/BitcoinUnlimited/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited","description":"Bitcoin Unlimited integration/staging tree","fork":true,"url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited","forks_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/forks","keys_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/teams","hooks_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/hooks","issue_events_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/events{/number}","events_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/events","assignees_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/assignees{/user}","branches_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/branches{/branch}","tags_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/tags","blobs_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/git/refs{/sha}","trees_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/statuses/{sha}","languages_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/languages","stargazers_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/stargazers","contributors_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/contributors","subscribers_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/subscribers","subscription_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/subscription","commits_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/commits{/sha}","git_commits_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/git/commits{/sha}","comments_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/comments{/number}","issue_comment_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/comments{/number}","contents_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/contents/{+path}","compare_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/merges","archive_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/downloads","issues_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues{/number}","pulls_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls{/number}","milestones_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/milestones{/number}","notifications_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/labels{/name}","releases_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/releases{/id}","deployments_url":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/deployments","created_at":"2014-04-09T21:03:00Z","updated_at":"2016-11-14T03:04:50Z","pushed_at":"2016-11-17T06:00:27Z","git_url":"git://github.com/BitcoinUnlimited/BitcoinUnlimited.git","ssh_url":"git@github.com:BitcoinUnlimited/BitcoinUnlimited.git","clone_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited.git","svn_url":"https://github.com/BitcoinUnlimited/BitcoinUnlimited","homepage":"http://www.bitcoinunlimited.info/download.html","size":71189,"stargazers_count":54,"watchers_count":54,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":30,"forks":30,"open_issues":30,"watchers":54,"default_branch":"0.12.1bu"}},"_links":{"self":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164"},"html":{"href":"https://github.com/BitcoinUnlimited/BitcoinUnlimited/pull/164"},"issue":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/164"},"comments":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/BitcoinUnlimited/BitcoinUnlimited/statuses/150c86e427187a71bc17ccd32483c98dc9dbfba2"}}}}
{"actor":{"display_login":"ftrader"}}