Commit Graph

6830 Commits

Author SHA1 Message Date
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
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 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
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
zkbot fa53daca4e Auto merge of #1907 - bitcartel:1903_z_sendmany_fee_parameter, r=ebfull
Closes #1903. Add fee parameter to z_sendmany.
2016-12-07 16:58:26 +00:00
Jack Grigg d85758f5cc
Document behaviour of CWallet::SetBestChain 2016-12-07 19:30:30 +13:00
Sean Bowe 53dc6a41eb Ensure ProofVerifier cannot be accidentally copied. 2016-12-06 18:42:31 -07:00
Sean Bowe ebd9aa11b1 Ensure cache contains valid entry when anchor is popped. 2016-12-06 12:54:56 -07:00
Sean Bowe 08de001a25 Regression test. 2016-12-06 12:54:53 -07:00
Sean Bowe bc59f53722 Isolate verification to a `ProofVerifier` context object that allows verification behavior to be tuned by the caller. 2016-12-05 12:40:06 -07:00
Simon 2d931e905b Fixes #1823. Witness anchors for input notes no longer cross block boundaries. 2016-12-03 00:22:42 -08:00
zkbot 5a0d9db4e4 Auto merge of #1681 - paragonie-scott:patch-1, r=str4d
Metrics - Don't exclaim unless > 1

"You have validated 0 transactions!" sounds a little less enthusiastic that intended. This uses a period instead.

After patch, it also says "a transaction".
2016-12-01 02:50:55 +00:00
Jack Grigg 1c8d5c4061
Address review comments, tweak strings 2016-12-01 15:34:57 +13:00
Scott ba6fc72bcd
Metrics - Don't exclaim unless > 1
"You have validated 0 transactions!" sounds a little less enthusiastic that intended. Also, only says "1 transaction".
2016-12-01 15:30:22 +13:00
Simon af53da0225 Closes #1903. Add fee parameter to z_sendmany. 2016-11-30 14:23:35 -08:00
Jack Grigg 03f83b9b0d
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-11-30 14:04:37 +13:00
Simon e2a6161f4a Closes #1901. Increase default settings for the max block size when
mining and the amount of space available for priority transactions.
2016-11-29 10:01:20 -08:00
Simon 520ced1405 Closes #1857. Fixes bug where tx spending only notes had priority of 0. 2016-11-28 22:54:49 -08:00
zkbot c29ab1fbb7 Auto merge of #1865 - bitcartel:master_checkpoint_11000, r=str4d
Add checkpoint at block height 15000
2016-11-29 05:39:27 +00:00
Jack Grigg e2752e1eca
Increase length of metrics divider 2016-11-29 18:17:28 +13:00