Commit Graph

15533 Commits

Author SHA1 Message Date
Conrado Gouvea 269c5c2e7f Add comment to zcash_script_new_precomputed_tx about references to input buffers 2022-01-31 15:16:35 -03:00
Kris Nuttycombe d8c818bfa5
Merge pull request #5464 from LarryRuane/2022-01-submitblock-log-soln-error
mining: submitblock: log detailed equihash solution error
2022-01-25 12:49:00 -07:00
Kris Nuttycombe 28eddb7c21
Merge pull request #5474 from LarryRuane/2022-01-disable-sprout-addr-gen
rpc: Disable Sprout address generation at Canopy #5368
2022-01-25 10:05:44 -07:00
Charlie O'Keefe 19bfc2f3b8
Merge pull request #5463 from zingolabs/drop_pyblake2_dep
Drop pyblake2 dependency
2022-01-25 09:32:08 -07:00
str4d a6f9c9c0bc Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-21 20:14:58 -07:00
str4d 423489c5e8
Merge pull request #5458 from nuttycom/cleanup/sendmany_txbuilder
Use the transaction builder to implement z_sendmany.
2022-01-12 23:50:09 +00:00
Kris Nuttycombe de58fc0b16 Update release notes to reflect z_sendmany changes 2022-01-12 10:45:58 -07:00
Kris Nuttycombe 528ae6d180 Return z_sendmany errors synchronously when possible. 2022-01-12 10:45:58 -07:00
Kris Nuttycombe 0ca7d49626 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-12 10:45:46 -07:00
Kris Nuttycombe 9554ed2dc4 Require an explicit flag to allow cross-pool transfers in z_sendmany.
This adds an `allowRevealedAmounts` argument to z_sendmany. This
flag must be present to allow an amount-revealing cross-pool transfer
to be constructed.
2022-01-11 19:40:02 -07:00
Kris Nuttycombe 322aee238a Fix conditions around dust thresholds. 2022-01-11 19:40:02 -07:00
Kris Nuttycombe b54a63bf18 Transaction builder must not set consensus branch ID for V4 transactions. 2022-01-11 13:28:34 -07:00
Kris Nuttycombe f9477a4499 Use transaction builder for asyncrpcoperation_sendmany.
This replaces the old implementation of asyncrpcoperation_sendmany
with one where all transaction construction is delegated to the
transaction builder. The capabilities of z_sendmany are somewhat
modified in the process:

* z_sendmany now permits sending funds from a Sprout address to
  both transparent and Sapling addresses. PRIVACY NOTE: When
  user sends a Sprout->Sapling transaction, the amount of the
  transaction is publicly revealed.
* z_sendmany no longer supports transactions sending funds into
  the Sprout pool, with the exception of change amounts when
  sending from a Sprout address.
* When sending transparent coinbase funds to a set of shielded
  addresses, the amount sent to recipients must fully consume
  the input value and no change is permitted. This is a slightly
  weaker constraint than was previously implemented; in the past,
  only a single shielded recipient was allowed.
2022-01-11 13:28:34 -07:00
Larry Ruane bc1af5fc2d mining: submitblock: log detailed equihash solution error 2022-01-11 12:52:30 -07:00
zancas 30abf25148
update doctest in gtest suite to prefer hashlib 2022-01-11 10:32:18 -07:00
Kris Nuttycombe d6525e24db
Merge pull request #5445 from rex4539/typos
Fix typos
2022-01-11 10:31:01 -07:00
zancas fbbdb23214
blake2b/s is integrated into hashlib, drop external python package dependency 2022-01-11 10:16:22 -07:00
str4d 005a8624bf
Merge pull request #5440 from nuttycom/cleanup/sendmany_txbuilder-prereq
Prerequisites for replacing manual transaction construction in asyncrpcoperation_sendmany with the transaction builder.
2022-01-11 15:24:55 +00:00
Kris Nuttycombe 951a44de93 Merge remote-tracking branch 'upstream/master' into cleanup/sendmany_txbuilder-prereq 2022-01-10 19:49:23 -07:00
Kris Nuttycombe ed93cf5aff
Merge pull request #5459 from daira/fix-drop-warning
Avoid a warning by explicitly calling drop
2022-01-10 19:46:40 -07:00
Kris Nuttycombe 41eebce355 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-10 19:46:06 -07:00
Daira Hopwood 0e073a53ee Replace call to drop with zeroization.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-10 02:39:25 +00:00
Daira Hopwood 4f7d15508f Avoid a warning by explicitly calling drop.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-01-09 23:54:35 +00:00
Kris Nuttycombe d3b599eac1 Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2022-01-07 11:49:09 -07:00
Kris Nuttycombe 864cd8622f Improve error messages in the case of taddr decoding failure. 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 9702b47e2a Use libzcash::PaymentAddress instead of std::string in mergetoaddress 2022-01-07 11:49:09 -07:00
Kris Nuttycombe eb91c7869a Remove a use of KeyIO::DecodeDestination in z_shieldcoinbase 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 20266ac911 Remove uses of KeyIO::DecodeDestination 2022-01-07 11:49:07 -07:00
Kris Nuttycombe d376e28382 Replace `DecodeDestination` in `GetMinerAddress` with `DecodePaymentAddress` 2022-01-06 22:29:44 -07:00
Kris Nuttycombe f5d4f6fef1 Remove `RawAddress`
This adds a new `AddrSet` type for use in note retrieval
as a filter, in place of a heterogeneous list of `RawAddress`
values. `RawAddress` will complicate the handling of addresses
within the wallet after the addition of unified addresses,
because it does not contain transparent receiver types, and
if we retain this polymorphism it means a lot of invalid states
are represented in places we don't want them to be. It's better
to figure out what types of addresses we're working with as soon
as possible after parsing, and use monomorphic calls from there
on in.
2022-01-06 22:29:41 -07:00
Kris Nuttycombe 4f2ff2a9f8 Remove spurious variant from asyncrpcoperation_sendmany
The `spendingkey_` field previously used by asyncrpcoperation_sendmany
caused a situation where call sites would assume the type of the
spending key based upon boolean flags that were derived elsewhere.
In attempting to support unified addresses, it is desirable to remove
these boolean deductions and instead work primarily based on the
direct evidence of the data at hand. This commit therefore removes
the `spendingkey_` field that could potentially produce results
that would disagree with these boolean values, in favor of such
direct evidence, making these call sites a bit less error prone.
2022-01-06 15:32:04 -07:00
Kris Nuttycombe 890e1d841d Add raw transparent address types to PaymentAddress
The addition of `UnifiedAddress` to the `PaymentAddress` type
introduced the need for methods that interact with payment addresses
to support transparent receivers as shielded ones, which is somewhat
inconsistent with previous uses of the `PaymentAddress` type.

This commit adds both `CKeyID` and `CScriptID` as new variants
of the `PaymentAddress` type. Following commits will shift encoding
and decoding to use the `PaymentAddress` type exclusively wherever
possible, rather than the current mix of `CDestination` and
`PaymentAddress` that complicates the wallet codebase.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe c35e2b4438 Remove spurious uses of HaveSpendingKeyForPaymentAddress
There's no need to dispatch through this visitor in cases where
the payment address type is already statically known.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe 62b86d6afc Use CKeyID and CScriptID instead of new P2PKH/P2SHAddress classes. 2022-01-06 13:44:45 -07:00
Kris Nuttycombe b305ad2892 Remove the `InvalidEncoding` type from key & address variants.
The presence of this variant results in a situation where more
of the code than necessary needs to be aware of and handle
decoding failures. This change moves all handling of decoding
failures to the point of decoding.
2022-01-06 13:44:45 -07:00
Kris Nuttycombe 0403799be2
Merge pull request #5454 from zcash/hotfix-v4.6.0-1
Hotfix v4.6.0-1
2022-01-05 18:15:33 -07:00
str4d fe7b87a96c
Merge pull request #5452 from str4d/release-v4.6.0-1
Release v4.6.0-1
2022-01-05 22:18:46 +00:00
Jack Grigg daef0041e0 Add release notes for v4.6.0-1 2022-01-05 20:24:29 +00:00
Jack Grigg cf22fa7fe3 make-release.py: Updated release notes and changelog for 4.6.0-1. 2022-01-05 20:18:43 +00:00
Jack Grigg b97133daaf make-release.py: Updated manpages for 4.6.0-1. 2022-01-05 20:18:43 +00:00
Jack Grigg 5bf937b422 make-release.py: Versioning changes for 4.6.0-1. 2022-01-05 20:16:10 +00:00
str4d 7b820cfa8f
Merge pull request #5451 from zcash/2022-01-getblocktemplate-regression-fix
rpc: Fix regression in getblocktemplate output
2022-01-05 20:07:44 +00:00
Jack Grigg 4559186596 rpc: Fix regression in getblocktemplate output
We added support for the NU5 consensus rules in v4.5.0, which alters the
block header to contain a `hashBlockCommitments` value instead of the
chain history root. However, the output of `getblocktemplate` wasn't
returning this value; once NU5 activated, the `blockcommitmentshash`
field was being set to "null" (all-zeroes).

In v4.6.0 we added full NU5 support to `getblocktemplate`, by adding a
`defaultroots` field that gave default values for `hashBlockCommitments`
and the components required to derive it. However, in doing so we
introduced a regression in the (now-deprecated) legacy fields, where
prior to NU5 activation they contained nonsense.

This commit fixes the output of `getblocktemplate` to have the intended
semantics for all fields:

- The `blockcommitmentshash` and `authdataroot` fields in `defaultroots`
  are now omitted from block templates for heights before NU5 activation.

- The legacy fields now always contain the default value to be placed
  into the block header (regaining their previous semantics).

Co-authored-by: Larry Ruane <larry@z.cash>
2022-01-05 12:07:46 +00:00
Larry Ruane 97a76f1b61 test: Fix ZIP 244 implementation
Script codes must be serialized in their field encoding, which
includes the CompactSize length prefix.

Co-authored-by: Jack Grigg <jack@z.cash>
2022-01-05 12:07:46 +00:00
Larry Ruane dfefab2f55 test: check getblocktemplate output before and after NU5
This test currently fails with submitblock returning the error
"bad-heartwood-root-in-block".

Added authdigest to GBT coinbasetxn field because we can't obtain this
via getrawtransaction.

Co-authored-by: Jack Grigg <jack@z.cash>
2022-01-05 12:07:46 +00:00
Dimitris Apostolou 2006939d27
Fix typos 2022-01-02 23:16:01 +02:00
Kris Nuttycombe 0931aa8908
Merge pull request #5443 from steven-ecc/gtest-fix-for-debug-mode
Lock cs_main prior to calling blockToJSON
2021-12-30 11:18:14 -07:00
Steven Smith 56b706d5c7 Lock cs_main prior to calling blockToJSON 2021-12-29 21:22:19 -08:00
Daira Hopwood ba0688da3f
Merge pull request #5441 from LarryRuane/2021-12-28-test-submitblock
test: assert that the return value of submitblock is None
2021-12-29 14:02:57 +00:00
Larry Ruane 1f223ebed7 assert that the return value of submitblock is None 2021-12-28 22:10:13 -07:00