Commit Graph

8737 Commits

Author SHA1 Message Date
Simon
edab3ddd2e Implement issue #997 to reduce time for test_bitcoin due to sleeps in
addrman.  Related to issue #717.
2016-06-06 17:11:15 +08:00
Simon
0dd2bf94dd Declare constants for the maximum number of retries, when to sleep
between retries and how long for.
2016-05-24 23:56:31 -07:00
Philip Kaufmann
0116e20ea1 remove using namespace std from addrman.cpp
Signed-off-by: Simon <simon@bitcartel.com>
2016-05-24 22:53:17 -07:00
Patrick Strateman
7bfb552f63 CAddrMan::Deserialize handle corrupt serializations better.
Signed-off-by: Simon <simon@bitcartel.com>
2016-05-24 22:47:00 -07:00
Ethan Heilman
1bf2cb1a06 Increase test coverage for addrman and addrinfo
Adds several unittests for CAddrMan and CAddrInfo.
Increases the accuracy of addrman tests.
Removes non-determinism in tests by overriding the random number generator.
Extracts testing code from addrman class to test class.

Signed-off-by: Simon <simon@bitcartel.com>
2016-05-24 12:55:33 -07:00
EthanHeilman
8375e1a3e7 Creates unittests for addrman, makes addrman testable.
Adds several unittests for addrman to verify it works as expected.
Makes small modifications to addrman to allow deterministic and targeted tests.

Signed-off-by: Simon <simon@bitcartel.com>
2016-05-24 11:10:54 -07:00
Simon
b0f75847ea Fix issue #717 where if addrman is starved of addresses (e.g. on testnet)
the Select_() function will loop endlessly trying to find an address,
and therefore eat up 100% cpu time on the 'opencon' thread.

Solution is to (1) add a delay to the loop and (2) restrict the number
of attempts to find an address.  On exiting the loop, we return
to an outer loop in net.cpp which will sleep, add seed nodes and
calcualte new addresses.
2016-05-13 16:00:22 -07:00
zkbot
94f0dcddb4 Auto merge of #873 - nathan-at-least:t832-zc2-release, r=nathan-at-least
Update release process docs; release notes; clean up ./docs directory a bit.

closes #834
2016-04-13 00:12:35 +00:00
Nathan Wilcox
525a3b9223 Rewrite release-process.md and follow the example to generate a changelog-style release-notes file. 2016-04-12 16:54:43 -07:00
Nathan Wilcox
fb537854ff Update a bunch of docs by adding a banner, delete a bunch of known bitrot docs; does not update release-process.md. 2016-04-12 16:40:30 -07:00
Jack Grigg
7213c0b158 Fix Equihash state initialisation in miner
After a new block is found or after a few nonces have been tried (currently
after every nonce), the miner checks for global changes. If any of these are
triggered, a new block is built from scratch, which re-initialises the Equihash
input. But if none of the checks are triggered, the miner just updates nTime and
continues mining - without updating the Equihash input to account for the new
block header. This bugfix corrects the behaviour by regenerating the Equihash
input in both situations.
2016-04-12 15:23:44 +12:00
zkbot
f2e157ab25 Auto merge of #846 - DoNotUseThisCodeJUSTFORKS:automated-performance-measurement-zcash-cli-method, r=ebfull
Automated performance measurement

Supersedes #843 because that one would have merged into the wrong branch. (Oh yeah and I rebased).

**REBASED AND FORCE PUSHED**
2016-04-11 21:56:12 +00:00
zkbot
4d322a4497 Auto merge of #831 - ebfull:foundersreward, r=nathan-at-least
Implement Founders' Reward

More info:  https://z.cash/blog/funding.html

The consensus rule is as follows:

```
All blocks before the first subsidy halving block, with the exception of
the genesis block, must contain an output which sends 20% of the block
subsidy value to a scriptPubKey `FOUNDERS_REWARD_SCRIPT`.
```

Right now, `FOUNDERS_REWARD_SCRIPT` is a 2-of-3 multisig P2SH.

Closes #125
2016-04-11 19:21:41 +00:00
Sean Bowe
62fdd8d094 Change pchMessageStart for new testnet. 2016-04-11 12:46:46 -06:00
Sean Bowe
6ca317e1cc Fix remaining RPC tests. 2016-04-11 12:46:46 -06:00
Taylor Hornby
722b0117d0 Benchmark a random equihash input. 2016-04-11 11:51:12 -06:00
Taylor Hornby
36b1269bc3 Make benchmark specified by command-line arguments 2016-04-11 10:54:55 -06:00
Taylor Hornby
51c8c56b4a Use a separate datadir for the benchmarks 2016-04-11 10:20:42 -06:00
Taylor Hornby
a0be8e262a Don't leave massif.out lying around after the benchmarks 2016-04-11 10:05:16 -06:00
Taylor Hornby
a1cd1a27ac Add verify equihash benchmark 2016-04-11 10:03:31 -06:00
Taylor Hornby
d44feea44c Add JoinSplit verification benchmarks 2016-04-11 10:03:17 -06:00
Taylor Hornby
bf8def9749 Add equihash solving benchmarks 2016-04-11 10:02:59 -06:00
Taylor Hornby
6962bb3df0 Add automated performance measurement system. 2016-04-11 08:15:25 -06:00
Daira Hopwood
c34d662f10 Specify Sean as the second contact for conduct issues.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-10 21:48:06 +01:00
Daira Hopwood
680550f883 Merge pull request #817 from daira/zc.v0.11.2.ticket802.code-of-conduct.0
Add Code of Conduct. fixes #802
2016-04-10 21:31:00 +01:00
Nathan Wilcox
ad56edf7d4 Fix (most) rpc tests by updating balances. zcpour, zcpourdoublespend, and txn_doublespend currently fail. 2016-04-08 18:05:51 -07:00
Nathan Wilcox
349a7b3714 Apply a patch from Sean to update wallet to use our new founders-reward aware balances. 2016-04-08 16:27:27 -07:00
Nathan Wilcox
4259e1e3dd Log all failing rpc tests concisely. 2016-04-08 14:50:52 -07:00
Sean Bowe
f3ffa3d27f Implementation of Founders' Reward.
All blocks before the first subsidy halving block, with the exception of
the genesis block, must contain an output which sends 20% of the block
subsidy value to a scriptPubKey `FOUNDERS_REWARD_SCRIPT`.
2016-04-08 14:40:28 -06:00
Sean Bowe
abc1c352c9 Add missing synchronization that causes race condition in test. 2016-04-08 13:54:44 -06:00
Jack Grigg
aa86873afd Fix pow_tests to work with Equihash
Changing the order of difficulty calculation operations to divide first doesn't
affect the result significantly, but ensures we never overflow the arith_uint256
during multiplication and get an artificial jump in difficulty.
2016-04-08 23:19:03 +12:00
Sean Bowe
e22df48519 Fix miner_tests to work with equihash 2016-04-08 22:16:29 +12:00
Jack Grigg
cf00c47d5b Fix tests that depend on old block header format
Changes to bloom tests were done by running the following commands:

sed -i 's/\(CDataStream stream(ParseHex(".\{152\}\)\(.\{8\}\)/\100000000000000000000000000000000000000000000000000000000\200/' src/test/bloom_tests.cpp
sed -i 's/\(vector<unsigned char> vch = ParseHex(".\{152\}\)\(.\{8\}\)/\100000000000000000000000000000000000000000000000000000000\200/' src/test/bloom_tests.cpp

and then reverting the single change to the transaction line.
2016-04-08 14:50:56 +12:00
Jack Grigg
b82dccaa0d Adjust genesis blocks to have valid solutions and hashes
The mainnet genesis block is artifically easy; we will revert this when we
actually start using mainnet.
2016-04-08 13:56:00 +12:00
Jack Grigg
fdda3c5085 Use Equihash for Proof-of-Work
The main and test networks are configured to use parameters that are currently
low-memory but usable with the basic solver; they will be increased once the
solver is optimised. The regtest network is configured to have extremely low
memory usage for speed.

Note that Bitcoin's double-hasher is used for the difficulty check. This does
not match the paper, but is simpler than changing the block header
serialization. Single hashing is kept for the EquiHash solver because there is
no requirement on execution time there, only on memory usage.
2016-04-08 13:56:00 +12:00
Jack Grigg
020bed6021 Add test vectors for Equihash 2016-04-08 13:56:00 +12:00
Jack Grigg
6d25662f25 Implement validator and basic solver for Equihash 2016-04-08 13:56:00 +12:00
Nathan Wilcox
bb9f19b487 Run all RPC tests, even when they fail. 2016-04-07 17:13:29 -07:00
Daira Hopwood
254c16dd94 Add Code of Conduct. fixes #802
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-01 01:35:52 +01:00
zkbot
9b7606fb6e Auto merge of #800 - str4d:592-disable-comparison-utility, r=defuse
Disable comparison utility

Also fixes `configure` to check that Java is present if `--with-comparison-tool` is set.

Closes #592
2016-04-01 00:02:59 +00:00
Taylor Hornby
5cd512b928 Try downloading from our mirror first to avoid headaches. 2016-03-31 16:33:30 -06:00
Sean Bowe
fd5007c126 Create new hasher for sha256() utility. 2016-03-31 16:19:29 -06:00
Sean Bowe
27a109af01 Improve testing and API of CSHA256 compression. 2016-03-31 16:15:07 -06:00
Sean Bowe
d3612b1c94 Remove zerocash's SHA256 implementation 2016-03-31 15:59:06 -06:00
Sean Bowe
8466467a35 Added SHA256Compress to Bitcoin's SHA256 implementation. 2016-03-31 14:23:56 -06:00
Jack Grigg
f53f490b91 Disable comparison utility
Closes #592
2016-03-25 16:44:33 +13:00
Jack Grigg
4bc2a390c6 Require java for --with-comparison-tool 2016-03-25 16:43:28 +13:00
Taylor Hornby
9bab3e89a2 Initialize libsodium first. 2016-03-24 13:13:14 -06:00
Sean Bowe
6806256b80 Initialize libsodium and remove openssl headers from util.cpp 2016-03-23 16:26:57 -06:00
Taylor Hornby
41d4eb705b Link with libsodium and replace a CSPRNG. 2016-03-17 16:38:27 -06:00