Commit Graph

14597 Commits

Author SHA1 Message Date
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
Jack Grigg 79ad5984b1 Remove JSDescription::h_sig
This removes the zcash/JoinSplit.hpp dependency from
primitives/transaction.cpp, and thus from libzcashconsensus.
2020-12-20 22:42:22 +00:00
Jack Grigg b1aa9365af Add JSDescriptionInfo for constructing JSDescriptions
This matches the existing transaction builder structs:
- SpendDescriptionInfo
- OutputDescriptionInfo
- TransparentInputInfo

It also removes the dependency of the transaction format on the proving
system.
2020-12-20 22:42:22 +00:00
Matt Corallo 726c5c8b19 Default to defining endian-conversion DECLs in compat w/o config
While this isn't a supported build configuration, some build
systems need to build without going through our autotools steps,
so defaulting to something sane may make it easier to build.

Specifically, this fixes the inability to build
rust-bitcoinconsensus on some non-x86 platforms. It needs to build
without our autotools/configure steps to ensure correct compile
args are passed from the rust build system to gcc. Converting the
args from the rust build system to gcc would be a lot of
unmaintainable work.
2020-12-20 22:42:22 +00:00
Homu 651e7fbfb5 Auto merge of #4923 - nuttycom:release-v4.2.0-rc1, r=nuttycom
Release v4.2.0 rc1

Notable changes
===============

Switch to ed25519-zebra for consensus signature checks
------------------------------------------------------
This removes the zcashd dependency upon libsodium for ed25519
signature checks and instead uses the Rust implementation in
ed25519-zebra, which has been active for signature verification
since the Canopy upgrade. For more information on the conditions
that led to this change see https://hdevalence.ca/blog/2020-10-04-its-25519am

Update default fees according to ZIP-313
----------------------------------------
Reduce default fees to 0.00001 ZEC as specified in ZIP-313 and
ensure that transactions paying at least the new minimum fee meet
the transaction relay threshold irrespective of transaction size.

Improve getblocktemplate rpc performance when using shielded coinbase
---------------------------------------------------------------------
This change precomputes future block templates to permit miners to
begin working atop newly arrived blocks as quickly as possible, rather
than waiting for a new template to be generated after a block has arrived.
It also reduces the initial the wait time for incorporating new mempool
transactions into a block from 1 minute to 10 seconds; the previous value
was inherited from the upstream bitcoin codebase but is inappropriate for
our block timing.

Migrate from rpc-tests.sh to rpc-tests.py
-----------------------------------------
This unifies and simplifies the RPC testing framework, as has
been done in the upstream Bitcoin codebase.
2020-12-19 19:01:05 +00:00
Kris Nuttycombe a0dd3e3ce5 make-release.py: Updated release notes and changelog for 4.2.0-rc1. 2020-12-19 09:56:36 -07:00
Kris Nuttycombe 0b5b6d5186 make-release.py: Updated manpages for 4.2.0-rc1. 2020-12-19 09:53:28 -07:00
Kris Nuttycombe f8bb085d85 make-release.py: Versioning changes for 4.2.0-rc1. 2020-12-19 09:45:41 -07:00
Homu 6fbf180b34 Auto merge of #4921 - nuttycom:fix_stdout_logging, r=str4d
Don't log to stdout if a file logger is configured.

This fixes an error introduced by 5dce316f10
2020-12-19 11:40:05 +00:00
Kris Nuttycombe 8cdac686eb Don't log to stdout if a file logger is configured.
This fixes an error introduced in 5dce316.
2020-12-18 22:20:04 -07:00
Homu c854ff7747 Auto merge of #4919 - rex4539:old-boost, r=daira
Remove workaround affecting old Boost version

Closes https://github.com/zcash/zcash/issues/4914.
2020-12-19 01:20:41 +00:00
Homu 2c0f6df168 Auto merge of #4916 - daira:reduce-fee, r=nuttycom
Reduce default fee to 1000 zatoshis

Per ZIP 313. This also ensures that transactions that pay the default fee will always be relayed, and not rate-limited.
2020-12-19 00:02:44 +00:00
Dimitris Apostolou c2c69a12e4
Remove workaround affecting old Boost version 2020-12-19 00:30:02 +02:00
Homu 6771bef6d5 Auto merge of #4918 - str4d:update-deps, r=daira
Update dependencies for 4.2.0

Includes some simplifications to the `tracing` configuration logic, now that we pin the correct dependency version.
2020-12-18 21:59:20 +00:00
Daira Hopwood e6a44ff833 Always allow transactions paying at least DEFAULT_FEE to be relayed, and do not rate-limit them.
In other words, make sure that the "minimum relay fee" is no greater than DEFAULT_FEE.

The intention is that this will allow setting the fee to DEFAULT_FEE for *all* transactions
(including transparent ones) in a future release, and be more compatible with other wallets
that already do so, per ZIP 313. refs #2942

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-18 21:19:23 +00:00
Kris Nuttycombe 8f4dd4460b Update boost to 1.75, postpone other updates.
This removes the paches iostreams-106.patch and signals2-noise.patch
which have been incorporated into boost 1.75. Also, this further
postpones updates to native_clank, libcxx and native_ccache.
2020-12-18 14:13:42 -07:00
Jack Grigg 5dce316f10 tracing: Simplify init logic using optional layers
The layer creation itself looks a bit more complex, but this is due to
how altering the presence of timestamps changes the type signature of the
formatter. The main improvements are that we now only initialise the
registry in a single location, and the log filter reload handle has a
single type signature (whereas previously its type signature depended on
the configuration).

Requires a minimum of tracing-subscriber 0.2.12, which added this feature.

Part of zcash/zcash#4668.
2020-12-18 19:42:09 +00:00
Jack Grigg c97665f397 tracing: Remove unnecessary tracing_init_inner internal function
This became unnecessary in 25d2e6e3c3.
2020-12-18 19:42:09 +00:00
Jack Grigg bdf44b1cf8 cargo update 2020-12-18 19:42:07 +00:00
Daira Hopwood 5e84362702 Reduce the default fee for z_* operations, and the "low fee penalty" threshold for mempool limiting, to 1000 zatoshis.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-18 12:37:03 -07:00
Homu 844ef48b45 Auto merge of #4912 - daira:daira-partial-revert-4904, r=daira
Partial revert of "Update links"

This partially reverts commit f459e43dc9. See #4904.

In summary, the rationale is that:
* Some of the changed files are from subtrees, which should be updated upstream.
* The licensing of four of the files under `build-aux/m4` is complicated and so changes to them should have required review with that in mind: 5b97cd27f8/COPYING (L38-L44)
* The changes to `contrib/debian/copyright` must also be reverted because those are in copies of specific versioned licenses.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-17 18:28:32 +00:00
Daira Hopwood 4fedb32441 Fix a typo introduced in #4904.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-17 18:27:52 +00:00
Homu 7a97e48cb7 Auto merge of #4909 - str4d:improve-logging, r=str4d
Improve logging

- Fix logging of peer spans under `net=info`.
- Log all mempool-accepted txids under `mempool=info`.
- Log the new log filter under `main=info` when calling `setlogfilter`.
2020-12-17 04:02:38 +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
Daira Hopwood 2840790f66 Partial revert of "Update links". See #4904
This partially reverts commit f459e43dc9.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-17 01:42:03 +00:00
Homu a058196146 Auto merge of #4603 - nuttycom:ff/no_global_params, r=daira
Prefer explicit passing of CChainParams to the Params() global.

This is (intended to be) a pure refactoring, no functional changes included.
2020-12-17 01:26:36 +00:00
Jack Grigg a8bcd46b8c test: Fix test_bitcoin compilation on macOS High Sierra
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-12-17 00:42:48 +00:00
Homu 5b97cd27f8 Auto merge of #4904 - rex4539:https, r=nuttycom
Update links

Updates numerous insecure or outdated links, plus a few minor typo fixes.
2020-12-17 00:05:14 +00:00
Kris Nuttycombe bce1da684b Remove vestigial OSX_SDK_VERSION from darwin build.
Upstream still uses this variable for qt builds, but as we no longer
have the GUI wallet it's unnecessary for Zcash.
2020-12-16 22:59:35 +00:00
fanquake f201e1e02d build: set minimum supported macOS to 10.14 2020-12-16 22:59:35 +00:00
Jack Grigg 8a1803b21a lint: Remove boost::variant and boost::optional from allowed includes 2020-12-16 22:59:35 +00:00
Jack Grigg db17aae4db Finish migrating to std::optional 2020-12-16 22:59:35 +00:00
Jack Grigg d8d0918951 scripted-diff: Migrate from boost::optional to std::optional
-BEGIN VERIFY SCRIPT-
sed -i 's/boost::none/std::nullopt/g' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h* ./src/*/*/*.cpp ;
sed -i 's/boost::optional/std::optional/g' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h* ./src/*/*/*.cpp ;
sed -i 's/std::optional<\(.*\)&>/std::optional<std::reference_wrapper<\1>>/' ./src/*/*.h ./src/*/*.cpp ;
sed -i 's/is_initialized()/has_value()/' ./src/*.cpp ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/optional.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include "boost\/optional.hpp"\n//' ./src/*.h ;
-END VERIFY SCRIPT-
2020-12-16 22:59:35 +00:00
Jack Grigg 521eb81a95 Add <optional> header to files that will need it 2020-12-16 22:59:34 +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 ae4551004a Finish migrating to std::variant 2020-12-16 22:59:32 +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
Jack Grigg f68c79554f Add <variant> header to files that will need it 2020-12-16 22:48:21 +00:00
Homu 83a4ae49b6 Auto merge of #4886 - LarryRuane:getblocktemplate-shielded, r=str4d
improve getblocktemplate performance for shielded coinbase

Closes #4817. This improvement applies only when the `longpollid` argument is specified. This argument causes the `getblocktemplate` RPC to not return a template immediately, but instead to wait until either a new block arrives, or new transactions arrive in the mempool.
2020-12-16 21:56:27 +00:00
Jack Grigg 8239c756b7 mempool: Log all accepted txids at INFO level
This adds logging for locally-submitted transactions. At DEBUG level we
additionally log contextual information about accepted transactions from
peers.

Closes zcash/zcash#4907.
2020-12-16 02:54:48 +00:00
Jack Grigg a5736aad95 rpc: Log the new filter when we set it 2020-12-16 02:42:10 +00:00
Jack Grigg b517be4334 rpc: Reload CNode spans after reloading the log filter
Closes zcash/zcash#4908.
2020-12-16 02:07:06 +00:00
Jack Grigg 42c38b00c1 net: Rework CNode spans
- Extract a reload function for recreating them.
- Record the peer id.
- Remove the peer id and address from the CNode constructor log
  (it will always be shown by the span at that log level).
2020-12-16 01:37:17 +00:00
Kris Nuttycombe e9b5d83709 Prefer explicit passing of CChainParams to the Params() global. 2020-12-15 08:23:09 -07:00
Larry Ruane 5f68253e58 improve getblocktemplate performance for shielded coinbase 2020-12-13 12:33:25 -07:00
Dimitris Apostolou f459e43dc9
Update links 2020-12-13 11:24:44 +02:00
Homu e9cc9b4eec Auto merge of #4896 - nuttycom:document_nsequence, r=daira
Write down the folklore about nSequence
2020-12-11 17:16:37 +00:00
Homu e7b425298f Auto merge of #4893 - str4d:ed25519-zebra-consensus, r=daira
Switch to ed25519-zebra for consensus signature checks

ed25519-zebra can validate all signatures pre-Canopy, and now that Canopy
is active on mainnet, we don't need to worry about consensus divergence.
2020-12-11 15:11:47 +00:00
Jack Grigg ceccb10e4f Update minimum chain work and set activation block hashes for testnet
The chain work is taken from testnet block 1197611.
2020-12-09 13:00:46 +00:00
Jack Grigg 28e01d67f7 Update minimum chain work and set activation block hashes for mainnet
The chain work is taken from mainnet block 1069420.
2020-12-08 14:45:45 +00:00