Commit Graph

13037 Commits

Author SHA1 Message Date
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
MarcoFalke e11e1ea58e
[trivial] Reuse translation and cleanup DEFAULT_* values
* DEFAULT_DISABLE_SAFEMODE = false
* Use DEFAULT_* constants for extern bools
2019-12-04 17:18:41 +00:00
Luke Dashjr 9bc915b02a
Bugfix: Omit wallet-related options from -help when wallet is not supported 2019-12-04 17:18:40 +00:00
Luke Dashjr 2e02bb21f7
Constrain constant values to a single location in code 2019-12-04 17:18:39 +00:00
Jack Grigg 363c945325
Initialize experimental mode in a separate function 2019-12-04 17:18:38 +00:00
Jonas Schnelli a425ac9706
Initialize logging before we do parameter interaction 2019-12-04 17:18:37 +00:00
Jonas Schnelli ef6b9b0fb2
Refactor parameter interaction, call it before AppInit2() 2019-12-04 17:18:36 +00:00
Luke Dashjr 5bedad9580
Bugfix: Omit wallet-related options from -help when wallet is disabled 2019-12-04 17:18:35 +00:00
Luke Dashjr a624c49219
Bugfix: If genproclimit is omitted to RPC setgenerate, don't change it; also show correct default in getmininginfo 2019-12-04 17:18:34 +00:00
Luke Dashjr 3779bea091
Bugfix: Describe dblogsize option correctly (it refers to the wallet database, not memory pool) 2019-12-04 17:18:33 +00:00
Luke Dashjr b90ea483dd
Bugfix: RPC: blockchain: Display correct defaults in help for verifychain method 2019-12-04 17:18:32 +00: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
Casey Rodarmor aa1d014b40
Give a better error message if system clock is bad
Fixes #2007

This checks to see if the system clock appears to be bad and gives a
helpful error message. If the user's clock is set incorrectly, hopefully
they'll abort, fix it, and then save themselves a fruitless resync.
2019-12-04 17:18:29 +00:00
Wladimir J. van der Laan 921e9a2e53
doc: mention change to option parsing behavior in release notes 2019-12-04 17:18:28 +00:00
Wladimir J. van der Laan 5514316892
Fix argument parsing oddity with -noX
`bitcoind -X -noX` ends up, unintuitively, with `X` set.
(for all boolean options X)

This result is due to the odd two-pass processing of arguments. This
patch fixes this oddity and simplifies the code at the same time.
2019-12-04 17:18:27 +00:00
Gavin Andresen b346588c13
Unit test doublespends in new blocks
As suggested by Greg Maxwell-- unit test to make sure a block
with a double-spend in it doesn't pass validation if half of
the double-spend is already in the memory pool (so full-blown
transaction validation is skipped) when the block is received.
2019-12-04 17:13:57 +00:00
Homu 9a06ea5ab8 Auto merge of #4221 - rex4539:typo, r=mdr0id
Fix typo
2019-12-03 22:12:39 +00:00
Homu 2383d1b1de Auto merge of #4211 - dagurval:rm-mempooltxinputlimit, r=mdr0id
Remove option mempooltxinputlimit

This option is no longer used after Overwinter. Fixes #4209.
2019-12-03 20:07:20 +00:00
Homu 46f44c6a38 Auto merge of #4180 - oxarbitrage:issue3198, r=mdr0id
Add node version to metrics screen

Closes #3198.

Example output:

```
Thank you for running a mainnet zcashd v2.1.0-rc1 node!
```
2019-12-03 18:02:57 +00:00
Homu 08c92b6e93 Auto merge of #4168 - oxarbitrage:issue3571, r=mdr0id
change LoadKeyMetadata, LoadZKeyMetadata and LoadSaplingZKeyMetadata to void

Fixes #3571
2019-12-03 16:59:15 +00:00
Homu 173d6a7c18 Auto merge of #4165 - oxarbitrage:issue4029, r=mdr0id
Remove CheckProofOfWork errors from logs

To fix https://github.com/zcash/zcash/issues/4029 bitcoin patch(https://github.com/bitcoin/bitcoin/pull/7459) was ported.
2019-12-03 14:56:52 +00:00
Homu 5e26d48a39 Auto merge of #4226 - str4d:2074-wallet-1, r=mdr0id
Bitcoin 0.12 wallet PRs 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6057
- bitcoin/bitcoin#6415

Part of #2074. Closes #3700.
2019-12-03 06:53:27 +00:00
Homu cc807987c9 Auto merge of #4244 - charlieok:add_check_depends_build_step, r=mdr0id
Add check-depends step to STAGE_COMMANDS list

Added to the beginning of the list of stage commands
2019-12-03 03:11:32 +00:00
Homu 2d4b6f9cc2 Auto merge of #4243 - mdr0id:ipv6_rpc_patch, r=mdr0id
IPv6 RPC patch

Cherry-picked from bitcoin/bitcoin#7489.

To support CI updates via GKE, this patch ensures hosts using only IPv4 can function gracefully on `proxy_test.py`.
2019-12-03 01:42:47 +00:00
Marshall Gaucher 017682f993
Update to stop random race error from assert 2019-12-02 17:39:00 -08:00
Marshall Gaucher acea0f7715
Update z_sendmany calls passing int 0, instead of Decimal('0') 2019-12-02 15:37:10 -08:00
str4d 6d57fcff13
Apply suggestions from code review
Co-Authored-By: Daira Hopwood <daira@jacaranda.org>
2019-12-02 21:10:35 +00:00