{"action":"created","comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/60522121","id":60522121,"diff_hunk":"@@ -6,10 +6,14 @@\n #ifndef BITCOIN_CONSENSUS_CONSENSUS_H\n #define BITCOIN_CONSENSUS_CONSENSUS_H\n \n-/** The maximum allowed size for a serialized block, in bytes (network rule) */\n-static const unsigned int MAX_BLOCK_SIZE = 1000000;\n+/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */\n+static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000;\n+/** The maximum allowed cost for a block, see BIP 141 (network rule) */\n+static const unsigned int MAX_BLOCK_COST = 4000000;","path":"src/consensus/consensus.h","position":9,"original_position":9,"commit_id":"7b539f9bfe4e96a9b30ffdc874aa80e4308c9dec","original_commit_id":"7b539f9bfe4e96a9b30ffdc874aa80e4308c9dec","user":{"login":"dcousens","id":413395,"avatar_url":"https://avatars.githubusercontent.com/u/413395?v=3","gravatar_id":"","url":"https://api.github.com/users/dcousens","html_url":"https://github.com/dcousens","followers_url":"https://api.github.com/users/dcousens/followers","following_url":"https://api.github.com/users/dcousens/following{/other_user}","gists_url":"https://api.github.com/users/dcousens/gists{/gist_id}","starred_url":"https://api.github.com/users/dcousens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcousens/subscriptions","organizations_url":"https://api.github.com/users/dcousens/orgs","repos_url":"https://api.github.com/users/dcousens/repos","events_url":"https://api.github.com/users/dcousens/events{/privacy}","received_events_url":"https://api.github.com/users/dcousens/received_events","type":"User","site_admin":false},"body":"Less implicit casts if this is also `uint64_t`","created_at":"2016-04-21T03:33:53Z","updated_at":"2016-04-21T03:33:53Z","html_url":"https://github.com/bitcoin/bitcoin/pull/7910#discussion_r60522121","pull_request_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910","_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments/60522121"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7910#discussion_r60522121"},"pull_request":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910"}}},"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910","id":67038135,"html_url":"https://github.com/bitcoin/bitcoin/pull/7910","diff_url":"https://github.com/bitcoin/bitcoin/pull/7910.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/7910.patch","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7910","number":7910,"state":"open","locked":false,"title":"Segregated witness","user":{"login":"sipa","id":548488,"avatar_url":"https://avatars.githubusercontent.com/u/548488?v=3","gravatar_id":"","url":"https://api.github.com/users/sipa","html_url":"https://github.com/sipa","followers_url":"https://api.github.com/users/sipa/followers","following_url":"https://api.github.com/users/sipa/following{/other_user}","gists_url":"https://api.github.com/users/sipa/gists{/gist_id}","starred_url":"https://api.github.com/users/sipa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipa/subscriptions","organizations_url":"https://api.github.com/users/sipa/orgs","repos_url":"https://api.github.com/users/sipa/repos","events_url":"https://api.github.com/users/sipa/events{/privacy}","received_events_url":"https://api.github.com/users/sipa/received_events","type":"User","site_admin":false},"body":"This is the complete code for segregated witness on top of master (implementing BIP141, BIP143, BIP144, BIP145)\r\n\r\nThe commits are organized in several sections (separated by empty commits named \"--- [SEGWIT] ... ---\")\r\n* Preparation commits (currently includes #7749)\r\n* Segnet (easier for testing at this point, though these will be removed before final merge)\r\n* P2P/node/consensus\r\n* Wallet changes\r\n* Tests\r\n\r\nThere are certainly some items left to do:\r\n- [ ] Incorporate changes to BIP145/BIP9 when finalized (see https://github.com/bitcoin/bips/pull/365)\r\n- [ ] Define a deployment time for testnet\r\n- [ ] Seed nodes that provide segwit-capable peers\r\n- [ ] Do tests in a mixed network of upgraded and non-upgraded nodes\r\n- [ ] Remove segnet from mainline merge\r\n- [ ] Define a deployment time for mainnet\r\n- [ ] Per-transaction caching of sighashes to fix the O(n^2) sighash problem (see https://github.com/sipa/bitcoin/pull/70)\r\n\r\nBut a lot of testing (unit tests, rpc tests, p2p tests, and tests by external software projects) are being done already, so it is probably time to make it visible as a PR for general review.\r\n\r\nMany thanks to all contributors so far, including @jl2012, @NicolasDorier, @CodeShark, @sdaftuar, @morcos, @luke-jr, @afk11, @theuni, @TheBlueMatt, as well as the original ideas by @gmaxwell and @luke-jr it is based on.\r\n","created_at":"2016-04-19T15:22:33Z","updated_at":"2016-04-21T03:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"325de3fd82d338884fdd92984f6d22d1babcabe3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910/commits","review_comments_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910/comments","review_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/7910/comments","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/7b539f9bfe4e96a9b30ffdc874aa80e4308c9dec","head":{"label":"sipa:segwit-master","ref":"segwit-master","sha":"7b539f9bfe4e96a9b30ffdc874aa80e4308c9dec","user":{"login":"sipa","id":548488,"avatar_url":"https://avatars.githubusercontent.com/u/548488?v=3","gravatar_id":"","url":"https://api.github.com/users/sipa","html_url":"https://github.com/sipa","followers_url":"https://api.github.com/users/sipa/followers","following_url":"https://api.github.com/users/sipa/following{/other_user}","gists_url":"https://api.github.com/users/sipa/gists{/gist_id}","starred_url":"https://api.github.com/users/sipa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipa/subscriptions","organizations_url":"https://api.github.com/users/sipa/orgs","repos_url":"https://api.github.com/users/sipa/repos","events_url":"https://api.github.com/users/sipa/events{/privacy}","received_events_url":"https://api.github.com/users/sipa/received_events","type":"User","site_admin":false},"repo":{"id":1458655,"name":"bitcoin","full_name":"sipa/bitcoin","owner":{"login":"sipa","id":548488,"avatar_url":"https://avatars.githubusercontent.com/u/548488?v=3","gravatar_id":"","url":"https://api.github.com/users/sipa","html_url":"https://github.com/sipa","followers_url":"https://api.github.com/users/sipa/followers","following_url":"https://api.github.com/users/sipa/following{/other_user}","gists_url":"https://api.github.com/users/sipa/gists{/gist_id}","starred_url":"https://api.github.com/users/sipa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipa/subscriptions","organizations_url":"https://api.github.com/users/sipa/orgs","repos_url":"https://api.github.com/users/sipa/repos","events_url":"https://api.github.com/users/sipa/events{/privacy}","received_events_url":"https://api.github.com/users/sipa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sipa/bitcoin","description":"Bitcoin integration/staging tree","fork":true,"url":"https://api.github.com/repos/sipa/bitcoin","forks_url":"https://api.github.com/repos/sipa/bitcoin/forks","keys_url":"https://api.github.com/repos/sipa/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sipa/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sipa/bitcoin/teams","hooks_url":"https://api.github.com/repos/sipa/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/sipa/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/sipa/bitcoin/events","assignees_url":"https://api.github.com/repos/sipa/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/sipa/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/sipa/bitcoin/tags","blobs_url":"https://api.github.com/repos/sipa/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sipa/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sipa/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/sipa/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sipa/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/sipa/bitcoin/languages","stargazers_url":"https://api.github.com/repos/sipa/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/sipa/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/sipa/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/sipa/bitcoin/subscription","commits_url":"https://api.github.com/repos/sipa/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/sipa/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/sipa/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/sipa/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/sipa/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/sipa/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sipa/bitcoin/merges","archive_url":"https://api.github.com/repos/sipa/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sipa/bitcoin/downloads","issues_url":"https://api.github.com/repos/sipa/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/sipa/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/sipa/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/sipa/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sipa/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/sipa/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/sipa/bitcoin/deployments","created_at":"2011-03-09T10:46:59Z","updated_at":"2016-04-04T17:59:14Z","pushed_at":"2016-04-20T22:36:08Z","git_url":"git://github.com/sipa/bitcoin.git","ssh_url":"git@github.com:sipa/bitcoin.git","clone_url":"https://github.com/sipa/bitcoin.git","svn_url":"https://github.com/sipa/bitcoin","homepage":"http://www.bitcoin.org","size":64946,"stargazers_count":47,"watchers_count":47,"language":"TypeScript","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":15,"forks":10,"open_issues":15,"watchers":47,"default_branch":"lows"}},"base":{"label":"bitcoin:master","ref":"master","sha":"04a29373571d44be36bd099c3b3ec3cda89e99d1","user":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"repo":{"id":1181927,"name":"bitcoin","full_name":"bitcoin/bitcoin","owner":{"login":"bitcoin","id":528860,"avatar_url":"https://avatars.githubusercontent.com/u/528860?v=3","gravatar_id":"","url":"https://api.github.com/users/bitcoin","html_url":"https://github.com/bitcoin","followers_url":"https://api.github.com/users/bitcoin/followers","following_url":"https://api.github.com/users/bitcoin/following{/other_user}","gists_url":"https://api.github.com/users/bitcoin/gists{/gist_id}","starred_url":"https://api.github.com/users/bitcoin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitcoin/subscriptions","organizations_url":"https://api.github.com/users/bitcoin/orgs","repos_url":"https://api.github.com/users/bitcoin/repos","events_url":"https://api.github.com/users/bitcoin/events{/privacy}","received_events_url":"https://api.github.com/users/bitcoin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bitcoin/bitcoin","description":"Bitcoin Core integration/staging tree","fork":false,"url":"https://api.github.com/repos/bitcoin/bitcoin","forks_url":"https://api.github.com/repos/bitcoin/bitcoin/forks","keys_url":"https://api.github.com/repos/bitcoin/bitcoin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitcoin/bitcoin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitcoin/bitcoin/teams","hooks_url":"https://api.github.com/repos/bitcoin/bitcoin/hooks","issue_events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/events{/number}","events_url":"https://api.github.com/repos/bitcoin/bitcoin/events","assignees_url":"https://api.github.com/repos/bitcoin/bitcoin/assignees{/user}","branches_url":"https://api.github.com/repos/bitcoin/bitcoin/branches{/branch}","tags_url":"https://api.github.com/repos/bitcoin/bitcoin/tags","blobs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitcoin/bitcoin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitcoin/bitcoin/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitcoin/bitcoin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitcoin/bitcoin/statuses/{sha}","languages_url":"https://api.github.com/repos/bitcoin/bitcoin/languages","stargazers_url":"https://api.github.com/repos/bitcoin/bitcoin/stargazers","contributors_url":"https://api.github.com/repos/bitcoin/bitcoin/contributors","subscribers_url":"https://api.github.com/repos/bitcoin/bitcoin/subscribers","subscription_url":"https://api.github.com/repos/bitcoin/bitcoin/subscription","commits_url":"https://api.github.com/repos/bitcoin/bitcoin/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitcoin/bitcoin/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitcoin/bitcoin/contents/{+path}","compare_url":"https://api.github.com/repos/bitcoin/bitcoin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitcoin/bitcoin/merges","archive_url":"https://api.github.com/repos/bitcoin/bitcoin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitcoin/bitcoin/downloads","issues_url":"https://api.github.com/repos/bitcoin/bitcoin/issues{/number}","pulls_url":"https://api.github.com/repos/bitcoin/bitcoin/pulls{/number}","milestones_url":"https://api.github.com/repos/bitcoin/bitcoin/milestones{/number}","notifications_url":"https://api.github.com/repos/bitcoin/bitcoin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/labels{/name}","releases_url":"https://api.github.com/repos/bitcoin/bitcoin/releases{/id}","deployments_url":"https://api.github.com/repos/bitcoin/bitcoin/deployments","created_at":"2010-12-19T15:16:43Z","updated_at":"2016-04-21T03:17:00Z","pushed_at":"2016-04-20T23:00:53Z","git_url":"git://github.com/bitcoin/bitcoin.git","ssh_url":"git@github.com:bitcoin/bitcoin.git","clone_url":"https://github.com/bitcoin/bitcoin.git","svn_url":"https://github.com/bitcoin/bitcoin","homepage":"https://bitcoin.org/en/download","size":129755,"stargazers_count":8877,"watchers_count":8877,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5996,"mirror_url":null,"open_issues_count":459,"forks":5996,"open_issues":459,"watchers":8877,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910"},"html":{"href":"https://github.com/bitcoin/bitcoin/pull/7910"},"issue":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7910"},"comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/issues/7910/comments"},"review_comments":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910/comments"},"review_comment":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitcoin/bitcoin/pulls/7910/commits"},"statuses":{"href":"https://api.github.com/repos/bitcoin/bitcoin/statuses/7b539f9bfe4e96a9b30ffdc874aa80e4308c9dec"}}}}