Commit Graph

981 Commits

Author SHA1 Message Date
Wladimir J. van der Laan 25e125a5d3 Move mempool rejections to new debug category
Move mempool rejections to debug category `mempoolrej`, to make it possible
to show them without enabling the entire category `mempool` which is
high volume.

(cherry picked from commit bitcoin/bitcoin@7f1f8f5edf)
2021-08-13 16:24:09 +01:00
Jack Grigg c173a26a2d Revert "Remove reference to -reindex-chainstate"
This reverts commit f42cde3c30.
2021-08-09 20:58:49 +01:00
Pieter Wuille d6d39449e5 Add -reindex-chainstate that does not rebuild block index
(cherry picked from commit d3d75479115bc3480f163df774ee9dd2f8bd9f54)
2021-08-09 20:58:49 +01:00
Pieter Wuille e967b56fbe Switch reindexing to AcceptBlock in-loop and ActivateBestChain afterwards
(cherry picked from commit 316623f2c197971db9b5bcb9c84e446254b552c3)
2021-08-09 20:58:49 +01:00
Jack Grigg 990bc46b2b Use a visitor for handling -mineraddress config option
This makes it easier to add UA support.
2021-07-13 03:21:54 +01:00
Jack Grigg 9ad5b75b30 rust: Load Orchard circuit parameters at startup 2021-06-21 18:33:57 +01:00
Chun Kuan Lee abd0471696 windows: Call SetProcessDEPPolicy directly
(cherry picked from commit d8a299206780b38959d732cbe40ba1dd25834f0e)
2021-06-05 14:49:02 +01:00
Karl-Johan Alm 5d6fa863b3 Refactor: Remove using namespace <xxx> from src/*.cpp.
(cherry picked from commit b7b48c8bbdf7a90861610b035d8b0a247ef78c45)

Zcash: Excluding changes to code we haven't backported yet that cause
too many conflicts.
2021-04-02 16:04:55 +13:00
Homu ba4eb241e7 Auto merge of #4996 - str4d:2074-net-blocksonly, r=str4d
Add -blocksonly option

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6993
- bitcoin/bitcoin#7046
- bitcoin/bitcoin#6780
  - The third commit (we backported the rest in #2390).
- bitcoin/bitcoin#7126
- bitcoin/bitcoin#7439
- bitcoin/bitcoin#15990
  - Only the `-blocksonly` documentation changes.
- bitcoin/bitcoin#16555
- bitcoin/bitcoin#18391
  - Only the `-blocksonly` documentation changes.

Part of #2074.
2021-03-31 11:27:22 +00:00
glowang 49d420f808 Update -blocksonly documentation
When -blocksonly is set to 1, it interacts with the -walletbroadcast
parameter and sets it to 0 if it has not been set already.This behavior
is not captured by the current documentation, which claims that -blocksonly
does not impact any wallet transactions.

(cherry picked from commit 621e86ee8d0102e2bf41f7656a368083b89b2f83)

Zcash: Excludes max-peer doc changes, since we don't have
block-relay-only peers yet.
2021-04-01 00:24:19 +13:00
Sjors Provoost c6fbc477dd [doc] mention whitelist is inbound, and applies to blocksonly
(cherry picked from commit 20ea9ef6ce9228a5258b99eeeeb40e6dfae2299f)
2021-04-01 00:17:02 +13:00
MarcoFalke 8dd2c02a3a doc: Mention blocksonly in reduce-traffic.md, unhide option
(cherry picked from commit fa8ced32a60dea37ac169241cf9a1f708ef46c4b)

Zcash: Only the documentation changes.
2021-04-01 00:13:49 +13:00
Jack Grigg d08cdbe5f7 metrics: Implement IP access control on Prometheus scrape endpoint 2021-03-30 15:12:08 +13:00
str4d dde7546091 Clean up comment
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 15:12:08 +13:00
str4d d0f468e1ce Add security warnings for -prometheusmetrics option
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-03-30 15:12:08 +13:00
Jack Grigg 1c2c8fed2e metrics: Expose binary metadata 2021-03-30 15:12:08 +13:00
Jack Grigg a79ffa3b50 rust: Add a Prometheus metrics exporter
The -prometheusmetrics=host_name:port config option enables the metrics
exporter.
2021-03-30 15:12:07 +13:00
Gregory Maxwell 9e67ec66a2 Blacklist -whitelistalwaysrelay; replaced by -whitelistrelay.
Zcash: just a comment fix, no need to blacklist as -whitelistalwaysrelay
will never have been active.
(cherry picked from commit 89d113e02a83617b4e971c160d47551476dacc71)
2021-02-22 18:29:12 -07:00
Gregory Maxwell c411af61e7 Add whitelistforcerelay to control forced relaying.
Also renames whitelistalwaysrelay.

Nodes relay all transactions from whitelisted peers, this
 gets in the way of some useful reasons for whitelisting
 peers-- for example, bypassing bandwidth limitations.

The purpose of this forced relaying is for specialized gateway
 applications where a node is being used as a P2P connection
 filter and multiplexer, but where you don't want it getting
 in the way of (re-)broadcast.

This change makes it configurable with whitelistforcerelay.

(cherry picked from commit 325c725fb6205e38142914acb9ed1733d8482d46)
2021-02-22 18:26:40 -07:00
MarcoFalke c8f15614e5 Move blocksonly parameter interaction to InitParameterInteraction() 2021-02-19 20:01:02 +00:00
Jonas Schnelli 2acfcc801f Move -blocksonly parameter interaction to the new ParameterInteraction() function 2021-02-19 19:56:18 +00:00
Patick Strateman 237de99aa9 Fix comment for blocksonly parameter interactions 2021-02-19 19:28:16 +00:00
Patick Strateman fd635a1f86 Display DEFAULT_WHITELISTALWAYSRELAY in help text 2021-02-19 19:28:16 +00:00
Patick Strateman 92f952e265 Use DEFAULT_BLOCKSONLY and DEFAULT_WHITELISTALWAYSRELAY constants 2021-02-19 19:28:16 +00:00
Patick Strateman 7e6ef59248 Add help text for blocksonly and whitelistalwaysrelay 2021-02-19 19:28:16 +00:00
Patick Strateman 32a1bbf0ae Add whitelistalwaysrelay option 2021-02-19 19:28:16 +00:00
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
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
Jack Grigg 51ae7a0ae5 init: Pass post-Blossom spacing into CNode::SetMaxOutboundTarget() 2021-02-17 13:35:11 -07: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
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
BtcDrak fa8d2a45bb Remove bad chain alert partition check
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.

(cherry picked from commit ab8be98fdb25b678a8cd7e89adf06d1b1f6bdd62)
2021-02-02 09:25:35 -07:00
Jack Grigg 6c280abfac Remove init_and_check_sodium from crypto/common.h
This removes the last implicit dependency on libsodium from
libzcashconsensus.

As of zcash/zcash#4893 we no longer depend on libsodium for Ed25519
signature verification.
2020-12-20 22:42:22 +00:00
Jack Grigg c4ea423827 prevector: Terminate without logging on failed allocation
This reverts aeb089ecc7, which introduced
logging, adding a dependency on libbitcoin_util.a to libzcashconsensus.a.

Also adds missing #includes that were being indirectly included via
prevector.h including util.h.
2020-12-20 22:42:22 +00:00
Homu dea50714f9 Auto merge of #4892 - str4d:boosted, r=str4d
Replace boost::variant and boost::optional with standard library

Includes a commit cherry-picked from https://github.com/bitcoin/bitcoin/pull/20419.

Closes #4821. Closes #4822.
2020-12-17 02:42:55 +00:00
Jack Grigg d9928926f3 Migrate from boost::optional::get to boost::optional::value
std::optional only has std::optional::value.
2020-12-16 22:59:34 +00:00
Jack Grigg b521cb8932 scripted-diff: Migrate from boost::variant to std::variant
-BEGIN VERIFY SCRIPT-
sed -i 's/boost::variant/std::variant/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ;
sed -i 's/boost::get<\(.*\)>(&/std::get_if<\1>(\&/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.cpp ;
sed -i 's/boost::get</std::get</' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.cpp ;
sed -i 's/boost::apply_visitor(/std::visit(/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ;
sed -i 's/class \(.*\)\b \?: public boost::static_visitor<.*>/class \1/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/variant\(\/.*\)\?.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include "boost\/variant\/.*.hpp"\n//' ./src/*/*.cpp ;
-END VERIFY SCRIPT-
2020-12-16 22:49:53 +00:00
Kris Nuttycombe e9b5d83709 Prefer explicit passing of CChainParams to the Params() global. 2020-12-15 08:23:09 -07:00
Jorge Timón f5e98e0fb1 scripted-diff: Remove PAIRTYPE
Zcash: Added an extra command to handle cases where the pair were not
separated by a space.

-BEGIN VERIFY SCRIPT-
sed -i 's/PAIRTYPE(\([^,]*\), \([^\)]*\))/std::pair<\1, \2>/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i 's/PAIRTYPE(\([^,]*\),\([^\)]*\))/std::pair<\1, \2>/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i ':a;N;$!ba;s/#define std::pair<t1, t2>    std::pair<t1, t2>\n//' ./src/utilstrencodings.h ;
-END VERIFY SCRIPT-
2020-11-23 23:07:15 +00:00
Jorge Timón 92a867febc scripted-diff: Fully remove BOOST_FOREACH
-BEGIN VERIFY SCRIPT-
sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
-END VERIFY SCRIPT-
2020-11-23 23:07:15 +00:00
Jack Grigg 1944eb1c86 lint: Fix duplicate includes 2020-11-09 23:06:21 +00:00
Wladimir J. van der Laan c0603a9fa6 Use fsbridge for fopen and freopen
Abstracts away how a path is opened to a `FILE*`.

Reduces the number of places where path is converted to a string
for anything else but printing.
2020-10-22 01:11:37 +01:00
Wladimir J. van der Laan 73bc7a068d Replace uses of boost::filesystem with fs
Step two in abstracting away boost::filesystem.

To repeat this, simply run:
```
git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g'
```
2020-10-22 01:11:37 +01:00
Wladimir J. van der Laan 7044e39a57 Replace includes of boost/filesystem.h with fs.h
This is step one in abstracting the use of boost::filesystem.
2020-10-22 01:11:37 +01:00
Homu fb24911c55 Auto merge of #4570 - oxarbitrage:issue2783, r=daira
Add timestamp to warnings

Closes https://github.com/zcash/zcash/issues/2783 by adding timestamp to warnings.
2020-10-14 09:16:45 +00:00
Homu b076c8dfc5 Auto merge of #4770 - nuttycom:fastsync, r=nuttycom
Add -ibdskiptxverification flag to allow faster synchronization.

Subsumes #4037
2020-10-13 13:54:05 +00:00
Kris Nuttycombe a75c613ade Fix command-line help for -ibdskiptxverification 2020-10-13 07:18:51 -06:00
Kris Nuttycombe 95e38235c7
Rename IBDSkipTxVerification back to ShouldCheckTransaction
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-12 15:38:07 -06:00
Daira Hopwood acf2d07189 Fix a new warning about use of boost::bind placeholders after updating Boost. closes #4774
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-10 21:41:46 +01:00