Commit Graph

13630 Commits

Author SHA1 Message Date
Jack Grigg a1942a6061 Remove unused declarations left over from libsnark verification 2020-07-08 13:59:47 +12:00
Jack Grigg ed4550eb77 Move GrothProof and SproutProof definitions into zcash/Proof.hpp 2020-07-08 13:59:47 +12:00
Homu 1192116598 Auto merge of #4581 - ebfull:zip215-impl-2, r=str4d
ZIP 215 Implementation

This is accompanied by 8c97acde89.
2020-07-07 21:39:49 +00:00
Sean Bowe 249de0808d
Remove outdated comment. 2020-07-03 10:24:35 -06:00
Sean Bowe a9d80b0750
Hash "Zcash" to align tests with ZIP 215 test vectors. 2020-07-03 10:20:37 -06:00
Sean Bowe c3b3e07160
Change LIBSODIUM_ERROR to -1.
We only relied on success being 0 and our code was otherwise agnostic to the
actual return code in the event of failed signature verification, but this
change keeps the API consistent.
2020-07-03 09:37:34 -06:00
Sean Bowe 394947de3a
Migrate ZIP 215 test vectors to gtest suite. 2020-07-03 09:36:34 -06:00
Homu 602e88ddb9 Auto merge of #4489 - therealyingtong:4479-remove-sprout-shielding, r=str4d
[ZIP 211] Disabling Addition of New Value to the Sprout Value Pool

Disables Sprout outputs after NU4 by checking for nonzero `vpub_old` in transactions after NU4 activation height.

Adds gtests to check expected behaviour before and after NU4 activation height.

edit:
Also modifies `z_` methods in `rpcwallet`, and adds a matching RPC test.

Implements [ZIP 211](https://zips.z.cash/zip-0211), closes #4479
2020-07-02 21:53:51 +00:00
Sean Bowe 14a09a5fd6
Remove unused imports from remove_sprout_shielding RPC test. 2020-07-02 11:09:22 -06:00
Kris Nuttycombe 7dd1889944 Trivial copyright fix.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-07-02 00:27:18 +08:00
therealyingtong 5e4d13b49d Add RPC tests
Test that Sprout shielding is accepted before Canopy and rejected after Canopy activation
2020-07-02 00:27:14 +08:00
therealyingtong 1c59f06df0 Add checks to z_ methods in rpcwallet
Disallow Sprout shielding after Canopy in z_sendmany, z_shieldcoinbase, z_mergetoaddress, and zc_raw_joinsplit (deprecated)
2020-07-01 23:47:36 +08:00
therealyingtong 2a2fc2a16f Add gtests
Should accept Sprout shielding before NU4 but reject it afterwards
2020-07-01 23:31:41 +08:00
therealyingtong 01cdea54ee Add contextual check to main.cpp
Reject transactions with nonzero vpub_old after NU4
2020-07-01 23:31:36 +08:00
Homu eed865052b Auto merge of #4579 - rvagg:rvagg/joinSplitRPC, r=str4d
Add joinSplitPubKey and joinSplitSig to RPC

These two properties are required to fully reconstruct a Zcash transaction's binary form from the RPC data.
2020-06-30 23:02:47 +00:00
Rod Vagg a106c15a19
Add joinSplitPubKey and joinSplitSig to RPC
These two properties are required to fully reconstruct a Zcash
transaction's binary form from the RPC data.

Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-30 21:47:51 +10:00
Sean Bowe e9c065df5b
Cargo fmt 2020-06-29 09:40:35 -06:00
Sean Bowe 8918eca876
Add more exhaustive tests for ZIP 215 compatibility. 2020-06-29 09:40:34 -06:00
Sean Bowe 58250b4801
Turn return values for libsodium-like API into constants for clarity. 2020-06-29 09:36:54 -06:00
Homu ab2b7c0969 Auto merge of #4566 - gtank:new_seeders, r=ebfull
Add Foundation's and gtank's DNS seeders

This adds our new DNS seeders to the list. They're running [CoreDNS](https://coredns.io) with a [Zcash crawler plugin](https://github.com/ZcashFoundation/dnsseeder), the result of a Zcash Foundation in-house development effort to replace zcash-seeder with something memory safe and easier to maintain.

These are validly operated seeders per the existing policy (https://zcash.readthedocs.io/en/latest/rtd_pages/dnsseed_policy.html):

> A DNS seed operating organization or person is expected to follow good host security practices, maintain control of applicable infrastructure, and not sell or transfer control of the DNS seed. Any hosting services contracted by the operator are equally expected to uphold these expectations.

In both cases the code is running on well-operated public cloud infrastructure in either a container or the most sandboxing appropriate to the environment. The DNS records pointing to the seeders are controlled by reputable third-party DNS providers under accounts with 2FA enabled.

> The DNS seed results must consist exclusively of fairly selected and functioning Zcash nodes from the public network to the best of the operator’s understanding and capability.

The crawler attempts to connect to all discoverable Zcash peers and ensures their continued uptime on a regular basis. The results are always a uniformly randomized subset of all known live peers.

> For the avoidance of doubt, the results may be randomized but must not single out any group of hosts to receive different results unless due to an urgent technical necessity and disclosed.

See above. However, we reserve the right to begin offering [NU-targeted results](https://github.com/ZcashFoundation/dnsseeder/issues/3) based on opt-in client queries.

> The results may not be served with a DNS TTL of less than one minute.

Mainnet results are served with a TTL of 600 seconds, and Testnet results with a TTL of 300 seconds to account for greater flux on that network.

> Any logging of DNS queries should be only that which is necessary for the operation of the service or urgent health of the Zcash network and must not be retained longer than necessary nor disclosed to any third party.

There is no logging of DNS queries in either production configuration, which can be somewhat confirmed by examining the Corefile(s) [[1]](https://github.com/ZcashFoundation/coredns-zcash/blob/master/coredns/Corefile)[[2]](https://github.com/ZcashFoundation/coredns-zcash/blob/master/scripts/gcp-start.sh#L9-L27) we use.

> Information gathered as a result of the operators node-spidering (not from DNS queries) may be freely published or retained, but only if this data was not made more complete by biasing node connectivity (a violation of expectation (1)).

The seeder currently has no persistence outside of its static config file, so this data is neither retained nor shared by the operators.

> Operators are encouraged, but not required, to publicly document the details of their operating practices.

Our deployments are described in detail by the [coredns-zcash](https://github.com/ZcashFoundation/coredns-zcash) repo. Reader, you could run one too!

> A reachable email contact address must be published for inquiries related to the DNS seed operation.

For general questions related to either seeder, contact george@zfnd.org or mention @gtank in the Foundation's Discord. For bug reports, open an issue on the [dnsseeder](https://github.com/ZcashFoundation/dnsseeder) repo.
2020-06-25 00:44:33 +00:00
Sean Bowe 98c6bdbae8
Redirect git checkouts of ebfull/ed25519-zebra through our vendored sources in offline mode. 2020-06-24 14:08:25 -06:00
Homu a23aa9113e Auto merge of #4582 - daira:remove-cs_ParamsIO, r=daira
Remove an unused CCriticalSection.

The code that used this was removed in 5f84491d82.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-06-24 19:04:38 +00:00
Sean Bowe f29c731915
Minor adjustments to librustzcash and tests. 2020-06-23 16:35:19 -06:00
Sean Bowe ba04450945
Remove unused curve25519-dalek dev-dependency. 2020-06-23 16:29:51 -06:00
Sean Bowe 14bdf7e811
Remove bincode crate. 2020-06-23 15:38:59 -06:00
Sean Bowe 2a3527bfe8
Add test that a weird signature successfully validates. 2020-06-23 14:31:41 -06:00
Sean Bowe 3251bea45a
Enforce ZIP 215 rules upon activation of Canopy. 2020-06-23 13:17:29 -06:00
Sean Bowe 9f71fa1c09
Change to version of ed25519-zebra crate which is compliant with ZIP 215. 2020-06-23 13:17:27 -06:00
Daira Hopwood 76c416d2df Remove an unused CCriticalSection.
The code that used this was removed in 5f84491d82.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-06-23 19:38:29 +01:00
Sean Bowe 3688f508d8
Make ed25519-zebra available via librustzcash. 2020-06-22 15:58:26 -06:00
George Tankersley 27b8a616de Add ZF and gtank's DNS seeders 2020-06-10 21:10:43 -04:00
Homu 552482a404 Auto merge of #3913 - str4d:smoke-tests, r=str4d
Automated smoke tests

Usage:

```
ZCASHD=./src/zcashd ZCASHCLI=./src/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash"
```

Includes code cherry-picked from bitcoin/bitcoin#7751.
2020-06-04 22:17:48 +00:00
Homu 4ffccda774 Auto merge of #4322 - oxarbitrage:issue3740, r=str4d
Add -debuglogfile option

Cherry-picked from https://github.com/bitcoin/bitcoin/pull/11781.
Closes https://github.com/zcash/zcash/issues/3740.
2020-06-04 00:40:45 +00:00
Homu e9a6d7926b Auto merge of #4282 - oxarbitrage:issue2375, r=daira
Add a flag to get amount results as integer

Closes https://github.com/zcash/zcash/issues/2375
2020-06-03 11:26:00 +00:00
Daira Hopwood 270a724c87
Remove unused import in qa/rpc-tests/listtransactions.py
Co-authored-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2020-06-03 12:25:31 +01:00
Alfredo Garcia 916351be04
fix/improve docs
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-02 09:14:50 -03:00
Homu 7275bc7f3f Auto merge of #4545 - str4d:metrics-ibd-progress-bar, r=str4d
metrics: Add a progress bar when in Initial Block Download mode

The progress bar shows both headers (in green) and blocks (in white / inverse of background colour). It is only printed for TTY output.

Additionally, the "not mining" message is no longer shown on mainnet, as the built-in CPU miner is not effective at the current network difficulty.
2020-06-02 03:01:51 +00:00
Jack Grigg 12e169d09f metrics: Only print IBD progress bar on TTY
Now that it is created from space characters, it is meaningless to print
it to a log file.
2020-06-02 14:23:03 +12:00
Jack Grigg a79337c3ee metrics: Switch to ANSI colour codes for progress bar
We already assume that ANSI colour codes work for the metrics art,
whereas the block characters have inconsistent support in fonts.
2020-06-02 14:20:55 +12:00
Homu 6d9573c66e Auto merge of #4552 - oxarbitrage:patch-5, r=str4d
Initialize size_t in CTxMemPool::DynamicMemoryUsage before using it

Closes https://github.com/zcash/zcash/issues/4551
2020-06-02 01:50:40 +00:00
Alfredo Garcia 74039434a8
initialize size_t 2020-06-01 09:47:02 -03:00
Alfredo Garcia 93afebeef4 add new parameters to rpc client and fix some bugs 2020-05-30 12:18:43 -03:00
Alfredo Garcia e7c829aa0e update docs 2020-05-30 10:34:03 -03:00
Alfredo Garcia 76cb4e8d04 remove not needed comments from wallet.py 2020-05-29 11:24:39 -03:00
Homu 3ded976d31 Auto merge of #4546 - daira:nu4-to-canopy, r=str4d
Rename NU4 to Canopy in constant and function names

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 09:15:59 +00:00
Daira Hopwood 1527e5b3ca Missing NU4->Canopy renames.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 10:02:50 +01:00
Daira Hopwood 22b8574d9e Rename golden/nu4.tar.gz to canopy.tar.gz.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-29 01:30:30 +01:00
Alfredo Garcia 3b9bd2da2f fix sort of options 2020-05-28 10:58:04 -03:00
Alfredo Garcia 7c84f4e98a fix test cases 2020-05-28 10:58:04 -03:00
Anthony Towns 83087be393 test: Add tests for `-debuglogfile` with subdirs 2020-05-28 10:58:04 -03:00