Commit Graph

14781 Commits

Author SHA1 Message Date
Homu b62e35dee8 Auto merge of #4994 - str4d:2074-net-misc-1, r=nuttycom
Bitcoin 0.12 misc P2P/Net PRs

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5288
  - Only the reorg, option was removed in bitcoin/bitcoin#6374 which we merged in #1258
- bitcoin/bitcoin#6561
- bitcoin/bitcoin#6728
- bitcoin/bitcoin#6829
- bitcoin/bitcoin#6974
- bitcoin/bitcoin#7075
- bitcoin/bitcoin#7166

Part of #2074.
2021-02-19 15:48:11 +00:00
Homu 89a4ab2ce9 Auto merge of #4993 - therealyingtong:postpone-depends-v4.3.0, r=str4d
Update/postpone dependencies for v4.3.0
2021-02-19 14:24:28 +00:00
Homu f0dcc1dbbe Auto merge of #4958 - zcash:4957_add_foundation_to_responsible_disclosure_list, r=str4d
Add Zcash Foundation to disclosure partners list

Adding the newly-negotiated agreement with the Foundation to our public commitment.
2021-02-19 02:41:49 +00:00
Jack Grigg e1fa80e9b7 Rename responsible_disclosure.md to SECURITY.md
This causes GitHub to provide a link to it on the "new issue" page,
which will direct people who are thinking of opening a normal issue
to read it.
2021-02-18 23:38:32 +00:00
str4d 897356584b
Update URL for Zcash Foundation security policy
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-02-19 12:37:34 +13:00
Homu 65122845c5 Auto merge of #4991 - nuttycom:backport/9792-fastrandom_chacha20, r=str4d
FastRandomContext improvements and switch to ChaCha20

Backport of bitcoin/bitcoin#9792

Commits are recorded here in stack order

- pick bitcoin/bitcoin@4fd2d2fc97
- pick bitcoin/bitcoin@16329224e7
- pick bitcoin/bitcoin@e04326fe66
- pick bitcoin/bitcoin@663fbae777 -- already applied in #3858, skip
- pick bitcoin/bitcoin@c21cbe61c6 -- already applied in #3858, skip
2021-02-18 21:40:41 +00:00
Homu 9d0d8f49a8 Auto merge of #4973 - str4d:bech32-known-answer, r=str4d
test: Convert Bech32 test vectors into known-answer test vectors

This enables other projects to confirm independently that their encoding
or decoding functions are consistent, instead of merely that they are
round-trip correct.
2021-02-18 20:15:58 +00:00
Gregory Maxwell 39cb786fda Disconnect on mempool requests from peers when over the upload limit.
Mempool requests use a fair amount of bandwidth when the mempool is large,
 disconnecting peers using them follows the same logic as disconnecting
 peers fetching historical blocks.
2021-02-18 19:34:58 +00:00
tulip a3bc3c3a57 Move time data log print to 'net' category to reduce log noise 2021-02-18 19:34:58 +00:00
Wladimir J. van der Laan fee9309f37 Always allow getheaders from whitelisted peers
Process `getheaders` messages from whitelisted peers even if we are in
initial block download. Whitelisted peers can always use a node as a
block source.

Also log a debug message when the request is ignored, for
troubleshooting.

Fixes #6971.
2021-02-18 19:03:58 +00:00
Daniel Kraft d620798930 doc: add comment explaining initial header request
Add a comment that explains why the initial "getheader" requests are
made starting from the block preceding the currently best one.

Thanks to sdaftuar for the explanation!
2021-02-18 19:03:58 +00:00
Wladimir J. van der Laan f2c38a528f timedata: Prevent warning overkill
The "please check your computer's data and time" message when the clock
deviates from the network currently generates an overkill of messages:

    orion@lethe:~/bitcoin$ src/bitcoind
    Warning: Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly.

In the log:

    2015-09-27 16:24:13 *** Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly.
    2015-09-27 16:24:13 Warning: Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly.

Remove one level of 'Warning:' and reduce to one log message.
2021-02-18 19:03:58 +00:00
Casey Rodarmor 63a214ad45 Add limitedmap test 2021-02-18 19:03:58 +00:00
Casey Rodarmor b43fc81e79 Disallow unlimited limited maps 2021-02-18 19:03:58 +00:00
Casey Rodarmor 4a51753b00 Make limited map actually respect max size 2021-02-18 19:03:58 +00:00
Josh Lehan d3a2f120f5 Re-organize -maxconnections option handling
Zcash: Was "Added -whiteconnections=<n> option" from bitcoin/bitcoin#5288. The
option was later removed in bitcoin/bitcoin#6374 which we merged in #1258. This
commit contains the difference between the two.
2021-02-18 19:03:58 +00:00
Homu e83ecc1dcb Auto merge of #4972 - LarryRuane:remove-PartitionCheck, r=str4d
Remove bad chain alert partition check

(cherry picked from https://github.com/bitcoin/bitcoin/pull/8275 commit ab8be98fdb25b678a8cd7e89adf06d1b1f6bdd62), original commit message:

As per meeting 2016-03-31
https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts

The partition checker was producing huge number of false-positives
and was disabled in 0.12.1 on the understanding it would either be
fixed in 0.13 or removed entirely from master if not.
2021-02-18 18:46:40 +00:00
Homu 1d378b1eb0 Auto merge of #2816 - str4d:2074-maxuploadtarget, r=str4d
Introduce -maxuploadtarget

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6622
- bitcoin/bitcoin#6987
- bitcoin/bitcoin#6958
- bitcoin/bitcoin#6984
- bitcoin/bitcoin#6999

Part of #2074.
2021-02-18 17:51:10 +00:00
Homu 6f04751c49 Auto merge of #4986 - str4d:zcash-script-precompute, r=str4d
zcash_script: Add API to verify scripts with precomputed tx data

This enables users of libzcash_script to more efficiently verify transactions with multiple inputs.

Closes zcash/zcash#4876.
2021-02-18 15:59:11 +00:00
therealyingtong eb351e485b Postpone dependencies 2021-02-18 20:50:39 +08:00
therealyingtong cb50c0a083 Cargo update 2021-02-18 20:02:36 +08:00
Kris Nuttycombe 676d302008 Update the maxuploadtarget.py tests to accommodate zcash.
Co-authored-by: str4d <thestr4d@gmail.com>
2021-02-17 17:00:18 -07:00
Jack Grigg a24f5b7bb4 zcash_script: Clarify return values in docs 2021-02-17 23:50:50 +00:00
Homu c8ed917ec6 Auto merge of #4989 - nuttycom:cleanup/chainparams_whitespace, r=str4d
Whitespace-only fix in chainparams.cpp

Fix a trivial annoyance.
2021-02-17 22:59:23 +00:00
Pieter Wuille 1f41301c97 Add a FastRandomContext::randrange and use it
(cherry picked from commit 4fd2d2fc97e21efceab849576e544160fd5e3e3d)
2021-02-17 15:43:43 -07:00
Pieter Wuille 12d8d06c80 Switch FastRandomContext to ChaCha20
(cherry picked from commit 16329224e70d0525208f6b0ba00c5e1531a4f5ea)
2021-02-17 15:43:43 -07:00
Pieter Wuille 89ab5b1eb6 Add ChaCha20
(cherry picked from commit e04326fe6652543dc26d90eba4a48fbdc935fd0c)
2021-02-17 15:43:43 -07:00
Homu cd00fb08d5 Auto merge of #4990 - nuttycom:backport/7888_prevector_bugs, r=nuttycom
Fix prevector bugs.

Backports:

bitcoin/bitcoin#7888
bitcoin/bitcoin#8671

Commits below are listed in stack order.

pick bitcoin/bitcoin@f71d4a3
pick bitcoin/bitcoin@a7af72a
pick bitcoin/bitcoin@4ed41a2
pick bitcoin/bitcoin@1e2c29f
2021-02-17 21:11:03 +00:00
Jack Grigg 1eb7bbc6be Fix some typos 2021-02-17 13:35:11 -07:00
Jack Grigg 51ae7a0ae5 init: Pass post-Blossom spacing into CNode::SetMaxOutboundTarget() 2021-02-17 13:35:11 -07:00
Jack Grigg 0f66b1e138 Pass current PoWTargetSpacing() into CNode::OutboundTargetReached() 2021-02-17 13:35:00 -07:00
Jack Grigg 2f24abe457 test: Migrate maxuploadtarget.py to Python 3 2021-02-17 13:35:00 -07:00
Jonas Schnelli 69ca2dde56 add (max)uploadtarget infos to getnettotals RPC help
Zcash: Update recommended minimum -maxuploadtarget
2021-02-17 13:34:49 -07:00
Jonas Schnelli 97e9a8162f add documentation for exluding whitelistes peer from maxuploadtarget 2021-02-17 13:34:49 -07:00
Jonas Schnelli 2f81b408c5 [docs] rename reducetraffic.md to reduce-traffic.md 2021-02-17 13:34:49 -07:00
Jonas Schnelli 385719c632 don't enforce maxuploadtargets disconnect for whitelisted peers 2021-02-17 13:34:41 -07:00
MarcoFalke 81adf52277 [doc] Add -maxuploadtarget release notes 2021-02-17 19:23:38 +00:00
MarcoFalke 72fbeae94e [net] Cleanup maxuploadtarget
* log: nMaxOutboundLimit is in bytes
* log: Hide misleading -maxuploadtarget=0 warning
* qa : Minor cleanup to maxuploadtarget rpc tests
* net: Use DEFAULT_MAX_UPLOAD_TARGET = 0
2021-02-17 19:23:38 +00:00
fanquake 2a10fcd083 [doc] Improve lanaguge in reducetraffic.md 2021-02-17 19:23:38 +00:00
Jonas Schnelli 4212d1c96d [doc] add documentation how to reduce traffic 2021-02-17 19:23:38 +00:00
Suhas Daftuar a0ca4116c1 Add RPC test for -maxuploadtarget 2021-02-17 19:23:38 +00:00
Jonas Schnelli 1a85cc8817 Introduce -maxuploadtarget
* -maxuploadtarget can be set in MiB
* if <limit> - ( time-left-in-24h-cycle / 600 * MAX_BLOCK_SIZE ) has reach, stop serve blocks older than one week and filtered blocks
* no action if limit has reached, no guarantee that the target will not be  surpassed
* add outbound limit informations to rpc getnettotals

Zcash: Also includes a cleanup from bitcoin/bitcoin#5697
2021-02-17 19:23:35 +00:00
Kris Nuttycombe 6c656ab13d Whitespace-only fix in chainparams.cpp
Fix a trivial annoyance.
2021-02-17 12:13:45 -07:00
Jeremy Rubin 372ed59e9c Minimal fix to slow prevector tests as stopgap measure
(cherry picked from commit f71d4a3786611d564e4c239099501daee989b170)
2021-02-17 10:56:59 -07:00
Kaz Wesley 7fb3a610f1 prevector::swap: fix (unreached) data corruption
swap was using an incorrect condition to determine when to apply an optimization
(not swapping the full direct[] when swapping two indirect prevectors).

Rather than correct the optimization I'm removing it for simplicity. Removing
this optimization minutely improves performance in the typical (currently only)
usage of member swap(), which is swapping with a freshly value-initialized
object.

(cherry picked from commit a7af72a697a8decab364792230153f114be3919c)
2021-02-17 10:56:59 -07:00
Kaz Wesley 6e582e2792 test prevector::swap
- add a swap operation to prevector tests (fails due to broken prevector::swap)
- fix 2 prevector test operation conditions that were impossible

(cherry picked from commit 4ed41a2b611dfd328fe6f72312d6c596650f03f8)
2021-02-17 10:56:59 -07:00
Kaz Wesley d5844a45d5 prevector: destroy elements only via erase()
Fixes a bug in which pop_back did not call the deleted item's destructor.

Using the most general erase() implementation to implement all the others
prevents similar bugs because the coupling between deallocation and destructor
invocation only needs to be maintained in one place.
Also reduces duplication of complex memmove logic.

(cherry picked from commit 1e2c29f2632c378843c5a3c9ad401a7bcacc4de0)
2021-02-17 10:56:59 -07:00
Homu b4b07a1bbd Auto merge of #2812 - str4d:2074-store-banlist, r=nuttycom
banlist.dat: store banlist on disk

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6310
- bitcoin/bitcoin#6315
  - Only the new signal and net changes, no QT.
- bitcoin/bitcoin#7350
- bitcoin/bitcoin#7458
- bitcoin/bitcoin#7696
- bitcoin/bitcoin#7959
- bitcoin/bitcoin#7906
  - Only the ban-related commits.
- bitcoin/bitcoin#8392
  - Only the second commit.
- bitcoin/bitcoin#8085
  - Only the second commit.
- bitcoin/bitcoin#10564
- bitcoin/bitcoin#13061
  - Wasn't needed when I first made this backport in 2017, but it is now!

Part of #2074.
2021-02-17 17:33:19 +00:00
Homu 89d9e557e1 Auto merge of #4985 - zcash:backport/8173-siphash_node_eviction, r=str4d
Use SipHash for node eviction

Backport of bitcoin/bitcoin#8173

Commits are listed in stack order.

- pick bitcoin/bitcoin@eebc232187
- pick bitcoin/bitcoin@888483098e
- pick bitcoin/bitcoin@c31b24f745
- pick bitcoin/bitcoin@9bf156bb9e
- pick bitcoin/bitcoin@053930ffc4
   - missing bitcoin/bitcoin#5697 (not a candidate for direct inclusion), using pieces directly
   - conflicts with zcash/zcash#1258 which it removes part of (this is ok)
      - ignore bitcoin/bitcoin#6374
      - requires bitcoin/bitcoin#7906, or at least bitcoin/bitcoin@cca221fd21
         - pick bitcoin/bitcoin@cca221fd21
   - conflicts with bitcoin/bitcoin#7181, not needed until later if at all
2021-02-17 16:39:15 +00:00
Wladimir J. van der Laan 2f840b55c0 test: Add more test vectors for siphash
Add full test vectors from spec, test per byte and per 8 bytes.

Builds on #8086.
2021-02-17 08:07:00 -07:00