Commit Graph

11185 Commits

Author SHA1 Message Date
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 9e1efad2d1
Merge pull request #6312 from str4d/6308-backport-6898
Backport `CreateNewBlock` rewrite
2023-01-19 21:47:20 +00:00
str4d 6ec042dd51
Merge pull request #6343 from rex4539/typos
Fix typos
2023-01-18 23:22:44 +00: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
Jack Grigg af8f1c207e depends: Boost 1.81.0 2023-01-13 00:33:13 +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
Dimitris Apostolou 3748f3b83a
Fix typos 2023-01-13 00:49:12 +02:00
Daira Hopwood 18b9f8fbd1
Merge pull request #6346 from daira/cleanup-exportwallet
Cleanup after removing dumpwallet
2023-01-12 22:37:09 +00:00
James O'Beirne 5acb393502 Add AbsPathForConfigVal to consolidate datadir prefixing for path args
Most commandline/config args are interpreted as relative to datadir if
not passed absolute. Consolidate the logic for this normalization.

(cherry picked from commit bitcoin/bitcoin@54604600c3)
2023-01-12 22:01:21 +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
Wladimir J. van der Laan 43e97615ab rpc: Write authcookie atomically
Use POSIX rename atomicity at the `bitcoind` side to create a working
cookie atomically:

- Write `.cookie.tmp`, close file
- Rename `.cookie.tmp` to `.cookie`

This avoids clients reading invalid/partial cookies as in #11129.

(cherry picked from commit bitcoin/bitcoin@82dd7195e1)
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
Daira Hopwood 374df7c4a2 Cleanup after removing dumpwallet.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2023-01-12 16:17:27 +00:00
Jack Grigg bbc18d2cb2 depends: googletest 1.12.1 2023-01-11 20:55:00 +00:00
str4d d766de5e67
Merge pull request #6337 from str4d/update-rust-deps
Update Rust dependencies
2023-01-11 17:45:39 +00:00
Jack Grigg 7cf42562d3 zcash_primitives 0.9 2023-01-11 00:56:29 +00:00
str4d 8dbba8e109
Merge pull request #6311 from sandakersmann/patch-2
Add some more historical checkpoints
2023-01-10 21:56:17 +00:00
Jack Grigg a33b8529ff Merge branch 'master' into 6307-backport-mempool-packages 2023-01-06 23:55:37 +00:00
Kris Nuttycombe 20996b4eb7
Merge pull request #6282 from str4d/ratchet-feature-deprecation
Ratchet feature deprecation
2023-01-06 11:58:27 -07:00
Jack Grigg 0ff86213ce Deprecate old hash fields of `getblocktemplate` 2023-01-05 22:32:19 +00:00
Jack Grigg 09cd65327b Disable previously-deprecated features by default
These features were deprecated at least 3 minor releases ago. I found
one mistake which was that `z_validateaddress` had not been placed
behind the `addrtype` deprecated feature; this has been fixed.
2023-01-05 22:32:19 +00:00
Jack Grigg a31252a8d8 txdb: Clean up for loop syntax in `WriteBatchSync` 2023-01-03 19:55:05 +00:00
Jack Grigg 37921677e9 Remove `zcraw*` RPC methods 2023-01-03 12:35:53 +00:00
Jack Grigg 2651451454 Remove `dumpwallet` RPC method
The RPC method handler is left in as a tombstone, to redirect callers to
the replacement method (as this is an upstream Bitcoin Core RPC method
that users may expect to be present).
2023-01-03 12:35:52 +00:00
Jack Grigg fb7eb1dad6 txdb: Remove const annotation from blockinfo iterator type
The const annotation was removed from the blockinfo type in
zcash/zcash#6192, but not from the type of its iterator. Recent Clang
versions are able to handle this, but GCC 11 (and it appears older Clang
versions) raise an error.

Closes zcash/zcash#6306.
2023-01-03 12:07:47 +00:00
Jack Grigg c16b1e8c24 test: Improve CreateNewBlock_validity exception checks 2022-12-20 11:41:04 +00:00
Alex Morcos 45355e85d0 Rewrite CreateNewBlock
Use the score index on the mempool to only add sorted txs in order.  Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined.
The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid.  Finality of txs is still checked (except not coinbase maturity, assumed in mempool).
Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created.
Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction.

Conflicts:
	src/miner.cpp

(cherry picked from commit bitcoin/bitcoin@553cad94e2)

Zcash: Merged in our changes.
2022-12-20 11:41:04 +00:00
Alex Morcos f18c96d7ae Expose FormatStateMessage
(cherry picked from commit bitcoin/bitcoin@5f12263302)
2022-12-20 08:57:33 +00:00
Alex Morcos 0d9a5442eb Make accessing mempool parents and children public
(cherry picked from commit bitcoin/bitcoin@1f09287c66)
2022-12-20 08:57:33 +00:00
Mark Friedenbach 38e319a88f Prevent block.nTime from decreasing
Under some circumstances it is possible for there to be a significant,
discontinuous jump in a node's clock value. On mining nodes, this can
result in block templates which are no longer valid due to time-based
nLockTime constraints. UpdateTime() is modified so that it will never
decrease a block's nLockTime, thereby preventing such invalidations.

(cherry picked from commit bitcoin/bitcoin@ef8dfe41d1)

Zcash: Updated CreateNewBlock_validity test and wallet_1941 RPC test to
ensure we satisfy the future timestamp soft fork rule.
2022-12-20 08:56:15 +00:00
Jack Grigg 1018ebd002 test: Handle mining slow start inside `CreateNewBlock_validity`
This partially reverts zcash/zcash@4f4a8c3c88
and correctly handles the mining slow start without repeatedly calling
CreateNewBlock.
2022-12-20 08:06:39 +00:00
str4d ca85cfbab3
Merge pull request #6244 from sellout/txbuilder-std-fee
Modify TransactionBuilder to use the standard default fee.
2022-12-19 21:03:38 +00:00
Suhas Daftuar ca514c655c Fix mempool package tracking edge case
CalculateMemPoolAncestors was always looping over a transaction's inputs
to find in-mempool parents.  When adding a new transaction, this is the
correct behavior, but when removing a transaction, we want to use the
ancestor set that would be calculated by walking mapLinks (which should
in general be the same set, except during a reorg when the mempool is
in an inconsistent state, and the mapLinks-based calculation would be the
correct one).

(cherry picked from commit bitcoin/bitcoin@60de0d5826)
2022-12-19 05:38:49 +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
Marius Kjærstad 2f8303617c
Add some more historical checkpoints
Add some more historical checkpoints i.a.w: https://github.com/zcash/zcash/issues/6224
2022-12-19 03:14:07 +01:00
str4d 1f7553d753
Merge pull request #6228 from sandakersmann/patch-1
Hardened checkpoint update at block 1860000 for mainnet
2022-12-15 19:40:00 +00:00
Greg Pfeil 1f401b39cc Fix a missing newline in the RPC docs 2022-12-12 15:01:21 -10:00
Kris Nuttycombe 4bc92bf7cb
Merge pull request #6242 from sellout/transaction-strategy
Add operations to TransactionStrategy
2022-12-12 09:22:25 -07:00
Kris Nuttycombe 80a1366a05
Merge pull request #6265 from sellout/any_taddr-sans-coinbase
Don’t select transparent coinbase with ANY_TADDR
2022-12-12 09:18:32 -07:00
Daira Hopwood 619456a4f4 tl::expected follow-up to address @str4d's comments.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-09 01:36:45 +00:00
Daira Hopwood d502714326 Refactor HaveShieldedRequirements to use tl::expected (example with a void T)
and rename it to CheckShieldedRequirements.

Signed-off-by: Daira Hopwood <jacaranda.org>
2022-12-08 20:53:54 +00:00
Greg Pfeil 54ecf53619
Update src/wallet/asyncrpcoperation_sendmany.cpp
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-12-07 15:22:11 -07:00
Greg Pfeil cf720fcf0f Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-07 12:31:07 -07:00
Greg Pfeil 7e6c53323a Improve PrivacyPolicy comments
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-07 11:09:27 -07:00
Greg Pfeil 4cff6f80c6 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-06 15:23:55 -07:00
Kris Nuttycombe 9c600a5582 Factor out memo parsing from asyncrpcoperation_sendmany 2022-12-06 15:23:55 -07:00