Commit Graph

13810 Commits

Author SHA1 Message Date
Larry Ruane bf568273a7 fix pyflakes CI errors 2020-07-02 14:32:48 -06:00
Kris Nuttycombe 834911c0d7 Update HalvingHeight documentation. 2020-07-02 14:30:06 -06:00
Kris Nuttycombe 49ea02925e Merge branch 'zip-207' of github.com:str4d/zcash into zip-207 2020-07-02 13:33:09 -06:00
Kris Nuttycombe d9088ab050
Record-constructor syntax for funding stream initialization.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-02 13:32:23 -06:00
Kris Nuttycombe 4d223f9797 Merge remote-tracking branch 'upstream/master' into zip-207 2020-07-02 13:24:45 -06:00
Kris Nuttycombe 5f20ef3c9d Minor naming change FundingStreamShare -> FundingStreamElement 2020-07-02 12:15:26 -06:00
Sean Bowe 14a09a5fd6
Remove unused imports from remove_sprout_shielding RPC test. 2020-07-02 11:09:22 -06:00
Alfredo Garcia 7db6e37b40 add log aporximation to metrics solution rates 2020-07-02 13:34:07 -03:00
Kris Nuttycombe b17f263c20
Capitalization fixes from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-02 09:58:12 -06:00
therealyingtong 19d4c47b66 Pass pindex to AddToWalletIfInvolvingMe() 2020-07-02 15:37:37 +08:00
therealyingtong 2f4d7e35c9 Throw error in plaintext deserialization 2020-07-02 15:37:37 +08:00
therealyingtong f24e706079 Replace leadByte in SaplingNote with is_zip_212 2020-07-02 15:37:32 +08:00
Kris Nuttycombe aff38f75f3
Qualified imports of std:: types
Co-authored-by: str4d <thestr4d@gmail.com>
2020-07-01 16:06:27 -06:00
Kris Nuttycombe bf381ad580
Replace BOOST_FOREACH with for..:
Co-authored-by: str4d <thestr4d@gmail.com>
2020-07-01 16:05:30 -06:00
Larry Ruane 5b7fed5bbf self.sync_all(), not time.sleep(4) 2020-07-01 10:28:15 -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
noname45688@gmail.com 777cda9429 Update to Python 3 2020-06-30 16:41:59 -04:00
noname45688@gmail.com 6ab6279bd9 Updating to Python 3 2020-06-30 16:33:08 -04: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
Kris Nuttycombe 92cec200ee Minor fixes for ZIP-207 review comments. 2020-06-29 16:13:08 -06:00
Kris Nuttycombe 074d054e84
Trivial error message fix.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:54:07 -06:00
Kris Nuttycombe 665b8c647b
Use for..: rather than BOOST_FOREACH
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:53:41 -06:00
Kris Nuttycombe 1c00a0b541
Identify `-fundingstream` parameter as being regtest-only
Co-authored-by: str4d <thestr4d@gmail.com>
2020-06-29 15:42:45 -06: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
Jack Grigg efd04b920b Implement zip-207 and zip-214.
Add funding streams to consensus parameters.

Add funding stream payments to coinbase txns generated by the miner.
* Reduce valueBalance for shielded outputs to funding streams.
* Ensure we produce binding signatures in any case where shielded
  outputs go to either a funding stream or the miner.
2020-06-25 16:15:50 -06:00
Larry Ruane 73fae6bf0a review, cleanup: eliminate uninitialized variable 2020-06-25 09:32:36 -06:00
therealyingtong 7a1d119170 Add gtests for v2 plaintexts 2020-06-25 09:12:24 +08:00
therealyingtong 6402c589c6 Refactor SaplingNotePlaintext::decrypt
Break up plaintext decryption into height-dependent and non-height-dependent parts.
2020-06-25 09:12:24 +08:00
therealyingtong 3c8e970358 Check epk vs esk whenever caller has esk 2020-06-25 09:12:24 +08:00
therealyingtong e060d59890 Reject v1 plaintexts after grace period
SaplingNotePlaintext::decrypt() now has to be aware of consensus params and blockheight. Its callers in wallet, rpcwallet, and tests are updated accordingly.

TransactionBuilder is also modified to reject invalid leadBytes.

Co-authored by Daira Hopwood (daira@jacaranda.org)
2020-06-25 09:12:21 +08:00
Sean Bowe 56d4ef8333 Make transaction builder take the next block height into account for use of v2 note plaintexts. 2020-06-25 09:11:43 +08:00
Sean Bowe 4af761121d Require that shielded coinbase output note plaintexts are version 2 if Canopy is active.
Co-authored by Ying Tong (yingtong@electriccoin.co)
2020-06-25 09:11:31 +08: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
Taylor Hornby 8f5dbd3293 Enforce pre-release dependency update check in make-release.py 2020-06-24 18:14:47 -06:00
Taylor Hornby 44c35c6f68 Change release instructions to block the release when dependencies are not updated and not postponed. 2020-06-24 18:14:47 -06:00
Taylor Hornby 75876f477b Implement system for postponing dependency updates. 2020-06-24 18:14:47 -06:00
Larry Ruane 0219a97139 flush witness cache correctly
Rather than flushing the witness cache from FlushStateToDisk(), called
by ActivateBestChain() called by ProcessNewBlock(), do so from
ThreadNotifyWallets() after the wallet has updated the in-memory witness
data according to the new block, so it's always consistent on disk.
2020-06-24 16:49:59 -06: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
Larry Ruane 6335944784 add python test to reproduce bug 4301 2020-06-24 09:27:11 -06: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