Commit Graph

7146 Commits

Author SHA1 Message Date
Jonas Schnelli 962ec4b5e4
[QA] add setban/listbanned/clearbanned tests 2017-03-02 13:23:03 -08:00
Jonas Schnelli ed3f13a057
[RPC] add setban/listbanned/clearbanned RPC commands 2017-03-02 13:23:03 -08:00
Jonas Schnelli 997829713c
[net] extend core functionallity for ban/unban/listban 2017-03-02 13:23:03 -08:00
Alex van der Peet 94ee48c42a
New RPC command disconnectnode 2017-03-02 13:23:03 -08:00
Stephen 6699b42518
Add paytxfee to getwalletinfo, warnings to getnetworkinfo 2017-03-02 13:23:03 -08:00
Daniel Kraft e940185294
Fix univalue handling of \u0000 characters.
Univalue's parsing of \u escape sequences did not handle NUL characters
correctly.  They were, effectively, dropped.  The extended test-case
fails with the old code, and is fixed with this patch.
2017-03-02 13:23:03 -08:00
zkbot 28a5393401 Auto merge of #2138 - daira:2137.compactsize-portability.0, r=arcalinea
Don't assume sizes of unsigned short and unsigned int in GetSizeOfCompactSize and WriteCompactSize.

Fixes #2137

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-02 21:07:20 +00:00
zkbot 14711a4a43 Auto merge of #2141 - bitcartel:1969_free_rate_limiter, r=daira
Closes #1969. Large shielded transactions using the default fee are no longer treated as "free" transactions
2017-03-02 03:51:14 +00:00
zkbot c1cff6069f Auto merge of #2130 - str4d:2095-metrics-reindex-msg, r=arcalinea
Do not ask a UI question on metrics screen

Based on bitcoin/bitcoin#8257.

Closes #2095.
2017-03-02 03:08:29 +00:00
zkbot 1a41597af8 Auto merge of #2114 - bitcartel:fix_fr_test_bug_and_new_testnet_addresses, r=daira
Closes #2113. Fixes bug in test and updates testnet fr addresses.

Updating the testnet fr addresses will introduce a consensus change on testnet, so all testnet nodes will be required to upgrade.  See #2113 for more information.
2017-03-02 02:18:33 +00:00
zkbot 312fbd9d0e Auto merge of #1932 - aniemerg:1522-pause-mining-for-joinsplit, r=arcalinea
Pause mining during JoinSplit creation

Closes #1522 .
2017-03-02 01:23:44 +00:00
Allan Niemerg 49c2cecb9f Pause mining during joinsplit creation 2017-03-01 16:54:26 -08:00
zkbot 44ccf1ff20 Auto merge of #2123 - bitcartel:2112_z_getoperationresult_returns_executing_status, r=arcalinea
Closes #2112 where z_getoperationresult could return stale status.

The problem was similar to a check-then-act race condition.  Status object was obtained from an operation, which might be in an 'executing' state.  Instead of checking the state recorded in the status object, the operation was queried again to see if it was in a finished state (failed,success,cancelled) and if yes, the status object was returned to the user.  However, if the operation had changed state in the background, the status object would be stale.
2017-03-02 00:24:26 +00:00
Simon ebe750a882 Part of #1969. Changing min fee calculation also changes the dust threshold. 2017-02-28 11:44:07 -08:00
Simon 0f724e716d Closes #1969. Default fee now sufficient for large shielded tx.
Sets default min relay tx fee to 100, which is used to initialize
nSatoshisPerK for min fee calculation.  The default z_sendmany
fee of 10000 is now sufficient to cover a tx of size 100000 bytes,
so txs will not be treated as "free" and hit the free rate limiter.
2017-02-28 11:43:04 -08:00
zkbot 6f5d8fbe81 Auto merge of #2126 - bitcartel:checkpoint_mainnet_67500, r=daira
Add checkpoint at block 67500 (mainnet)

Close #2125
2017-02-28 01:01:56 +00:00
zkbot 98ddf87d18 Auto merge of #2128 - bitcartel:checkpoint_testnet_38000, r=daira
Add checkpoint at block 38000 (testnet)

Closes #2127
2017-02-28 00:12:04 +00:00
Daira Hopwood d76ed723c5 Don't assume sizes of unsigned short and unsigned int in GetSizeOfCompactSize and WriteCompactSize.
Fixes #2137

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-27 19:34:23 +00:00
Jack Grigg 0cd769fbb7
Treat metrics screen as non-interactive for now
Closes #2095
2017-02-23 12:55:14 +00:00
Jack Grigg f42cde3c30
Remove reference to -reindex-chainstate
Revert this when bitcoin/bitcoin#7917 is merged.
2017-02-23 12:42:28 +00:00
Pieter Wuille 5d66d0a11e
Do not ask a UI question from bitcoind 2017-02-23 12:40:45 +00:00
Simon 5a888f7294 Add testnet checkpoint at block 38000 2017-02-22 22:34:20 -08:00
Simon b897de531c Add mainnet checkpoint at block 67500 2017-02-22 21:36:44 -08:00
Simon 2f21206cfc Closes #2112 where z_getoperationresult could return stale status. 2017-02-22 16:14:56 -08:00
Simon 1003180260 Keep first three original testnet fr addresses so existing coinbase
transactions on testnet remain valid during upgrade.  New addresses
will be used starting from block 53127.
2017-02-22 11:04:17 -08:00
zkbot 4e338b0c36 Auto merge of #2093 - bitcartel:sent_network_alerts, r=daira
Closes #2092. Maintain record of alerts sent onto mainnet.
2017-02-20 17:28:40 +00:00
Simon 4340ec9705 Update founders reward addresses for testnet 2017-02-20 09:23:06 -08:00
Simon 2911b35712 Fix bug where test was generating but not saving keys to wallet on disk. 2017-02-20 09:23:06 -08:00
Simon f47269cda9 Add assert to check alert message length is valid 2017-02-17 11:55:41 -08:00
Leo Arias 82c754f628 Fix the path to the example configuration 2017-02-11 13:52:15 -06:00
Simon 2ddec8f0e4 Bump version to 1.0.6 as part of release process 2017-02-10 09:55:49 -08:00
zkbot 93baaeee3e Auto merge of #2081 - daira:1955-single-address-mining, r=bitcartel
Address @str4d's comment on #1965 about the case where -gen is not set

https://github.com/zcash/zcash/pull/1965#discussion_r100414069

Note that the case of calling the ``setgenerate true`` RPC with the wallet disabled was already handled correctly.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-10 08:58:19 +00:00
zkbot eaaa5f625f Auto merge of #2082 - str4d:univalue-subtree, r=bitcartel
Add UniValue as subtree

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6637
- bitcoin/bitcoin#6239
- bitcoin/bitcoin#6379
- bitcoin/bitcoin#6456
- bitcoin/bitcoin#6788
2017-02-10 07:46:58 +00:00
zkbot e51bd1b556 Auto merge of #1990 - str4d:1985-replace-json-spirit-with-univalue, r=str4d
Convert entire source tree from json_spirit to UniValue

This PR cherry-picks bitcoin/bitcoin#6121 and then migrates the Zcash-specific code to UniValue.

Also cherry-picks:
- bitcoin/bitcoin#6241
- bitcoin/bitcoin#6234

Closes #1985.
2017-02-10 05:15:53 +00:00
Jack Grigg f54db399f2
Get rid of fPlus argument to FormatMoney in Zcash-specific code 2017-02-10 02:19:14 +00:00
Jack Grigg c24109ecc3
UniValue::getValues const reference 2017-02-10 02:19:12 +00:00
Jack Grigg 2cc6bab201
Update UniValue includes in Zcash-specific code 2017-02-10 02:19:06 +00:00
Cory Fields 1dc626314d
build: match upstream build change 2017-02-10 02:19:03 +00:00
Wladimir J. van der Laan a8c22cc4d1
util: use locale-independent parsing in ParseDouble
Use locale-indepent C++ based parsing instead of C's strtod,
which checks for different input based on the user's locale.
Fixes #6443.
2017-02-10 02:19:02 +00:00
Wladimir J. van der Laan 2aee461930
univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).

Zcash: cherry-picked from commit 7650449a6777710cf818d41862626164da0cd412
Dropped changes to qa/rpc-tests/rest.py pending addition of /rest/headers/
2017-02-10 02:19:01 +00:00
Wladimir J. van der Laan d5bf1afae9
rpc: Make ValueFromAmount always return 8 decimals
This is the format that was always returned to JSON clients.
The difference was not noticed before, because VREAL values
are post-processed by univalue.

By implementing the functionality directly it breaks the dependency
of rpcserver on utilmoneystr. FormatMoney is now only used for debugging
purposes.

To test, port over the formatting tests from util_tests.cpp to
rpc_tests.cpp.
2017-02-10 02:18:59 +00:00
Wladimir J. van der Laan fed500e2dd
rpc: Accept scientific notation for monetary amounts in JSON
Add a function `ParseFixedPoint` that parses numbers according
to the JSON number specification and returns a 64-bit integer.

Then this in `AmountFromValue`, rather than `ParseMoney`.

Also add lots of tests (thanks to @jonasschnelli for some of them).

Fixes issue #6297.
2017-02-10 02:18:58 +00:00
Wladimir J. van der Laan e76a3849c6
Changes necessary now that zero values accepted in AmountFromValue
- Add an accept test for zero amounts, and a reject test for negative
  amounts
- Remove ugly hack in `settxfee` that is no longer necessary
- Do explicit zero checks in wallet RPC functions
- Don't add a check for zero amounts in `createrawtransaction` - this
  could be seen as a feature
2017-02-10 02:18:57 +00:00
Wladimir J. van der Laan a5beb3a51b
Get rid of fPlus argument to FormatMoney
It's never used with any other value than false, the default.
2017-02-10 02:18:55 +00:00
Wladimir J. van der Laan c66dff3dc7
Don't go through double in AmountFromValue and ValueFromAmount
My prime gripe with JSON spirit was that monetary values still had to be
converted from and to floating point which can cause deviations (see #3759
and https://bitcoin.stackexchange.com/questions/22716/bitcoind-sendfrom-round-amount-error).

As UniValue stores internal values as strings, this is no longer
necessary. This avoids risky double-to-integer and integer-to-double
conversions completely, and results in more elegant code to boot.
2017-02-10 02:18:54 +00:00
Jonas Schnelli fbc98d7720
remove $(@F) and subdirs from univalue make 2017-02-10 02:18:52 +00:00
Jonas Schnelli a10a6e2a0e
[Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2017-02-10 02:18:51 +00:00
Jack Grigg 0025fb4b0e
Merge commit 'a4071034f6ad640ef91057fa3f45098c4933f444' as 'src/univalue' 2017-02-10 02:18:46 +00:00
Jonas Schnelli 7fc7bab25d
remove univalue, prepare for subtree 2017-02-10 00:56:22 +00:00
Jack Grigg 02972a1bcd
[cleanup] Simplify test code 2017-02-10 00:53:15 +00:00
Jack Grigg 873c40365a
[cleanup] Remove unused import 2017-02-10 00:53:14 +00:00
Jack Grigg cc71666a51
unsigned int -> size_t for comparing with UniValue.size() 2017-02-10 00:53:13 +00:00
Jack Grigg 5fb326d41d
Manually iterate over UniValue arrays in tests 2017-02-10 00:53:09 +00:00
Jack Grigg 0d37ae3a59
Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
Jonas Schnelli f70084cf06
fix rpcmining/getblocktemplate univalue transition logic error 2017-02-10 00:35:24 +00:00
Jonas Schnelli b60e9f230f
fix util_tests.cpp clang warnings
was introduced with #6121
2017-02-10 00:35:24 +00:00
Jonas Schnelli 6b1e42bbfa
univalue: add type check unit tests 2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan 4bcb9c9099
univalue: add strict type checking 2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan 5960d70002
util: Add ParseInt64 and ParseDouble functions
Strict parsing functions for other numeric types.

- ParseInt64 analogous to ParseInt32, but for 64-bit values.
- ParseDouble for doubles.
- Make all three Parse* functions more strict (e.g. reject whitespace on
  the inside)

Also add tests.
2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan ff67da37cd
Simplify RPCclient, adapt json_parse_error test
# Conflicts:
#	src/test/rpc_tests.cpp
2017-02-10 00:35:24 +00:00
Jonas Schnelli c288192b19
fix univalue json parse tests 2017-02-10 00:35:24 +00:00
Jonas Schnelli b47f3aea36
fix missing univalue types during constructing 2017-02-10 00:35:24 +00:00
Jonas Schnelli bf3f56025d
fix rpc batching univalue issue 2017-02-10 00:35:24 +00:00
Jonas Schnelli d014114d67
Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
2017-02-10 00:35:24 +00:00
Jonas Schnelli 851f58f94e
remove JSON Spirit UniValue wrapper 2017-02-10 00:35:24 +00:00
Jonas Schnelli 565d26737a
fix rpc unit test, plain numbers are not JSON compatible object
UniValues read() does only read valid json.
2017-02-10 00:35:24 +00:00
Jonas Schnelli 9ccfdd9a01
univalue: correct bool support 2017-02-10 00:35:24 +00:00
Jonas Schnelli 49a5df0ef3
univalue: add support for real, fix percision and make it json_spirit compatible
- avoid breaking the API because of different number/percision handling
2017-02-10 00:35:24 +00:00
Jonas Schnelli 23f71dc740
special threatment for null,true,false because they are non valid json 2017-02-10 00:35:24 +00:00
Jonas Schnelli 38fc4b7090
expicit set UniValue type to avoid empty values 2017-02-10 00:35:24 +00:00
Jonas Schnelli 9756b7bd29
extend conversion to UniValue 2017-02-10 00:35:24 +00:00
Jeff Garzik ed21d5bd4b
Convert tree to using univalue. Eliminate all json_spirit uses. 2017-02-10 00:35:24 +00:00
Jeff Garzik 03912600e8
UniValue: export NullUniValue global constant 2017-02-10 00:35:24 +00:00
Jeff Garzik ec57cc0ffe
UniValue: prefer .size() to .count(), to harmonize w/ existing tree 2017-02-10 00:35:24 +00:00
zkbot f52293b982 Auto merge of #2078 - ebfull:uaf, r=bitcartel
Fix use after free in transaction_tests.

Fixes #2026
2017-02-10 00:29:57 +00:00
Daira Hopwood 3df7c4c8c0 Address @str4d's comment about the case where -gen is not set.
Also avoid shadowing mineToLocalWallet variable.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-10 00:15:12 +00:00
zkbot 7d4ced95ed Auto merge of #2056 - str4d:2035-experimental-mode, r=bitcartel
Add a flag for enabling experimental features

Closes #2035.
2017-02-09 23:39:02 +00:00
Simon 6605125d4e Add comment about fix for #2026. 2017-02-09 15:17:21 -08:00
zkbot d32511c72c Auto merge of #2054 - str4d:2030-decoderawtransaction-joinsplit-fields, r=bitcartel
Show all JoinSplit components in getrawtransaction and decoderawtransaction

Closes #2030.
2017-02-09 22:56:01 +00:00
Jack Grigg b8eb37757b
Require -experimentalmode for wallet encryption 2017-02-09 22:10:58 +00:00
Jack Grigg 1f015f6afa
Add a flag for enabling experimental features 2017-02-09 22:10:58 +00:00
Sean Bowe 05ec7887f1 Fix use after free in transaction_tests. 2017-02-09 14:35:33 -07:00
zkbot 0c78782662 Auto merge of #1965 - str4d:1955-single-address-mining, r=bitcartel
Switch miner to P2PKH, add -mineraddress option

Closes #945 and #1955.
2017-02-09 20:58:00 +00:00
zkbot 253c610783 Auto merge of #2050 - str4d:2020-zmq, r=bitcartel
Add ZeroMQ notifications

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6103
- bitcoin/bitcoin#6684
- bitcoin/bitcoin#6686
- bitcoin/bitcoin#6736
- bitcoin/bitcoin#6739
- bitcoin/bitcoin#6743
- bitcoin/bitcoin#6768
- bitcoin/bitcoin#6779
- bitcoin/bitcoin#6810
- bitcoin/bitcoin#6927
- bitcoin/bitcoin#6980 (only upgrading zeromq)
- bitcoin/bitcoin#6680
- bitcoin/bitcoin#7058
- bitcoin/bitcoin#7621
- bitcoin/bitcoin#7335 (only parts affecting `zmq_test.py`)
- bitcoin/bitcoin#7853 (only parts affecting `zmq_test.py`)
- bitcoin/bitcoin#7762
- bitcoin/bitcoin#7993 (only upgrading zeromq)
- bitcoin/bitcoin#8238
- bitcoin/bitcoin#8701
- bitcoin/bitcoin#6685

Closes #2020.
2017-02-09 20:08:15 +00:00
Daira Hopwood 9bba9b37c8 Better error reporting for the !ENABLE_WALLET && ENABLE_MINING case.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-02-09 19:31:47 +00:00
zkbot b2e2dccc64 Auto merge of #2068 - bitcartel:2045_sendmany_fee_zero, r=bitcartel
Closes #2045 by allowing z_sendmany with 0 fee
2017-02-09 18:56:44 +00:00
zkbot 80a32b2845 Auto merge of #1863 - str4d:1795-config-flag-disable-miner, r=bitcartel
Add compile flag to disable compilation of mining code

Closes #1795
2017-02-09 17:43:43 +00:00
Jack Grigg f49bcdf92b
Add -minetolocalwallet flag, enforced on -mineraddress 2017-02-08 23:37:45 +00:00
Jonas Schnelli 3ba2e19e2b
[ZMQ] append a message sequence number to every ZMQ notification 2017-02-08 22:11:53 +00:00
Jonas Schnelli abf8020443
[ZMQ] refactor message string 2017-02-08 22:11:53 +00:00
mrbandrews d4cca6a320
Fixes ZMQ startup with bad arguments. 2017-02-08 22:11:53 +00:00
Daniel Cousens 63303d025d
zmq: prepend zmq to debug messages 2017-02-08 22:11:53 +00:00
Daniel Cousens 6550e97224
init: add zmq to debug categories 2017-02-08 22:11:53 +00:00
Daniel Cousens 57c6ef01d9
init: amend ZMQ flag names 2017-02-08 22:10:42 +00:00
Jonas Schnelli 6a793d9c27
use CBlockIndex* insted of uint256 for UpdatedBlockTip signal
- removes mapBlockIndex find operation
- theoretically allows removing the cs_main lock during zqm notification while introducing a new file position lock
2017-02-08 22:10:42 +00:00
João Barbosa 5015d2b27f
Fix ZMQ Notification initialization and shutdown
Moves the call Initialize() from init.cpp to CreateWithArguments() and handles the
return value. Moves the call Shutdown() from init.cpp to destructor.
Changes Initialize() and Shutdown() to protected members.
2017-02-08 22:10:42 +00:00
Cory Fields 007148fafa
build: Make use of ZMQ_CFLAGS 2017-02-08 22:10:42 +00:00
Jack Grigg 8b99caa3e6
Add ZMQ libs to zcash-gtest 2017-02-08 22:10:42 +00:00
Jeff Garzik f200002cf3
Add ZeroMQ support. Notify blocks and transactions via ZeroMQ
Continues Johnathan Corgan's work.
Publishing multipart messages

Bugfix: Add missing zmq header includes

Bugfix: Adjust build system to link ZeroMQ code for Qt binaries
2017-02-08 22:10:42 +00:00
João Barbosa 7e6ec078fa
Add UpdatedBlockTip signal to CMainSignals and CValidationInterface 2017-02-08 22:10:42 +00:00
Simon 4b7f603813 Alert 1001 2017-02-08 12:21:07 -08:00
Simon 684ae2a730 Alert 1000 2017-02-08 11:57:15 -08:00
zkbot 138f19b0ba Auto merge of #2072 - bitcartel:2060_debug_zrpc_zrpcunsafe, r=bitcartel
Closes #2060 by updating zrpc and zrpcunsafe logging
2017-02-08 18:54:47 +00:00
Simon 43b6753782 Update zrpc vs zrpcunsafe logging in z_sendmany operation 2017-02-08 10:50:40 -08:00
zkbot dff700c1af Auto merge of #2055 - str4d:1545-note-decryption-error-class, r=daira
Use a more specific exception class for note decryption failure

Closes #1545.
2017-02-08 03:12:37 +00:00
Simon 3307124a2b Add parameter interaction, where zrpcunsafe implies zrpc 2017-02-06 23:29:07 -08:00
Simon 7eccce4e44 Closes #2045 by allowing z_sendmany with 0 fee 2017-02-06 14:14:28 -08:00
Jack Grigg c1de826f10
Correct #ifdef nesting of miner headers and helper functions 2017-02-06 11:55:06 +00:00
Jack Grigg 78ba3472d2
Update help text for mining options 2017-02-06 11:55:05 +00:00
Jack Grigg 8e8b6d701b
Switch miner to P2PKH, add -mineraddress option
Closes #945 and #1955.
2017-02-06 11:54:58 +00:00
zkbot 499e34fc64 Auto merge of #1706 - paragonie:master, r=bitcartel
Use libsodium's CSPRNG instead of OpenSSL's

Closes #1632.
2017-02-05 18:26:11 +00:00
Simon ee84f279a9 Update z_sendmany logging 2017-02-01 09:27:44 -08:00
Simon 3110b793f0 Closes #2057 by adding extra zrpcunsafe logging 2017-01-31 22:00:46 -08:00
Jack Grigg 51fde9ea08
Use a more specific exception class for note decryption failure
Closes #1545.
2017-01-31 23:05:19 +01:00
Jack Grigg 6d0ab3ee59
Show all JoinSplit components in getrawtransaction and decoderawtransaction
Closes #2030
2017-01-31 21:32:19 +01:00
Jack Grigg 2cc0a252ad
Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
Jack Grigg 475233553b
Fix linking error in CreateJoinSplit 2017-01-23 18:29:22 +01:00
Jack Grigg bf6a138304
Address review comments 2017-01-23 17:06:54 +01:00
Jack Grigg 207924a1d5
Remove OpenSSL PRNG reseeding
Per https://download.libsodium.org/doc/generating_random_data/ reseeding the
default libsodium PRNG is not required.
2017-01-23 17:06:54 +01:00
Jack Grigg 13124da0b6
Update comment 2017-01-23 17:06:54 +01:00
Scott e5df7ee78e
Update random.h
While I'm making an argument for better consistency, I might as well be self-consistent.
2017-01-23 17:06:54 +01:00
Paragon Initiative Enterprises, LLC 3106267575
Use libsodium's CSPRNG instead of OpenSSL's 2017-01-23 17:06:54 +01:00
Sean Bowe b8f737b364 Bump version to 1.0.5. 2017-01-19 19:21:32 -07:00
zkbot 0edb3c0f16 Auto merge of #1978 - str4d:1941-scan-whole-chain-on-zkey-import, r=ebfull
Scan the whole chain whenever a z-key is imported

Closes #1941.
2017-01-20 00:02:12 +00:00
zkbot c2c7998c2e Auto merge of #1979 - str4d:1786-inform-users-to-fetch-params, r=bitcartel
Instruct users to run zcash-fetch-params if network params aren't available

Closes #1786.
2017-01-19 21:47:26 +00:00
zkbot 78674ca79e Auto merge of #2007 - bitcartel:1097_copyright_notice_and_date, r=bitcartel
Closes #1097 so that zcash-cli displays license info like zcashd.

LicenseInfo is refactored from init.cpp to util.cpp so that the
bitcoin-cli makefile target does not need to be modified.
2017-01-19 00:56:47 +00:00
zkbot 4458f87138 Auto merge of #2028 - bitcartel:std_numeric_gcc_620_compile_issue, r=ebfull
Add missing header

Closes #2027 where gcc 6.2.0 identified that `rpcwallet.cpp` was missing a header file `<numeric>` which is required due to usage of `std::accumulate`.
2017-01-18 19:45:02 +00:00
Simon bcbde86a87 Add missing header required by std::accumulate 2017-01-18 10:52:37 -08:00
zkbot 63e0e895a5 Auto merge of #2006 - bitcartel:1497_destination_path_validation_when_exporting, r=bitcartel
Fixes #1497 ZCA-009 by restricting export to a user defined folder and sanitizing filenames
2017-01-18 18:19:50 +00:00
zkbot 94f427a211 Auto merge of #1999 - str4d:1950-random-cookie-rpc-auth, r=ebfull
rpc: Implement random-cookie based authentication

Cherry-picked from bitcoin/bitcoin#6388.

Closes #1950.
2017-01-18 14:20:25 +00:00
Jack Grigg 9773b95f6e
Coverage build system tweaks 2017-01-18 13:57:05 +01:00
zkbot 4d52160de3 Auto merge of #2001 - bitcartel:1957_add_size_to_listtransactions, r=ebfull
Closes #1957 by adding tx serialization size to listtransactions output.
2017-01-18 07:15:35 +00:00
zkbot 3b04df9072 Auto merge of #1982 - str4d:1954-update-debug-categories, r=ebfull
Update debug categories

Closes #1954.
2017-01-18 05:51:20 +00:00
zkbot f37f0805cc Auto merge of #1980 - bitcartel:fix_z_sendmany_logging_bug_txid, r=ebfull
Fix bug where z_sendmany logged incorrect txid fragment when sending from taddr

Closes #1987.
2017-01-18 05:10:18 +00:00
zkbot c583e42e6b Auto merge of #1977 - bitcartel:1967_z_sendmany_debug_age_of_notes, r=ebfull
Fixes #1967 by adding age of note to z_sendmany logging.
2017-01-18 04:29:06 +00:00
zkbot 1e8778a274 Auto merge of #1976 - bitcartel:1964_z_sendmany_exception_handling, r=ebfull
Fixes #1964 to catch general exception in z_sendmany and catch exceptions as reference-to-const.
2017-01-18 03:48:12 +00:00
zkbot acabe0a22d Auto merge of #1973 - str4d:1943-remove-extraneous-bins-from-dist, r=ebfull
Exclude test binaries from make install

Closes #1943.
2017-01-18 02:26:12 +00:00
zkbot 2a18730417 Auto merge of #1972 - str4d:1950-ensure-messages-are-rendered, r=ebfull
Ensure messages are rendered in the metrics UI

Part of #1950.
2017-01-18 01:45:04 +00:00
zkbot ee2f1ebb9d Auto merge of #1942 - str4d:1940-threaded-createjoinsplit, r=ebfull
Extend createjoinsplit to benchmark parallel JoinSplits

Closes #1940
2017-01-18 01:04:05 +00:00
zkbot 4169cddd64 Auto merge of #1991 - bitcartel:1960_z_getoperation_include_call_details, r=ebfull
Fixes #1960: z_getoperationstatus/result now includes operation details.
2017-01-17 19:24:07 +00:00
zkbot 9cd91833a5 Auto merge of #2015 - bitcartel:1780_sort_getoperationstatus, r=ebfull
Closes #1780. Result of z_getoperationstatus now sorted by operation's creation time.
2017-01-17 04:06:28 +00:00
Simon 8aa7937d44 Fixes #1960: z_getoperationstatus/result now includes operation details. 2017-01-16 16:45:27 -08:00
zkbot 6abf7adc14 Auto merge of #2013 - str4d:2002-require-zcash-conf, r=ebfull
Require zcash.conf to start zcashd

Closes #2002.
2017-01-16 23:09:38 +00:00
Jack Grigg 5ae347827f
Fix gtest ordering broken by #1949
Part of #1539
2017-01-16 20:16:29 +01:00
Simon f32cade8fd Closes #1957 by adding tx serialization size to listtransactions output. 2017-01-16 11:07:16 -08:00
Simon 9064d73bf8 Fixes #1497 ZCA-009 by restricting data exporting to user defined folder.
Previously the RPC interface allowed z_exportwallet, backupwallet and
dumpwallet to write data to an arbitrary filename.  ZCA-009 demonstrates
how this is vulnerable.  The resolution is to only allow data to
written when the -exportdir has been configured.  Also filenames are
restricted to alphanumeric characters.
2017-01-16 10:56:06 -08:00
Simon af02114469 Closes #1097 so zcash-cli now displays license info like zcashd.
LicenseInfo is refactored from init.cpp to util.cpp so that the
bitcoin-cli makefile target does not need to be modified.
2017-01-16 09:38:09 -08:00
Simon 2d2f3d1806 Closes #1780. Result of z_getoperationstatus now sorted by creation time of operation 2017-01-11 11:49:10 -08:00
Jack Grigg 24f4e3365b
Show a friendly message explaining why zcashd needs a zcash.conf 2017-01-11 12:55:35 +01:00
Jack Grigg d87f00c4d5
Throw an error if zcash.conf is missing
An empty zcash.conf is sufficient to bypass this error.
2017-01-10 16:33:41 +01:00
zkbot a6ba873aa8 Auto merge of #1949 - str4d:1810-fix-disablewallet, r=str4d
Fix --disablewallet

Closes #1810.
2017-01-09 17:36:41 +00:00
Wladimir J. van der Laan e957192c54
rpc: Implement random-cookie based authentication
When no `-rpcpassword` is specified, use a special 'cookie' file for
authentication. This file is generated with random content when the
daemon starts, and deleted when it exits. Read access to this file
controls who can access through RPC. By default this file is stored in
the data directory but it be overriden with `-rpccookiefile`.

This is similar to Tor CookieAuthentication: see
https://www.torproject.org/docs/tor-manual.html.en

Alternative to #6258. Like that pull, this allows running bitcoind
without any manual configuration. However, daemons should ideally never write to
their configuration files, so I prefer this solution.
2017-01-09 17:57:05 +01:00
Eran Tromer 894a0b3295 CreateJoinSplit: add start_profiling() call
This solves the problem of profiling output displaying nonsensical large time values.
2017-01-05 11:30:23 -05:00
Jack Grigg 53e9a6a0e2
Update debug categories
Closes #1954.
2017-01-05 11:56:42 +01:00
Jack Grigg 0b0a48c881
Suggest ./zcutil/fetch-params.sh as well
Once we improve the from-source installation docs to use 'make install', we can
revert this commit.
2017-01-05 11:38:38 +01:00
Jack Grigg b6e439b261
Handle newlines in UI messages 2017-01-05 08:38:35 +01:00
Jack Grigg e698459ec8
Strip out the SECURE flag in metrics UI so message style is detected 2017-01-05 08:19:15 +01:00
Jack Grigg 83561c9cb3
Trigger metrics UI refresh on new messages 2017-01-05 08:18:29 +01:00
Simon 4c1cd287be Fixes a bug where the unsigned transaction was logged by z_sendmany
after a successful sign and send, meaning that the logged hash fragment
would be different from the txid logged by "AddToWallet".  This issue
occured when sending from transparent addresses, as utxo inputs must be
signed.  It did not occur when sending from shielded addresses.
2017-01-04 12:26:23 -08:00
Jack Grigg bddf4079fd
Instruct users to run zcash-fetch-params if network params aren't available
Closes #1786.
2017-01-04 17:58:07 +01:00
Jack Grigg 7e3a20f235
Scan the whole chain whenever a z-key is imported
Closes #1941.
2017-01-04 15:40:35 +01:00
Simon 01f6c5dbee Fixes #1967 by adding age of note to z_sendmany logging. 2017-01-03 23:57:11 -08:00
Simon fce7260811 Fixes #1964 to catch general exception in z_sendmany and catch
exceptions as reference-to-const.
2017-01-03 12:50:19 -08:00
Jack Grigg 8e0fc39097
Exclude test binaries from make install
Closes #1943.
2017-01-03 11:23:21 +01:00
zkbot 57a0725ae1 Auto merge of #1946 - str4d:blockchain-stats-num-commitments, r=ebfull
Add total number of commitments to getblockchaininfo
2016-12-16 21:47:53 +00:00
Sean Bowe fc538ec2ea Add test for IncrementalMerkleTree::size(). 2016-12-16 13:50:55 -07:00
Jack Grigg d0ce704abe
Add a tool for profiling the creation of JoinSplits 2016-12-17 02:43:43 +13:00
Jack Grigg 6daab5b4fc
Only run wallet tests when wallet is enabled 2016-12-16 10:52:37 +13:00
Jack Grigg f3e4968626
Only enable getblocktemplate when wallet is enabled 2016-12-16 10:44:04 +13:00
Jack Grigg 83ce8a4d7c
Update version to 1.0.4 2016-12-15 16:33:09 +13:00
Jack Grigg 5d6e1aa60f
Add total number of commitments to getblockchaininfo 2016-12-15 15:50:26 +13:00
zkbot a530e9582f Auto merge of #1939 - str4d:1933-fix-bug, r=str4d
Only increment new notes on reindex

Addresses another issue in #1904.

When an existing one of our notes was found again, its cache was reset and it was re-witnessed. This would cause encountered notes to get out-of-sync with the otherwise-ignored newer notes, which could be a problem if the wallet data happens to be written out during a reindex.
2016-12-15 01:32:30 +00:00
Jack Grigg 4082dcb10f
Extend createjoinsplit to benchmark parallel JoinSplits
Closes #1940
2016-12-14 15:28:00 +13:00
zkbot 152c0ebf21 Auto merge of #1938 - ebfull:g2-subgroup-check, r=str4d
Additional well-formedness check for G2 elements

libsnark currently checks that G<sub>1</sub> and G<sub>2</sub> elements are well-formed by ensuring that they satisfy their respective curve equations, and although this is enough for G<sub>1</sub> (which is instantiated as an order r curve E/F<sub>p</sub>: y^2 = x^3 + b), G<sub>2</sub> is the order r *subgroup* of the composite order r(2q-r) curve E'/Fp<sup>2</sup>: y^2 = x^3 + b/e constructed via a sextic twisting isomorphism. This means we need to ensure these points are order r as well.

None of the proofs on the Zcash blockchain violate this check, and it may not even be possible for them to violate this check (bilinearity is not preserved). Let's be cautious and do it anyway.
2016-12-13 11:26:23 +00:00
zkbot 5c47d620f4 Auto merge of #1892 - str4d:1749-disable-js-verification-before-checkpoints, r=str4d
Skip JoinSplit verification before the last checkpoint

Part of #1749
2016-12-13 10:36:48 +00:00
Jack Grigg c0ec0e756b
Fix bug in IncrementNoteWitness() 2016-12-13 22:53:52 +13:00
Jack Grigg 78f4e0ef37
Rewrite reindex test to check beyond the max witness cache size 2016-12-13 22:53:29 +13:00
Jack Grigg 0752d1f8c4
Extract block-generation wallet test code into a function 2016-12-13 22:53:11 +13:00
Jack Grigg 35ce717f96
Fix bug in wallet tests 2016-12-13 22:50:57 +13:00
Sean Bowe c4fce3fc81 Check that E' points are actually in G2 by ensuring they are of order r. 2016-12-12 19:14:42 -07:00
Jack Grigg 6f78f4f44c
Only check cache validity for witnesses being incremented or decremented
Fixes the bug resulting from #1904.
2016-12-13 09:34:55 +13:00
zkbot 9f7bc6cba5 Auto merge of #1904 - str4d:1749-write-witness-cache-with-best-block, r=ebfull
Write witness caches when writing the best block

For steady-state operation, this reduces the average time between wallet disk
writes from once per block to once per hour.

On -rescan, witness caches are only written out at the end along with the best
block, increasing speed while ensuring that on-disk state is kept consistent.

Witness caches are now never recreated during a -reindex, on the assumption that
the blocks themselves are not changing (the chain is just being reconstructed),
and so the witnesses will remain valid.

Part of #1749.
2016-12-09 21:11:15 +00:00
Jack Grigg 9d2cc3a784
Make the test pass by fixing the bug! 2016-12-10 00:56:32 +13:00
Jack Grigg eeee6d5d6c
Add a reindex test that fails because of a bug in decrementing witness caches
Ref: https://github.com/zcash/zcash/pull/1904#issuecomment-265992988
2016-12-10 00:51:32 +13:00
zkbot 0617e428e2 Auto merge of #1895 - bitcartel:1857_tx_priority, r=str4d
Closes #1857. Fixes bug where a transaction sending from a zaddr would have a priority of zero.

Transactions sent from a zaddr should now be mined sooner as they no longer have a priority of zero
2016-12-09 08:10:21 +00:00
Jack Grigg 6fb8d0c2d6
Skip JoinSplit verification before the last checkpoint
Part of #1749
2016-12-09 21:06:45 +13:00
zkbot 8a6c070bfa Auto merge of #1870 - str4d:1749-benchmark-rescanning, r=str4d
Add benchmarks for rescan components

Part of #1749.
2016-12-09 07:12:22 +00:00
zkbot a398121503 Auto merge of #1919 - ebfull:abstract-verification, r=str4d
Isolate verification to a ProofVerifier context object that allows verification behavior to be tuned by the caller.

This is an alternative foundation for #1892, i.e., #1892 will have to be changed if this PR is accepted.

I think this is a safer approach because it allows us to isolate verification behavior to a single object. This will come in handy when @arielgabizon finishes the batching code.
2016-12-09 06:22:53 +00:00
Sean Bowe 37cce214a4 ASSERT_TRUE -> ASSERT_FALSE 2016-12-08 23:14:23 -07:00
Jack Grigg 9755eb8292
Add JS to second block to ensure witnesses are incremented 2016-12-09 16:59:40 +13:00
Jack Grigg 88b7f3c28b
Generate JS for trydecryptnotes, make number of addresses a variable 2016-12-09 16:59:39 +13:00
Jack Grigg a513ea90d4
Fix indentation 2016-12-09 16:59:34 +13:00
zkbot 07a728300b Auto merge of #1642 - str4d:add-solver-rate-to-getmininginfo, r=str4d
Add getlocalsolps and getnetworksolps RPC calls, show them in getmininginfo
2016-12-09 03:18:23 +00:00
zkbot f848d40c6d Auto merge of #1902 - bitcartel:1901_increase_default_settings_block_priority, r=str4d
Closes #1901. Increase default settings for max block size and space for priority transactions.

ref #1901
2016-12-09 00:33:01 +00:00
zkbot cdbd851417 Auto merge of #1928 - ebfull:fix-anchor-cache-bug, r=str4d
Fix anchor cache bug

Fixes #1912.

If an anchor is removed from the cache, but didn't exist in it beforehand, it will insert a blank tree. If it's reinserted in a child cache, when the child cache flushes it will mark the treestate as entered but won't bring the valid tree with it.

Thankfully, we assert when connecting blocks so that this inconsistency won't cause us to build on a blank tree after a reorg.
2016-12-08 21:22:23 +00:00
Sean Bowe 690171e268 Add more tests for ProofVerifier. 2016-12-08 12:47:41 -07:00
Sean Bowe eb82238dd0 Rename Dummy to Disabled. 2016-12-08 12:32:39 -07:00
zkbot e68e26c208 Auto merge of #1911 - bitcartel:1823_witness_does_not_have_same_anchor_as_change_input, r=str4d
With chained joinsplits, witness anchors for input notes no longer cross block boundaries

Closes #1823
2016-12-08 01:23:40 +00:00
zkbot 400c4f04e6 Auto merge of #1878 - str4d:1875-non-tty-metrics-usability, r=str4d
Improve non-TTY metrics usability

Closes #1875.
2016-12-07 23:19:47 +00:00
Simon 84e8c5f921 WitnessAnchorData only needs to store one witness per JSOutPoint. 2016-12-07 12:05:29 -08:00