A risk exists where a malicious DNS seeder eclipses a node by returning an enormous number of IP addresses. In this commit we mitigate this risk by limiting the number of IP addresses addrman learns to 256 per DNS seeder.
GitHub-Pull: #12626
Rebased-From: 46e7f80
41c29f6d1d qa: Fix python TypeError in script.py (MarcoFalke)
7460945e0b [qa] Delete cookie file before starting node (Suhas Daftuar)
0a76ed232a qa: Cache only chain and wallet for regtest datadir (MarcoFalke)
6c26df06ad [qa] Ensure bitcoind processes are cleaned up when tests end (Suhas Daftuar)
df38b130d9 [tests] Test starting bitcoind with -h and -version (John Newbery)
4bdb0ce517 [tests] Fix intermittent rpc_net.py failure. (John Newbery)
0e98f96e42 test: Use wait_until in tests where time was used for polling (Ben Woosley)
1286f3e49a test: Use wait_until to ensure ping goes out (Ben Woosley)
cfebd400ef [test] Round target fee to 8 decimals in assert_fee_amount (Karl-Johan Alm)
Pull request description:
Similar to #12967 this contains all relevant bugfixes and improvements to the functional test suite.
I didn't include fixes to make the tests run on Windows, since that is still an ongoing effort and doesn't seem worth to backport.
As all of these are clean cherry-picks, I suggest reviewers redo the cherry-picks to get the same branch and then run the extended test suite.
Tree-SHA512: 70e1bc28d5572f93796f1ac4d97d77e8146869c15dcc1e3b65a730fa2641283050f769cefd9791d800c758e0a92f11fd55ed0797ccec87b897c7e701d0187f34
If a cookie file exists in a datadir prior to node startup, it must have
been leftover from a prior unclean shutdown. As bitcoind will overwrite
it anyway, delete it before starting up to prevent the test framework
from inadvertently trying to connect using stale credentials.
Github-Pull: #12902
Rebased-From: 75d0e4c5444249f0cf81ed0494e2c2717170b695
rpc_net.py would intermittently fail on Travis, probably
due to assuming that two consecutive RPC calls were atomic.
Fix this by only testing that amounts are bounded above and
below rather than equal.
Github-Pull: #12804
Rebased-From: 5a67c0524e5dc98d0e387f189545bc99863916d4
The output would produce arbitrary number of decimal points, sometimes resulting in 9 decimals:
AssertionError: Fee of 0.00000415 BTC too low! (Should be 0.000006175 BTC)
The above looks like the expected fee is 6175 sats when in reality it's 618.
Github-Pull: #12486
Rebased-From: 42e1b5d9797b65d3ce13a7cbace15fbedbcd4018
faf316a43 test: Update trust git root (Wladimir J. van der Laan)
Pull request description:
Marco Falke's old key expired, causing a travis error while verifying
commits 36afd4db44 and before:
gpg: Good signature from "Marco Falke <marco.falke@tum.de>" [unknown]
gpg: aka "Marco Falke <falke.marco@gmail.com>" [unknown]
gpg: Note: This key has expired!
Primary key fingerprint: B8B3 F1C0 E58C 15DB 6A81 D30C 3648 A882 F431 6B9B
Subkey fingerprint: FE09 B823 E6D8 3A3B C798 3EAA 2D7F 2372 E50F E137
Update the trusted root commit to the commit after that, to fix
this issue.
(cherry picked from commit 7deba93bdc76616011a9f493cbc203d60084416f)
Tree-SHA512: c86cc23d087af54a1448545c122fc67a0c556b5eac8ac7d16eeec8c42d8d0d81b7b5041f9a175787604aa47883b68403cfa01c10a52db64e35be52e559b20ec8
Marco Falke's old key expired, causing a travis error while verifying
commits 36afd4db44 and before:
gpg: Good signature from "Marco Falke <marco.falke@tum.de>" [unknown]
gpg: aka "Marco Falke <falke.marco@gmail.com>" [unknown]
gpg: Note: This key has expired!
Primary key fingerprint: B8B3 F1C0 E58C 15DB 6A81 D30C 3648 A882 F431 6B9B
Subkey fingerprint: FE09 B823 E6D8 3A3B C798 3EAA 2D7F 2372 E50F E137
Update the trusted root commit to the commit after that, to fix
this issue.
(cherry picked from commit 7deba93bdc76616011a9f493cbc203d60084416f)
25afebc2ba depends: Switch expat download to GitHub (fanquake)
Pull request description:
@droark [mentioned](https://github.com/bitcoin/bitcoin/pull/12402#issuecomment-370098383) the expat download was failing when trying to gitian build 0.16.
I tried locally and also saw issues:
```
make download
Checksum missing or mismatched for expat source. Forcing re-download.
Fetching expat-2.2.1.tar.bz2 from https://downloads.sourceforge.net/project/expat/expat/2.2.1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 652 100 652 0 0 361 0 0:00:01 0:00:01 --:--:-- 0
/Users/xxx/Github/bitcoin/depends/work/download/expat-2.2.1/expat-2.2.1.tar.bz2.temp: FAILED
shasum: WARNING: 1 computed checksum did NOT match
Fetching expat-2.2.1.tar.bz2 from https://bitcoincore.org/depends-sources
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (22) The requested URL returned error: 404 Not Found
make[1]: *** [/Users/xxx/Github/bitcoin/depends/sources/download-stamps/.stamp_fetched-expat-expat-2.2.1.tar.bz2.hash] Error 22
make: *** [download-linux] Error 2
```
This switches to downloading from GitHub, as we are doing in master.
Tree-SHA512: 0e3072ce4d8fee3e2bc434afc7469968c21e01ca35aa2ccbffc25f8e9b00af2e4a5f3f9e4cd5c0cd8e72a10b16205236eb0536380849109a739c09358dbc1394
0) Adjust BIP30 enforcement values
1) Reduce amount that peers can adjust our time to eliminate an attack vector. Thanks to
coblee for this fix.
2) Zeitgeist2 patch - thanks to Lolcust and ArtForz. This fixes an issue where a
51% attack can change difficulty at will. Go back the full period unless it's the
first retarget after genesis.
3) Avoid overflow in CalculateNextWorkRequired(). Thanks to pooler for the overflow fix.
4) Zeitgeist2 bool fshift bnNew.bits(). Thanks to romanornr for this path.
5) SegWit ContextualCheckBlockHeader adjustment and extra coverage.
6) Reject peer proto version below 70002. Thanks to wtogami for this patch.
7) Send final alert message to nodes warning about removal of the alert system. Thanks to coblee for this patch.
8) Adjust default settings for Litecoin.
835a21b Squashed 'src/leveldb/' changes from c521b3ac65..64052c76c5 (MarcoFalke)
Pull request description:
The leveldb bump is the same branch/commit as in #12451
Tree-SHA512: 585a55747c75e990c9fd73399e98e548c01bef8b960c0a99844326de43663d004d2211b4689518f2d3e51cc48a732e9c92082939c356793143db411224fa75fa
This faulty translation contained Chinese messages, and as en_US is our
source language, having a separate translation for it is pointless, remove it.
Tree-SHA512: 8493876926355890aa3b713851ed53d37ffe601280f7e0f45461abfe9671af10dc5c6ce966adb89b663486a46df43b0a36b797da7e1cd719597a7e15914bd4a2
util_tests.cpp needs to include the signal.h header on FreeBSD.
Reported by denis2342 on IRC.
Github-Pull: #12447
Rebased-From: dd7e42cbb4390788705031ffa0bc893d26f0597e
Tree-SHA512: 10ead029bb59f5d69e37b5679c710f22d64051de26e1ec8342eec4e4dec4d76249e16dff78d192972bcb8d139d99c7555a7cb2fe43b2b911103eab6d6f943b79