Commit Graph

26596 Commits

Author SHA1 Message Date
W. J. van der Laan
bf672ce25a build: Bump version to 0.21.2rc1
Tree-SHA512: 73d4df24ad516ca54ab23bcbd686223447a208904bb18a7a34400daab6d4b07322a7f244504547c772ede08b9e8606291df9d101236d8fd6debcb43563d069ac
2021-08-11 12:08:43 +02:00
MarcoFalke
4b523c8f0a Merge bitcoin/bitcoin#22569: [0.21] Rate limit the processing of rumoured addresses
2a57108051 Avoid Appveyor compilation failure (Pieter Wuille)
a653aacbd6 Add logging and addr rate limiting statistics (Pieter Wuille)
aaa4833fc9 Functional tests for addr rate limiting (Pieter Wuille)
8df3e5bd84 Randomize the order of addr processing (Pieter Wuille)
83dfe6c65e Rate limit the processing of incoming addr messages (Pieter Wuille)

Pull request description:

  Backport of #22387.

  The rate at which IP addresses are rumoured (through ADDR and ADDRV2 messages) on the network seems to vary from 0 for some non-participating nodes, to 0.005-0.025 addr/s for recent Bitcoin Core nodes. However, the current codebase will happily accept and process an effectively unbounded rate from attackers. There are measures to limit the influence attackers can have on the addrman database (bucket restrictions based on source IPs), but still - there is no need to permit them to feed us addresses at a rate that's orders of magnitude larger than what is common on the network today, especially as it will cause us to spam our peers too.

  This PR implements a [token bucket](https://en.wikipedia.org/wiki/Token_bucket) based rate limiter, allowing an average of 0.1 addr/s per connection, with bursts up to 1000 addresses at once. Whitelisted peers as well as responses to GETADDR requests are exempt from the limit. New connections start with 1 token, so as to not interfere with the common practice of peers' self-announcement.

  Due to the lack of the `Peer` struct in 0.21, the relevant fields have been added to `CNodeState` instead, necessitating additional locks, and slightly different structure to avoid too much `cs_main` grabbing. The last test-improving commit has also been dropped, as the code has changed too much. Most of the behavior is still tested however, just not the part that compares with RPC statistics.

ACKs for top commit:
  achow101:
    ACK 2a57108051
  GeneFerneau:
    Approach + code review ACK [2a57108](2a57108051)
  jnewbery:
    reACK 2a57108051

Tree-SHA512: ecf4891ac6173d732aa40b4d05fc0dce94127a613cb9051bf6188a2f95824f8234b17d386dd0b352ddf3d352202cc2ff07915ae35657d8e64907e3f80703d1d9
2021-08-06 19:46:04 +02:00
Pieter Wuille
2a57108051 Avoid Appveyor compilation failure 2021-08-05 09:48:25 -07:00
Pieter Wuille
a653aacbd6 Add logging and addr rate limiting statistics
Includes logging improvements by Vasil Dimov and John Newbery.

Github-Pull: #22387
Rebased-From: f424d601e1
2021-08-05 09:40:04 -07:00
Pieter Wuille
aaa4833fc9 Functional tests for addr rate limiting
Github-Pull: #22387
Rebased-From: b4ece8a1cd
2021-08-05 09:40:04 -07:00
Pieter Wuille
8df3e5bd84 Randomize the order of addr processing
Github-Pull: #22387
Rebased-From: 5648138f59
2021-08-05 09:40:04 -07:00
Pieter Wuille
83dfe6c65e Rate limit the processing of incoming addr messages
While limitations on the influence of attackers on addrman already
exist (affected buckets are restricted to a subset based on incoming
IP / network group), there is no reason to permit them to let them
feed us addresses at more than a multiple of the normal network
rate.

This commit introduces a "token bucket" rate limiter for the
processing of addresses in incoming ADDR and ADDRV2 messages.
Every connection gets an associated token bucket. Processing an
address in an ADDR or ADDRV2 message from non-whitelisted peers
consumes a token from the bucket. If the bucket is empty, the
address is ignored (it is not forwarded or processed). The token
counter increases at a rate of 0.1 tokens per second, and will
accrue up to a maximum of 1000 tokens (the maximum we accept in a
single ADDR or ADDRV2). When a GETADDR is sent to a peer, it
immediately gets 1000 additional tokens, as we actively desire many
addresses from such peers (this may temporarily cause the token
count to exceed 1000).

The rate limit of 0.1 addr/s was chosen based on observation of
honest nodes on the network. Activity in general from most nodes
is either 0, or up to a maximum around 0.025 addr/s for recent
Bitcoin Core nodes. A few (self-identified, through subver) crawler
nodes occasionally exceed 0.1 addr/s.

Github-Pull: #22387
Rebased-From: 0d64b8f709
2021-08-05 09:40:00 -07:00
MarcoFalke
068ac69b56 Merge bitcoin/bitcoin#22578: [0.21] Additional backports
55e941f5df test: Fix intermittent feature_taproot issue (MarcoFalke)
681f728a35 ci: Build with --enable-werror by default, and document exceptions (Hennadii Stepanov)
89426c43fb ci: Fix macOS brew install command (Hennadii Stepanov)

Pull request description:

  This backports a few changes to fix CI failures we are seeing with the 0.21 branch.

  Backports #21663, this might be the easiest way to fix the macOS CI failures we're seeing. i.e in #22569. The underlying issue is that the older CI images are using a version of brew that without running `brew update` first, is trying to download packages like Boost, from bintray (which no-longer works).

  This also includes #20182, as by fixing macOS failure, via running `brew upgrade`, we end up using a newer version of miniupnpc, which emits a GNU extension related warning, and causes the build to fail, because we use `-Werror`.

  Backporting #20535 should fix #22581.

ACKs for top commit:
  hebasto:
    ACK 55e941f5df, I verified changes by backporting locally.

Tree-SHA512: 3ab2c5c73c707d0f5b862264f3a0179cdeee30ae55aae872f3c3e0bb81d71a5027c39ba830210c99a21f98cc86c4167c4f215e24d1a8891ec79ce512debf82df
2021-07-30 09:15:14 +02:00
fanquake
52778f4245 Merge bitcoin/bitcoin#22580: [0.21] Backport: Reset scantxoutset progress before inferring descriptors
080b47d9ce rpc: reset scantxoutset progress on finish (Pavol Rusnak)

Pull request description:

  Backport of #19362.

ACKs for top commit:
  achow101:
    Code Review ACK 080b47d9ce

Tree-SHA512: 1f58965393663bfc0796fc06ef846bc87521d04d79c2a62227acf4d466de649db7d244c8992a32aa1086e6bf0ac92fb8a5aeadf4673441fefa505e40c02d5daf
2021-07-30 10:22:08 +08:00
MarcoFalke
55e941f5df test: Fix intermittent feature_taproot issue
Github-Pull: #20535
Rebased-From: fa275e1539
2021-07-29 20:25:28 +08:00
Hennadii Stepanov
681f728a35 ci: Build with --enable-werror by default, and document exceptions
Github-Pull: #20182
Rebased-From: 2f6fe4e4e9
2021-07-29 20:25:03 +08:00
Hennadii Stepanov
89426c43fb ci: Fix macOS brew install command
Details: https://github.com/Homebrew/discussions/discussions/691

Github-Pull: #21663
Rebased-From: b7381552cd
2021-07-29 16:52:15 +08:00
Pavol Rusnak
080b47d9ce rpc: reset scantxoutset progress on finish
Github-Pull: #19362
Rebased-From: 8c4129b454
2021-07-29 16:02:26 +08:00
fanquake
997e528a34 Merge bitcoin/bitcoin#22427: [0.21] gui: Backports for 0.21.2
e3f1da4bf3 qt: Draw "eye" sign at the beginning of watch-only addresses (Hennadii Stepanov)
6ca54ce2ae qt: Do not extend recent transaction width to address/label string (Hennadii Stepanov)
f220368220 qt: Do not use QClipboard::Selection on Windows and macOS. (Hennadii Stepanov)

Pull request description:

  Backports https://github.com/bitcoin-core/gui/pull/277, https://github.com/bitcoin-core/gui/pull/365.

ACKs for top commit:
  fanquake:
    ACK e3f1da4bf3
  jarolrod:
    ACK e3f1da4bf3

Tree-SHA512: 43cc2ac48f4e5014bfdbe86cc904bb36d2be9fcd257f0fc0800c384bd727bb98466723e450a8909b06708784ad91184be599c49cf60de2e4377202774cb878f6
2021-07-29 11:20:57 +08:00
Hennadii Stepanov
e3f1da4bf3 qt: Draw "eye" sign at the beginning of watch-only addresses
Github-Pull: bitcoin-core/gui#365
Rebased-From: cd46c11577
2021-07-11 12:03:33 +03:00
Hennadii Stepanov
6ca54ce2ae qt: Do not extend recent transaction width to address/label string
Github-Pull: bitcoin-core/gui#365
Rebased-From: 9ea1da6fc9
2021-07-11 12:03:12 +03:00
Hennadii Stepanov
f220368220 qt: Do not use QClipboard::Selection on Windows and macOS.
Windows and macOS do not support the global mouse selection.

Github-Pull: bitcoin-core/gui#277
Rebased-From: 7f3a5980c1
2021-07-11 12:03:11 +03:00
fanquake
bd2f4164c6 Merge bitcoin/bitcoin#22366: [0.21] fuzz: add missing ECCVerifyHandle to base_encode_decode
da816247f0 util: Properly handle -noincludeconf on command line (MarcoFalke)
513613d8a8 Cleanup -includeconf error message (MarcoFalke)
70eac6fcd0 Fix crash when parsing command line with -noincludeconf=0 (MarcoFalke)
c5357fa415 fuzz: add missing ECCVerifyHandle to base_encode_decode (Andrew Poelstra)

Pull request description:

  Backports #22279, #22002 and #22137 to fix fuzzing issues in the 0.21 branch: https://github.com/bitcoin/bitcoin/runs/2864012729.

ACKs for top commit:
  achow101:
    ACK da816247f0

Tree-SHA512: ab8751387e42e03ff43594ae34be8ed0dba903d7da1aaecb9f19c08366570d8995abe89ba0c9bafe37662940f3e83bef1e9e50f330e86114cd6a773becd1fd21
2021-07-08 11:52:07 +08:00
MarcoFalke
4c29b63cfb Merge bitcoin/bitcoin#22255: [0.21] wallet: Do not iterate a directory if having an error while accessing it
7b0b201d10 wallet: Do not iterate a directory if having an error while accessing it (Hennadii Stepanov)

Pull request description:

  This change prevents infinite looping for, for example, system folders
  on Windows.

  Github-Pull: #21907
  Rebased-From: 29c9e2c2d2

  Note: Trivial backport, but in a differently-named function in another file

ACKs for top commit:
  hebasto:
    ACK 7b0b201d10, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: d41ab267250e8bfd9289cacf1fd804cc1a3bb20fc479dc9da5a69ebf26530b552b11b2ee6b11e17a1c146ca792ee65bd64eeb2269fa5e73a70361da8a2a09925
2021-07-01 08:35:53 +02:00
MarcoFalke
da816247f0 util: Properly handle -noincludeconf on command line
This bug was introduced in commit
fad0867d6a.

Unit test
Co-Authored-By: Russell Yanofsky <russ@yanofsky.org>

Github-Pull: #22137
Rebased-From: fa910b4765
2021-06-30 10:39:33 +08:00
MarcoFalke
513613d8a8 Cleanup -includeconf error message
Remove the erroneous trailing newline '\n'. Also, print only the first
value to remove needless redundancy in the error message.

Github-Pull: #22002
Rebased-From: fad0867d6a
2021-06-30 10:23:54 +08:00
MarcoFalke
70eac6fcd0 Fix crash when parsing command line with -noincludeconf=0
Github-Pull: #22002
Rebased-From: fa9f711c37
2021-06-30 10:23:51 +08:00
Andrew Poelstra
c5357fa415 fuzz: add missing ECCVerifyHandle to base_encode_decode
GitHub Pull: #22279
Rebased-From: 906d791311
2021-06-29 11:03:27 +08:00
MarcoFalke
926f76cb20 Merge bitcoin/bitcoin#22191: [0.21] gitian: Use custom MacOS code signing tool
0fe60a84ae Use latest signapple commit (Andrew Chow)
5313d6aed2 gitian: Remove codesign_allocate and pagestuff from MacOS build (Andrew Chow)
27d691b6b5 gitian: use signapple to create the MacOS code signature (Andrew Chow)
2f33e339a8 gitian: use signapple to apply the MacOS code signature (Andrew Chow)
65ce833042 gitian: install signapple in gitian-osx-signer.yml (Andrew Chow)

Pull request description:

  Backport of #20880 and #22190

ACKs for top commit:
  MarcoFalke:
    cherry-pick-only ACK 0fe60a84ae 🍀

Tree-SHA512: e864048fab02a1857161602dd53abba552ca3f859c133a47a5e62c28d3e4de9cd099bce86123a1b5892042b09f51cc1ddd2ed1b0c71bfba162710eaee3f5bf91
2021-06-19 09:50:11 +02:00
Hennadii Stepanov
7b0b201d10 wallet: Do not iterate a directory if having an error while accessing it
This change prevents infinite looping for, for example, system folders
on Windows.

Github-Pull: #21907
Rebased-From: 29c9e2c2d2
2021-06-15 19:02:45 +00:00
Andrew Chow
0fe60a84ae Use latest signapple commit
Update gitian and guix to use the same latest signapple commit

Github-Pull: #22190
Rebased-From: 683d197970
2021-06-08 17:04:36 -04:00
Andrew Chow
5313d6aed2 gitian: Remove codesign_allocate and pagestuff from MacOS build
Github-Pull: #20880
Rebased-From: 2c403279e2
2021-06-08 16:58:40 -04:00
Andrew Chow
27d691b6b5 gitian: use signapple to create the MacOS code signature
Github-Pull: #20880
Rebased-From: f55eed2514
2021-06-08 16:57:32 -04:00
Andrew Chow
2f33e339a8 gitian: use signapple to apply the MacOS code signature
Github-Pull: #20880
Rebased-From: 95b06d2185
2021-06-08 16:57:28 -04:00
Andrew Chow
65ce833042 gitian: install signapple in gitian-osx-signer.yml
Github-Pull: #20880
Rebased-From: 42bb1ea363
2021-06-08 16:56:08 -04:00
fanquake
419f9b3b3b Merge bitcoin/bitcoin#22022: Final backports for 0.21.2rc1
09620b89f5 Update Windows code signing certificate (Andrew Chow)
46320ba72f Remove user input from URI error message (unknown)
f2a88986a1 p2p, bugfix: use NetPermissions::HasFlag() in CConnman::Bind() (Jon Atack)

Pull request description:

ACKs for top commit:
  achow101:
    ACK 09620b89f5 Diffs match.
  hebasto:
    ACK 09620b89f5, tested https://github.com/bitcoin-core/gui/pull/280 behavior.
  fanquake:
    ACK 09620b89f5

Tree-SHA512: 1c4aaec42ea047261b5d30851bca605540eccf572708403335b38016127d3230b5380b3f5ef03921ed62192239b0d3da9787d51f557ed7911bf6bb2a7c172753
2021-05-31 15:31:31 +08:00
Andrew Chow
09620b89f5 Update Windows code signing certificate
Github-Pull: bitcoin/bitcoin#22017
Rebased-From: 167fb1fc72
2021-05-22 10:45:21 +02:00
unknown
46320ba72f Remove user input from URI error message
+ Detailed error messages for invalid address
+ Used `IsValidDestination` instead of `IsValidDestinationString`
+ Referred to https://github.com/bitcoin/bitcoin/pull/20832 for solution

Github-Pull: bitcoin-core/gui#280
Rebased-From: 3bad0b3fad
2021-05-22 10:45:20 +02:00
Jon Atack
f2a88986a1 p2p, bugfix: use NetPermissions::HasFlag() in CConnman::Bind()
PF_NOBAN is a multi-flag that includes PF_DOWNLOAD, so the conditional
in CConnman::Bind() using a bitwise AND will return the same result
for both the "noban" status and the "download" status.

Example:

`PF_DOWNLOAD` is `0b1000000`
`PF_NOBAN`    is `0b1010000`

This makes a check like `flags & PF_NOBAN` return `true` even if `flags`
is equal to `PF_DOWNLOAD`.

If `-whitebind=download@1.1.1.1:8765` is specified, then `1.1.1.1:8765`
should be added to the list of local addresses. We only want to avoid
adding to local addresses (that are advertised) a whitebind that has a
`noban@` flag.

As a result of a mis-check in `CConnman::Bind()` we would not have added
`1.1.1.1:8765` to the local addresses in the example above.

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: bitcoin/bitcoin#21644
Rebased-From: dde69f20a0
2021-05-22 09:58:26 +02:00
W. J. van der Laan
58c0742632 Merge bitcoin/bitcoin#21932: [0.21] depends: update Qt 5.9 source url
deff4e763e depends: update Qt 5.9 source url (Kittywhiskers Van Gogh)

Pull request description:

  ## Expected Behavior

  Running `make` in the depends directory should result in the successful building of host platform dependencies

  ## Actual Behavior

  `make` terminates as `qt.mk` points to (now) outdated URL path for Qt 5.9 sources, returning error 404

  ## Remedy

  Update `qt.mk` to point to updated source location as Qt has relocated them

ACKs for top commit:
  RandyMcMillan:
    tACK deff4e7
  hebasto:
    ACK deff4e763e, I have verified the new link, and checked that old one is unavailable:
  jarolrod:
    tACK deff4e763e

Tree-SHA512: d5b11a678c871a87e6884a35641178ee349728ead51da06018953be36aab5a30aef9c80b549da49802e87903eb0b7836cc343301325bd8c505cb4246f6752505
2021-05-13 13:43:35 +02:00
Kittywhiskers Van Gogh
deff4e763e depends: update Qt 5.9 source url 2021-05-12 22:35:32 +05:30
W. J. van der Laan
8584a4460d doc: Archive and clean out release notes post-0.21.1
Tree-SHA512: 0ae93cb9dae1449318913a7a6f32c233aefddf77335dc1ad416e84beab39ab45cd863073ddc69a243bbb704951d99646f734717f71d9599a54592699f15d84ab
2021-05-05 16:18:38 +02:00
MarcoFalke
bbd89d23b3 Merge bitcoin/bitcoin#21860: [0.21] Backport update to Boost download URL
856de5bd5e build,boost: update download url. (fdov)

Pull request description:

  Backports #21662 to the 0.21 branch. Boost has migrated it's download URLs due to bintrays imminent closure. The Boost site has also been updated to point to the new URLs. i.e: https://www.boost.org/users/history/version_1_70_0.html.

  Github-Pull: #21662
  Rebased-From: 36c10b9f4b

ACKs for top commit:
  jarolrod:
    ACK 856de5bd5e

Tree-SHA512: cae7262f963dd6e00af699c3e1bce2ee3ff9f76c5dcc24c8a5bf37025b53de28e4cb80de65a380208ee1841a89736d5c35605e40b728b6c7a9f026d8165d74c8
2021-05-05 08:54:13 +02:00
fdov
856de5bd5e build,boost: update download url.
- bintray is closing.
    - updated to jfrog.io.

Github-Pull: #21662
Rebased-From: 36c10b9f4b
2021-05-05 09:41:09 +08:00
W. J. van der Laan
194b9b8792 build: Bump RC to 0 (-final)
Tree-SHA512: b63d8c2514fa34d4503da8a37fb42948e03610e06dae6aaef7ba3d2568efd3bb138e7510da569a49d83c2618fa697ba949d55880fc2884a75a87028259d7c544
v0.21.1
2021-04-29 21:31:20 +02:00
W. J. van der Laan
d97d0d31a6 doc: Merge release notes fragment, merge taproot description from wiki
Co-authored-by: David A. Harding <dave@dtrt.org>
Co-authored-by: Jon Atack <jon@atack.com>
Co-authored-by: Pieter Wuille <pieter@wuille.net>

Tree-SHA512: dd9ac416ff22276833111198445d76cf8417012a6faad0c3560276f1dcf24586ff41c65ac3430fbf1e840aaa563d3dd101671cff306b0fd92aa2ee03bb7f926b
2021-04-22 22:13:28 +02:00
W. J. van der Laan
5577e0a486 doc: Add PR and author list to release notes for 0.21.1
Tree-SHA512: c74b12dee645bd8d3dcff8d572a82369ea0895339d0d12e5360182421fa8cef4d3eba309ff7668e97dc24cd6afc800ab9ceb4eca5458085acf12c368f6c2f859
2021-04-19 06:01:38 +02:00
W. J. van der Laan
329eafa7f4 doc: Regenerate manual pages for 0.21.1rc1
Tree-SHA512: cc9cd502dc40d89f34b1b043e96df180f0e16ba7c6e039866b349d19aff582d1c4b4ab8e8960b4f427d72ad5f97c7c1e8fec3f2e008a0107dea33a2c8f13febc
v0.21.1rc1
2021-04-16 13:41:41 +02:00
W. J. van der Laan
e85dfdbf31 build: Bump version to 0.21.1rc1 2021-04-16 13:23:58 +02:00
W. J. van der Laan
ab20518191 gui: Pre-rc1 translations update
Tree-SHA512: 6978293bda56b0cb1370f3ddf201477a2f12e0b8c9462d3f4703b837d9be4be65142a5e97c4a473fb9fa90edd83dba8a98ea3b0ecc335062868d1e6c550241b2
2021-04-16 13:21:07 +02:00
fanquake
f8bbee425e Merge #21614: [0.21] test: Backports
b8af67eeef fuzz: cleanups for versionbits fuzzer (Anthony Towns)
79cdb4a198 test: make sure non-IP peers get discouraged and disconnected (Vasil Dimov)
b765f41164 test: also check disconnect in denialofservice_tests/peer_discouragement (Vasil Dimov)
dfeb6c10bb test: use pointers in denialofservice_tests/peer_discouragement (Vasil Dimov)

Pull request description:

  Backport tests

ACKs for top commit:
  vasild:
    ACK b8af67eeef
  jnewbery:
    ACK b8af67eeef
  ajtowns:
    ACK b8af67eeef ; visually compared individual commits to originals, checked original commits are in master

Tree-SHA512: 22f665560f9d452993b12508d93d93ff54e3e91dcf39f731e27aedfb891570168066c185413d455bee4fa082c011b65ea1b0eee51e3633392b07a0db008d51c8
2021-04-16 17:57:18 +08:00
Anthony Towns
b8af67eeef fuzz: cleanups for versionbits fuzzer
Github-Pull: #21489
Rebased-From: aa7f418fe3
2021-04-16 11:21:02 +02:00
Vasil Dimov
79cdb4a198 test: make sure non-IP peers get discouraged and disconnected
Github-Pull: #21571
Rebased-From: 81747b2171
2021-04-16 11:20:04 +02:00
Vasil Dimov
b765f41164 test: also check disconnect in denialofservice_tests/peer_discouragement
Use `CConnmanTest` instead of `CConnman` and add the nodes to it
so that their `fDisconnect` flag is set during disconnection.

Github-Pull: #21571
Rebased-From: 637bb6da36
2021-04-16 11:20:04 +02:00
Vasil Dimov
dfeb6c10bb test: use pointers in denialofservice_tests/peer_discouragement
This is a non-functional change that replaces the `CNode` on-stack
variables with `CNode` pointers.

The reason for this is that it would allow us to add those `CNode`s
to `CConnman::vNodes[]` which in turn would allow us to check that they
are disconnected properly - a `CNode` object must be in
`CConnman::vNodes[]` in order for its `fDisconnect` flag to be set.

If we store pointers to the on-stack variables in `CConnman` then it
would crash at the end, trying to `delete` them.

Github-Pull: #21571
Rebased-From: 4d6e246fa4
2021-04-16 11:20:04 +02:00