Commit Graph

11500 Commits

Author SHA1 Message Date
Simon 61624ed05d Part of #2966, extending Sprout tests to other epochs.
This continues the work started in PR #3109.
2018-04-09 16:17:30 -07:00
Jack Grigg 47fe5f72f4
Disable building libzcashconsensus by default
The library is not currently a supported build artifact; it needs work in
order to build on certain platforms (e.g. MacOS), and its dependencies need to
be narrowed down (Equihash is not a requirement for validating scripts).
2018-04-06 15:09:50 +01:00
Homu 079d9e6a57 Auto merge of #3149 - str4d:release-v1.1.0-rc1, r=str4d
Release v1.1.0-rc1
2018-04-05 04:36:15 -07: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
Homu 600c4acee1 Auto merge of #3151 - bitcartel:fix_alertnotify_test, r=str4d
Fix Deprecation test to check for sanitized string from alertnotify.

Closes #3150
2018-04-05 02:08:42 -07:00
Simon 6901d30830 Fix test to check for sanitized string from alertnotify.
If client version is 1.1.0-rc1, the alertnotify message will have
been sanitized and will show as 1.1.0rc1.
2018-04-04 21:55:20 -07:00
Jack Grigg 776b494aec
make-release.py: Updated release notes and changelog for 1.1.0-rc1. 2018-04-05 03:26:17 +01:00
Jack Grigg 13d491c7bf
make-release.py: Updated manpages for 1.1.0-rc1. 2018-04-05 03:26:07 +01:00
Jack Grigg 5e11533408
make-release.py: Versioning changes for 1.1.0-rc1. 2018-04-05 03:08:20 +01:00
Homu f6d09aa822 Auto merge of #2814 - str4d:2074-node-bloom, r=str4d
Add NODE_BLOOM service bit

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6579
  - Zcash equivalent of BIP 111
- bitcoin/bitcoin#6652
  - Docs for BIP 111
- bitcoin/bitcoin#7087
- bitcoin/bitcoin#7174
- bitcoin/bitcoin#8709

Part of #2074. Closes #2738.
2018-04-04 17:34:30 -07:00
Jack Grigg 3fe2f3d143
Update -enforcenodebloom RPC test with filterclear vs filteradd 2018-04-05 01:30:38 +01:00
R E Broadley 4f31d82395
Allow filterclear messages for enabling TX relay only.
An example of where this might be useful is allowing a node to connect blocksonly during IBD but then becoming a full-node once caught up with the latest block. This might also even want to be the default behaviour since during IBD most TXs appear to be orphans, and are routinely dropped (for example when a node disconnects). Therefore, this can waste a lot of bandwidth.

Additionally, another pull could be written to stop relaying of TXs to nodes that are clearly far behind the latest block and are running a node that doesn't store many orphan TXs, such as recent versions of Bitcoin Core.
2018-04-05 01:30:38 +01:00
Jack Grigg 2b7fcab8fc
Move bloom filter filtering logic back into command "switch" 2018-04-05 01:30:38 +01:00
Jack Grigg 0a284ecaf6
Fix NODE_BLOOM documentation errors 2018-04-05 01:30:38 +01:00
Jack Grigg b77e46fe01
Add RPC test for -enforcenodebloom 2018-04-05 01:30:38 +01:00
Matt Corallo 1c82adeb87
Don't do mempool lookups for "mempool" command without a filter 2018-04-05 01:30:12 +01:00
Patick Strateman b976ce7cee
Document both the peerbloomfilters and enforcenodebloom options. 2018-04-05 01:30:12 +01:00
Patick Strateman f07ad43553
Add enforcenodebloom option.
Previously peers which implement a protocol version less than NO_BLOOM_VERSION
would not be disconnected for sending a filter command, regardless of the
peerbloomfilter option.

Many node operators do not wish to provide expensive bloom filtering for SPV
clients, previously they had to cherry pick the commit which enabled the
disconnect logic.

The default should remain false until a sufficient percent of SPV clients
have updated.
2018-04-05 01:30:12 +01:00
Patick Strateman d06ae252a0
Move bloom filter filtering logic outside of command "switch" (giant if/else).
Moving this logic outside of the "switch" makes it far simpler to
enable the forced disconnect by a parameter.
2018-04-05 01:30:12 +01:00
Wladimir J. van der Laan 935f9f713c
doc: update release-notes and bips.md for BIP111
Also includes a09db7c [trivial] Minor format fixes
2018-04-05 01:30:12 +01:00
Matt Corallo 8bc4461326
Add NODE_BLOOM service bit and bump protocol version
Lets nodes advertise that they offer bloom filter support explicitly.
The protocol version bump allows SPV nodes to assume that NODE_BLOOM is
set if NODE_NETWORK is set for pre-170004 nodes.

Also adds an option to turn bloom filter support off for nodes which
advertise a version number >= 170004. Nodes attempting to use bloom
filters on such protocol versions are banned, and a later upgade
should drop nodes of an older version which attempt to use bloom
filters.

Much code stolen from Peter Todd.

Zcash: Implements Zcash equivalent of BIP 111; deploys with Overwinter
2018-04-05 01:30:12 +01:00
Homu f5b1082f9c Auto merge of #3148 - str4d:DOS-mitigation-tx-expiry, r=str4d
Don't increase banscore for expired transactions if they only just expired

Closes #3141.
2018-04-04 15:46:25 -07:00
Jack Grigg 10e97b8f00
test: Add missing Overwinter fields to mininode's CTransaction 2018-04-04 22:49:49 +01:00
Homu dc57d6a7bc Auto merge of #3146 - str4d:bc-7956-dbwrapper-tests, r=str4d
Additional dbwrapper tests

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#7992
- bitcoin/bitcoin#9867
  - Only the commit affecting dbwrapper tests
- bitcoin/bitcoin#9610
  - Only the change affecting dbwrapper tests
- bitcoin/bitcoin#10844
2018-04-04 14:23:14 -07:00
Jack Grigg 8a22734ec1
test: Check return value of snprintf 2018-04-04 19:18:23 +01:00
Simon 7cc423522f Bump MIT Licence copyright header. 2018-04-04 10:16:06 -07:00
Simon 2742b20833 Use range based for loop
Instead of iterating over 0 .. 1 and then deciding on an actual desired
value, use a range based for loop for the desired value.

Adapted from d0413c670b4e5dc79d5cc1bc35571fca745c9a24
Authored-by: René Nyffenegger <mail@renenyffenegger.ch>
2018-04-04 09:57:59 -07:00
Lauda 923f2579b1 [Trivial] Grammar and typo correction
Minor corrections in src\test\* .
2018-04-04 09:46:29 -07:00
Wladimir J. van der Laan 64b4790789 test: Replace remaining sprintf with snprintf
Use of `sprintf` is seen as a red flag as many of its uses are insecure.
OpenBSD warns about it while compiling, and some modern platforms, e.g.
[cloudlibc from cloudabi](https://github.com/NuxiNL/cloudlibc) don't
even provide it anymore.

Although our uses of these functions are secure, it can't hurt to
replace them anyway. There are only 3 occurences left, all in the
tests.
2018-04-04 09:43:59 -07:00
Jack Grigg 162cc4240e
Fix typo 2018-04-04 14:59:07 +01:00
Matt Corallo cf00779278
Add test for dbwrapper iterators with same-prefix keys. 2018-04-04 11:29:20 +01:00
Wladimir J. van der Laan 54a9734897
test: Add more thorough test for dbwrapper iterators
I made a silly mistake in a database wrapper where keys
were sorted by char instead of uint8_t. As x86 char is signed
the sorting for the block index database was messed up, resulting
in a segfault due to missing records.

Add a test to catch:
- Wrong sorting
- Seeking errors
- Iteration result not complete
2018-04-04 11:28:34 +01:00
Wladimir J. van der Laan 7b1acda395
chain: Add assertion in case of missing records in index db 2018-04-04 11:18:41 +01:00
Daira Hopwood 473a113241 Don't increase banscore if the transaction only just expired.
Author: Jack Grigg <str4d@z.cash>
2018-04-04 01:29:47 +01:00
Daira Hopwood a0ea82301a Test that receiving an expired transaction does not increase the peer's ban score. 2018-04-04 00:01:49 +01:00
Daira Hopwood 697140ede5 Add support for Overwinter v3 transactions to mininode framework. 2018-04-04 00:01:23 +01:00
Jay Graber e4dff510b4 Set ban score for expired txs to 0 2018-04-03 23:50:43 +01:00
Homu 77669b952b Auto merge of #2598 - str4d:2074-dbwrapper, r=str4d
Bitcoin 0.12+ dbwrapper improvements

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6650
  - Only refactor - excludes obfuscation
- bitcoin/bitcoin#6777
  - Excluding obfuscation-related changes
- bitcoin/bitcoin#6865
- bitcoin/bitcoin#6823
- bitcoin/bitcoin#6873
- bitcoin/bitcoin#7927
  - Excluding first commit (already included) and second commit (obfuscation-related)
- bitcoin/bitcoin#8467

Part of #2074.
2018-04-03 14:11:29 -07:00
Jack Grigg 2d7bae5b33
Update CBlockTreeDB::EraseBatchSync for dbwrapper refactor 2018-04-03 21:38:34 +01:00
Homu 599c847818 Auto merge of #2820 - str4d:darwin-build-patches, r=str4d
[macOS] Darwin build patches

Part of #2246.
2018-04-03 12:44:24 -07:00
Pavel Janík 56aa25684c
Do not shadow members in dbwrapper 2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan 3923bcca7c
dbwrapper: Move `HandleError` to `dbwrapper_private`
HandleError is implementation-specific.
2018-04-03 20:40:54 +01:00
Wladimir J. van der Laan 809a429ecf
dbwrapper: Pass parent CDBWrapper into CDBBatch and CDBIterator
Zcash: Makes future extensions easier.

Original description (when this was introduced upstream):

Pass parent wrapper directly instead of obfuscation key. This
makes it possible for other databases which re-use this code
to use other properties from the database.

Add a namespace dbwrapper_private for private functions to be used
only in dbwrapper.h/cpp and dbwrapper_tests.
2018-04-03 20:40:54 +01:00
Jeff Garzik e3da7a572d
leveldbwrapper file rename to dbwrapper.* 2018-04-03 20:40:54 +01:00
Jeff Garzik f345c41ec4
leveldbwrapper symbol rename: Remove "Level" from class, etc. names 2018-04-03 20:40:54 +01:00
Jeff Garzik 7249ee6d7c
leveldbwrapper: Remove unused .Prev(), .SeekToLast() methods
Also, trim trailing whitespace.
2018-04-03 20:40:54 +01:00
Daniel Kraft c77586964a
trivial: use constants for db keys
Replace literal occurances of the key "prefixes" 'c' and 'b' in txdb.cpp
by the respective constants.
2018-04-03 20:40:54 +01:00
Jack Grigg 26cdb83add
Update blockchain.py RPC test for Zcash 2018-04-03 20:40:54 +01:00
Pieter Wuille f95bf4c417
Fix chainstate serialized_size computation 2018-04-03 20:40:54 +01:00
James O'Beirne 79272bfaf9
Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2018-04-03 20:40:54 +01:00