Commit Graph

27470 Commits

Author SHA1 Message Date
Andrew Chow
b1b679e0ab Explicitly mark legacy wallet tests as such
Some tests are intended to test only legacy wallet behavior. With
automatic switching of wallet type, we need to make them explicit
2021-01-27 12:52:46 -05:00
Andrew Chow
09514e1bef Setup wallets for interface_zmq.py 2021-01-27 12:52:46 -05:00
Andrew Chow
4d03ef9a73 Use MiniWallet in rpc_net.py 2021-01-27 12:52:46 -05:00
Andrew Chow
4de23824b0 Setup wallets for interface_bitcoin_cli.py 2021-01-27 12:52:46 -05:00
Andrew Chow
7c71c627d2 Setup wallets with descriptors for feature_notifications 2021-01-27 12:52:46 -05:00
Andrew Chow
1f1bef8dba Have feature_filelock.py test both bdb and sqlite, depending on compiled 2021-01-27 12:52:46 -05:00
Andrew Chow
c77975abc0 Disable upgrades tests that require BDB if BDB is not compiled 2021-01-27 12:52:46 -05:00
Andrew Chow
1f20cac9d4 Disable wallet_descriptor.py bdb format check if BDB is not compiled 2021-01-27 12:52:46 -05:00
Andrew Chow
3641597d7e tests: Don't make any wallets unless wallet is required 2021-01-27 12:52:46 -05:00
Andrew Chow
b9b88f57a9 Skip legacy wallet reliant tests if BDB is not compiled 2021-01-27 12:52:46 -05:00
Andrew Chow
6f36242389 tests: Set descriptors default based on compilation
Determines whether descriptors should be used based on whether the
--descriptor or --legacy-wallet option is set,
and the compiled support. If no option is set and both BDB and SQLite
are available, it defaults to legacy.

This is used to switch descriptor agnostic tests between descriptors and
legacy wallet.
2021-01-27 12:52:46 -05:00
Wladimir J. van der Laan
15a9df0706
Merge #20964: rpc: Add specific error code for "wallet already loaded"
a6739cc868 rpc: Add specific error code for "wallet already loaded" (Wladimir J. van der Laan)

Pull request description:

  Add a separate RPC error code for "wallet already loaded" to avoid having to match on message to detect this.
  Requested by shesek for rust-bitcoinrpc.

  If concept ACKed needs:
  - [ ]  Release note
  - [x]  A functional test (updated the existing test to make it pass, I think this is enough)

ACKs for top commit:
  jonasschnelli:
    Code Review ACK a6739cc868
  promag:
    Code review ACK a6739cc868.

Tree-SHA512: 9091872e6ea148aec733705d6af330f72a02f23b936b892ac28f9023da7430af6332418048adbee6014305b812316391812039e9180f7f3362d11f206c13b7d0
2021-01-27 13:43:31 +01:00
MarcoFalke
11d3b58336
Merge #20757: doc: tor.md and -onlynet help updates
193f9a9c97 doc: update tor.md manual config, move after automatic config (Jon Atack)
9af99b6f39 doc: update/improve automatic tor section of tor.md (Jon Atack)
dfc4ce1273 doc: update -proxy, -onion and -onlynet info in tor.md (saibato)
784a278e87 doc: update -onlynet help in src/init.cpp (Jon Atack)

Pull request description:

  This continues the tor documentation and help improvements of #19961 and clarifies issues that contributors have been mentioning and noticing, like in https://github.com/bitcoin/bitcoin/issues/20555#issuecomment-750433818.

  More info:

  - https://github.com/bitcoin/bitcoin/pull/19961#discussion_r545051534
  - https://github.com/bitcoin/bitcoin/pull/19961#discussion_r544912964

ACKs for top commit:
  Rspigler:
    ACK 193f9a9c97
  prayank23:
    ACK 193f9a9c97 9af99b6f39 dfc4ce1273

Tree-SHA512: edb1b776c4624e1c2e30d829511c226a6492b719f5d1aaaeee1eaade47c108a99c09004d13a05f70b2d65f36db3db647902b5ea36807a87065f34acade33ccea
2021-01-27 13:21:04 +01:00
Jon Atack
193f9a9c97
doc: update tor.md manual config, move after automatic config 2021-01-26 15:13:29 +01:00
MarcoFalke
faff3991a9
ci: Fuzz with integer sanitizer 2021-01-26 12:50:43 +01:00
MarcoFalke
e130ff38c9
Merge bitcoin-core/gui#183: Add include for std::bind.
2a39ccf133 Add include for std::bind. (sinetek)

Pull request description:

  Hi, this patch adds in <functional> because the GUI code makes use of std::bind.
  That's all.

ACKs for top commit:
  jonasschnelli:
    utACK 2a39ccf133

Tree-SHA512: fb5ac07d9cd5d006182b52857b289a9926362a2f1bfa4f7f1c78a088670e2ccf39ca28214781df82e8de3909fa3e69685fe1124a7e3ead758575839f5f2277a9
2021-01-26 11:14:27 +01:00
Jonas Schnelli
5f65f13597
Merge bitcoin-core/gui#189: qt: drop workaround for QTBUG-42503 which was fixed in Qt 5.5.0
a2a3f4cd8d qt: drop workaround for QTBUG-42503 which was fixed in Qt 5.5.0 (Pavol Rusnak)

Pull request description:

  Fixes https://github.com/bitcoin-core/gui/issues/101

ACKs for top commit:
  jonasschnelli:
    Tested ACK a2a3f4cd8d -

Tree-SHA512: 9ccbc20ff7991ec70cac7d4e4413f9d80a1de453e217d03927a5f167e87eae7f369f0ad437c40c8107e5384c5c5c758659ed0db923837a38f8d705f01f9cb798
2021-01-26 10:41:23 +01:00
Jonas Schnelli
d38e2d9a19
Merge bitcoin-core/gui#186: Add information to "Confirm fee bump" window
232d1f92bb Add information to "Confirm fee bump" window (Prayank)

Pull request description:

  + Add information in bump fee confirmation box according to the documentation: https://bitcoincore.org/en/doc/0.20.0/rpc/wallet/bumpfee/

  + Workaround to fix issue: https://github.com/bitcoin/bitcoin/issues/20795 in which user isn't aware of new inputs, outputs added to replacement transaction before broadcasting. Initial transaction had used coin control features and custom change address. Until the issue is fixed by change in coin selection algorithm we can add this warning.

  + Waiting for comments from devs who are working on coin selection algorithm PRs or involved in related research. However got two comments from Luke Dashjr and Pieter Wuille:

  _luke-jr: Reducing the change output also could be a privacy problem, since it identifies which output was change._

  _sipa: Wallet doesn't know the original transaction was using coin control. So I think its expected that if you use automatic fee bumping, you'll get whatever the coin selection algorithm decides. As for why its not decreasing the change and instead adding another input, that may be a bug._  (IRC: #bitcoin-core-dev)

ACKs for top commit:
  jonasschnelli:
    Tested ACK - 232d1f92bb

Tree-SHA512: 2ff65db1ddb1d4a45f82670b6ca303a0bf48acf3d09defffc21f44ec81cb6182268959706f592f3442aae5db48f43b8ea86973d74ec2721be93d209ce0414953
2021-01-26 10:30:13 +01:00
MarcoFalke
32d44d2b1c
Merge #21000: fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer
f0f8b1a076 fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer (practicalswift)
58232e3ffb fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses (practicalswift)

Pull request description:

  Add UBSan suppressions needed for fuzz tests to not warn under `-fsanitize=integer`.

  Avoid `-fsanitize=integer` warnings in fuzzing harnesses.

  Suppressed warnings (excluding warnings from `src/crypto/` and `src/test/`):

  ```
  addrman.cpp:306:24: runtime error: implicit conversion from type 'long' of value 5190149478 (64-bit, signed) to type 'uint32_t' (aka 'unsigned int') changed the value to 895182182 (32-bit, unsigned)
  addrman.h:446:43: runtime error: implicit conversion from type 'int' of value -22 (32-bit, signed) to type 'const uint8_t' (aka 'const unsigned char') changed the value to 234 (8-bit, unsigned)
  arith_uint256.cpp:32:35: runtime error: left shift of 1712128 by 24 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  arith_uint256.cpp:47:39: runtime error: left shift of 4294966784 by 31 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  chain.cpp:151:12: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551615 (64-bit, unsigned)
  coins.cpp:114:22: runtime error: unsigned integer overflow: 0 - 96 cannot be represented in type 'unsigned long'
  compressor.cpp:162:33: runtime error: unsigned integer overflow: 15617702637291228364 * 10 cannot be represented in type 'unsigned long'
  compressor.cpp:188:11: runtime error: unsigned integer overflow: 2265760372865400000 * 10 cannot be represented in type 'unsigned long'
  hash.cpp:13:15: runtime error: left shift of 1692305888 by 15 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  pubkey.h:152:23: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
  streams.h:570:31: runtime error: left shift of 350879 by 52 places cannot be represented in type 'uint64_t' (aka 'unsigned long')
  util/bip32.cpp:57:36: runtime error: left shift of 3241096244 by 1 places cannot be represented in type 'unsigned int'
  util/strencodings.cpp:562:38: runtime error: implicit conversion from type 'unsigned char' of value 255 (8-bit, unsigned) to type 'char' changed the value to -1 (8-bit, signed)
  util/strencodings.h:164:24: runtime error: implicit conversion from type 'int' of value -74 (32-bit, signed) to type 'unsigned long' changed the value to 18446744073709551542 (64-bit, unsigned)
  ```

  The warnings above happen here:

  32b191fb66/src/addrman.cpp (L306)
  32b191fb66/src/addrman.h (L446)
  32b191fb66/src/arith_uint256.cpp (L32)
  32b191fb66/src/arith_uint256.cpp (L47)
  32b191fb66/src/chain.cpp (L151)
  32b191fb66/src/coins.cpp (L114)
  32b191fb66/src/compressor.cpp (L162)
  32b191fb66/src/compressor.cpp (L188)
  32b191fb66/src/hash.cpp (L13)
  32b191fb66/src/pubkey.h (L152)
  32b191fb66/src/streams.h (L570)
  32b191fb66/src/util/bip32.cpp (L57)
  32b191fb66/src/util/strencodings.cpp (L562)
  32b191fb66/src/util/strencodings.h (L164)

ACKs for top commit:
  MarcoFalke:
    review ACK f0f8b1a076 🤚

Tree-SHA512: a8f04f7cc055d03653161de1d9d14d106a6280cea1e86a1243abcd57cf8e61dcf5f731d0ab0da5b390790e816022ff7a70759a641463bc7e3303076b8667009f
2021-01-26 10:00:43 +01:00
MarcoFalke
ce75fc36ed
Merge #20971: test: Work around libFuzzer deadlock
fa39c8a3e8 test: Work around libFuzzer deadlock (MarcoFalke)

Pull request description:

  Only required part is `symbolize=0`, but the other changes shouldn't hurt

ACKs for top commit:
  practicalswift:
    cr ACK fa39c8a3e8: patch looks correct

Tree-SHA512: 9cddf1de46ad12aea9b8be2c1acb86ba0e07ffdb52f8155d943edf970955551c7cb049a3a6c027846b45dab0dc0966dec42999476ebde50aa761a08dbb751eae
2021-01-26 09:56:24 +01:00
MarcoFalke
cbe439629e
Merge bitcoin-core/gui#167: raise helpMessageDialog
77114462f2 raise helpMessageDialog (randymcmillan)

Pull request description:

  the raise() method brings the helpMessageDialog to the top if it is obscured by another window.

ACKs for top commit:
  promag:
    Code review ACK 77114462f2.
  hebasto:
    ACK 77114462f2, tested on:

Tree-SHA512: 0d5b107aa9a5ce3891e88ef69f64461c8b23d17476b798691119e84bfc78e16b2491c798adb5d6cc347af3b7f18729593d7924090c336114a3cf34fbee344bfb
2021-01-26 09:47:52 +01:00
MarcoFalke
280d0bd0bd
Merge #21010: refactor: remove straggling boost::mutex usage
f827e151a2 refactor: remove straggling boost::mutex usage (fanquake)

Pull request description:

  After the merge of #18710, the linter is warning:
  ```bash
  A new Boost dependency in the form of "boost/thread/mutex.hpp" appears to have been introduced:
  src/sync.cpp:#include <boost/thread/mutex.hpp>
  src/test/sync_tests.cpp:#include <boost/thread/mutex.hpp>

  ^---- failure generated from test/lint/lint-includes.sh
  ```

  #18710 removed `boost/thread/mutex.hpp` from lint-includes, however in the interim #19337 was merged, which introduced more `boost::mutex` usage.

  Given we no longer use `boost::mutex`, just remove the double lock test and remaining includes.

ACKs for top commit:
  laanwj:
    Code review ACK f827e151a2
  hebasto:
    ACK f827e151a2

Tree-SHA512: f738b12189fe5b39db3e8f8231e9002714413a962eaf98adc84a6614fa474df5616358cfb1c89b92a2b0564efa9b704a774c49d4a25dca18a0ccc3cd9eabfc0a
2021-01-26 09:30:02 +01:00
Prayank
232d1f92bb Add information to "Confirm fee bump" window
Check if "Coin Control features" are enabled to display warning before broadcasting replacement transaction
Workaround to fix issue: bitcoin/bitcoin#20795

Co-authored-by: Jon Atack <jon@atack.com>
2021-01-26 13:51:21 +05:30
fanquake
f827e151a2
refactor: remove straggling boost::mutex usage
After the merge of #18710, the linter is warning:
```bash
A new Boost dependency in the form of "boost/thread/mutex.hpp" appears to have been introduced:
src/sync.cpp:#include <boost/thread/mutex.hpp>
src/test/sync_tests.cpp:#include <boost/thread/mutex.hpp>

^---- failure generated from test/lint/lint-includes.sh
```

the interim #19337 was merged, which introduced more `boost::mutex` usage.

Given we no longer use `boost::mutex`, just remove the double lock test
and remaining includes.
2021-01-26 15:57:28 +08:00
Samuel Dobson
16ae3368f2
Merge #17350: doc: Add developer documentation to isminetype
40f05647ee doc: Add developer documentation to isminetype (HAOYUatHZ)

Pull request description:

  Closes: https://github.com/bitcoin/bitcoin/issues/17217

ACKs for top commit:
  meshcollider:
    utACK 40f05647ee

Tree-SHA512: 156ff3bc02613d65aed5fcf50250ec3f3365b6c83c810763673ecfdd081a1310e5235be05f0c782638f191be61ad0028511392c40e4106a56eb1c6a3a8ab73b9
2021-01-26 13:24:35 +13:00
Samuel Dobson
4b15ffe991
Merge #20832: rpc: Better error messages for invalid addresses
8f0b64fb51 Better error messages for invalid addresses (Bezdrighin)

Pull request description:

  This PR addresses #20809.

  We add more detailed error messages in case an invalid address is provided inside the 'validateaddress' and 'getaddressinfo' RPC calls. This also covers the case when a user provides an address from a wrong network.

  We also add a functional test to test the new error messages.

ACKs for top commit:
  kristapsk:
    ACK 8f0b64fb51
  meshcollider:
    Code review ACK 8f0b64fb51

Tree-SHA512: ca0f806ab573e96b79e98d9f8c810b81fa99c638d9b5e4d99dc18c8bd2568e6a802ec305fdfb2983574a97a19a46fd53b77645f8078fb77e9deb24ad2a22cf93
2021-01-26 13:15:13 +13:00
practicalswift
f0f8b1a076 fuzz: Add UBSan suppressions needed for fuzz tests to not warn under -fsanitize=integer 2021-01-25 20:55:36 +00:00
practicalswift
58232e3ffb fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses 2021-01-25 20:55:36 +00:00
Jon Atack
9af99b6f39
doc: update/improve automatic tor section of tor.md 2021-01-25 21:31:10 +01:00
saibato
dfc4ce1273
doc: update -proxy, -onion and -onlynet info in tor.md
Improve the description of what these options do with regards to
tor or network traffic.

Some of the wording is from a laanwj review in PR 19358.
2021-01-25 21:31:08 +01:00
Jon Atack
784a278e87
doc: update -onlynet help in src/init.cpp 2021-01-25 21:31:05 +01:00
Wladimir J. van der Laan
52d84a45e2
Merge #20987: doc: add instructions for generating RPC docs
e147af7624 doc: add instructions for generating RPC docs (benk10)

Pull request description:

  Added instructions on how to generate the up to date RPC docs for the bitcoincore.org website in the relevant release-process subsection.

ACKs for top commit:
  theStack:
    ACK e147af7624 ⚙️

Tree-SHA512: 1621d9915ac77f663aa7892237d3e5ff4d9566301c4c0fcb8615804b68d71f6c19bd6e6d84710cd2d2ae492e6b149cdc6edae6292bd20d88d7ca8cd530b4081a
2021-01-25 20:33:23 +01:00
Wladimir J. van der Laan
b386d37360
Merge #18710: Add local thread pool to CCheckQueue
bb6fcc75d1 refactor: Drop boost::thread stuff in CCheckQueue (Hennadii Stepanov)
6784ac471b bench: Use CCheckQueue local thread pool (Hennadii Stepanov)
dba30695fc test: Use CCheckQueue local thread pool (Hennadii Stepanov)
01511776ac Add local thread pool to CCheckQueue (Hennadii Stepanov)
0ef938685b refactor: Use member initializers in CCheckQueue (Hennadii Stepanov)

Pull request description:

  This PR:
  - gets rid of `boost::thread_group` in the `CCheckQueue` class
  - allows thread safety annotation usage in the `CCheckQueue` class
  - is alternative to #14464 (https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-616618525, https://github.com/bitcoin/bitcoin/pull/18710#issuecomment-617291612)

  Also, with this PR (I hope) it could be easier to resurrect a bunch of brilliant ideas from #9938.

  Related: #17307

ACKs for top commit:
  laanwj:
    Code review ACK bb6fcc75d1
  LarryRuane:
    ACK bb6fcc75d1
  jonatack:
    Code review ACK bb6fcc75d1 and verified rebase to master builds cleanly with unit/functional tests green

Tree-SHA512: fddeb720d5a391b48bb4c6fa58ed34ccc3f57862fdb8e641745c021841c8340e35c5126338271446cbd98f40bd5484f27926aa6c3e76fa478ba1efafe72e73c1
2021-01-25 20:21:19 +01:00
randymcmillan
77114462f2
raise helpMessageDialog 2021-01-25 10:57:44 -05:00
setpill
624091b7b9 Fix docker args conditional 2021-01-25 15:33:07 +01:00
MarcoFalke
d0852f39a7
Merge #20998: test: Fix BlockToJsonVerbose benchmark
7487bc9900 Fix BlockToJsonVerbose benchmark (Martin Ankerl)

Pull request description:

  Currently it was not possible to run just the BlockToJsonVerbose benchmark because it did not set up everything it needed, running `bench_bitcoin -filter=BlockToJsonVerbose` caused this assert to fail:

  ```
  bench_bitcoin: chainparams.cpp:506: const CChainParams& Params(): Assertion `globalChainParams' failed.
  ```

  Initializing TestingSetup fixes this.

ACKs for top commit:
  theStack:
    Tested ACK 7487bc9900 🐎

Tree-SHA512: 27b9702cb4bacc0475710f7b31f41844e83b8a0787685380749505d179aba724728604d4e4e2e3b3cb38cde88ab12f170881b5d3eb615872ee84632e85312166
2021-01-25 08:42:53 +01:00
Wladimir J. van der Laan
a6739cc868 rpc: Add specific error code for "wallet already loaded" 2021-01-25 07:55:35 +01:00
Wladimir J. van der Laan
543bf745d3 gitian-linux: Extend noexec-stack workaround to powerpc 2021-01-24 23:33:16 +01:00
Luke Dashjr
00f67c8aa1 gitian-linux: Build binaries for 64-bit POWER 2021-01-24 23:27:39 +01:00
Wladimir J. van der Laan
f707fcde9a
Merge #20958: gitian-keys: Add signer aliases, some historical keys
2b4cfb44bd gitian-keys: Add signer aliases, some historical keys (Wladimir J. van der Laan)

Pull request description:

  Update `keys.txt` for `gitian-verify.py`  (bitcoin-core/bitcoin-maintainer-tools#71)

  - Extend line format with signer aliases in parentheses
  - Add a few historical signers
  - Sort the file by name

  Co-authored-by: fanquake <fanquake@gmail.com>

Top commit has no ACKs.

Tree-SHA512: 0bd22161400358fb2507be3f49b0ad79f323fdc280ecb647e1728d11f9d8ddea4a71286e5808036399929ede79c541432191f93f314ccfd12e40aadad56b8faa
2021-01-24 21:48:01 +01:00
Wladimir J. van der Laan
2b4cfb44bd gitian-keys: Add signer aliases, some historical keys
Co-authored-by: fanquake <fanquake@gmail.com>
2021-01-24 19:01:26 +01:00
Wladimir J. van der Laan
e31af1065e
Merge #20989: gitian-keys: add CoinForensics key
94271d2ce7 gitian-keys: add CoinForensics key (coinforensics)

Pull request description:

  in ref to:
  bitcoin-core/gitian.sigs#1427

  PGP Signing key: https://coinforensics.keybase.pub/pgp/signing_key.asc

  ```
  -----BEGIN PGP PUBLIC KEY BLOCK-----

  mQENBF/1zL0BCADD1H7gNIVYZ3ibv3HBl8ue5yQKc68DCZk9HAZy9OLRoFLnR0CF
  qwTT8WnjWjvlc/66Ql6kgNhZu3AlEQ4FuTZ9tbYwYeHvw/SBTZkFFlWOyrs5dNJ+
  P+pDHUQQLGyu7oBM/6EpsVVbcXTWXXv3fUI3t0zqhHccCONDi//zFC8vv4hNE3Ps
  mTqxDSU3H88Zkhcel0zgIQXebnAfoExoMcue+A0TZAvk5HC1VCbuacyC6yIfcnqb
  lgOylUc7EA9TNYw52U4hcACyusm+T8wkdjutOtO5j+bFIDKRMkez2MvZZdfr08B4
  FgfUwzlR5lnr3Ezf7tjx9KA4e1300eh3vidNABEBAAG0TENvaW5Gb3JlbnNpY3Mg
  KFNpZ25pbmdLZXkpIDw1OTU2NzI4NCtjb2luZm9yZW5zaWNzQHVzZXJzLm5vcmVw
  bHkuZ2l0aHViLmNvbT6JAVQEEwEIAD4WIQQQFZjcgjwbX5pmJKul4JB6A4DmwwUC
  X/XMvQIbAwUJCWYBgAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCl4JB6A4Dm
  w4LRCACpLnGtci9ADF6jzt82PcLUHDlL1c8HNs+KeLa3SQ+KF45gmfOPieRZlj5l
  1MNJ0F5Km5DdJA0u39mNINlfdIlPOkxqXnmRAKbVCXVSUF0b8cmIdwYAc70qRpV/
  y6zTgfC8Zs1974/NX95+1GSnw+97MEbR3ULW3mapQXht6gDVCDZXIWVm9WQHzsXQ
  MmAqoynPhKfGAPf75rdgRjpwUS/BUASP+jSAiG5cuEtFljh2sARz2/H3JAAkqHhQ
  6Sqy3rMvNdZ3JVlRI9JOLlVp81PlnQFt39UDV09wa88st/6lTT35xm3LfhcPqSzx
  6KA9zt87hNlRX9sXxVDTusYvwj5EuQENBF/1zL0BCACth5JAULLkySfkVAeGzpbF
  sRkQxS4GJa6EB9qE+nJOijcBVJGwJlyaKHYu1lOTQBiOAz1bJXYk1kiG+CupvzfW
  4gnZRBtF1G/irbEArg2uLvOukKVgusElxUG8iSE7u0B2ET+RPXRPABY75htLS6Id
  xvgZiVAt/w5hRt3jbdmwGjOxdorkdofODvMOKtdi0qqxi16GJSD5EqasBIYpKO8Y
  xKKFJNusHaEgUAXkL82UwcO6YyuSsCckRKJTukNisCza5u2gWNf0hQHbiouEbFz7
  /e7x4Iys9EbOS+N6PnfbyVokbWMN3rSeq56Lci2/DK1YC+PFaxU8zydg4rqscwab
  ABEBAAGJATwEGAEIACYWIQQQFZjcgjwbX5pmJKul4JB6A4DmwwUCX/XMvQIbDAUJ
  CWYBgAAKCRCl4JB6A4Dmw+DfCADBX9/1ABB6KIYOMfd9/OzUI03hXQruZMz3CT6H
  RVhpmjvZAc210kVGW8X7Y50op4NQbdgheQgCTft/iteLv7JIPo8UauBls0G90Kgm
  aCFa4z9y3cMF+tkylgubuPVaOVh+OCcF9ZBzPQeQViMN0u/K1whhs48paFfG6tT4
  g7gO11PnRnCwIFGbwULp+yWInG1F2Hosbt03dzHQdPRWMzvo4Cb+gzIYES4jb0uQ
  AganiOKOOpLUgQ/9Iw1hEvqqZ/cjFR+lCztLrXUyLDzGo636C0Q3LYLoMEudk3Cx
  9mf4vHJoGKqk4Op9ATBaN8ET/F99AcQJRz7U3wL/88WDSRND
  =6SYc
  -----END PGP PUBLIC KEY BLOCK-----
  ```

ACKs for top commit:
  laanwj:
    ACK 94271d2ce7

Tree-SHA512: 9e6e26b145d00b5835d1a52d169a13e0c2cbcaea64d3c39130e430ef446db3b0f4bec514b6b97e5aa78dd9898c14e55ed77d4bc95cd9aacf097ed61479d6ecab
2021-01-24 18:57:33 +01:00
Martin Ankerl
7487bc9900 Fix BlockToJsonVerbose benchmark
Currently it was not possible to run just the BlockToJsonVerboes benchmarsk because it did not set up everything it needed, running `bench_bitcoin -filter=BlockToJsonVerbose` caused this assert to fail:

```
bench_bitcoin: chainparams.cpp:506: const CChainParams& Params(): Assertion `globalChainParams' failed.
```

Initializing TestingSetup fixes this.
2021-01-24 10:31:13 +01:00
Bezdrighin
8f0b64fb51 Better error messages for invalid addresses
This commit addresses #20809.

We add an additional 'error' property in the result of 'validateaddress' in case the address is not valid that gives a short description of why the address in invalid. We also change the error message returned by 'getaddressinfo' in case the address is invalid.
2021-01-24 02:44:53 +01:00
Troy Giorshev
bff7c66e67 Add documentation to contrib folder
This commit adds brief documentation for this feature.  Included in the
justification is the purpose of this feature as well as usage and
functionality tips.
2021-01-23 16:15:05 -05:00
Troy Giorshev
381f77be85 Add Message Capture Test
Add a functional test for CaptureMessage.  This connects and then
disconnects a peer so that the handshake can be used to check if capture
is being done correctly.

Included in a docstring in the test is the following:

From the data file we'll only check the structure.

We won't care about things like:
- Deserializing the payload of the message
    - This is managed by the deserialize methods in
      test_framework.messages
- The order of the messages
    - There's no reason why we can't, say, change the order of the
      messages in the handshake
- Message Type
    - We can add new message types

We're ignoring these because they're simply too brittle to test here.
2021-01-23 16:15:05 -05:00
Troy Giorshev
e4f378a505 Add capture parser
This commit adds contrib/message-capture/message-capture-parser.py, a python
script to be used alongside -capturemessages to parse the captured
messages.

It is complete with arguments and will parse any file given, sorting the
messages in the files when creating the output.  If an output file is
specified with -o or --output, it will dump the messages in json format
to that file, otherwise it will print to stdout.

The small change to the unused msg_generic is to bring it in line with
the other message classes, purely to avoid a bug in the future.
2021-01-23 16:01:39 -05:00
Troy Giorshev
4d1a582549 Call CaptureMessage at appropriate locations
These calls are toggled by a debug-only "capturemessages" flag.  Default
disabled.
2021-01-23 15:58:42 -05:00
Troy Giorshev
f2a77ff97b Add CaptureMessage
This commit adds the CaptureMessage function.  This will later be called
when any message is sent or received.  The capture directory is fixed,
in a new folder "message_capture" in the datadir.  Peers will then have
their own subfolders, named with their IP address and port, replacing
colons with underscores to keep compatibility with Windows.  Inside,
received and sent messages will be captured into two binary files,
msgs_recv.dat and msgs_sent.dat.

e.g.
message_capture/203.0.113.7_56072/msgs_recv.dat
message_capture/203.0.113.7_56072/msgs_sent.dat

The format has been designed as to result in a minimal performance
impact.  A parsing script is added in a later commit.
2021-01-23 15:58:42 -05:00
MarcoFalke
fad3d7625a
fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSION 2021-01-23 20:04:37 +01:00