Commit Graph

13728 Commits

Author SHA1 Message Date
Homu 2ba4f16590 Auto merge of #4605 - daira:more-iterator-cleanups, r=daira
More iterator cleanups

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-15 20:09:37 +00:00
Daira Hopwood 3383c4855f More iterator cleanups.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-15 19:18:57 +01:00
Homu b4ec903ac4 Auto merge of #4608 - str4d:post-heartwood-cleanups, r=nuttycom
Post-Heartwood cleanups

The C++ Equihash validator is removed; the Rust validator is now used unconditionally for the entire chain.

Changes made to enable contextually switching between the two validators have been reverted.

Also fixes a segfault that could occur on reindex during consensus-related development.
2020-07-15 14:59:15 +00:00
Homu cf034d4594 Auto merge of #4594 - nuttycom:ed25519-zebra-2.0.0, r=therealyingtong
Use ed25519-zebra from crates.io.

Closes #4592
2020-07-15 12:38:07 +00:00
Jack Grigg 3611f68811 Revert "Pass the block height through to CheckEquihashSolution()"
This reverts commit 49f9584613.

Now that we are depending unconditionally on the Rust Equihash
validator, CheckEquihashSolution() can revert to being a non-contextual
check.

This also fixes a segfault that would occur during reindexing if the
consensus rules were altered such that a previously-valid block would
become invalid, and the node's block files contained blocks in a
specific order. It was encountered while testing the Canopy NU on
testnet (due to a bug in the implementation of ZIP 212 that was
separately fixed in zcash/zcash#4604).
2020-07-15 16:16:40 +12:00
Jack Grigg 96920e952d Remove C++ Equihash validator 2020-07-15 14:03:45 +12:00
Jack Grigg 79846ac1f3 Use Rust Equihash validator unconditionally
It correctly validates all blocks prior to Heartwood activation.
2020-07-15 13:59:32 +12:00
Homu 54180fbce5 Auto merge of #4604 - daira:fix-unintended-consensus-change, r=str4d
Fix an unintended consensus change in decryption of coinbase outputs

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 23:25:35 +00:00
Daira Hopwood 2336259c1e Fix an unintended consensus change in decryption of coinbase outputs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 22:59:34 +01:00
Homu d09cedb63a Auto merge of #4602 - daira:makefile-key-constants, r=daira
Add key_constants.h to src/Makefile.am

This should fix Gitian builds.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 17:07:32 +00:00
Daira Hopwood 239ea1270e Add key_constants.h to src/Makefile.am.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 17:44:54 +01:00
Homu 23f3161a06 Auto merge of #4601 - therealyingtong:release-v3.1.0-rc1, r=daira
Release v3.1.0-rc1
2020-07-14 11:30:30 +00:00
therealyingtong 0901cb0241
Undo manual DEPRECATION_HEIGHT 2020-07-14 14:46:15 +08:00
therealyingtong d7b976b737
make-release.py: Updated release notes and changelog for 3.1.0-rc1. 2020-07-14 14:38:11 +08:00
therealyingtong e255e8bd0a
make-release.py: Updated manpages for 3.1.0-rc1. 2020-07-14 14:38:10 +08:00
therealyingtong e2be85b3af
make-release.py: Versioning changes for 3.1.0-rc1. 2020-07-14 14:36:44 +08:00
Homu 973dff930a Auto merge of #4599 - daira:iterator-cleanup, r=therealyingtong
Clean up some iterator usage

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 05:12:41 +00:00
Homu 4fadb7f124 Auto merge of #4598 - therealyingtong:release-notes-v3.1.0, r=str4d
[v3.1.0] Update release notes
2020-07-14 02:52:25 +00:00
ying tong 2bf1985097
Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2020-07-14 10:50:15 +08:00
Daira Hopwood 0b0c84f4c9 Another cleanup.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 01:00:18 +01:00
Daira Hopwood 57409b7d2b Remove an unnecessary iterator increment.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-14 00:47:34 +01:00
Homu 6caed410c0 Auto merge of #4600 - daira:fix-cscheduler, r=daira
Fix bug in CScheduler
2020-07-13 21:38:06 +00:00
Taylor Hornby daf9ed98a1 Fix bug in CScheduler 2020-07-13 19:40:49 +01:00
Daira Hopwood 66096d540f Clean up some iterator usage.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-13 19:35:26 +01:00
therealyingtong a72246adc8 Update release notes for v3.1.0 2020-07-13 17:34:12 +08:00
Homu 959f5b09d0 Auto merge of #4560 - str4d:zip-207, r=nuttycom
[ZIP 207] Funding Streams + [ZIP 214] Dev Fund Recipients

Closes #4554. Closes #4555.
2020-07-10 22:45:11 +00:00
Kris Nuttycombe d80857f2b5 Trivial whitespace fix. 2020-07-10 08:31:46 -06:00
Kris Nuttycombe c88b461f89
Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 08:29:47 -06:00
Kris Nuttycombe 0e7ae06905 Fix assertion check in GetBlockSubsidy 2020-07-10 08:26:33 -06:00
str4d 8f7861573d
Merge pull request #20 from daira/zip-207
Changes to getblocksubsidy RPC, and resolution of a problem with initializing chain params
2020-07-11 01:55:03 +12:00
Daira Hopwood 69cf041d5d Change the format of `getblocksubsidy` output to use an array of funding stream objects.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 14:10:26 +01:00
Daira Hopwood 64cfbab3db
Apply suggestions from code review
keyInfo -> keyConstants

Co-authored-by: ying tong <yingtong@z.cash>
2020-07-10 12:33:27 +01:00
Homu 66d4c88943 Auto merge of #4572 - oxarbitrage:issue4571, r=str4d
Add solution rates aproximation to metrics

Closes https://github.com/zcash/zcash/issues/4571
2020-07-10 07:02:14 +00:00
Daira Hopwood aa1b924427 Cosmetic spacing changes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 02:14:42 +01:00
Daira Hopwood 9161071b02 Use ValueFromAmount instead of double arithmetic, and improve variable names.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 02:08:30 +01:00
Kris Nuttycombe 9228c3113d Fix typo in constant. 2020-07-09 18:26:11 -06:00
Kris Nuttycombe 9119ca8f86 Rename KeyInfo -> KeyConstants and move out of Consensus namespace. 2020-07-09 18:19:13 -06:00
Kris Nuttycombe 07ff0d19a0 Make evident the relationship between chainparams and key IO. 2020-07-09 17:48:47 -06:00
Daira Hopwood 8121e874e2 Change getblocksubsidy RPC to take into account funding streams.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-09 23:33:14 +01:00
Daira Hopwood 6bd85925e7 Tests for changes to getblocksubsidy.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-09 23:33:14 +01:00
Kris Nuttycombe 7555a7c26a
Use for..in rather than an indexed loop.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-07-09 11:40:23 -06:00
Daira Hopwood 50c1d5cee6 Add GetActiveFundingStreams function.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-09 18:32:39 +01:00
Kris Nuttycombe e456d87cbf Merge remote-tracking branch 'upstream/master' into zip-207 2020-07-09 08:23:57 -06:00
Homu 3f4a532588 Auto merge of #4573 - LarryRuane:issue4301-CopyPreviousWitnesses, r=daira
Flush witness data to disk only when it's consistent

Closes #4301. Running this PR's code will not repair a data directory that has been affected by this problem; that requires starting zcashd with the `-rescan` or `-reindex` options.
2020-07-09 11:50:41 +00:00
Larry Ruane 4811dcc426 sync before stopping nodes
This makes the test more deterministic. When the nodes are split, and
partition B (node 1) mines a joinsplit transaction, that block only
sometimes appears on the blockchain after the nodes are all reconnected.
2020-07-08 20:48:50 -06:00
Homu 701adc38cb Auto merge of #4578 - therealyingtong:zip212-impl, r=str4d
ZIP212 implementation

Closes #4557.
(description by @ebfull, taken from #4575)

* The `SaplingNote` structure has a new enum called `zip212Enabled`. This
  member is private and reflects whether the note was or is being created
  using the derivation method of ZIP 212 (i.e., `BeforeZip212` or `AfterZip212`).
* The `SaplingNotePlaintext` structure has a new unsigned char member
  `leadbyte`. This member is private and contains the leading byte of the
  plaintext (e.g. `0x01`, `0x02`).
* The serialization of `SaplingNotePlaintext` sets `zip212Enabled` to
  `BeforeZip212` iff the serialized note plaintext version is not `0x01`.
* The `r`/`rcm` fields have been removed and replaced with a private field
  `rseed`. `SaplingNote` and `SaplingNotePlaintext` now have a helper method
  `rcm()` which returns the `rcm` either by deriving it with `rseed`
  (if `zip212Enabled` is `AfterZip212`) or returning `rseed` by interpreting
  `rseed` as `rcm`.
* All the methods of obtaining a `SaplingNote` account for these changes:
  - The `SaplingNote` constructor that is used by e.g. the transaction builder,
    and internally samples random `rcm`, now takes a `zip212Enabled` argument
    to decide whether to sample `rcm` the "old" way or the "new" way.
  - The bare constructor for `SaplingNote` is removed.
  - The other constructor which takes the raw contents of the note is only used
    in tests or in `Note.cpp`, but now also takes a `zip212Enabled` argument.
  - The other way of obtaining a note, by calling `SaplingNotePlaintext::note()`,
    has been adjusted.
* The `SaplingNotePlaintext` class now has an `generate_or_derive_esk()` method
  that either samples a random `esk` or derives it using the local `rseed`
  depending on the value of `leadbyte`.
* The encryption routine is modified to consult `generate_or_derive_esk()` and
  provide it to the note encryption object.
* The note encryption objects now take an optional `esk` as input and otherwise
  sample a random `esk` internally. This API functionality is preserved to allow
  for testing.
* The `SaplingNotePlaintext` decryption routines are modified:
  - The out and enc decryption routines now check that `epk` is consistent with
    the derived `esk`.
  -  The out decryption routine for plaintexts also checks that `esk` is
    consistent with what is derived by the note.
* The miner and transaction builder consult the activation of Canopy when
  creating `SaplingNote`s.
* The consensus rules are modified so that shielded outputs (miner rewards)
  must have `v2` note plaintexts after Canopy has activated.
2020-07-09 00:29:07 +00:00
Kris Nuttycombe ca3f5df607 Remove assertion that was breaking regtest in the case that blossom activates after the halving. 2020-07-08 17:02:28 -06:00
Kris Nuttycombe 436dee90de Merge remote-tracking branch 'upstream/master' into zip-207 2020-07-08 15:04:32 -06:00
Kris Nuttycombe 84e8cce77d Use ed25519-zebra from crates.io. 2020-07-08 13:11:27 -06:00
Kris Nuttycombe 06789f99d3 Fix ordering of transparent outputs such that miner reward is vout[0] 2020-07-08 11:04:47 -06:00