Commit Graph

14781 Commits

Author SHA1 Message Date
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
Jack Grigg 4ca2b20496 test: Use ed25519_verify in ConsensusTests 2020-12-08 14:23:37 +00:00
Homu 5ab69760c5 Auto merge of #4891 - zquestz:add_hex_to_getblock, r=daira
[Feature] Include transaction hex in verbose getblock output

This fixes https://github.com/zcash/zcash/issues/4888 and actually makes it so the existing documentation is correct!

I also added a small test to make sure the transaction hex is returned correctly in verbose (2) `getblock` calls, and matches the value in `getrawtransaction`.

Let me know if there is anything else I need to update, as this is my first PR for zcash.

-------------------------------------------------------------------------------------------

Please ensure this checklist is followed for any pull requests for this repo. This checklist must be checked by both the PR creator and by anyone who reviews the PR.
* [ ] Relevant documentation for this PR has to be completed and reviewed by @mdr0id before the PR can be merged
* [ ] A test plan for the PR must be documented in the PR notes and included in the test plan for the next regular release

As a note, all buildbot tests need to be passing and all appropriate code reviews need to be done before this PR can be merged.
2020-12-08 14:16:34 +00:00
Kris Nuttycombe 2e9bdc6789 Write down the folklore about nSequence 2020-12-08 07:14:42 -07:00
Homu 7dbd969b14 Auto merge of #4882 - rex4539:fix-readelf, r=daira
readelf is Linux only

Fixes https://github.com/zcash/zcash/issues/4875.
2020-12-05 14:31:11 +00:00
Dimitris Apostolou 307dd8837f
Fix readelf configuration
Co-authored-by: str4d <thestr4d@gmail.com>
2020-12-04 20:48:26 +02:00
Homu 36838ef60f Auto merge of #4889 - LarryRuane:getinfo-add-build-version, r=LarryRuane
add more version information to getinfo rpc

Needed for https://github.com/zcash/lightwalletd/issues/319, lightwalletd's `GetLightdInfo` grpc would like to return the zcashd version and commit hash.
2020-12-04 16:59:21 +00:00
Jack Grigg c3a91be479 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-04 03:42:16 +00:00
Homu 77c2a5f810 Auto merge of #4877 - str4d:boost-backports, r=str4d
Backport Boost removal PRs

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7613
- bitcoin/bitcoin#10502
- bitcoin/bitcoin#10193
- bitcoin/bitcoin#13961
- bitcoin/bitcoin#13734
  - Only the second commit (we don't need the first).
- bitcoin/bitcoin#14480

Part of #4819.
2020-12-04 01:34:19 +00:00
Jack Grigg 4cb31e5a19 Fix Hungarian notation nit from Daira 2020-12-04 01:32:07 +00:00
Josh Ellithorpe efb603557a
Include transaction hex in verbose getblock output 2020-12-03 14:18:17 -10:00
Larry Ruane 18775308fa add more version information to getinfo rpc 2020-12-02 09:42:28 -07:00
Homu c8896f9907 Auto merge of #4874 - str4d:rpc-tests-py, r=str4d
Backport migration from rpc-tests.sh to rpc-tests.py

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#6567
- bitcoin/bitcoin#6523
- bitcoin/bitcoin#6616
- bitcoin/bitcoin#6788
  - Only the commit fixing `rpc-tests.py`
- bitcoin/bitcoin#6791
  - Only the fix to `qa/rpc-tests/README.md`
- bitcoin/bitcoin#6827
- bitcoin/bitcoin#6930
- bitcoin/bitcoin#6804
- bitcoin/bitcoin#7029
- bitcoin/bitcoin#7028
- bitcoin/bitcoin#7027
- bitcoin/bitcoin#7135
- bitcoin/bitcoin#7209
- bitcoin/bitcoin#7635
- bitcoin/bitcoin#7778
- bitcoin/bitcoin#7851
- bitcoin/bitcoin#7814
  - Only the changes to the new .py files in this PR.
- bitcoin/bitcoin#7971
- bitcoin/bitcoin#7972
- bitcoin/bitcoin#8056
  - Only the first commit.
- bitcoin/bitcoin#8098
- bitcoin/bitcoin#8104
- bitcoin/bitcoin#8133
  - Only the `rpc-tests.py` commit.
- bitcoin/bitcoin#8066
- bitcoin/bitcoin#8216
  - Only the last two commits.
- bitcoin/bitcoin#8254
- bitcoin/bitcoin#8400
- bitcoin/bitcoin#8482
  - Excluding the first commit (only affects RPC tests we don't have).
- bitcoin/bitcoin#8551
- bitcoin/bitcoin#8607
  - Only the pull-tester commit, for conflict removal.
- bitcoin/bitcoin#8625
- bitcoin/bitcoin#8713
- bitcoin/bitcoin#8750
- bitcoin/bitcoin#8789
- bitcoin/bitcoin#9098
- bitcoin/bitcoin#9276
  - Excluding the second commit (we don't have the changes it requires).
- bitcoin/bitcoin#9657
- bitcoin/bitcoin#9807
- bitcoin/bitcoin#9766
- bitcoin/bitcoin#9823
2020-12-02 13:53:52 +00:00
Jack Grigg a7370b112e test: Run shielding-heavy RPC tests in serial 2020-12-02 13:52:08 +00:00
Jack Grigg 3a91bcfac5 test: Silence pyflakes unused import warning
rpc-tests.py trial-imports zmq to determine whether it is available.
2020-12-02 01:01:50 +00:00
Dimitris Apostolou 21bfa3a0e1
readelf is Linux only 2020-11-25 12:44:58 +02:00
Jack Grigg e03667b608 lint: Remove boost/foreach.hpp from allowed includes 2020-11-23 23:24:05 +00:00