Skip to content

Commit ec7dbaa

Browse files
committed
Merge #12756: [config] Remove blockmaxsize option
4757c04 [config] Remove blockmaxsize option (John Newbery) Pull request description: The blockmaxsize option was marked as deprecated in V0.15.1, and code was added to convert provided blockmaxsize into blockmaxweight. However, this code was incorrectly implemented, and blockmaxsize was silently ignored. No users have complained about blockmaxsize being ignored, so just remove it in V0.17. Fixes #12640 cc @ajtowns Tree-SHA512: 968d71d37bf175c5a02539ddec289a12586f886e1dfe64c1d9aa5e39db48d06d21665153824fac3b11503a55f0812d2f1115a2d726aafd37b76ed629ec0aa671
2 parents 25cf18f + 4757c04 commit ec7dbaa

File tree

6 files changed

+18
-23
lines changed

6 files changed

+18
-23
lines changed

doc/release-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ Low-level RPC changes
109109

110110
- The log timestamp format is now ISO 8601 (e.g. "2018-02-28T12:34:56Z").
111111

112+
Miner block size removed
113+
------------------------
114+
115+
The `-blockmaxsize` option for miners to limit their blocks' sizes was
116+
deprecated in V0.15.1, and has now been removed. Miners should use the
117+
`-blockmaxweight` option if they want to limit the weight of their blocks'
118+
weights.
119+
112120
Credits
113121
=======
114122

src/init.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,6 @@ std::string HelpMessage(HelpMessageMode mode)
491491
strUsage += HelpMessageOpt("-whitelistrelay", strprintf(_("Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)"), DEFAULT_WHITELISTRELAY));
492492

493493
strUsage += HelpMessageGroup(_("Block creation options:"));
494-
if (showDebug)
495-
strUsage += HelpMessageOpt("-blockmaxsize=<n>", "Set maximum BIP141 block weight to this * 4. Deprecated, use blockmaxweight");
496494
strUsage += HelpMessageOpt("-blockmaxweight=<n>", strprintf(_("Set maximum BIP141 block weight (default: %d)"), DEFAULT_BLOCK_MAX_WEIGHT));
497495
strUsage += HelpMessageOpt("-blockmintxfee=<amt>", strprintf(_("Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_BLOCK_MIN_TX_FEE)));
498496
if (showDebug)
@@ -798,15 +796,6 @@ void InitParameterInteraction()
798796
if (gArgs.SoftSetBoolArg("-whitelistrelay", true))
799797
LogPrintf("%s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1\n", __func__);
800798
}
801-
802-
if (gArgs.IsArgSet("-blockmaxsize")) {
803-
unsigned int max_size = gArgs.GetArg("-blockmaxsize", 0);
804-
if (gArgs.SoftSetArg("blockmaxweight", strprintf("%d", max_size * WITNESS_SCALE_FACTOR))) {
805-
LogPrintf("%s: parameter interaction: -blockmaxsize=%d -> setting -blockmaxweight=%d (-blockmaxsize is deprecated!)\n", __func__, max_size, max_size * WITNESS_SCALE_FACTOR);
806-
} else {
807-
LogPrintf("%s: Ignoring blockmaxsize setting which is overridden by blockmaxweight", __func__);
808-
}
809-
}
810799
}
811800

812801
static std::string ResolveErrMsg(const char * const optname, const std::string& strBind)

src/miner.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ BlockAssembler::BlockAssembler(const CChainParams& params, const Options& option
6868
static BlockAssembler::Options DefaultOptions(const CChainParams& params)
6969
{
7070
// Block resource limits
71-
// If neither -blockmaxsize or -blockmaxweight is given, limit to DEFAULT_BLOCK_MAX_*
72-
// If only one is given, only restrict the specified resource.
73-
// If both are given, restrict both.
71+
// If -blockmaxweight is not given, limit to DEFAULT_BLOCK_MAX_WEIGHT
7472
BlockAssembler::Options options;
7573
options.nBlockMaxWeight = gArgs.GetArg("-blockmaxweight", DEFAULT_BLOCK_MAX_WEIGHT);
7674
if (gArgs.IsArgSet("-blockmintxfee")) {

test/functional/feature_fee_estimation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def setup_network(self):
133133
which we will use to generate our transactions.
134134
"""
135135
self.add_nodes(3, extra_args=[["-maxorphantx=1000", "-whitelist=127.0.0.1"],
136-
["-blockmaxsize=17000", "-maxorphantx=1000"],
137-
["-blockmaxsize=8000", "-maxorphantx=1000"]])
136+
["-maxorphantx=1000"],
137+
["-maxorphantx=1000"]])
138138
# Use node0 to mine blocks for input splitting
139139
# Node1 mines small blocks but that are bigger than the expected transaction rate.
140140
# NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes,

test/functional/feature_maxuploadtarget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MaxUploadTest(BitcoinTestFramework):
3434
def set_test_params(self):
3535
self.setup_clean_chain = True
3636
self.num_nodes = 1
37-
self.extra_args = [["-maxuploadtarget=800", "-blockmaxsize=999000"]]
37+
self.extra_args = [["-maxuploadtarget=800"]]
3838

3939
# Cache for utxos, as the listunspent may take a long time later in the test
4040
self.utxo_cache = []
@@ -144,7 +144,7 @@ def run_test(self):
144144
#stop and start node 0 with 1MB maxuploadtarget, whitelist 127.0.0.1
145145
self.log.info("Restarting nodes with -whitelist=127.0.0.1")
146146
self.stop_node(0)
147-
self.start_node(0, ["-whitelist=127.0.0.1", "-maxuploadtarget=1", "-blockmaxsize=999000"])
147+
self.start_node(0, ["-whitelist=127.0.0.1", "-maxuploadtarget=1"])
148148

149149
# Reconnect to self.nodes[0]
150150
self.nodes[0].add_p2p_connection(TestP2PConn())

test/functional/feature_pruning.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ def set_test_params(self):
3131

3232
# Create nodes 0 and 1 to mine.
3333
# Create node 2 to test pruning.
34-
self.full_node_default_args = ["-maxreceivebuffer=20000","-blockmaxsize=999000", "-checkblocks=5", "-limitdescendantcount=100", "-limitdescendantsize=5000", "-limitancestorcount=100", "-limitancestorsize=5000" ]
34+
self.full_node_default_args = ["-maxreceivebuffer=20000", "-checkblocks=5", "-limitdescendantcount=100", "-limitdescendantsize=5000", "-limitancestorcount=100", "-limitancestorsize=5000" ]
3535
# Create nodes 3 and 4 to test manual pruning (they will be re-started with manual pruning later)
3636
# Create nodes 5 to test wallet in prune mode, but do not connect
3737
self.extra_args = [self.full_node_default_args,
3838
self.full_node_default_args,
3939
["-maxreceivebuffer=20000", "-prune=550"],
40-
["-maxreceivebuffer=20000", "-blockmaxsize=999000"],
41-
["-maxreceivebuffer=20000", "-blockmaxsize=999000"],
40+
["-maxreceivebuffer=20000"],
41+
["-maxreceivebuffer=20000"],
4242
["-prune=550"]]
4343

4444
def setup_network(self):
@@ -124,7 +124,7 @@ def reorg_test(self):
124124
# Reboot node 1 to clear its mempool (hopefully make the invalidate faster)
125125
# Lower the block max size so we don't keep mining all our big mempool transactions (from disconnected blocks)
126126
self.stop_node(1)
127-
self.start_node(1, extra_args=["-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"])
127+
self.start_node(1, extra_args=["-maxreceivebuffer=20000","-checkblocks=5", "-disablesafemode"])
128128

129129
height = self.nodes[1].getblockcount()
130130
self.log.info("Current block height: %d" % height)
@@ -147,7 +147,7 @@ def reorg_test(self):
147147

148148
# Reboot node1 to clear those giant tx's from mempool
149149
self.stop_node(1)
150-
self.start_node(1, extra_args=["-maxreceivebuffer=20000","-blockmaxsize=5000", "-checkblocks=5", "-disablesafemode"])
150+
self.start_node(1, extra_args=["-maxreceivebuffer=20000","-checkblocks=5", "-disablesafemode"])
151151

152152
self.log.info("Generating new longer chain of 300 more blocks")
153153
self.nodes[1].generate(300)

0 commit comments

Comments
 (0)