Skip to content

Commit

Permalink
Implement block-size market based equilibrium.
Browse files Browse the repository at this point in the history
This removes BIP109, 2MB blocksize proposal.
In its pace I insert the concept of market equilibrium based blocksizing.
Technically this means;

* We remove from the consensus rules the max-block-size.
* We introduce a command-line-argument that defines the max-block-size it
  will accept from other nodes.

Classic chose to use -blocksizeacceptlimit as a descriptive name, but for
compatibility with BU has an alias for its -excessiveblocksize.
Values are in whole megabytes, but floating point values are accepted with
an accuracy up to 100KB.  So, you can have "3.5" as blocksizeacceptlimit.
This value will be put in the coinbase-comment as "EB3.5" in this example.

In short;
Miners can continue to use the -blockmaxsize argument or bitcoin.conf
setting to limit the size of blocks they generate!  All nodes can also use
the `-blocksizeacceptlimit` option to limit the size of the blocks accepted
from (other) miners.
  • Loading branch information
zander committed Nov 21, 2016
1 parent 0eeefda commit 5c132f0
Show file tree
Hide file tree
Showing 24 changed files with 89 additions and 945 deletions.
1 change: 0 additions & 1 deletion qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
'bip65-cltv-p2p.py',
'bipdersig-p2p.py',
'bipdersig.py',
'bigblocks.py',
'getblocktemplate_longpoll.py',
'getblocktemplate_proposals.py',
'txn_doublespend.py',
Expand Down
331 changes: 0 additions & 331 deletions qa/rpc-tests/bigblocks.py

This file was deleted.

8 changes: 7 additions & 1 deletion qa/rpc-tests/p2p-fullblocktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def __init__(self, tx = CTransaction(), n = -1):
each test.
'''

MAX_BLOCK_SIZE = 1000000

class FullBlockTest(ComparisonTestFramework):

''' Can either run this test as 1 node with expected answers, or two and compare them.
Expand All @@ -39,6 +41,10 @@ def __init__(self):
self.tip = None
self.blocks = {}

def setup_nodes(self):
return start_nodes(4, self.options.tmpdir,
extra_args = [["-maxblocksize=1000000", "--blocksizeacceptlimit=1"]])

def run_test(self):
test = TestManager(self, self.options.tmpdir)
test.add_all_connections(self.nodes)
Expand Down Expand Up @@ -349,7 +355,7 @@ def update_block(block_number, new_transactions):
tx.vout = [CTxOut(0, script_output)]
b24 = update_block(24, [tx])
assert_equal(len(b24.serialize()), MAX_BLOCK_SIZE+1)
yield rejected(RejectResult(16, b'bad-blk-length'))
yield rejected()

b25 = block(25, spend=out7)
yield rejected()
Expand Down
6 changes: 4 additions & 2 deletions qa/rpc-tests/prioritise_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import COIN, MAX_BLOCK_SIZE
from test_framework.mininode import COIN

MAX_BLOCK_SIZE = 1000000

class PrioritiseTransactionTest(BitcoinTestFramework):

Expand All @@ -24,7 +26,7 @@ def setup_network(self):
self.nodes = []
self.is_network_split = False

self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-printpriority=1", "-blockmaxsize=750000"]))
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-printpriority=1", "-blockmaxsize=750000", "--blocksizeacceptlimit=1"]))
self.relayfee = self.nodes[0].getnetworkinfo()['relayfee']

def run_test(self):
Expand Down
1 change: 0 additions & 1 deletion qa/rpc-tests/test_framework/mininode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
MY_SUBVERSION = b"/python-mininode-tester:0.0.2/"

MAX_INV_SZ = 50000
MAX_BLOCK_SIZE = 1000000

COIN = 100000000L # 1 btc in satoshis

Expand Down

0 comments on commit 5c132f0

Please sign in to comment.