Commit Graph

1078 Commits

Author SHA1 Message Date
Daira Emma Hopwood 11dc0d7277 Add a `-blockunpaidactionlimit` config option to configure the per-block
limit on unpaid actions for ZIP 317 block template construction.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-20 00:48:38 +01:00
Daira Emma Hopwood c1930170d2 Remove the implementation of score-based block template construction
and the `-blockminsize` option.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-19 22:48:46 +01:00
Daira Emma Hopwood d20a52faaa Fix some messages, comments, and documentation that:
* used "fee" to mean "fee rate", "kB" to mean 1000 bytes, "satoshis"
  to mean zatoshis, or that incorrectly used "BTC" in place of "ZEC";
* used obsolete concepts such as "zero fee" or "free transaction"; or
* did not accurately document their applicability.

Uses of "satoshis" as a JSON key are not altered.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos 5e87cb480f Allow setting minrelaytxfee to 0
Setting minrelaytxfee to 0 will allow all transactions regardless of fee to enter your mempool until it reaches its size limit.

(cherry picked from commit bitcoin/bitcoin@7d4e9509ad)

Zcash: Removed the following misleading sentence from the upstream
commit message:

> However now that mempool limiting is governed by a separate
> incrementalrelay fee, it is an unnecessary restriction to prevent
> a minrelaytxfee of 0.

We do not have `-incrementalrelayfee`, which was added upstream in
bitcoin/bitcoin#9380 . Still, it was pointless to prevent
`-minrelaytxfee=0`, because we did not prevent `-minrelaytxfee=1`
or other low values, which would be similarly ineffective.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos a4346b2012 [rpc] sendrawtransaction no longer bypasses minRelayTxFee
The prioritisetransaction API can always be used if a transaction needs to be submitted that bypasses minRelayTxFee.

(cherry picked from commit bitcoin/bitcoin@ad727f4eaf)

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos 335ac369ea [debug] Change -printpriority option
-printpriority output is now changed to only show the fee rate and hash of transactions included in a block by the mining code.

(cherry picked from commit bitcoin/bitcoin@400b15147c)

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Daira Emma Hopwood 63d08919d1 Warn on node startup if the removed `-blockprioritysize` option is set
to a non-zero value.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Alex Morcos dbf52938af [mining] Remove -blockprioritysize.
Remove ability of mining code to fill part of a block with transactions sorted by coin age.

(cherry picked from commit bitcoin/bitcoin@272b25a6a9)

Zcash:
* Add release notes.
* Remove a static assertion that no longer applies.
* Spell "prioritise" and "prioritisation" (when referring to tx prioritisation) consistently
  with 'ise', to match the "prioritisetransaction" RPC call.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-04-17 18:49:45 +01:00
Jack Grigg 33367709f7 Merge most `cxx::bridge` definitions into a single bridge
This enables us to use Rust types across more bridged APIs, which we
can't do with multiple bridge definitions until `cxx` adds support.
2023-04-05 10:50:35 +00:00
Greg Pfeil 666a8d1b37
Merge pull request #6377 from sellout/wallet_tx_builder/z_sendmany
Extract common transaction logic from z_sendmany
2023-03-22 11:24:33 -06:00
Jack Grigg ce73341951 `s/string/std::string` in `init.cpp`
This was breaking with `--disable-wallet`, likely due to some PR
removing a `using namespace std;` line from a header file that this code
was implicitly depending on.
2023-03-13 15:47:55 +00:00
Greg Pfeil 4bf618937e
Don’t pass PrivacyPolicy to selector constructor
This reverts to the `bool` that was used previously. The independent change to use
`TransparentCoinbasePolicy as a parameter type eliminates some of the motivation for this, and there
is a better approach to solving the remaining issues in #6457.
2023-03-09 16:29:15 -07:00
Greg Pfeil 820af47019
Unify requireTransparentCoinbase handling
Eliminates SelectsTransparentCoinbase in favor of a Disallow/Allow/Require ternary. Also asserts if
a selector requires transparent coinbase but doesn’t select transparent.
2023-03-09 13:04:17 -07:00
Kris Nuttycombe 010141426d
Allow selectors to require transparent coinbase 2023-03-09 13:04:17 -07:00
Kris Nuttycombe cc2fd60617 Make all CCoinsView methods pure-virtual. 2023-02-15 13:58:46 -07:00
Kris Nuttycombe 3cec519ce4 scripted-diff: Update Zcash copyrights to 2023
-BEGIN VERIFY SCRIPT-
for party in "The Zcash developers" "The Bitcoin Core developers" "Bitcoin Developers"; do
  sed -i"" -e "s#Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? $party#Copyright (c) \1-2023 $party#" COPYING
  sed -i"" -e "s#\(.*\)\([0-9]\{4\}\)\(-[0-9]\{4\}\)\, $party#\1\2-2023, $party#" contrib/debian/copyright
done

sed -i"" -e "s/define(_COPYRIGHT_YEAR, [0-9]\{4\})/define(_COPYRIGHT_YEAR, 2023)/" configure.ac
sed -i"" -e "s/#define COPYRIGHT_YEAR [0-9]\{4\}/#define COPYRIGHT_YEAR 2023/" src/clientversion.h

git grep "^// Copyright (c) .* The Zcash developers" \
  | awk -F ':' '{print $1}' \
  | xargs -I {} sed -i"" -e "s#// Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? The Zcash developers#// Copyright (c) \1-2023 The Zcash developers#" {}
-END VERIFY SCRIPT-
2023-01-23 11:31:54 -07:00
str4d 8bc5740003
Merge pull request #6348 from str4d/update-deps-5.4.0
Update dependencies for 5.4.0 and fix some help messages
2023-01-13 16:18:10 +00:00
Jack Grigg 7e42041772 Document -clockoffset option 2023-01-13 00:43:46 +00:00
MarcoFalke 828c63ecc4 init: Fix help message for checkblockindex
(cherry picked from commit bitcoin/bitcoin@4ae7d1529e)
2023-01-13 00:32:42 +00:00
Daira Hopwood fae6cd175c Change the time that the wallet will wait for the block index to load from 5 minutes to 2 hours.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-01-13 00:02:03 +00:00
James O'Beirne 145d259e3e Clarify help messages for path args to mention datadir prefix
Change `-conf`'s and others' help messages to indicate that relative path
values will be prefixed by the datadir path. This behavior is confusing when
attempting to specify a configuration file in the current directory with
`-conf=bitcoin.conf`, but loading the `bitcoin.conf` file in ~/.bitcoin
datadir.

(cherry picked from commit bitcoin/bitcoin@a1e13055c2)
2023-01-12 22:01:21 +00:00
MarcoFalke db29ea9e05 Clarify mocktime help message
(cherry picked from commit bitcoin/bitcoin@fa461df685)
2023-01-12 22:01:21 +00:00
MarcoFalke d97f5a0301 [init] Help Msg: Use Params(CBaseChainParams::MAIN)
(cherry picked from commit bitcoin/bitcoin@faa572a329)
2023-01-12 22:01:21 +00:00
MarcoFalke 6703ba2e4e [init] Add missing help for args
(cherry picked from commit bitcoin/bitcoin@fa6ab96799)
2023-01-12 22:01:21 +00:00
Suhas Daftuar b63c58500a Track transaction packages in CTxMemPoolEntry
Associate with each CTxMemPoolEntry all the size/fees of descendant
mempool transactions.  Sort mempool by max(feerate of entry, feerate
of descendants).  Update statistics on-the-fly as transactions enter
or leave the mempool.

Also add ancestor and descendant limiting, so that transactions can
be rejected if the number or size of unconfirmed ancestors exceeds
a target, or if adding a transaction would cause some other mempool
entry to have too many (or too large) a set of unconfirmed in-
mempool descendants.

(cherry picked from commit bitcoin/bitcoin@5add7a74a6)

Zcash:
- Mempool methods were adapted to our mempool changes.
- Default ancestor and descendant size limits were double to account for
  our larger block size.
- The mempool_packages RPC test fee was adapted to account for our
  emissions curve (which results in a smaller per-block reward that
  needs to be split into smaller shards for sequential transactions.
- Includes some modifications to account for us backporting
  bitcoin/bitcoin@f3fe83673e early in
  zcash/zcash#5269.
2022-12-19 05:38:43 +00:00
Jack Grigg 93de2aae0e Place zcashd.debug.* metrics behind a -debugmetrics config option 2022-11-21 20:50:02 +00:00
Daira Hopwood a6141281d4
Merge pull request #6201 from sellout/fix-disable-wallet
Fix building with --disable-wallet
2022-10-19 07:36:23 +01:00
Greg Pfeil 669a1b9ba0 Qualify a `string`
This only gets triggered with `./configure --disable-wallet`, but clang
complains about this unqualified identifier.
2022-10-18 13:52:04 -06:00
Greg Pfeil 04d314d067 Apply suggestions from code review
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-10-18 13:43:14 -06:00
Greg Pfeil fa494a10a1 Fix `zcashd --help`
When I cleaned up the debug log reporting, I included the path to the debug log
in the help message, which unfortunately required the base params to be
loaded. They don’t get loaded before the help message (and they shouldn’t), so
this caused an assertion failure.

The fix is to use “debug log” in the help message, rather than the path to the
actual debug log. This is the right thing to do, because the help message
explains how to set the path to the debug log, so the literal path when run with
`--help` would possibly not be the correct one at runtime.

Fixes #6184.
2022-10-18 13:42:02 -06:00
Greg Pfeil db1b4313c3 Don't recommend -reindex-chainstate.
As mentioned in #5964 and #5977, `-reindex-chainstate` is currently broken. This
removes it from error messages so that we don't suggest its use, but rather a
full `-reindex`.

This change should be reverted if/when those issues are fixed.
2022-09-12 11:28:51 -06:00
Wladimir J. van der Laan fad9fba1e1 build: Get rid of `CLIENT_DATE`
Putting the build date in the executable is a practice that has no place
in these days, now that deterministic building is increasingly common.

Continues #7732 which did this for the GUI.

(cherry picked from commit bitcoin/bitcoin@d096d22446)
2022-08-20 03:13:52 +00:00
Greg Pfeil cca3b070bb Eliminate indirection for debug log
Many error messages would say "see debug.log" or similar, without
indicating where the debug log actually lives. This now prints the
actual path in those cases.

It also changes more general uses of "debug.log" to "debug log", since
the file name may not even be "debug.log" if the user has specified it.
2022-08-17 09:02:40 -06:00
Pieter Wuille 2d1e63c45a Add SHA256 dispatcher
(cherry picked from commit bitcoin/bitcoin@2991c91d88)
2022-07-16 10:13:26 +00:00
Kris Nuttycombe 40df3d402e
Merge pull request #6042 from nuttycom/feature/clock_capability
Add a clock for testing with an offset from the system clock.
2022-07-15 08:23:23 -06:00
Kris Nuttycombe e7922af588 Add a clock for testing with an offset from the system clock.
This change improves clock management for zcashd by ensuring
that all clock methods (obtaining seconds, milliseconds, and
microseconds since the epoch) agree under testing conditions
using `-mocktime`, and also adds a feature that allows tests
to specify an offset to the system clock; this is useful to
allow comprehensive testing of the "timejacking attack mitigation"
consensus rules.
2022-07-14 16:33:54 -06:00
Jack Grigg 087c85ec03 Cache Sapling and Orchard bundle validation
This adds two new CuckooCaches in validation, each caching whether all
of a transaction bundle's proofs and signatures were valid.

Bundles which match the validation cache never have proofs or signatures
added to the batch validators. For blocks where all transactions have
been previously observed in the mempool, the final validation of the
batches should be a no-op.

Part of zcash/zcash#6049.
2022-07-13 15:49:37 +00:00
Jeremy Rubin cebf89c7a7 Add CuckooCache implementation and replace the sigcache map_type with it
SQUASHME: Change cuckoocache to only work for powers of two, to avoid mod operator
SQUASHME: Update Documentation and simplify logarithm logic
SQUASHME: OSX Build Errors
SQUASHME: minor Feedback from sipa + bluematt
SQUASHME: DOCONLY: Clarify a few comments.

(cherry picked from commit bitcoin/bitcoin@c9e69fbf39)
2022-07-08 21:01:11 +00:00
Kris Nuttycombe ee3055f596
Merge pull request #6064 from zcash/version-5.1.0
Merge 5.1.0 stablilization branch back into the main branch
2022-07-08 08:14:59 -06:00
Cory Fields a423c2af8c time: add runtime sanity check
std::chrono::system_clock.time_since_epoch and time_t(0) are not guaranteed
to use the Unix epoch timestamp, but in practice they almost certainly will.
Any differing behavior will be assumed to be an error, unless certain
platforms prove to consistently deviate, at which point we'll cope with it
by adding offsets.

Do a quick runtime check to verify that
time_t(0) == std::chrono::system_clock's epoch time == unix epoch.

Co-authored-by: Anthony Towns <aj@erisian.com.au>

Zcash: The first commit of bitcoin/bitcoin#21110; we intend to handle
the changes made by the second commit of that PR in a separate fashion;
see zcash/zcash#6042.

(cherry picked from commit bitcoin/bitcoin@3c2e16be22)
2022-07-07 14:00:03 -06:00
Kris Nuttycombe d9c5326f17 Ensure that the node has position information before attempting to read block data. 2022-07-05 17:24:39 -06:00
Jim Posen 9a7e2c153d scripted-diff: Move util files to separate directory.
-BEGIN VERIFY SCRIPT-
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp

sed -i -e 's/"util\.h"/"util\/system\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
git checkout HEAD -- src/secp256k1 # exclude secp256k1, which has its own "util.h"
sed -i -e 's/"utilmoneystr\.h"/"util\/moneystr\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utilstrencodings\.h"/"util\/strencodings\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utiltime\.h"/"util\/time\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')

sed -i -e 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
sed -i -e 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
sed -i -e 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
sed -i -e 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h

sed -i -e 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
sed -i -e 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
sed -i -e 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
sed -i -e 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am

sed -i -e 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
-END VERIFY SCRIPT-
2022-07-01 17:50:09 -06:00
Kris Nuttycombe 733289afa3 Revert "Merge pull request #6037 from nuttycom/feature/clock_capability"
This reverts commit 93ae72c17e, reversing
changes made to f3f1f81302.
2022-07-01 10:15:41 -06:00
Kris Nuttycombe 825ca45341 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-07-01 13:51:22 +01:00
Kris Nuttycombe 88401bc25e Add a clock for testing with an offset from the system clock.
This change improves clock management for zcashd by ensuring
that all clock methods (obtaining seconds, milliseconds, and
microseconds since the epoch) agree under testing conditions
using `-mocktime`, and also adds a feature that allows tests
to specify an offset to the system clock; this is useful to
allow comprehensive testing of the "timejacking attack mitigation"
consensus rules.
2022-07-01 13:51:22 +01:00
Jack Grigg eb9dd95f69 test: Load the proof verification keys in Boost tests
The change to use Orchard batch validation now requires the Orchard
verifying key to be available even if there are no items in the batch.
For simplicity, we now load all verifying keys in the Boost tests.
2022-07-01 01:24:15 +00:00
Jack Grigg d8a8b30b61 Document that `-reindex` and `-salvagewallet` both imply `-rescan`
The latter soft-sets `-rescan` if corruption is detected, while the
former implicitly rescans as a side-effect of replaying the chain
history to the wallet.
2022-06-01 14:37:03 +00:00
Jack Grigg 22a284ceeb wallet: Clear witness caches on load if reindexing
The reindexing process will replay the chain history against the wallet
starting from genesis, so we can just rebuild the witness caches from
scratch to ensure consistency.
2022-06-01 14:30:28 +00:00
Kris Nuttycombe 726f221062 Do not attempt to begin a rescan if reindexing.
The progress of the reindexing operation will ensure that the wallet
database is reconstructed.

Fixes #5974
2022-05-26 13:25:03 -06:00
Kris Nuttycombe 822ab78edc Revert "Make `-reindex` and `-reindex-chainstate` imply `-rescan`"
This reverts commit af7d883854.
2022-05-26 12:45:22 -06:00