Commit Graph

1585 Commits

Author SHA1 Message Date
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
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
Suhas Daftuar ef14b8ba60 Add test showing bug in mempool packages
(cherry picked from commit bitcoin/bitcoin@598b25d5ee)
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
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
Greg Pfeil cf720fcf0f Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-12-07 12:31:07 -07:00
Daira Hopwood e870334d04
Merge pull request #6267 from rex4539/typos
Fix typos
2022-12-06 17:39:20 +00:00
Daira Hopwood 72cef60175 Postpone updates.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-03 19:47:30 +00:00
Greg Pfeil 5f0681a601 Update failing tests after fixing ANY_TADDR behavior 2022-12-02 22:30:45 -07:00
Daira Hopwood b2c88861ee Bump timestamps and add libcxx/native_clang 15.0.6 in `postponed-updates.txt`.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-12-02 02:15:22 +00:00
Dimitris Apostolou 0994282019
Fix typos 2022-11-25 23:09:48 +02:00
Greg Pfeil 3de2348987 Postpone dependency updates for v5.3.1 2022-11-23 22:05:45 -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 368d04245d Change asOfHeight to preserve Bitcoin compat 2022-11-22 22:06:51 -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 d444f8b586 Fix small error in code review suggestions 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
Greg Pfeil 4f85307186 Add FIXMEs to repair comments after #6262 is fixed 2022-11-22 10:36:34 -07:00
Kris Nuttycombe 0a87047186
Merge pull request #6245 from sellout/wallet_accounts-formatting
Small formatting change
2022-11-22 07:55:40 -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 b27fdf54fd Add matured_at_height test helper 2022-11-21 22:36:12 -07: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 71b5f99ede Work around #6262 in wallet_listunspent 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
str4d c267c3ee26
Merge pull request #6192 from daira/reduce-equihash-solution-memory
Reduce memory usage of CBlockIndex
2022-11-21 22:25:30 +00:00
Jack Grigg 93de2aae0e Place zcashd.debug.* metrics behind a -debugmetrics config option 2022-11-21 20:50:02 +00:00
Daira Hopwood 27ffefed12
Merge pull request #6248 from sellout/reuse-python
Avoid inconsistent Python lookup
2022-11-18 22:52:38 +00:00
Greg Pfeil d796114b2e Add additional asOfHeight tests 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
Daira Hopwood 3529097153 Fix a dependency of the `show_help` RPC test on the number of cores,
and an incompatibility with Python 3.9 in the test framework that
affected the `receivedby` extended RPC test.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-11-15 13:58:26 +00:00
Greg Pfeil c12fb6ad5b Avoid inconsistent Python lookup
When executing a Python script from within Python, rather than looking for
`python3` in /usr/local/bin and falling back to the script’s shebang line,
_always_ use the same Python that is executing the caller.

I don’t know why this script doesn’t just run `bitcoin_util_test.py`
directly (always using the shebang line), but I assume that is
intentional (but that should be documented). Otherwise, I’d prefer that
approach.
2022-11-14 06:37:51 -10: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 4ec2642f94 Small formatting change 2022-11-10 20:50:22 -07:00
Kris Nuttycombe e417ba89a6
Merge pull request #6211 from sellout/updatecheck-token-path
Improve token handling in the updatecheck script
2022-10-26 12:15:29 -06:00
Greg Pfeil 1296b646b3
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-10-26 09:07:58 -06:00
Greg Pfeil 87aa33ecc4 `zcash --help` test improvements
Applying suggestions from @daira’s review of #6204.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-10-21 19:03:13 -06:00
Greg Pfeil 8e333b3f49 updatecheck: support XDG-based token location
Have updatecheck look in $XDG_DATA_HOME/zcash/updatecheck/token for the GH
token. Having one in the repo will still take precedence (for pre-existing
users, as well as if you want to override the token used in a particular
case). The new location is standardized, exists at the user level (as the token
logically does), and means that you don't need to copy files around if you get a
new clone or worktree to do a release.
2022-10-20 12:25:13 -06:00
Greg Pfeil 4c21d6f444 updatecheck: simplify token handling
- make the token optional (just will hit a rate limit after a few runs of the
  script)
- only load the token once, rather than once per request (this is necessary
  after the above change, so you don't get the warning printed repeatedly)
- switch from BasicAuth to an Authorization header (this means we no longer need
  the GitHub username, just the token)
- support a token file that doesn't contain a username (it will still parse old
  versions of the file properly)
2022-10-20 12:13:30 -06:00
Greg Pfeil 9c4bf36c45 updatecheck: fix GitHub auth
The script was accessing nonexistent vars, so auth wasn't working. Mostly not
noticable until you hit the API's unauthed request rate limit.
2022-10-20 10:48:02 -06:00
Kris Nuttycombe 06a1c78941 Certify librustzcash crate upgrades. 2022-10-20 08:35:29 -06:00
Kris Nuttycombe 2f734ce6ea Vet cxxbridge upgrade. 2022-10-19 12:21:37 -06:00
Kris Nuttycombe 05110068d9 Update and/or postpone dependencies for 5.3.0 2022-10-19 10:09:03 -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 5c19487991 Add test for `zcashd --help`
Currently failing.
2022-10-18 13:42:02 -06:00
Daira Hopwood 774fa691aa Always use a tuple as right argument of % in new Python code.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-18 13:42:02 -06:00
Greg Pfeil 1e480d2b4d Address review feedback and fixed test failures
Some tests were checking error message strings, but the check was still
hardcoded to “bitcoind”.
2022-10-18 13:42:02 -06:00
Greg Pfeil 8cb655c3ff Fix display of binary name in error messages.
Ensures that test failures report the name of the actual binary that was run.
2022-10-18 13:42:02 -06:00
Greg Pfeil ebea82c96c
Merge pull request #6165 from sellout/rpc-tests-binary-name
Fix display of binary name in error messages.
2022-10-11 16:25:51 -06:00
Jack Grigg 4871fba26a rust: Update remaining dependencies
The audit exemptions have been regenerated for these dependencies.
2022-10-11 10:13:41 +00:00
Jack Grigg 2477ef9c4b rust: Audit some dependency updates 2022-10-11 05:08:07 +00:00
Daira Hopwood 7788afcf54 Always use a tuple as right argument of % in new Python code.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-10-10 20:50:59 +01:00
Jack Grigg 13657342c8 qa: Recommend cargo-upgrades instead of cargo-outdated
Closes zcash/zcash#6090.
2022-10-10 19:05:51 +00:00
Jack Grigg 9a69c2b01e rust: Update to `cpufeatures 0.2.5`
Closes zcash/zcash#6195.
2022-10-10 19:04:39 +00:00
Jack Grigg f7b59a5ddb qa: Postpone Clang 15.0.2 2022-10-10 18:56:49 +00:00
Jack Grigg 1f836859f3 depends: Update cxx to 1.0.78 2022-10-10 18:56:12 +00:00
Jack Grigg 3b9f7c2a69 rust: Update to `metrics 0.20` 2022-10-10 18:44:33 +00:00
Greg Pfeil ad47364f31 Address review feedback and fixed test failures
Some tests were checking error message strings, but the check was still
hardcoded to “bitcoind”.
2022-10-04 10:21:06 -06:00
Greg Pfeil 6a7c86e63b Fix display of binary name in error messages.
Ensures that test failures report the name of the actual binary that was run.
2022-10-04 10:21:06 -06:00
DeckerSU 225c8b8a03
test_framework: fix AttributeError in sapling_spends_compact_digest
Without this fix we will get:
AttributeError: 'SpendDescriptionV5' object has no attribute 'anchor'
On certain V5 transactions rehash / calc_sha256, for example:
ca6abd8ef7d6ef158a4a35ea2c2c0cf122f2f664a88f8fa5b6fd79e48c5bed59
2022-10-04 01:54:34 +02:00
str4d f466eb0484
Merge pull request #6156 from daira/prepare-epks-and-ivks
Switch to a version of librustzcash that prepares ivk and epk when doing trial decryption
2022-09-27 22:59:45 +01:00
Jack Grigg 0e3fc36a47 wallet: Correctly track heap usage of batch items
As of zcash/librustzcash#633, `SaplingDomain::IncomingViewingKey` now
allocates memory internally, and this memory persists as long as the
`BatchRunner` is alive. Now that we have decoupled the measurement of
heap usage for batch tasks from their internals, we can add bounds to
all of the generic parameters of `Batch` to enable correctly measuring
their actual heap usage.

Ported from zcash/librustzcash@913aa0a988.
2022-09-26 22:19:33 +00:00
Kris Nuttycombe 34f0a973c7
Merge pull request #6152 from sellout/orchard-anchor-hash
Fix finalorchardroot serialization
2022-09-23 19:53:54 -06:00
Daira Hopwood 9c433909f5 Audit dependency updates.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-09-24 02:49:19 +01:00
Greg Pfeil 5514542a0a
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-09-23 18:39:00 -06:00
Jack Grigg 153248aee1 qa: Add audit policies for patched Rust crates 2022-09-23 03:44:07 +00:00
Jack Grigg d3b434eb0f depends: Update cxx to 1.0.76 2022-09-23 03:44:07 +00:00
Jack Grigg 6af969a7b7 qa: Postpone Clang 15 to retain LLVM 14 pin 2022-09-23 02:57:07 +00:00
Jack Grigg d33594026c qa: Postpone dependencies that require CMake 2022-09-23 02:57:07 +00:00
Greg Pfeil bdde47fb5d Fix finalorchardroot serialization
Previously, `finalorchardroot` and `orchard.anchor` were serialized differently
in the RPC API, which made it difficult to correlate them. This changes the
serialization for `finalorchardroot` to match `orchard.anchor`.
2022-09-22 18:20:42 -06:00
Greg Pfeil 4f4ef5537b Add a finalorchardroot RPC test 2022-09-22 14:13:58 -06:00
Kris Nuttycombe da5fbfe747
Merge pull request #6132 from sellout/rpc-test-improvements
RPC test improvements
2022-08-22 16:06:50 -06:00
Greg Pfeil 6766e39ad1 Add simplejson to requirements for rpc-tests 2022-08-22 13:38:16 -06:00
Greg Pfeil 113d7a4840 Add an `rpc-tests` make target
This ensures that zcashd is up-to-date with any changes before running the
tests.
2022-08-22 13:38:16 -06:00
Jack Grigg 8d82cee9c8 rust: Add `zcash-inspect` binary for inspecting Zcash data
Currently supports Zcash blocks, block headers, and transactions. Some
consensus rules are also checked, and a JSON context object can be
optionally passed to provide any necessary details for extra contextual
consensus checks.
2022-08-19 04:13:05 +00:00
Jack Grigg a2b971befb rust: Update some of the pinned dependencies
The primary purpose of this commit is an exercise in using `cargo vet`
for tracking audits of our Rust dependency updates. `cargo update` was
run, and then a simple-to-audit subset of the dependency updates were
audited and committed.
2022-08-17 10:39:38 +00:00
Jack Grigg 12c36670fe depends: Update Clang / libcxx to LLVM 14.0.6
In practice we are using 14.0.0 in most cases, as the LLVM Project have
not published Ubuntu binaries for any point release after 14.0.0 (which
we are using here).
2022-08-10 23:10:40 +00:00
Jack Grigg 93422e8fe2 depends: Update Rust to 1.62.1 2022-08-10 22:57:46 +00:00
Kris Nuttycombe 4a17098b72
Merge branch 'version-5.2.0' into narrow-too-many-args 2022-07-25 10:42:15 -06:00
Daira Hopwood a227652d7d Update cxx to 1.0.72.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-07-25 14:57:19 +01:00
Kris Nuttycombe e48d26eeb9 qa: Postpone recent native_rust, native_cxxbridge and rustcxx updates 2022-07-22 14:56:22 -06:00
Kris Nuttycombe 035a26b674 Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
Kris Nuttycombe 6477c6165b Update getblocktemplate test to use persisted sprout chain 2022-07-18 09:00:34 -06:00
Kris Nuttycombe 91f62f4161 Update finalsaplingroot test to use persisted sprout chains. 2022-07-18 09:00:34 -06:00
Kris Nuttycombe 95bbfd09aa Update feature_zip239 test to use persisted sprout chains. 2022-07-15 08:23:57 -06:00
Kris Nuttycombe b2fc56c24a Update sprout_sapling_migration test to use persisted sprout chains. 2022-07-15 08:23:57 -06:00
Kris Nuttycombe afea5c386d Add RPC test initialization using the persisted Sprout chains. 2022-07-15 08:23:57 -06:00
Kris Nuttycombe 532017e74e Remove the temporary test that was used for setup of the cached Sprout fixtures. 2022-07-15 08:23:57 -06:00
Kris Nuttycombe 5d44ce318e Add persistent Sprout test data.
This is in preparation for removing the ability to generate
Sprout outputs from z_shieldcoinbase. Once that is complete,
we will no longer be able to use `z_shieldcoinbase` for test
setup for uses of Sprout funds; instead, the persisted blockchain
state created in this commit will be used for tests that require
the use of Sprout funds.

This brings the test framework into line with how Sprout funds
are now used on mainnet and testnet; existing Sprout funds may
be spent, and Sprout change may be created, but no funds may
be transfered into the Sprout pool, since the activation of
ZIP 211.
2022-07-15 08:23:57 -06: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
zancas a4a0fbb3c0 match the actual two hyphen flag 2022-07-14 07:44:17 -06:00
str4d 050133358b
Merge pull request #6059 from superbaud/smoketest-minconf
Update smoke_test.py to compensate for changes in minimum confirmations required
2022-07-08 20:08:02 +01:00
Jack Grigg 884c149c64 qa: Postpone latest `cxx` update 2022-07-08 02:51:43 +00:00
sasha b72aaab820 Patch smoke_tests.py to require 4 confirmations for z_mergetoaddress 2022-07-07 01:22:40 -07:00
sasha 823c1b44c5 Improve smoke_test.py wait_for_balance message in the minconf!=1 case 2022-07-06 23:23:44 -07:00
sasha 61dd95ef0b Patch smoke_tests.py to properly handle changes in minconf behavior 2022-07-06 22:58:03 -07:00
Jack Grigg 343ddc1752 qa: Add native_cxxbridge and rustcxx to update checker 2022-07-05 21:45:59 +00:00
Jack Grigg 2e6a6572ba qa: Postpone dependency updates 2022-07-05 20:43:26 +00:00
Jack Grigg af59b2adb7 qa: Reformat for latest cargo-vet 2022-07-05 18:22:57 +00:00
Jack Grigg 90f13641b9 Use batch validation for Sapling proofs and signatures 2022-07-05 18:21:51 +00:00