Commit graph

25988 commits

Author SHA1 Message Date
Hennadii Stepanov a490d074b3
doc: Add anchors.dat to files.md 2020-10-09 14:30:09 +03:00
Hennadii Stepanov 0a85e5a7bc
p2p: Try to connect to anchors once 2020-10-09 14:29:05 +03:00
Hennadii Stepanov 5543c7ab28
p2p: Fix off-by-one error in fetching address loop
This is a move-only commit.
2020-10-09 14:29:05 +03:00
Hennadii Stepanov 4170b46544
p2p: Integrate DumpAnchors() and ReadAnchors() into CConnman 2020-10-09 14:29:05 +03:00
Hennadii Stepanov bad16aff49
p2p: Add CConnman::GetCurrentBlockRelayOnlyConns() 2020-10-09 14:29:04 +03:00
Hennadii Stepanov c29272a157
p2p: Add ReadAnchors() 2020-10-09 14:29:04 +03:00
Hennadii Stepanov 567008d2a0
p2p: Add DumpAnchors() 2020-10-09 14:28:58 +03:00
fanquake 12a1c3ad1a
Merge #20107: doc: Collect release-notes snippets
faa0847dec doc: Add release notes for #20101 (MarcoFalke)
99992e7832 doc: Collect release-notes snippets (MarcoFalke)

Pull request description:

  Also add a note for #20101

ACKs for top commit:
  fanquake:
    ACK faa0847dec - no need to bike-shed here as these will all get massaged to death in the wiki anyways.

Tree-SHA512: 63d3597e2bbd422ec182e76112110477d22e3afedb479114ddec958405bcdd63492df9477267aac65605612af49c0aff6246b1bc3d41dd606d6d61c30117c109
2020-10-09 18:08:14 +08:00
fanquake 6854dbdc88
Merge #20076: doc: Update and improve files.md
2dc79c4264 doc: Update and improve files.md (Hennadii Stepanov)

Pull request description:

  This PR adds to the `files.md`:
  - the `signet` subdirectory
  - the `ip_asn.map` file
  - some small improvements

ACKs for top commit:
  practicalswift:
    ACK 2dc79c4264
  MarcoFalke:
    ACK 2dc79c4264

Tree-SHA512: f645486a26293e91eda826dee46e5798af9a81be410d48d07c2714f416da19b85e7e75b1a638b0e03a3e6dc486a8bb65c4be811eb2ff51b66f5817aecf89416d
2020-10-09 18:02:38 +08:00
MarcoFalke 380705ef4f
Merge #20106: cirrus: Use kvm to avoid spurious CI failures in the default virtualization cluster
faf2999e25 cirrus: Use kvm to avoid spurious CI failures in the default virtualization cluster (MarcoFalke)

Pull request description:

  Try to fix #20093

ACKs for top commit:
  practicalswift:
    ACK faf2999e25
  hebasto:
    ACK faf2999e25, the related doc:

Tree-SHA512: 156aa2ce5a5dde11570f7f90f9d51be540a5469f090033ab6f337b2c46347741469e109f9566f4b7c424339483d61192b91102021f5db38823ce4cf4428e5671
2020-10-09 08:44:35 +02:00
Wladimir J. van der Laan d9de00b3e0
Merge #20105: [net] Remove CombinerAll
1afcd41a90 [net] Remove CombinerAll (John Newbery)

Pull request description:

  This was introduced in 9519a9a4 for use with boost signals. Boost signals
  have not been used in net since 8ad663c1, so this code is unused.

ACKs for top commit:
  MarcoFalke:
    review ACK 1afcd41a90
  laanwj:
    code review ACK 1afcd41a90

Tree-SHA512: a4313142afb88bf12f15abc4e717b3b0d0b40d2d5db2638494af3181e1cd680d7b036087050fc0e0dfe606228849a2e20ae85135908a9ebe8ff2130f163920e1
2020-10-08 20:42:19 +02:00
MarcoFalke faa0847dec
doc: Add release notes for #20101 2020-10-08 15:11:25 +02:00
MarcoFalke 392c6f4fb2
Merge #20101: rpc: change no wallet loaded message to be clearer
907f142fc7 rpc: change no wallet loaded message to be clearer (Andrew Chow)

Pull request description:

  Changes the no wallet is loaded rpc error message to be clearer that no wallet is loaded and how the user can load or create a wallet. Also changes the error code from METHOD_NOT_FOUND to RPC_WALLET_NOT_FOUND as that makes more sense.

ACKs for top commit:
  MarcoFalke:
    review ACK 907f142fc7
  kristapsk:
    ACK 907f142fc7. In addition to standard tests, just in case tested that this doesn't break anything with JoinMarket.
  meshcollider:
    utACK 907f142fc7

Tree-SHA512: 4b413e6ab5430ec75a79de9db6583f2f3f38ccdf71aa373d8386a56e64f07f92200c8107c8c82c92c7c431d739615977c208b771a24c5960fa8676789b5497a2
2020-10-08 15:07:23 +02:00
MarcoFalke faf2999e25
cirrus: Use kvm to avoid spurious CI failures in the default virtualization cluster 2020-10-08 14:47:21 +02:00
John Newbery 1afcd41a90 [net] Remove CombinerAll
This was introduced in 9519a9a4 for use with boost signals. Boost signals
have not been used in net since 8ad663c1, so this code is unused
2020-10-08 12:28:38 +01:00
MarcoFalke b337bd7bc0
Merge #20065: fuzz: Configure check for main function
fae7a1c188 fuzz: Configure check for main function (MarcoFalke)

Pull request description:

  Instead of the PP jungle, use a proper configure check

  Fixes https://github.com/google/honggfuzz/issues/336#issuecomment-702972138

ACKs for top commit:
  practicalswift:
    ACK fae7a1c188

Tree-SHA512: 2e55457d01f9ac598bb1e119d8b49dca55a28f88ec164cee6b5f071c29e9791f5a46cc8ee2b801b3a3faf906348da964ce32e7254da981c1104b9210a3508100
2020-10-08 13:17:45 +02:00
MarcoFalke 9dd4de2832
Merge #20027: Use mockable time everywhere in net_processing
b6834e312a Avoid 'timing mishap' warnings when mocking (Pieter Wuille)
ec3916f40a Use mockable time everywhere in net_processing (Pieter Wuille)

Pull request description:

  The fact that net_processing uses a mix of mockable tand non-mockable time functions made it hard to write functional tests for #19988.

  I'm opening this as a separate PR as I believe it's independently useful. In some ways this doesn't go quite as far as it could, as there are now several data structures that could be converted to `std::chrono` types as well now. I haven't done that here, but I'm happy to reconsider that.

ACKs for top commit:
  MarcoFalke:
    ACK b6834e312a 🌶
  jnewbery:
    utACK b6834e312a
  naumenkogs:
    utACK b6834e3

Tree-SHA512: 6528a167c57926ca12894e0c476826411baf5de2f7b01c2125b97e5f710e620f427bbb13f72bdfc3de59072e56a9c1447bce832f41c725e00e81fea019518f0e
2020-10-08 11:38:47 +02:00
Pieter Wuille b6834e312a Avoid 'timing mishap' warnings when mocking 2020-10-08 01:04:29 -07:00
Pieter Wuille ec3916f40a Use mockable time everywhere in net_processing 2020-10-08 01:04:29 -07:00
Andrew Chow 907f142fc7 rpc: change no wallet loaded message to be clearer
Changes the no wallet is loaded rpc error message to be clearer that no
wallet is loaded and how the user can load or create a wallet. Also
changes the error code from METHOD_NOT_FOUND to RPC_WALLET_NOT_FOUND as
that makes more sense.
2020-10-07 21:36:44 -04:00
MarcoFalke 283a73d7ea
Merge #20092: util: Do not use gArgs global in ArgsManager member functions
d103484fe8 util: Do not use gArgs global in ArgsManager member functions (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  practicalswift:
    ACK d103484fe8: patch looks correct

Tree-SHA512: dda7a5062363170c6995f2fd8fda48c0a919e5ca67be9faa8f0fa66f9d3b535f134eb6f4860a0859bc5457c02230b34a8d1264045f22bed8d30668158ac2271f
2020-10-07 09:31:12 +02:00
fanquake db88db4727
Merge #19339: validation: re-delegate absurd fee checking from mempool to clients
b048b275d9 [validation] Remove absurdfee from accepttomempool (John Newbery)
932564b9cf scripted-diff: update max-fee-exceeded error message to include RPC (gzhao408)
8f1290c601 [rpc/node] check for high fee before ATMP in clients (gzhao408)

Pull request description:

  Picked up from #15810. Add separate fee-checking logic for clients that need to enforce max fee rates, then remove the `absurdFee` logic from ATMP.

  ATMP's `nAbsurdFee` argument is used to enforce user-specific behavior (it is not policy since it isn't applied consistently: it is only ever used in RPC and wallet, and set to 0 everywhere else internally). It should be removed from `AcceptToMemoryPool` because (1) validation results/mempool behavior should not be user-specific and (2) enforcing a max fee rate should be the responsibility of the client instead of the mempool.

  Note: this PR does not intend to _remove_ protection from high fees, just re-delegate the responsibility to clients.

ACKs for top commit:
  jnewbery:
    utACK b048b275d9
  LarryRuane:
    re-ACK b048b275d9
  MarcoFalke:
    re-ACK b048b275d9 , only change is squashing one commit 🏦
  instagibbs:
    utACK b048b275d9

Tree-SHA512: 57c17ba16d230a4cae2896dd6a64c924f307757824e35784bf96da7b10aff2d8ea910710edf35e981035623a155f8766209a92a0fdb856549fde78bc3eaae4d2
2020-10-07 10:58:30 +08:00
Pieter Wuille d8cd7b137f
Merge #20095: CI: Bump vcpkg commit ID to get new msys mirror list
c83155b406 Bump vcpkg commit ID to get new msys mirror list (Aaron Clauson)

Pull request description:

  This fixes the appveyor CI job, see #20066.

  Currently the job fails because some of the vcpkg dependencies need to install msys2 and the hardcoded mirror in the vcpkg config is down.

  Vcpkg commit 76a7e9248fb3c57350b559966dcaa2d52a5e4458 adds new mirrors to the hardcoded list.

ACKs for top commit:
  decryp2kanon:
    utACK c83155b406
  practicalswift:
    ACK c83155b406
  sipa:
    utACK c83155b406. Verified that 40230b8e3f6368dcb398d649331be878ca1e9007 is a recent commit in the https://github.com/microsoft/vcpkg repository's master branch.

Tree-SHA512: 0887454a18d341cca35448fc8003d82b522ca32b0e7e5929a3b79d72603b79769fe0af9cc6eec3565e905eb530ada7ca8e4b9f1c04881197a5ccf0f8c829274e
2020-10-06 12:00:24 -07:00
Aaron Clauson c83155b406
Bump vcpkg commit ID to get new msys mirror list
This fixes the appveyor CI job, see #20066.

Currently the job fails because some of the vcpkg dependencies need to install msys2 and the hardcoded mirror in the vcpkg config is down.

Vcpkg commit 76a7e9248fb3c57350b559966dcaa2d52a5e4458 adds new mirrors to the hardcoded list.
2020-10-06 19:17:53 +01:00
Hennadii Stepanov d103484fe8
util: Do not use gArgs global in ArgsManager member functions 2020-10-06 14:57:06 +03:00
Hennadii Stepanov 2dc79c4264
doc: Update and improve files.md
Added the `signet` subdirectory and the `ip_asn.map` file.
2020-10-06 11:05:03 +03:00
John Newbery b048b275d9 [validation] Remove absurdfee from accepttomempool
Mempool behavior should not be user-specific.
Checking that txfee is acceptable should be
the responsibility of the wallet or client, not
the mempool.
2020-10-05 04:55:01 -07:00
gzhao408 932564b9cf scripted-diff: update max-fee-exceeded error message to include RPC
-BEGIN VERIFY SCRIPT-
sed -i 's/Fee exceeds maximum configured by \-\maxtxfee/Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)/g' src/util/error.cpp test/functional/rpc_fundrawtransaction.py test/functional/rpc_psbt.py test/functional/rpc_rawtransaction.py test/functional/wallet_bumpfee.py test/functional/wallet_create_tx.py
-END VERIFY SCRIPT-
2020-10-05 04:55:01 -07:00
gzhao408 8f1290c601 [rpc/node] check for high fee before ATMP in clients
Check absurd fee in BroadcastTransaction and RPC,
return TransactionError::MAX_FEE_EXCEEDED instead
of TxValidationResult::TX_NOT_STANDARD because this
is client preference, not a node-wide policy.
2020-10-05 04:54:05 -07:00
MarcoFalke 875e1ccc9f
Merge #19947: Test: Cover "change_type" option of "walletcreatefundedpsbt" RPC
a56e9f5670 test: Assert exclusive PSBT funding options (Oliver Gugger)
64bc5efd39 test: Assert PSBT change type (Oliver Gugger)

Pull request description:

  Increases test coverage of the `walletcreatefundedpsbt` RPC.

  Tests the following combinations:
   - Make sure the global option `-changetype` is used as the default value for the `change_type` option if not specified.
   - Make sure the global option `-changetype` can be overwritten by explicitly setting the `change_type` option of the `walletcreatefundedpsbt` RPC call.
   - Make sure the options `change_type` and `changeAddress` are mutually exclusive.

ACKs for top commit:
  achow101:
    ACK a56e9f5670

Tree-SHA512: bf0fb20c890887b7228ad9277fdb32f367ba772eed6efbe2b4f471f808d4d435110256601e8ebd9bea57026d9f22f3cc3c26a009b017e3da6d8fc6896313def5
2020-10-05 09:45:11 +02:00
fanquake dde104963b
Merge #20064: RPC: remove duplicate line in getblock help
1885ad3546 RPC: remove duplicate line in getblock help (Fabian Jahr)

Pull request description:

  Line simply seems duplicated in error.

  Testing instructions:
  Run `src/bitcoin-cli help getblock` on master branch to reproduce. Then build this PR and compare its results.

ACKs for top commit:
  dhruv:
    tACK `1885ad3`
  kristapsk:
    ACK 1885ad3546
  Emzy:
    tACK 1885ad3546

Tree-SHA512: 870c035cb553b0e1d5ef72e64231ef277e0392efe94bc6ecf47129023bd94a6d5a276f46529807f68a1db55c7baa94d9119c7264d9947bc4e5dd9dcefd1b13e7
2020-10-05 09:40:17 +08:00
MarcoFalke fae7a1c188
fuzz: Configure check for main function 2020-10-04 17:49:07 +02:00
MarcoFalke cce1513179
Merge #19723: Ignore unknown messages before VERACK
675e55e013 Ignore unknown messages before VERACK (Suhas Daftuar)

Pull request description:

  This allows for feature negotiation to take place with messages between VERSION and VERACK in the future, without requiring additional software changes to specifically ignore messages for features that are unimplemented by our software.

ACKs for top commit:
  sipa:
    utACK 675e55e013
  practicalswift:
    ACK 675e55e013: patch looks correct
  MarcoFalke:
    ACK 675e55e013
  hebasto:
    ACK 675e55e013, the offender peer will be eventually disconnected due to the timeout.

Tree-SHA512: 8d2b1d8b9843f2ee26b2c30f7c5ff0bfcfbe3f46b32cd0369c48ece26624151091237e83ce3f18c6da004099026602cfab1642ac916db777f047d170b365c007
2020-10-04 15:39:26 +02:00
MarcoFalke f0fd132226
Merge #20072: ci: Build Arm64 on Travis without functional tests
33df8d46bb ci: Build Arm64 on Travis without functional tests (Fabian Jahr)

Pull request description:

  The Travis Arm64 env is a pretty big PITA for quite a while now. It simply seems to time out due to a lack of resources as far as I can tell from my research into the matter.

  I have reported the issue in August and received no response: https://travis-ci.community/t/arm64-failing-without-message/9775. Others have complained about similar issues with Arm64 over the past year. The explanation for this is probably that this env is still considered to be in beta: https://docs.travis-ci.com/user/multi-cpu-architectures.

  Considering the high frequency of failures (I didn't run any numbers, just based on my personal observations) and the beta status I would suggest that we shorten the runtime by removing part of the test suite until the env is more stable. I would suggest removing functional tests since it should help for sure but maybe there are other ideas.

ACKs for top commit:
  MarcoFalke:
    ACK 33df8d46bb

Tree-SHA512: 55b0c658b526611d16a26e9508611ddeecbfbd842ec064ada61d188a8be2f473e080c2a35746a9aae8006b11b0c2ab9dd4639b0f3004ecf821506e26c7345972
2020-10-04 09:42:53 +02:00
MarcoFalke 2f7a53cc9d
Merge #20069: test: Mention commit id in scripted diff error
3491bf358a test: Mention commit id in scripted diff error (Wladimir J. van der Laan)

Pull request description:

  Add commit id to make spotting the issue easier.

ACKs for top commit:
  robot-dreams:
    ACK 3491bf358a
  sipa:
    utACK 3491bf358a
  hebasto:
    ~ACK~ Concept ACK 3491bf358a, should help in situations like https://travis-ci.org/github/bitcoin/bitcoin/jobs/732481553

Tree-SHA512: 1ae66fa760f9e5d52e029bae71f6b5863f1efd7b95de3723ea09290944c9d7687f5ec6927aa115a3aebd6f2b993baa0c2433975c6ad5cd2858089013362eb599
2020-10-04 09:09:38 +02:00
MarcoFalke 06314fbb55
Merge #20071: ci, lint: Remove usage of TRAVIS_COMMIT_RANGE
a91ab86fae lint: Use TRAVIS_BRANCH in lint-git-commit-check.sh (Fabian Jahr)
c11dc995c9 lint: Don't use TRAVIS_COMMIT_RANGE in whitespace linter (Fabian Jahr)
1b41ce8f5f lint: Don't use TRAVIS_COMMIT_RANGE for commit-script-check (Fabian Jahr)

Pull request description:

  This is causing problems again, very similar to #19654.

  UPDATE: This now removes all remaining usages of TRAVIS_COMMIT_RANGE and instead uses TRAVIS_BRANCH for the range, including `lint-git-commit-check` where TRAVIS_COMMIT_RANGE had already been removed. For builds triggered by a pull request, TRAVIS_BRANCH is the name of the branch targeted by the pull request. In the linters there is still a fallback that assumes master as the target branch.

ACKs for top commit:
  sipa:
    ACK a91ab86fae. See test I tried in #20075.

Tree-SHA512: 1378bdebd5d8787a83fbda5d9999cc9447209423e7f0218fe5eb240e6a32dc1b51d1cd53b4f8cd1f71574d935ac5e22e203dfe09cce17e9976a48416038e1263
2020-10-04 09:05:59 +02:00
Fabian Jahr a91ab86fae
lint: Use TRAVIS_BRANCH in lint-git-commit-check.sh 2020-10-03 21:56:15 +02:00
Fabian Jahr c11dc995c9
lint: Don't use TRAVIS_COMMIT_RANGE in whitespace linter 2020-10-03 21:56:13 +02:00
Fabian Jahr 1b41ce8f5f
lint: Don't use TRAVIS_COMMIT_RANGE for commit-script-check 2020-10-03 21:55:52 +02:00
Fabian Jahr 33df8d46bb
ci: Build Arm64 on Travis without functional tests 2020-10-03 19:20:04 +02:00
Wladimir J. van der Laan 3491bf358a test: Mention commit id in scripted diff error 2020-10-03 13:50:52 +02:00
fanquake 54fc96ffa7
Merge #19956: rpc: Improve invalid vout value rpc error message
f471a3be00 scripted diff: Improve invalid vout value rpc error message (Nima Yazdanmehr)

Pull request description:

  Since the `vout` value can start at `0`, the error message for *negative* values can be improved to something like: `vout cannot be negative`.

ACKs for top commit:
  fanquake:
    ACK f471a3be00
  promag:
    Code review ACK f471a3be00.

Tree-SHA512: fbdee3d0ddd5b58eb93934a1217b44e125a9ad39e672b1f35c7609c6c5fcf45ae1b731d3d6135b7225d98792dbfc34a50907b8c41274a5b029d7b5c59f886560
2020-10-03 11:13:21 +08:00
Fabian Jahr 1885ad3546
RPC: remove duplicate line in getblock help 2020-10-03 00:44:59 +02:00
Oliver Gugger a56e9f5670
test: Assert exclusive PSBT funding options
Make sure the options "change_type" and "changeAddress" of the
walletcreatefundedpsbt RPC cannot both be specified a the same time.
2020-10-02 17:15:52 +02:00
MarcoFalke 171cd05ae3
Merge #20034: test: Get rid of default wallet hacks
c1585bca8d test: Get rid of default wallet hacks (Russell Yanofsky)
ed3acda33b test, refactor: add default_wallet_name and wallet_data_filename variables (Russell Yanofsky)

Pull request description:

  Changes:

  - Get rid of setup_nodes (`-wallet`, `-nowallet`, `-disablewallet`) argument rewriting
  - Get rid of hardcoded wallet `""` names and `-wallet=""` args

  Motivation:

  - Simplify test framework behavior so it's easier to write new tests without having arguments mangled by the framework
  - Make tests more readable, replacing unexplained `""` string literals with `default_wallet_name` references
  - Make it trivial to update default wallet name and wallet data filename for sqlite #19077 testing
  - Stop relying on `-wallet` arguments to create wallets, so it is easy to change `-wallet` option in the future to only load existing wallets not create new ones (to avoid accidental wallet creation, and encourage use of wallet encryption and descriptor features)

ACKs for top commit:
  MarcoFalke:
    ACK c1585bca8d, only effective change is adding documentation 🎵

Tree-SHA512: f62dec7cbdacb5f330aa0e1eec89ab4d065540d91495bbedcb375eda1c080b45ce9edb310ce253c44c4839f1b4cc2c7df9816c58402d5d43f94a437e301ea8bc
2020-10-02 17:07:35 +02:00
Wladimir J. van der Laan d9935222d5
Merge #19951: net, test: CNetAddr scoped ipv6 test coverage, rename scopeId to m_scope_id
f36887fa47 net: rename CNetAddr scopeId to m_scope_id, improve code doc (Jon Atack)
5cb5fd3005 test: add test coverage for CNetAddr ipv6 scoped addresses (Jon Atack)

Pull request description:

  Add some test coverage for the IPv6 scoped address feature in `netaddress`/`netbase` per https://tools.ietf.org/html/rfc4007, update the member name `scopeId` to `m_scope_id` per `doc/developer-notes.md`, and improve the code doc.

  ----

  Reviewers can manually verify the test with these steps:

  - [pull down the changes locally and check out this branch](https://jonatack.github.io/articles/how-to-review-pull-requests-in-bitcoin-core#pull-down-the-code-locally)

  - [build Bitcoin Core](https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests)

  - run the test: `cd src ; test/test_bitcoin -t net_tests/cnetaddr_basic -l all`

  <details><summary><em>you should see passing test output like this</em></summary><p>

  ```
  Running 1 test case...
  Entering test module "Bitcoin Core Test Suite"
  test/net_tests.cpp(85): Entering test suite "net_tests"
  test/net_tests.cpp(204): Entering test case "cnetaddr_basic"
  test/net_tests.cpp(210): info: check LookupHost("0.0.0.0", addr, false) has passed
  test/net_tests.cpp(211): info: check !addr.IsValid() has passed
  test/net_tests.cpp(212): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(214): info: check addr.IsBindAny() has passed
  test/net_tests.cpp(215): info: check addr.ToString() == "0.0.0.0" has passed
  test/net_tests.cpp(218): info: check LookupHost("255.255.255.255", addr, false) has passed
  test/net_tests.cpp(219): info: check !addr.IsValid() has passed
  test/net_tests.cpp(220): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(222): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(223): info: check addr.ToString() == "255.255.255.255" has passed
  test/net_tests.cpp(226): info: check LookupHost("12.34.56.78", addr, false) has passed
  test/net_tests.cpp(227): info: check addr.IsValid() has passed
  test/net_tests.cpp(228): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(230): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(231): info: check addr.ToString() == "12.34.56.78" has passed
  test/net_tests.cpp(234): info: check LookupHost("::", addr, false) has passed
  test/net_tests.cpp(235): info: check !addr.IsValid() has passed
  test/net_tests.cpp(236): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(238): info: check addr.IsBindAny() has passed
  test/net_tests.cpp(239): info: check addr.ToString() == "::" has passed
  test/net_tests.cpp(242): info: check LookupHost(ipv6_addr, addr, false) has passed
  test/net_tests.cpp(243): info: check addr.IsValid() has passed
  test/net_tests.cpp(244): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(246): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(247): info: check addr.ToString() == ipv6_addr has passed
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): info: check addr.ToString() == scoped_addr has passed
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): info: check addr.ToString() == scoped_addr has passed
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): info: check addr.ToString() == scoped_addr has passed
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): info: check addr.ToString() == scoped_addr has passed
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(266): info: check LookupHost(ipv6_addr + "%0", addr, false) has passed
  test/net_tests.cpp(267): info: check addr.IsValid() has passed
  test/net_tests.cpp(268): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(269): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(270): info: check addr.ToString() == ipv6_addr has passed
  test/net_tests.cpp(274): info: check addr.IsValid() has passed
  test/net_tests.cpp(275): info: check addr.IsTor() has passed
  test/net_tests.cpp(277): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(278): info: check addr.ToString() == "6hzph5hv6337r6p2.onion" has passed
  test/net_tests.cpp(282): info: check !addr.IsValid() has passed
  test/net_tests.cpp(283): info: check addr.IsInternal() has passed
  test/net_tests.cpp(285): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(286): info: check addr.ToString() == "esffpvrt3wpeaygy.internal" has passed
  test/net_tests.cpp(204): Leaving test case "cnetaddr_basic"; testing time: 30933us
  test/net_tests.cpp(85): Leaving test suite "net_tests"; testing time: 30975us
  Leaving test module "Bitcoin Core Test Suite"; testing time: 31169us

  *** No errors detected
  ```
  </p>/</details>

  - change this line in the code to break the feature:
  ```diff
  --- a/src/netaddress.cpp
  +++ b/src/netaddress.cpp
  @@ -716,7 +716,7 @@ bool CService::GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const
           memset(paddrin6, 0, *addrlen);
           if (!GetIn6Addr(&paddrin6->sin6_addr))
               return false;
  -        paddrin6->sin6_scope_id = m_scope_id;
  +        // paddrin6->sin6_scope_id = m_scope_id;
  ```

  - rebuild, e.g. `make`

  - run the test: `test/test_bitcoin -t net_tests/cnetaddr_basic -l all`, verify that the added tests break

  <details><summary><em>you should see test output with a few failed tests like this</em></summary><p>

  ```
  Running 1 test case...
  Entering test module "Bitcoin Core Test Suite"
  test/net_tests.cpp(85): Entering test suite "net_tests"
  test/net_tests.cpp(204): Entering test case "cnetaddr_basic"
  test/net_tests.cpp(210): info: check LookupHost("0.0.0.0", addr, false) has passed
  test/net_tests.cpp(211): info: check !addr.IsValid() has passed
  test/net_tests.cpp(212): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(214): info: check addr.IsBindAny() has passed
  test/net_tests.cpp(215): info: check addr.ToString() == "0.0.0.0" has passed
  test/net_tests.cpp(218): info: check LookupHost("255.255.255.255", addr, false) has passed
  test/net_tests.cpp(219): info: check !addr.IsValid() has passed
  test/net_tests.cpp(220): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(222): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(223): info: check addr.ToString() == "255.255.255.255" has passed
  test/net_tests.cpp(226): info: check LookupHost("12.34.56.78", addr, false) has passed
  test/net_tests.cpp(227): info: check addr.IsValid() has passed
  test/net_tests.cpp(228): info: check addr.IsIPv4() has passed
  test/net_tests.cpp(230): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(231): info: check addr.ToString() == "12.34.56.78" has passed
  test/net_tests.cpp(234): info: check LookupHost("::", addr, false) has passed
  test/net_tests.cpp(235): info: check !addr.IsValid() has passed
  test/net_tests.cpp(236): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(238): info: check addr.IsBindAny() has passed
  test/net_tests.cpp(239): info: check addr.ToString() == "::" has passed
  test/net_tests.cpp(242): info: check LookupHost(ipv6_addr, addr, false) has passed
  test/net_tests.cpp(243): info: check addr.IsValid() has passed
  test/net_tests.cpp(244): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(246): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(247): info: check addr.ToString() == ipv6_addr has passed
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): error: in "net_tests/cnetaddr_basic": check addr.ToString() == scoped_addr has failed [1122:3344:5566:7788:9900:aabb:ccdd:eeff != 1122:3344:5566:7788:9900:aabb:ccdd:eeff%1]
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): error: in "net_tests/cnetaddr_basic": check addr.ToString() == scoped_addr has failed [1122:3344:5566:7788:9900:aabb:ccdd:eeff != 1122:3344:5566:7788:9900:aabb:ccdd:eeff%21]
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): error: in "net_tests/cnetaddr_basic": check addr.ToString() == scoped_addr has failed [1122:3344:5566:7788:9900:aabb:ccdd:eeff != 1122:3344:5566:7788:9900:aabb:ccdd:eeff%19]
  test/net_tests.cpp(254): info: check LookupHost(scoped_addr, addr, false) has passed
  test/net_tests.cpp(255): info: check addr.IsValid() has passed
  test/net_tests.cpp(256): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(257): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(258): error: in "net_tests/cnetaddr_basic": check addr.ToString() == scoped_addr has failed [1122:3344:5566:7788:9900:aabb:ccdd:eeff != 1122:3344:5566:7788:9900:aabb:ccdd:eeff%3]
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(263): info: check !LookupHost(ipv6_addr + "%" + zone_id, addr, false) has passed
  test/net_tests.cpp(266): info: check LookupHost(ipv6_addr + "%0", addr, false) has passed
  test/net_tests.cpp(267): info: check addr.IsValid() has passed
  test/net_tests.cpp(268): info: check addr.IsIPv6() has passed
  test/net_tests.cpp(269): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(270): info: check addr.ToString() == ipv6_addr has passed
  test/net_tests.cpp(274): info: check addr.IsValid() has passed
  test/net_tests.cpp(275): info: check addr.IsTor() has passed
  test/net_tests.cpp(277): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(278): info: check addr.ToString() == "6hzph5hv6337r6p2.onion" has passed
  test/net_tests.cpp(282): info: check !addr.IsValid() has passed
  test/net_tests.cpp(283): info: check addr.IsInternal() has passed
  test/net_tests.cpp(285): info: check !addr.IsBindAny() has passed
  test/net_tests.cpp(286): info: check addr.ToString() == "esffpvrt3wpeaygy.internal" has passed
  test/net_tests.cpp(204): Leaving test case "cnetaddr_basic"; testing time: 32316us
  test/net_tests.cpp(85): Leaving test suite "net_tests"; testing time: 32354us
  Leaving test module "Bitcoin Core Test Suite"; testing time: 32522us

  *** 4 failures are detected in the test module "Bitcoin Core Test Suite"
  ```
  </p></details>

  - leave your review here

ACKs for top commit:
  laanwj:
    ACK f36887fa47

Tree-SHA512: 8e77e512db130642be7d3a910735ca803a2afdb5a704f713f163f8b5a80be3077a2be6f0a3ca43d299731dcd2545ac35571f8c74e5250a72a48233c26f9a3ab5
2020-10-02 17:06:59 +02:00
Wladimir J. van der Laan 597488d37c
Merge #19871: doc: Clarify scope of eviction protection of outbound block-relay peers
d76925478e [doc] Clarify semantic of peer's m_protect w.r.t to outbound eviction logics (Antoine Riard)
ac71fe936d [doc] Clarify scope of eviction protection of outbound block-relay peers (Antoine Riard)

Pull request description:

  Block-relay-only peers were introduced by #15759. According to its
  author, it was intented to make them only immune to outbound peer
  rotation-based eviction and not from all eviction as modified comment
  leans to think of.

  Clearly indicate that outbound block-relay peers aren't protected
  from eviction by the bad/lagging chain logic.

  Fix #19863

ACKs for top commit:
  naumenkogs:
    ACK d76925478e
  jonatack:
    ACK d76925478e

Tree-SHA512: 597fbd62838a6e39276024165b11514cad20a2e9d33cf9202d261cbadcb62b2df427c858e0cb57e585840d4c1d4600104aa53916bb868541f2580e4eed9b4b52
2020-10-02 16:42:38 +02:00
Jon Atack f36887fa47
net: rename CNetAddr scopeId to m_scope_id, improve code doc 2020-10-02 16:42:02 +02:00
Jon Atack 5cb5fd3005
test: add test coverage for CNetAddr ipv6 scoped addresses 2020-10-02 16:40:15 +02:00
Oliver Gugger 64bc5efd39
test: Assert PSBT change type
Make sure the wallet's default change type is respected by default when
funding a PSBT but can be overwritten by the "change_type" option.
2020-10-02 15:48:45 +02:00