Skip to content

Commit 423659c

Browse files
committed
Merge #9264: 0.13.2 backports
f26dab7 Adapt ZMQ/rest serialization to take rpcserialversion arg (instagibbs) 21ccb9f Add option to return non-segwit serialization via rpc (Gregory Sanders) a710a43 Improvement of documentation of command line parameter 'whitelist' (wodry) 58eab24 [qa] rpc-tests: Apply random offset to portseed (MarcoFalke) ecd7db5 [qa] test_framework: Exit when tmpdir exists (MarcoFalke) 387ec9d Add script tests for FindAndDelete in pre-segwit and segwit scripts (Johnson Lau) 87fbced Change all instance of 'GMT epoch' to 'Unix epoch' (matthias) b1e978c instance of 'mem pool' to 'mempool' (S. Matthew English) ff55a2d Update gitian signing key of jl2012 (Johnson Lau) 28d0f22 Fix calculation of number of bound sockets to use (Matt Corallo) 396c405 Include select.h when WIN32 is not defined (Ivo van der Sangen) eebc699 bench: Fix subtle counting issue when rescaling iteration count (Wladimir J. van der Laan) 0c09d9f Send tip change notification from invalidateblock (Russell Yanofsky) 6f7841c qt: Avoid OpenSSL certstore-related memory leak (Wladimir J. van der Laan) e5ad693 qt: Avoid shutdownwindow-related memory leak (Wladimir J. van der Laan) e4bea4f qt: Avoid splash-screen related memory leak (Wladimir J. van der Laan) c12f4e9 qt: Prevent thread/memory leak on exiting RPCConsole (Wladimir J. van der Laan) dc46b10 qt: Plug many memory leaks (Wladimir J. van der Laan) ff423cc [Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan) 6d70a73 [Qt] fix coincontrol sort issue (Jonas Schnelli) 3fffbf7 Doxygen: Set PROJECT_NAME = "Bitcoin Core" (MarcoFalke) f82c81b fix getnettotals RPC description about timemillis. (Masahiko Hyuga) 6fe3981 net: don't send feefilter messages before the version handshake is complete (Cory Fields) 5f3a12c qt: Use correct conversion function for boost::path datadir (Wladimir J. van der Laan) 08d1c90 Missed one "return false" in recent refactoring in #9067 (UdjinM6) f27596a Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers (UdjinM6) f85ee01 Fix exit codes: - `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error) - error reading config file should exit with `1` (UdjinM6) 5bcb05d [rpc] ParseHash: Fail when length is not 64 (MarcoFalke) 973ca1e Fix doxygen comment: the transaction is returned in txOut (Pavel Janík) 6f86b53 [Qt] make warnings label selectable (Jonas Schnelli) 106da69 Sync bitcoin-tx with tx version policy (BtcDrak) 12428b4 add software-properties-common (Steven) 40169dc Set minimum required Boost to 1.47.0 (fanquake) c134d92 [build-aux] Boost_Base serial 27 (fanquake) 4a974b2 Simple Update to File 'bitcoin-qt.desktop' (matthias) 975ab12 Update INSTALL landing redirection notice for build instructions. (randy-waterhouse) 3a3bcbf Use RelevantServices instead of node_network in AttemptToEvict. (Gregory Maxwell) ca1fd75 Make orphan parent fetching ask for witnesses. (Gregory Maxwell) b96a8f7 [qa] Test getblocktemplate default_witness_commitment (Suhas Daftuar) 99477c7 Always add default_witness_commitment with GBT client support (Pieter Wuille) da5a16b Always drop the least preferred HB peer when adding a new one. (Gregory Maxwell) 094848b log block size and weight correctly. (jnewbery) d1b4da9 build: fix qt5.7 build under macOS (Cory Fields)
2 parents e591c10 + f26dab7 commit 423659c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+670
-344
lines changed

INSTALL

Lines changed: 0 additions & 5 deletions
This file was deleted.

INSTALL.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Building Bitcoin
2+
================
3+
4+
See doc/build-*.md for instructions on building the various
5+
elements of the Bitcoin Core reference implementation of Bitcoin.

build-aux/m4/ax_boost_base.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# and this notice are preserved. This file is offered as-is, without any
3434
# warranty.
3535

36-
#serial 26
36+
#serial 27
3737

3838
AC_DEFUN([AX_BOOST_BASE],
3939
[
@@ -96,7 +96,7 @@ if test "x$want_boost" = "xyes"; then
9696
libsubdirs="lib64 libx32 lib lib64"
9797
;;
9898
ppc64|s390x|sparc64|aarch64|ppc64le)
99-
libsubdirs="lib64 lib lib64 ppc64le"
99+
libsubdirs="lib64 lib lib64"
100100
;;
101101
esac
102102

configure.ac

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ else
4545
CXXFLAGS_overridden=no
4646
fi
4747
AC_PROG_CXX
48-
m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
4948

5049
dnl By default, libtool for mingw refuses to link static libs into a dll for
5150
dnl fear of mixing pic/non-pic objects, and import/export complications. Since
@@ -60,6 +59,15 @@ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
6059
dnl Check if -latomic is required for <std::atomic>
6160
CHECK_ATOMIC
6261

62+
dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
63+
dnl that we get the same -std flags for both.
64+
m4_ifdef([AC_PROG_OBJCXX],[
65+
if test "x${OBJCXX+set}" = "x"; then
66+
OBJCXX="${CXX}"
67+
fi
68+
AC_PROG_OBJCXX
69+
])
70+
6371
dnl Libtool init checks.
6472
LT_INIT([pic-only])
6573

@@ -607,8 +615,11 @@ fi
607615

608616
if test x$use_boost = xyes; then
609617

618+
dnl Minimum required Boost version
619+
define(MINIMUM_REQUIRED_BOOST, 1.47.0)
620+
610621
dnl Check for boost libs
611-
AX_BOOST_BASE
622+
AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
612623
AX_BOOST_SYSTEM
613624
AX_BOOST_FILESYSTEM
614625
AX_BOOST_PROGRAM_OPTIONS

contrib/debian/bitcoin-qt.desktop

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[Desktop Entry]
22
Encoding=UTF-8
3-
Name=Bitcoin
4-
Comment=Bitcoin P2P Cryptocurrency
3+
Name=Bitcoin Core
4+
Comment=Connect to the Bitcoin P2P Network
5+
Comment[de]=Verbinde mit dem Bitcoin peer-to-peer Netzwerk
56
Comment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair
67
Comment[tr]=Bitcoin, eşten eşe kriptografik sanal para birimi
78
Exec=bitcoin-qt %u

contrib/gitian-keys/jl2012-key.pgp

Lines changed: 272 additions & 102 deletions
Large diffs are not rendered by default.

doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
2828
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
2929
# by quotes) that should identify the project.
3030

31-
PROJECT_NAME = Bitcoin
31+
PROJECT_NAME = "Bitcoin Core"
3232

3333
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
3434
# This could be handy for archiving the generated documentation or

doc/build-unix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ install necessary parts of boost:
8282
BerkeleyDB is required for the wallet. db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin).
8383
You can add the repository and install using the following commands:
8484

85+
sudo apt-get install software-properties-common
8586
sudo add-apt-repository ppa:bitcoin/bitcoin
8687
sudo apt-get update
8788
sudo apt-get install libdb4.8-dev libdb4.8++-dev

qa/pull-tester/rpc-tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,18 @@ def __init__(self, num_tests_parallel, test_list=None, flags=None):
243243
self.test_list = test_list
244244
self.flags = flags
245245
self.num_running = 0
246+
# In case there is a graveyard of zombie bitcoinds, we can apply a
247+
# pseudorandom offset to hopefully jump over them.
248+
# (625 is PORT_RANGE/MAX_NODES)
249+
self.portseed_offset = int(time.time() * 1000) % 625
246250
self.jobs = []
247251

248252
def get_next(self):
249253
while self.num_running < self.num_jobs and self.test_list:
250254
# Add tests
251255
self.num_running += 1
252256
t = self.test_list.pop(0)
253-
port_seed = ["--portseed=%s" % len(self.test_list)]
257+
port_seed = ["--portseed={}".format(len(self.test_list) + self.portseed_offset)]
254258
log_stdout = tempfile.SpooledTemporaryFile(max_size=2**16)
255259
log_stderr = tempfile.SpooledTemporaryFile(max_size=2**16)
256260
self.jobs.append((t,

qa/rpc-tests/p2p-segwit.py

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,24 +182,16 @@ class SegWitTest(BitcoinTestFramework):
182182
def setup_chain(self):
183183
initialize_chain_clean(self.options.tmpdir, 3)
184184

185-
def add_options(self, parser):
186-
parser.add_option("--oldbinary", dest="oldbinary",
187-
default=None,
188-
help="pre-segwit bitcoind binary for upgrade testing")
189-
190185
def setup_network(self):
191186
self.nodes = []
192187
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-logtimemicros=1", "-whitelist=127.0.0.1"]))
193188
# Start a node for testing IsStandard rules.
194189
self.nodes.append(start_node(1, self.options.tmpdir, ["-debug", "-logtimemicros=1", "-whitelist=127.0.0.1", "-acceptnonstdtxn=0"]))
195190
connect_nodes(self.nodes[0], 1)
196191

197-
# If an old bitcoind is given, do the upgrade-after-activation test.
198-
self.test_upgrade = False
199-
if (self.options.oldbinary != None):
200-
self.nodes.append(start_node(2, self.options.tmpdir, ["-debug", "-whitelist=127.0.0.1"], binary=self.options.oldbinary))
201-
connect_nodes(self.nodes[0], 2)
202-
self.test_upgrade = True
192+
# Disable segwit's bip9 parameter to simulate upgrading after activation.
193+
self.nodes.append(start_node(2, self.options.tmpdir, ["-debug", "-whitelist=127.0.0.1", "-bip9params=segwit:0:0"]))
194+
connect_nodes(self.nodes[0], 2)
203195

204196
''' Helpers '''
205197
# Build a block on top of node0's tip.
@@ -1164,7 +1156,7 @@ def test_standardness_v0(self, segwit_activated):
11641156
if segwit_activated:
11651157
# tx and tx2 were both accepted. Don't bother trying to reclaim the
11661158
# P2PKH output; just send tx's first output back to an anyone-can-spend.
1167-
sync_mempools(self.nodes)
1159+
sync_mempools([self.nodes[0], self.nodes[1]])
11681160
tx3.vin = [CTxIn(COutPoint(tx.sha256, 0), b"")]
11691161
tx3.vout = [CTxOut(tx.vout[0].nValue-1000, CScript([OP_TRUE]))]
11701162
tx3.wit.vtxinwit.append(CTxInWitness())
@@ -1693,19 +1685,53 @@ def test_witness_sigops(self):
16931685

16941686
def test_getblocktemplate_before_lockin(self):
16951687
print("\tTesting getblocktemplate setting of segwit versionbit (before lockin)")
1696-
block_version = (self.nodes[0].getblocktemplate())['version']
1697-
assert_equal(block_version & (1 << VB_WITNESS_BIT), 0)
1688+
# Node0 is segwit aware, node2 is not.
1689+
for node in [self.nodes[0], self.nodes[2]]:
1690+
gbt_results = node.getblocktemplate()
1691+
block_version = gbt_results['version']
1692+
# If we're not indicating segwit support, we should not be signalling
1693+
# for segwit activation, nor should we get a witness commitment.
1694+
assert_equal(block_version & (1 << VB_WITNESS_BIT), 0)
1695+
assert('default_witness_commitment' not in gbt_results)
16981696

16991697
# Workaround:
17001698
# Can either change the tip, or change the mempool and wait 5 seconds
17011699
# to trigger a recomputation of getblocktemplate.
1702-
self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
1700+
txid = int(self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1), 16)
17031701
# Using mocktime lets us avoid sleep()
1702+
sync_mempools(self.nodes)
17041703
self.nodes[0].setmocktime(int(time.time())+10)
1705-
1706-
block_version = self.nodes[0].getblocktemplate({"rules" : ["segwit"]})['version']
1707-
assert(block_version & (1 << VB_WITNESS_BIT) != 0)
1708-
self.nodes[0].setmocktime(0) # undo mocktime
1704+
self.nodes[2].setmocktime(int(time.time())+10)
1705+
1706+
for node in [self.nodes[0], self.nodes[2]]:
1707+
gbt_results = node.getblocktemplate({"rules" : ["segwit"]})
1708+
block_version = gbt_results['version']
1709+
if node == self.nodes[2]:
1710+
# If this is a non-segwit node, we should still not get a witness
1711+
# commitment, nor a version bit signalling segwit.
1712+
assert_equal(block_version & (1 << VB_WITNESS_BIT), 0)
1713+
assert('default_witness_commitment' not in gbt_results)
1714+
else:
1715+
# For segwit-aware nodes, check the version bit and the witness
1716+
# commitment are correct.
1717+
assert(block_version & (1 << VB_WITNESS_BIT) != 0)
1718+
assert('default_witness_commitment' in gbt_results)
1719+
witness_commitment = gbt_results['default_witness_commitment']
1720+
1721+
# TODO: this duplicates some code from blocktools.py, would be nice
1722+
# to refactor.
1723+
# Check that default_witness_commitment is present.
1724+
block = CBlock()
1725+
witness_root = block.get_merkle_root([ser_uint256(0), ser_uint256(txid)])
1726+
check_commitment = uint256_from_str(hash256(ser_uint256(witness_root)+ser_uint256(0)))
1727+
from test_framework.blocktools import WITNESS_COMMITMENT_HEADER
1728+
output_data = WITNESS_COMMITMENT_HEADER + ser_uint256(check_commitment)
1729+
script = CScript([OP_RETURN, output_data])
1730+
assert_equal(witness_commitment, bytes_to_hex_str(script))
1731+
1732+
# undo mocktime
1733+
self.nodes[0].setmocktime(0)
1734+
self.nodes[2].setmocktime(0)
17091735

17101736
# Uncompressed pubkeys are no longer supported in default relay policy,
17111737
# but (for now) are still valid in blocks.
@@ -1945,6 +1971,7 @@ def run_test(self):
19451971

19461972
# Advance to segwit being 'started'
19471973
self.advance_to_segwit_started()
1974+
sync_blocks(self.nodes)
19481975
self.test_getblocktemplate_before_lockin()
19491976

19501977
sync_blocks(self.nodes)
@@ -1987,10 +2014,7 @@ def run_test(self):
19872014
self.test_signature_version_1()
19882015
self.test_non_standard_witness()
19892016
sync_blocks(self.nodes)
1990-
if self.test_upgrade:
1991-
self.test_upgrade_after_activation(self.nodes[2], 2)
1992-
else:
1993-
print("\tSkipping upgrade-after-activation test (use --oldbinary to enable)")
2017+
self.test_upgrade_after_activation(self.nodes[2], 2)
19942018
self.test_witness_sigops()
19952019

19962020

0 commit comments

Comments
 (0)