Homu [Thu, 23 May 2019 03:03:45 +0000 (20:03 -0700)]
Auto merge of #4014 - zebambam:add_bitcoinabc_responsible_disclosure_relationship, r=Eirik0
Fixes #4013, added BitcoinABC as a disclosure partner
I've tried to avoid using "partner" as a term in general because it's not accurate, but it's quicker to type. We intend to share any vulns we become aware of in our bitcoin code with at least BitcoinABC.
Homu [Mon, 13 May 2019 15:18:08 +0000 (08:18 -0700)]
Auto merge of #4002 - Eirik0:migration-status-info, r=Eirik0
Add Logging and persist async operation for Sapling migration
Currently zcashd will automatically remove the last async migration operations when it reaches the height where it sends the transactions it just made. This is not in alignment with other async operations, which are not removed until a node is restarted or a user calls `z_getoperationresult`. This PR removes the calls to pop the operations so that they can be accessed and reviewed later. In this PR I also correct the operation's `amount_migrated` field to exclude the transaction fee (this field existed for debugging purposes, but should be consistent with `z_getmigrationstatus`), and have included the list of migration txids in the operation's result (this is similar to the async rpcs such as `z_sendmany`).
Documentation: none needed.
Test plan:
* After migration transactions have been created, list the opids and call `z_getoperationresult` on them.
* Check that the operations' `amount_migrated` fields exclude the fee.
Homu [Thu, 9 May 2019 20:51:49 +0000 (13:51 -0700)]
Auto merge of #3995 - bitcartel:no_migration_during_block_download_phase, r=Eirik0
Don't allow Sprout-to-Sapling migration when syncing during IBD or after wake from sleep.
Prevent migration transactions from being created in response to incoming blocks when a node launches and syncs (the initial block download phase) and when a node wakes from sleep/hibernation and starts syncing old blocks rapidly.
Homu [Thu, 9 May 2019 18:26:33 +0000 (11:26 -0700)]
Auto merge of #3997 - bitcartel:transaction_builder_tiny_format_error, r=Eirik0
Remove unused specifier from format string
The extra specifier meant that a runtime error would be thrown during Sprout to Sapling migration, if `zrpcunsafe` logging was enabled, preventing migration transactions from being created.
Simon [Thu, 9 May 2019 03:32:04 +0000 (20:32 -0700)]
Remove unused specifier from format string.
The extra specifier meant that a runtime error would be thrown
during Sprout to Sapling migration if `zrpcunsafe` logging
was enabled:
"tinyformat: Too many conversion specifiers in format string"
Auto merge of #3968 - bitcartel:3768_enable_mainnet_turnstile, r=bitcartel
Activate turnstile on mainnet
This PR enables [ZIP209](https://github.com/zcash/zips/blob/master/zip-0209.rst) support on mainnet, to mark blocks as invalid if they would lead to a turnstile violation in the Sprout or Sapling value pools.
To test this PR, I performed the following manual tests:
1. Used RPC call `getblock` to verify the fallback Sprout value.
2. Individually changed the fallback Sprout block hash, block height and chain value, recompiling and relaunching the node, verifying that each individual change resulted in an error. When the block hash and block height are incorrect, an error is logged to debug.log `FallbackSproutValuePoolBalance(): fallback block hash is incorrect`. An incorrect chain value results in node termination with error: `void FallbackSproutValuePoolBalance(CBlockIndex*, const CChainParams&): Assertion '*pindex->nChainSproutValue == chainparams.SproutValuePoolCheckpointBalance()' failed.`
3. Ran the `Smoke Testing` described in PR #3885, on mainnet.
4. Launched zcashd with experimental feature `-developersetpoolsizezero` to manually trigger a turnstile violation in both Sprout and Sapling shielded pools. The Sprout turnstile violation occurred after launch, due to chance, when the next incoming block 520786 contained a Sprout unshielding transaction. The Sapling turnstile violation was triggered after creating a Sapling unshielding transaction.
Auto merge of #3940 - str4d:3607-init-encrypted-wallet-without-hd-seed, r=bitcartel
init: Fix new HD seed generation for previously-encrypted wallets
Closes #3607.
How to verify (with `zcashd` flags `-testnet -wallet=wallet.3607.dat -experimentalfeatures -developerencryptwallet`):
- Start `zcashd` 2.0.0, encrypt the wallet, and stop the node.
- Start `zcashd` 2.0.1+ (before this branch), and see that it crashes during startup.
- Start `zcashd` built from this branch, and see that it does not crash during startup. Unlock the wallet, then stop.
- Start `zcashd` 2.0.1+ (before this branch), and see that it no longer crashes during startup.
Auto merge of #3964 - bitcartel:test_turnstile_violation, r=bitcartel
Test turnstile violation
Adds experimental feature -developersetpoolsizezero to enable developers to test Sprout and Sapling turnstile violations on testnet and in regtest mode.
depends: Support additional cross-compilation targets in Rust
This will make it easier for third parties to cross-compile `zcashd` for other platforms. The third commit in this PR shows how to add a new target to the Rust dependency builder.
The default Rust target during cross-compilation is the canonical host, which is derived from `HOST` using `depends/config.sub`. If the canonical host differs from the required Rust target, add the necessary mapping in addition to the target itself.
Also includes fixes for cross-compiling aarch64 targets.