Commit Graph

12849 Commits

Author SHA1 Message Date
Jack Grigg 8af85a0d10
Extend comment with reason for taking care with locks 2019-12-18 15:06:54 -06:00
Jack Grigg 03db5c8ca3
Tie sync_blocks in RPC tests to notifier thread 2019-12-18 15:06:54 -06:00
Jack Grigg 9771506acd
Move block-notifying logic into ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Jack Grigg a71a7341b9
Merge tree and boolean fields in ChainTip API
The trees were being unnecessarily fetched during DisconnectTip.
2019-12-18 15:06:54 -06:00
Jack Grigg a28916d273
Move mempool tx notifying logic out of CTxMemPool
ThreadNotifyWallets now collects all notification-related state at once,
and then executes wallet logic based on the collected state after
dropping any locks it is holding.
2019-12-18 15:06:54 -06:00
Jack Grigg 2c8dff00cc
ThreadNotifyRecentlyAdded -> ThreadNotifyWallets 2019-12-18 15:06:54 -06:00
Homu 63c3d1ec94 Auto merge of #4227 - str4d:2074-scripts-1, r=str4d
Bitcoin script PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6335
- bitcoin/bitcoin#6424
- bitcoin/bitcoin#11058
- bitcoin/bitcoin#12460
- bitcoin/bitcoin#13194

Part of #2074.
2019-12-17 17:05:58 +00:00
str4d 31e1ea63e1
Apply suggestions from code review
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2019-12-17 11:05:28 -06:00
Homu e51e21c3f0 Auto merge of #4261 - str4d:4217-z_mergetoaddress-release-notes, r=str4d
Add z_mergetoaddress to release notes

Closes #4217.
2019-12-13 18:59:50 +00:00
Jack Grigg 5746704b4b
Add z_mergetoaddress to release notes 2019-12-11 23:41:53 +00:00
Homu a96942e809 Auto merge of #4148 - str4d:macos-cross-compile, r=mdr0id
Enable macOS cross-compilation

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7809
  - The `native_cctools` fix.
- bitcoin/bitcoin#8210
  - The macOS toolchain bump.
- bitcoin/bitcoin#9891
- bitcoin/bitcoin#15581
  - The `tar` change.
- bitcoin/bitcoin#16049
  - The `native_cctools` change.

Build instructions:
- Fetch `MacOSX10.11.sdk` from e.g. https://github.com/phracker/MacOSX-SDKs/releases
- Extract it into `depends/SDKs` (creating that folder first)
- `HOST=x86_64-apple-darwin11 ./zcutil/build.sh`
2019-12-11 05:26:07 +00:00
Homu 5db5bd749c Auto merge of #4245 - oxarbitrage:issue4012, r=daira
Remove dead code

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

Equivalent to bitcoin/bitcoin/pull/9822
2019-12-10 22:10:10 +00:00
Jack Grigg adb47482c8
Revert "depends: Explicitly set Boost toolchain during configuration"
This reverts commit 734e594c2c.

It appears that this was fixing a single issue with the FreeBSD build,
while b6d0996cec addressed the underlying
cause. However, the change in this commit overrides the underlying fix
when cross-compiling for Darwin.
2019-12-10 20:40:30 +00:00
Jack Grigg 97098c45cb
depends: Manually apply build_env to second half of googletest build
The build environment is applied to the entire configured build_cmds
section, but it doesn't carry over past the && between the gmock and
gtest builds. This causes problems when cross-compiling for darwin, as
the correctly-configured clang++ is provided in the build environment.
2019-12-10 20:40:29 +00:00
Jack Grigg a89c1058bc
configure: Don't require RELRO and BIND_NOW when cross-compiling darwin 2019-12-10 20:40:28 +00:00
Jack Grigg 073f5b8f48
depends: Add Rust targets for cross-compiling darwin 2019-12-10 20:40:26 +00:00
Jack Grigg 576de307fe
depends: Compile bdb with --disable-atomics when cross-compiling darwin
This sidesteps the problem where the atomics check tries to run a test
binary, which cannot be performed during cross compilation. We should
replace this with a better solution in future.

Part of #3710.
2019-12-10 20:38:33 +00:00
Ulrich Kempken 2e5bb0a4a2
depends: switch to secure download of all dependencies
Some dependency sources were downloaded via http, even though https (SSL/TLS) options are available.
Even if we potentially check the integrity of the downloaded files via hash comparison, we should make
use of this additional security layer.

Zcash:
native_cctools.mk
2019-12-10 20:38:32 +00:00
Carl Dong 6dcba32cc4
depends: tar: Always extract as yourself
For normal users, --no-same-owner is default, but not so for root, where
it is assumed that root can change ownership willy-nilly. This is not
the case for privilege-limited container environments where we gaslight
the process into thinking it's root.

Zcash: Excludes QT changes
2019-12-10 20:38:31 +00:00
Cory Fields 8ae1b9ded1
depends: make osx output deterministic
ld64 is threaded, and uses a worker for each CPU to parse input files. But
there's a bug in the parser causing dependencies to be calculated differently
based on which files have already been parsed.

As a result, builders with more CPUs are more likely to see non-determinism.

This looks to have been fixed in a newer version of ld64, so just disable
threading for now. There's no noticible slowdown.
2019-12-10 20:38:30 +00:00
Cory Fields f7f7b1c557
depends: bump OSX toolchain
clang: 3.7.1
cctools: 877.8
ld64: 253.9

Zcash: Second part of f25209a3e1e6488d4d44de15b0f113d2302e9aee from
upstream (we merged the first part in #2697).
2019-12-10 20:38:29 +00:00
Cory Fields 4d59b8bdd1
depends: qt/cctools: fix checksum checksum tests
Checksums were being verified after download, but not again before extraction

Zcash: Only cctools changes
2019-12-10 20:38:28 +00:00
Jack Grigg be43fb5e98
Revert "Remove insecurely-downloaded dependencies that we don't currently use."
This partially reverts commit 86551dcb18
to bring back native_cctools for cross-compiling macOS.
2019-12-10 20:38:27 +00:00
Alfredo Garcia c0d5b87277 readd create_directories 2019-12-09 18:04:06 -03:00
Homu 34d428aa43 Auto merge of #4176 - oxarbitrage:issue3161, r=str4d
avoid blockchain progress greater than 1.0

Closes #3161
2019-12-09 16:02:14 +00:00
Homu 98354db098 Auto merge of #4246 - rex4539:fix-comment, r=daira
Remove stale comment

Closes https://github.com/zcash/zcash/issues/2962
2019-12-06 17:32:12 +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
Pieter Wuille 2cb14d79b1
Remove template matching and pseudo opcodes
The current code contains a rather complex script template matching engine,
which is only used for 3 particular script types (P2PK, P2PKH, multisig).
The first two of these are trivial to match for otherwise, and a specialized
matcher for multisig is both more compact and more efficient than a generic
one.

The goal is being more flexible, so that for example larger standard multisigs
inside SegWit outputs are more easy to implement.

As a side-effect, it also gets rid of the pseudo opcodes hack.
2019-12-04 20:36:46 +00:00
Ben Woosley 82beb18901
Assert CPubKey::ValidLength to the pubkey's header-relevent size
Previously this was an inline test where the specificity was probably judged
overly specific. As a class method it makes sense to maintain consistency.

And replace some magic values with their constant equivalents.

Zcash: Excludes changes to the following functions we don't have:

- ExtractPubKey (bitcoin/bitcoin#6415)
- IsCompressedPubKey (bitcoin/bitcoin#8499)
2019-12-04 20:36:45 +00:00
Jim Posen 3c8c8009db
Comments: More comments on functions/globals in standard.h.
Zcash: Excludes comments for variables and functions we don't have:

- GetScriptForRawPubKey (bitcoin/bitcoin#6415)
- GetScriptForWitness (bitcoin/bitcoin#8149)
2019-12-04 20:36:33 +00:00
Peter Todd 602960e5b5
Accept any sequence of PUSHDATAs in OP_RETURN outputs
Previously only one PUSHDATA was allowed, needlessly limiting
applications such as matching OP_RETURN contents with bloom filters that
operate on a per-PUSHDATA level. Now any combination that passes
IsPushOnly() is allowed, so long as the total size of the scriptPubKey
is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings)

Also, this fixes the odd bug where previously the PUSHDATA could be
replaced by any single opcode, even sigops consuming opcodes such as
CHECKMULTISIG. (20 sigops!)
2019-12-04 20:35:01 +00:00
Peter Todd 6962f1d2f0
Add IsPushOnly(const_iterator pc)
Allows IsPushOnly() to be applied to just part of the script for
OP_RETURN outputs.
2019-12-04 20:34:16 +00:00
Peter Todd cf6cf56a68
Make TX_SCRIPTHASH clear vSolutionsRet first
Previously unlike other transaction types the TX_SCRIPTHASH would not
clear vSolutionsRet, which means that unlike other transaction types if
it was called twice in a row you would get the result of the previous
invocation as well.
2019-12-04 20:34:15 +00:00
Luke Dashjr 4884e75c8c
Policy: MOVEONLY: 3 functions to policy.o:
- [script/standard.o] IsStandard
- [main.o] IsStandardTx
- [main.o] AreInputsStandard

Also, don't use namespace std in policy.cpp
2019-12-04 20:34:14 +00:00
Jorge Timón dd0c036538
Policy: MOVEONLY: Create policy/policy.h with some constants
Zcash: Adjusted to be move-only after our changes to the constants.
2019-12-04 20:34:11 +00:00
Homu 868c63f92d Auto merge of #2390 - str4d:2132-mapargs-prep, r=str4d
Misc upstream PRs

Cherry-picked from the following upstream PRs:

- https://github.com/bitcoin/bitcoin/pull/6077
  - Second commit only (first was already applied to 0.11.X and then reverted)
- https://github.com/bitcoin/bitcoin/pull/6284
- https://github.com/bitcoin/bitcoin/pull/6489
- https://github.com/bitcoin/bitcoin/pull/6235
- https://github.com/bitcoin/bitcoin/pull/6905
- https://github.com/bitcoin/bitcoin/pull/6780
  - Excluding second commit (QT) and third commit (requires https://github.com/bitcoin/bitcoin/pull/6993)
- https://github.com/bitcoin/bitcoin/pull/6961
  - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to.
- https://github.com/bitcoin/bitcoin/pull/7044
- https://github.com/bitcoin/bitcoin/pull/8856
- https://github.com/bitcoin/bitcoin/pull/9002

Part of #2074 and #2132.
2019-12-04 19:20:44 +00:00
Jack Grigg 1088866455
pyflakes fixes 2019-12-04 19:16:20 +00:00
Jack Grigg 6278085c23
Match alerts both with and without comments
We always locally check alerts against our subversion string without comments.
This change ensures that we will also propagate alerts to peers based on their
subversion strings without comments. Note that if an alert specifically targets
a commented subversion string, we will only relay it to peers with the exact
same comments.
2019-12-04 17:21:56 +00:00
Jack Grigg 5fd97dcdf9
Wrap long line 2019-12-04 17:21:55 +00:00
Jack Grigg 784a481070
cleanup: Comments 2019-12-04 17:21:54 +00:00
Jack Grigg dfeb5bfc6c
Parameterize zcash.conf in init error message 2019-12-04 17:21:53 +00:00
Jack Grigg 00d1efde32
Add tests covering the current interaction of alerts with subver comments 2019-12-04 17:21:52 +00:00
Jack Grigg c1ed8080f2
Handle Equihash and optional miner code in TestChain100Setup 2019-12-04 17:21:51 +00:00
Jack Grigg 26a84cc1f9
Fix benchmarks after removal of SelectParamsFromCommandLine() 2019-12-04 17:18:46 +00:00
Gregory Maxwell 9fee2baebf
Make connect=0 disable automatic outbound connections.
Otherwise it just responds to this obvious bit of configuration by
 trying to connect to "0" in a loop.
2019-12-04 17:18:45 +00:00
Jorge Timón 71068892d2
Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs 2019-12-04 17:18:44 +00:00
Gregory Sanders f4d9e06a90
Added additional config option for multiple RPC users. 2019-12-04 17:18:43 +00:00
MarcoFalke e763ce7b20
[qt] Move GUI related HelpMessage() part downstream
Zcash: Non-QT parts only
2019-12-04 17:18:42 +00:00