Commit Graph

325 Commits

Author SHA1 Message Date
Homu 5009f219e6 Auto merge of #4830 - daira:rename-bp-funding-stream, r=daira
Rename the FS_ZIP214_ECC funding stream to FS_ZIP214_BP

See also https://github.com/zcash/zips/pull/412 .

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-27 15:06:57 +00:00
Daira Hopwood d54dda736d Rename the FS_ZIP214_ECC funding stream to FS_ZIP214_BP.
See also https://github.com/zcash/zips/pull/412 .

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-27 13:27:19 +00:00
Jack Grigg d476537d86 scripted-diff: Remove BOOST_STATIC_ASSERT
-BEGIN VERIFY SCRIPT-
sed -i 's/BOOST_STATIC_ASSERT(/static_assert(/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/static_assert.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
-END VERIFY SCRIPT-
2020-10-27 10:44:58 +00:00
Homu 31f48caf0e Auto merge of #4690 - LarryRuane:CopyPreviousWitnessesPart2, r=str4d
Flush witness data when consistent (part 2)

Closes #4680. After CWallet::ChainTipAdded() updates the witness data, it may flush it to disk (SetBestChain()); make sure the locator part is consistent with the witnesses (height).
2020-09-24 13:31:31 +00:00
Larry Ruane 81db0a2fc7 Flush witness data when consistent (part 2)
After CWallet::ChainTipAdded() updates the witness data, it
may flush it to disk (SetBestChain()); make sure the locator
part is consistent with the witnesses (height).
2020-09-05 07:21:11 -06:00
Sean Bowe 6937dff376
Set activation height for Canopy on mainnet. 2020-09-01 13:16:05 -06:00
Daira Hopwood 889b05df41
Clarify a comment about the ZF and MG addresses 2020-09-01 12:56:05 +01:00
Sean Bowe abd4b736e4
Add dev fund addresses for mainnet. 2020-08-31 15:07:43 -06:00
therealyingtong 283287ab5b
Use 51 Testnet Dev Fund addresses, and adjust the end heights.
Co-authored-by: Ying Tong Lai <yingtong@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-25 09:45:30 +08:00
therealyingtong 62c3613816
Delay testnet activation height by one week 2020-07-24 08:15:35 +08:00
therealyingtong 8a4c51508a
Set Canopy testnet activation height to 1020500 2020-07-18 00:28:45 +08:00
ewillbefull@gmail.com c0a19854bf Add dev fund addresses for testnet NU4 activation. 2020-07-15 20:09:39 -06:00
Daira Hopwood aa1b924427 Cosmetic spacing changes.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 02:14:42 +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
Kris Nuttycombe 4d223f9797 Merge remote-tracking branch 'upstream/master' into zip-207 2020-07-02 13:24:45 -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
George Tankersley 27b8a616de Add ZF and gtank's DNS seeders 2020-06-10 21:10:43 -04:00
Daira Hopwood c1227ae67c Rename NU4 to Canopy in constant and function names.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-05-28 13:11:48 +01:00
Homu 3860e7cae7 Auto merge of #4533 - ebfull:heartwood-activation, r=ebfull
Enable Heartwood activation on mainnet

This sets the Heartwood activation height to `903000`, which follows the deprecation height of `v2.1.2-3` (which is set to deprecate on block `901475`, roughly 31 hours earlier, sometime mid-July).
2020-05-20 21:36:27 +00:00
Sean Bowe d0c96683bf
Set the Heartwood activation height to 903000. 2020-05-19 14:38:49 -06:00
Sean Bowe ecafe6913c
Update minimum chain work on testnet to reflect Heartwood activation. 2020-05-18 09:59:34 -06:00
ebfull 84a703b3b1
Merge branch 'master' into hotfix-v2.1.2-1 2020-05-06 16:36:01 -06:00
Sean Bowe 8dcb533226
Add the intended testnet activation block of Heartwood to our intended rewind logic. 2020-05-05 14:47:29 -06:00
Jack Grigg 99d387fc51 Add NU4 to upgrade list
Once NU4 has a name, we will rename the constants.
2020-05-01 11:38:03 +12:00
Sean Bowe b42af16553
Set Heartwood activation height for testnet to 903800. 2020-04-21 16:13:33 -06:00
Homu b5f179d207 Auto merge of #4370 - str4d:3060-sapling-viewing-keys, r=str4d
Add support for Sapling full viewing keys

This PR adds Sapling support to `z_exportviewingkey` and `z_importviewingkey`, and stores imported Sapling viewing keys in the wallet.

Closes #3060.
2020-03-28 02:41:26 +00:00
Daira Hopwood 5d5e6a6762 Fix typos/minor errors in comments, and wrap some lines.
This minimizes the diff in the example implementation of funding streams in ZIP 207.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-03-11 16:41:31 +00:00
Jack Grigg 3c7385bc8e Add encoding and decoding for Sapling extended full viewing keys 2020-02-21 00:59:27 +00:00
Alfredo Garcia d53d4d880a add destination wrappers 2020-02-18 13:20:43 -03:00
Daira Hopwood ca8d32070a Add string argument to static_asserts to satisfy C++11.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-06 23:35:56 +00:00
Daira Hopwood 4ab896c69d Enable future timestamp soft fork at varying heights according to network.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-02-04 23:40:04 +00:00
Homu 126a3b96ae Auto merge of #4247 - rex4539:protect-to-shield, r=daira
Change "protect" terminology to "shield"

Closes https://github.com/zcash/zcash/issues/2149

Note: Renamed `wallet_protectcoinbase.py` to `wallet_shieldingcoinbase.py` because there was an existing file also named `wallet_shieldcoinbase.py`.
2019-12-06 16:29:29 +00:00
Homu f9602d407b Auto merge of #4240 - str4d:heartwood-activation-logic, r=str4d
Add Heartwood to upgrade list
2019-12-05 17:40:29 +00:00
Dimitris Apostolou f0003239f8
Change "protect" terminology to "shield" 2019-12-04 23:17:06 +02:00
Jorge Timón bd87de60ed
Chainparams: Translations: DRY: options and error strings
Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine
2019-12-04 17:18:31 +00:00
Jorge Timón af9b9652fa
Chainparams: Replace CBaseChainParams::Network enum with string constants (suggested by Wladimir) 2019-12-04 17:18:30 +00:00
Jack Grigg 9c93079e28
Add Heartwood to upgrade list 2019-11-25 14:15:19 +00:00
Sean Bowe 4180589f02
Set mainnet activation of Blossom 2019-11-01 09:31:55 -06:00
Homu 4eaad3f77b Auto merge of #4154 - zebambam:remove_stale_seeder, r=Eirik0
Removed stale seeder, fixing #4153

Removed old seeder.
2019-10-07 15:06:20 -07:00
zebambam 3b9237b883 Removed stale seeder, fixing #4153 2019-10-07 13:17:21 -07:00
Jack Grigg c8c43c4210
Add block hashes for Overwinter, Sapling, and testnet Blossom
Also updates nMinimumChainWork for testnet (using block 585000).
2019-09-19 16:10:35 +01:00
Eirik Ogilvie-Wigley 63dac4b08a Update nMinimumChainWork 2019-08-19 15:16:12 -06:00
Eirik Ogilvie-Wigley 1288fb1dd8 Set testnet Blossom activation height 2019-08-16 13:21:33 -06:00
Homu 2528af69ff Auto merge of #4025 - bitcartel:shorter_block_target_interval_zip208, r=daira
Implement ZIP 208: Shorter Block Target Spacing

Closes #3690.
2019-08-09 02:35:30 -07:00
Eirik Ogilvie-Wigley 832134f4cd Update PoW related assertions 2019-08-05 13:16:13 -06:00
Eirik Ogilvie-Wigley 3eb90d4040 Use pre-Blossom max FR height when calculating address change interval 2019-08-02 20:53:41 -06:00
Eirik Ogilvie-Wigley 2c6c55261d Make NetworkUpgradeAvailable a method of Params 2019-07-29 14:47:06 -06:00
Eirik Ogilvie-Wigley 102dafdf89 Update block subsidy halving for zip208 2019-07-29 13:44:53 -06:00
Eirik Ogilvie-Wigley c192e3a75d Update pow_tests for shorter block times 2019-07-26 10:34:23 -06:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Simon ac4a606d4a Remove use of redundant member nPowTargetSpacing. 2019-07-11 13:46:28 -06:00
MarcoFalke 98f3010026
[doc] Fix doxygen comments for members 2019-05-23 17:48:20 +01:00
Jack Grigg cea06a4fd3
Move Equihash parameters into consensus params 2019-05-23 17:48:13 +01:00
Simon 68c17ffec8 Update chain work and checkpoint using block 525000. 2019-05-02 14:53:35 -07:00
Simon fc79a848fb Enable ZIP209 on mainnet and set fallback Sprout pool balance. 2019-04-23 22:57:30 -07:00
Simon 4c1a8884f4 Add testnet and regtest experimental feature: -developersetpoolsizezero 2019-04-22 14:24:40 -07:00
Jack Grigg 885fce070a
Add Blossom to upgrade list 2019-04-02 07:39:36 +01:00
Homu 008705d7c1 Auto merge of #3885 - ebfull:turnstile, r=bitcartel
Reject blocks that violate turnstile

This is an implementation of a consensus rule which marks blocks as invalid if they would lead to a turnstile violation in the Sprout or Shielded value pools. The motivations and deployment details can be found in the [accompanying ZIP draft](https://github.com/zcash/zips/pull/210).

**This PR only introduces the rule for testnet at the moment.**

We achieve the institution of this rule in three ways:

1. Nodes prior to #2795 did not record the "delta" in the Sprout value pool balance as part of the on-disk block index. This was a long time ago, though, and all nodes that are consensus-compatible with the network today have been recording this value for newer blocks. However, the value is absent from older block indexes unless the node has reindexed or synchronized from scratch in the time since. We shouldn't need to require nodes to reindex in order to enforce this consensus rule. We avoid this problem by falling back on a hardcoded Sprout shielded value pool balance in a very recent block.
2. If during `ConnectBlock` we observe that the resulting shielded value pool balance of Sprout or Sapling is negative, we reject the block.
3. During the miner's block assembly process the miner will skip over transactions if adding them to the assembled block might violate the turnstile, since the resulting block would be invalid. This means that theoretical transactions violating the turnstile would still be relayed in the network (and made available in users' memory pools) and so a turnstile violation would have some visibility outside of block relay.

## Smoke Testing

It's really tricky to test the behavior that automatically falls back to hardcoded shielded value pool balances in our architecture because it's very testnet-specific and node-version-specific. However, we can do some smoke tests to see that everything is working.

I modified the serialization of `CDiskBlockIndex` to serialize `boost::none` for `nSproutValue`

```
if ((s.GetType() & SER_DISK) && (nVersion >= SPROUT_VALUE_VERSION)) {
    boost::optional<CAmount> nSproutValueFake = boost::none;
    READWRITE(nSproutValueFake);
}
```

and then began a reindex of my node which I interruped around height 130k on testnet. I then restored the original serialization and resumed the reindex; I have thus _roughly_ simulated a older node "upgrading" to a newer node that records the deltas when processing new blocks. My node showed pool monitoring was disabled, as expected, for Sprout. I confirmed that some blocks following the reindex had nonzero Sprout `valueDelta` from `getblock`, as expected. I finished the reindex, restarted the node, and confirmed that the serialization worked for newer blocks but not older blocks by querying `getblock`, simply as a reassurance.

Finally, I introduced the code in this PR and reloaded the node. The desired behavior (that the chain began to be "monitored" again) worked, and the values were consistent with the hardcoded constant. I then made a payment to a Sprout z-addr from the transparent pool and the pool value increased as expected, as reported by `getblockchaininfo`. I reindexed the node again to exercise the remaining logic and check for turnstile violations throughout the history of testnet; there were none.
2019-03-19 12:10:17 -07:00
Sean Bowe 4e3dca978b Do not enable ZIP209 on regtest right now. 2019-03-19 12:44:53 -06:00
Sean Bowe b5c7e63bcd Change SproutValuePoolCheckpointEnabled to ZIP209Activated 2019-03-18 11:32:26 -06:00
Sean Bowe 6482b661ab Check blockhash of fallback block for Sprout value pool balance 2019-03-14 15:39:11 -06:00
Sean Bowe 2b1252af80 Consolidate logic to enable turnstile auditing for testnet/regtest/mainnet. 2019-03-14 14:29:04 -06:00
Simon ea5f00aa5d Add checkpoint for block 497000. 2019-03-13 17:31:49 -07:00
Simon 16385486b8 Update nMinimumChainWork using block 497000. 2019-03-13 17:24:43 -07:00
Sean Bowe 24db3297df (testnet) Fall back to hardcoded shielded pool balance to avoid reorgs. 2019-03-13 00:43:54 -06:00
mdr0id fe0507761a Update nMinimumChainWork with information from the getblockchaininfo RPC 2019-02-11 09:04:13 -08:00
mdr0id 9a126cbb70 Update nnMinimumChainWork per 2.0.2 getblockchaininfo 2018-11-29 10:32:18 -08:00
Simon 85809c75ad Update mainnet checkpoint for block 410100. 2018-10-13 08:55:38 -07:00
Jack Grigg 1f7ee4af70
Rename min-difficulty flag to remove off-by-one in the name 2018-10-04 23:26:05 +01:00
Jack Grigg b86dc98047
Only enable min-difficulty blocks on testnet from a particular height
The min-difficulty change is a bilateral consensus rule change, and so
must be conditionally enabled in order for the earlier section of the
chain to synchronise.

Technically this could be implemented as a network upgrade, but as this will
never be deployed to mainnet, a targeted fork will suffice.
2018-10-04 14:05:27 +01:00
Jack Grigg 5ead4b1713
Revert "Get rid of consensus.fPowAllowMinDifficultyBlocks."
This reverts commit dffc025d38.
2018-10-03 16:08:00 +01:00
Jack Grigg 70b4ad2dcd
wallet: Switch from SaplingSpendingKey to SaplingExtendedSpendingKey
The wallet now only stores Sapling extended spending keys, and thus can
only be used with keys generated from an HDSeed via ZIP 32.

Note that not all Sapling keys in the wallet will correspond to the
wallet's HDSeed, as a standalone Sapling xsk can be imported via
z_importkey. However, it must have been generated from a seed itself,
and thus is more likely to be backed up elsewhere.
2018-09-03 10:45:37 +01:00
Sean Bowe 955b328ad1 Sapling mainnet activation height 2018-08-15 12:09:31 -06:00
Jack Grigg 0ecdd0f30a
chainparams: Add BIP 44 coin type (as registered in SLIP 44) 2018-08-05 10:41:06 +01:00
Homu 0361f789fe Auto merge of #3246 - str4d:checkpoint-304600, r=bitcartel
Add some more checkpoints, up to the 1.1.0 release
2018-08-01 13:55:34 -07:00
Jack Grigg 3f4ad5967b
Fix block hash for checkpoint at height 270000 2018-07-30 17:45:04 +01:00
Homu 3835cbb57f Auto merge of #3263 - str4d:ibd-upstream-changes, r=bitcartel
InitialBlockDownload upstream changes

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7208
- bitcoin/bitcoin#8007
- bitcoin/bitcoin#9053
  - Excluding second commit (requires bitcoin/bitcoin#8865)
- bitcoin/bitcoin#10388
2018-07-17 13:17:27 -07:00
Jack Grigg 7e45636707
chainparams: Add Sapling Bech32 HRPs 2018-06-07 16:41:59 +12:00
Jack Grigg d670db7164
Sapling testnet activation height 2018-05-25 16:05:25 +12:00
Gregory Maxwell e41632c9fb
IBD check uses minimumchain work instead of checkpoints.
This introduces a 'minimum chain work' chainparam which is intended
 to be the known amount of work in the chain for the network at the
 time of software release.  If you don't have this much work, you're
 not yet caught up.

This is used instead of the count of blocks test from checkpoints.

This criteria is trivial to keep updated as there is no element of
subjectivity, trust, or position dependence to it. It is also a more
reliable metric of sync status than a block count.
2018-05-15 21:25:19 +12:00
Wladimir J. van der Laan 29aaf13b0a
Make max tip age an option instead of chainparam
After discussion in #7164 I think this is better.

Max tip age was introduced in #5987 to make it possible to run
testnet-in-a-box. But associating this behavior with the testnet chain
is wrong conceptually, as it is not needed in normal usage.
Should aim to make testnet test the software as-is.

Replace it with a (debug) option `-maxtipage`, which can be
specified only in the specific case.
2018-05-15 21:24:58 +12:00
Jack Grigg 93bd00a0d5
Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +01:00
Jack Grigg ef1678bf0f
Add some more checkpoints, up to the 1.1.0 release 2018-05-07 15:15:41 +01:00
Jack Grigg b6be3e88bb
Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +01:00
Jack Grigg b1608eed82
Add a constant for Overwinter's transaction version 2018-04-23 20:39:04 +01:00
Jack Grigg 176fada24d
Add Sapling to upgrade list 2018-04-12 12:13:05 -06:00
Jack Grigg 4d234cd2f8
Overwinter mainnet activation height 2018-04-11 20:21:45 -06:00
Jack Grigg ecf544d062
Set Overwinter protocol version to 170005
170004 is the protocol version for the NODE_BLOOM change, which is being
"released" in this RC. The activation height is being set in the final release,
which means that we may end up with both RC and final release versions online
when Overwinter activates. Bumping the protocol version for Overwinter enables
RC nodes to be correctly disconnected.
2018-04-05 12:07:44 +01:00
Jack Grigg 138cf77004
Overwinter release notes and testnet activation height
Closes #2957.
2018-02-28 13:19:36 +00:00
Simon 2423a40c08 Add field nProtocolVersion to struct NetworkUpgrade. 2018-02-23 14:05:13 -08:00
Simon 072099d788 Implementation of Overwinter transaction format ZIP 202. 2018-02-16 10:10:15 -08:00
Jack Grigg 548683767c
Add Overwinter to upgrade list 2018-02-04 22:58:42 +00:00
Jack Grigg f52da91139
Test network upgrade logic
Also demonstrates how to specify a network upgrade.
2018-02-04 22:58:39 +00:00
Jack Grigg b174b7e330
Allow changing network upgrade parameters on regtest
Derived from upstream commit 56c87e92110f05d7452f1e85bf755246ffc77206:
    Allow changing BIP9 parameters on regtest
2018-02-04 22:57:59 +00:00
Jack Grigg 780f526bc9
Network upgrade activation mechanism 2018-02-04 22:57:56 +00:00
Jack Grigg 40ebf08ff8
Add viewing key prefix to regtest parameters 2018-01-22 15:32:52 +00:00
Jack Grigg ff145dfe32
Add missing namespace for boost::get 2018-01-22 10:30:41 -05:00
Cory Fields 91690d6e84
chainparams: don't use std namespace 2018-01-22 10:30:41 -05:00