Commit Graph

11122 Commits

Author SHA1 Message Date
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 7abdade2cc Don’t select transparent coinbase with ANY_TADDR
This also includes the “Insufficient funds” suffixes on dust threshold
failures.

Fixes #6262
2022-12-02 22:30:45 -07:00
Daira Hopwood 5e3e4d49d0 make-release.py: Versioning changes for 5.3.1. 2022-12-02 02:42:08 +00:00
Greg Pfeil 0647a9ba24 make-release.py: Versioning changes for 5.3.1-rc1. 2022-11-23 22:09:24 -07:00
Greg Pfeil f6a4f68115
Merge pull request #6122 from nuttycom/wallet/listunspent_as_of
Add `asOfHeight` argument across the RPC API
2022-11-23 21:20:20 -07:00
Greg Pfeil 583fbb2218 Simplify filtering AvailableCoins by destination 2022-11-23 11:51:22 -07:00
Greg Pfeil 2eb29c2a66
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-11-23 11:00:10 -07:00
Greg Pfeil 368d04245d Change asOfHeight to preserve Bitcoin compat 2022-11-22 22:06:51 -07:00
Greg Pfeil 4b2203a1fd Change asOfHeight to use -1 as default 2022-11-22 16:47:40 -07:00
Greg Pfeil 6421f47ef7 Revert getinfo support of asOfHeight
This operation is practically deprecated, so don’t change it.
2022-11-22 16:47:40 -07:00
Greg Pfeil 7792228bab Revert change to getbalance minconf
It was the docs that were wrong. In this case, the default `minconf` _should_ be
0 (to match upstream).
2022-11-22 16:47:40 -07:00
Greg Pfeil f290b9a7b4
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-11-22 15:59:07 -07:00
Daira Hopwood 6284f3f8b0
Merge pull request #6231 from miodragpop/headers-first-rebirth
Headers-first fix
2022-11-22 19:27:03 +00:00
Greg Pfeil 5ea600a102
Update src/rpc/server.cpp
Co-authored-by: Kris Nuttycombe <kris.nuttycombe@gmail.com>
2022-11-22 10:38:21 -07:00
Kris Nuttycombe 30846624da
Merge pull request #6246 from sellout/zsendmany-docs
Improve z_sendmany documentation
2022-11-22 07:55:02 -07:00
str4d b9158fe377
Merge pull request #6259 from str4d/debugmetrics
Place zcashd.debug.* metrics behind a -debugmetrics config option
2022-11-22 06:05:47 +00:00
Greg Pfeil 3b3f8f4cac
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 21:15:07 -07:00
Greg Pfeil 77fb36a422 Don’t trust mempool tx when using `asOfHeight` 2022-11-21 20:44:21 -07:00
Greg Pfeil 08469bd3c0 Add error cases and default to `asOfHeight` 2022-11-21 20:44:21 -07:00
Greg Pfeil 13d79c453b Require minconf > 0 when asOfHeight is provided 2022-11-21 20:44:21 -07:00
Greg Pfeil 7f79b6b93d GetUnconfirmedBalance should not take asOfHeight
This also
* renames `GetUnconfirmedBalance` to `GetUnconfirmedTransparentBalance`,
* reverts the `getunconfirmedbalance` RPC call to not accept `asOfHeight`,
* conditionalizes `getwalletinfo` to only include unconfirmed balances in calls
  without `asOfHeight`, and
* removes the unused `Get*WatchOnlyBalance` functions.
2022-11-21 20:44:21 -07:00
Greg Pfeil 4b91d81e6f Fix calls that should have specified asOfHeight 2022-11-21 20:44:21 -07:00
Greg Pfeil 952a1ac433 Ignore mempool when asOfHeight is set
This also catches a case where the default minconf was 0 (which disagreed with
the docs), and a case where asOfHeight checked the wrong param entry.
2022-11-21 20:44:21 -07:00
Daira Hopwood 154e4dfb2e
Update constants
@str4d and @daira decided on these.
2022-11-21 23:16:00 +00:00
Jack Grigg 93de2aae0e Place zcashd.debug.* metrics behind a -debugmetrics config option 2022-11-21 20:50:02 +00:00
Daira Hopwood fb66589022 Declare `CBlockTreeDB::Read*` methods as `const` when they are trivially so.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Daira Hopwood 089acd75f7 Add Prometheus metrics so we have more visibility into what is going
on with the Equihash solution trimming:

* (counter) `zcashd.debug.memory.allocated_equihash_solutions` -
  the number of Equihash solutions that have ever been allocated;
* (counter) `zcashd.debug.memory.trimmed_equihash_solutions` -
  the number of Equihash solutions that were trimmed;
* (counter) `zcashd.debug.blocktree.trimmed_equihash_read_dbindex` -
  the number of times a block index entry needed to be reread to
  construct a block header because a solution had been trimmed;
* (counter) `zcashd.debug.blocktree.write_batch` -
  the number of block tree batch write operations (calls to
  `CBlockTreeDB::WriteBatchSync`);
* (counter) `zcashd.debug.blocktree.write_batch_read_dbindex` -
  the number of times a block index entry needed to be reread
  before being written during a block tree batch write operation.

These metrics are specific to `zcashd`; they are primarily intended
for performance debugging of this feature and should not be considered
stable.

Co-authored-by: Jack Grigg <thestr4d@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Daira Hopwood 8c958e13a5 Improve handling of database read errors.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Daira Hopwood aee8d5c0ec Avoid storing the Equihash solution in a CBlockIndex object once it has been written
to the leveldb database.

Co-authored-by: Jack Grigg <thestr4d@gmail.com>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-21 18:24:45 +00:00
Greg Pfeil e4426a725c Extract asOfHeight info from RPC calls 2022-11-19 01:03:28 -07:00
Greg Pfeil 10eb43c232 Don’t ignore asOfHeight in IsSpent calls 2022-11-18 21:39:39 -07:00
Greg Pfeil d01c5e744c Implement `asOfHeight` 2022-11-18 01:20:00 -07:00
Greg Pfeil 659077aff2 Propagate asOfHeight to all relevant RPC calls
This removes the default `std::nullopt`[^1] and threads `asOfHeight` through the
call graph, only using `std::nullopt` where it is unconditionally correct (e.g.,
where we would be creating a tx, and thus need the actual chain tip).

This does not change deprecated or legacy operations.

[^1]: Having a default makes it easy to miss call sites that should be
      updated. If a default is deemed useful, it should be added in a separate
      commit, so that all call sites can be reviewed in an earlier commit.
2022-11-18 01:20:00 -07:00
Kris Nuttycombe 2c487c9430 Add RPC test for wallet_listunspent changes 2022-11-18 01:20:00 -07:00
Kris Nuttycombe b745992489 Add `unspent_as_of` argument to `listunspent`
This makes it possible for `listunspent` to return utxos unspent as of a
particular depth in the main chain.
2022-11-18 01:20:00 -07:00
Daira Hopwood 2ee172fe15 Error reporting improvements.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-13 18:46:30 +00:00
Greg Pfeil 641faccdd6 Improve z_sendmany documentation
It previously said “send multiple times”, but it only sends a single
transaction.
2022-11-11 12:07:43 -07:00
Miodrag Popović 6ccdf7fa6c Headers sync timeout: Use EstimateNetHeight() for closer approximation of remaining headers to download 2022-11-11 19:53:01 +01:00
Suhas Daftuar 9238e2c3cf Add timeout for headers sync
(cherry-picked bitcoin/bitcoin@76f74811c4)

At startup, we choose one peer to serve us the headers chain, until
our best header is close to caught up.  Disconnect this peer if more
than 15 minutes + 1ms/expected_header passes and our best header
is still more than 1 day away from current time.
2022-11-11 10:49:41 +01:00
Daira Hopwood 6e232d1ab2 Improve a comment about the wallet birthday scanning optimization.
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-09 15:00:24 +00:00
Daira Hopwood 3cc9da3d2e Ensure that the optimization of not scanning blocks prior to the wallet's
birthday does not cause us to try to "rewind" the Orchard wallet to a
height after its current checkpoint.

potentially fixes #5958

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-09 13:50:13 +00:00
Miodrag Popović a84eea73b7 FindNextBlocksToDownload(): Fetch active consensus params to read nMinimumChainWork 2022-11-02 10:27:49 +01:00
Suhas Daftuar 5cfa090446 Delay parallel block download until chain has sufficient work
(cherrypicked bitcoin/bitcoin@e2652002b6)

nMinimumChainWork is an anti-DoS threshold; wait until we have a proposed
tip with more work than that before downloading blocks towards that tip.
2022-11-02 10:25:06 +01:00
Daira Hopwood 1889a466ec Report the prevout for each transparent input as it is being checked
Author: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-29 18:46:58 +01:00
Kris Nuttycombe fd2cd0f02b Add extra detail related to transparent inputs and outputs. 2022-10-29 18:44:53 +01:00
Greg Pfeil 5a084253d6 make-release.py: Versioning changes for 5.3.0. 2022-10-20 10:38:42 -06:00
Kris Nuttycombe 16c49a844e Fix clippy lints. 2022-10-20 08:35:29 -06:00
Kris Nuttycombe 741e6b1108 Update to released versions of librustzcash crates. 2022-10-20 08:35:29 -06: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