Commit Graph

2380 Commits

Author SHA1 Message Date
Greg Fitzgerald
9b12a79c8d cargo +nightly fmt 2018-04-12 17:04:11 -06:00
Stephen Akridge
8dc15b88eb Add skel test which sends a bad transaction, verify it doesn't make it 2018-04-12 15:01:59 -07:00
Anatoly Yakovenko
c2eeeb27fd bump timer 2018-04-12 11:12:10 -07:00
Anatoly Yakovenko
180d8b67e4 requests to packets function 2018-04-12 10:44:09 -07:00
Greg Fitzgerald
51633f509d Fix test
The test was meant to ensure the signature covered the 'tokens'
field, but then when the 'plan' field was rolled in, Transaction::verify()
started failing because Plan::verify() failed. When Transaction::verify()
was split into two, the unexpected failure was exposed but went unnoticed.
This patch brings it back to its original intent, to ensure signature
verification fails if the network attempts to change the client's payment.
2018-04-11 22:17:21 -06:00
Greg Fitzgerald
705228ecc2 Remove redundant signs 2018-04-11 22:17:21 -06:00
Greg Fitzgerald
3b9ef5ccab Fix the nightly build 2018-04-11 20:24:14 -06:00
Greg Fitzgerald
be9a670fb7 Add process_packets() benchmark 2018-04-11 18:02:45 -06:00
Greg Fitzgerald
6e43e7a146 Enable parallelized accountant 2018-04-11 18:01:59 -06:00
Greg Fitzgerald
ab2093926a Merge pull request #120 from aeyakovenko/fix_bench_compile
fix compile error
2018-04-11 18:01:13 -06:00
Anatoly Yakovenko
2ef3db9fab fix compile error 2018-04-11 15:40:25 -07:00
Stephen Akridge
6987b6fd58 Add tests for ecdsa sig checking 2018-04-11 12:29:44 -07:00
Greg Fitzgerald
50ccecdff5 Refactor 2018-04-11 09:02:33 -06:00
Greg Fitzgerald
e838a8c28a Delete unused function 2018-04-10 21:56:13 -06:00
Greg Fitzgerald
e5f7eeedbf Use iterators 2018-04-10 21:48:26 -06:00
Greg Fitzgerald
d1948b5a00 Zip earlier
And remove redundant into_iter() calls.
2018-04-10 21:18:39 -06:00
Anatoly Yakovenko
c934a30f66 commandline options for client and testnode 2018-04-09 21:14:52 -07:00
Anatoly Yakovenko
f330739bc7 Recycler test should verifyt that its recycling 2018-04-07 07:08:42 -07:00
Greg Fitzgerald
584c8c07b8 Better symmetry
deserialize -> process -> serialize
2018-04-06 16:34:59 -06:00
Greg Fitzgerald
a93ec03d2c Move creating blobs into its own function 2018-04-06 16:22:02 -06:00
Greg Fitzgerald
7bd3a8e004 Reduce cyclomatic complexity 2018-04-06 16:12:13 -06:00
Greg Fitzgerald
912a5f951e Why is msgs cloned here? 2018-04-06 15:58:11 -06:00
Greg Fitzgerald
6869089111 Parallelize deserialize 2018-04-06 15:52:58 -06:00
Greg Fitzgerald
6fd32fe850 Cleanup constants 2018-04-06 15:43:05 -06:00
Greg Fitzgerald
81e2b36d38 Cleanup packet_verify 2018-04-06 15:24:15 -06:00
Greg Fitzgerald
7d811afab1 Parallelize CPU sig verify 2018-04-06 15:21:49 -06:00
Greg Fitzgerald
5fc81dd6c8 Fix the nightly build
Nightly uses a different (but backward compatible) version of rustfmt.
2018-04-05 22:39:29 -06:00
Greg Fitzgerald
491a530d90 Support parallelization of arbitrary transactions
Still assumes witnesses are processed serially afterward.
2018-04-05 22:30:25 -06:00
Greg Fitzgerald
c12da50f9b Fix race condition
Without this patch, it was possible for two transactions with the same
'from' address to drive its balance below zero. With the patch, we'll
hold a write lock from just before we verify sufficient funds until
after those funds are deducted from the account.
2018-04-05 22:30:25 -06:00
Greg Fitzgerald
41e8500fc5 Break up process_verified_transaction() 2018-04-05 22:29:13 -06:00
Stephen Akridge
f4466c8c0a Change for cuda verify integration 2018-04-05 20:00:44 -07:00
Greg Fitzgerald
01326936e6 Expire all transactions after some amount of time
Reject old transactions so that we can calculate an upper bound
for memory usage, and therefore ensure the server won't slow
down over time to crash due to memory exhaustion.
2018-04-05 10:26:45 -06:00
Greg Fitzgerald
c960e8d351 Reject transactions with a last_id that isn't from this ledger
Before this patch, a client could put any value into `last_id` and
was primarily there to ensure the transaction had a globally unique
signature. With this patch, the server can use `last_id` as an
indicator of how long its been since the transaction was created.
The server may choose to reject sufficiently old transactions so
that it can forget about old signatures.
2018-04-05 09:54:03 -06:00
Greg Fitzgerald
8d425e127b Update benchmark to avoid write locks in sig duplicate detection 2018-04-04 17:29:22 -06:00
Greg Fitzgerald
3cfb07ea38 Sort signatures by last_id
This will allow for additional concurrency as well as give the server
a means of garbage-collecting old signatures.
2018-04-04 17:06:31 -06:00
Greg Fitzgerald
76679ffb92 Per-cell locking
This allows us to use read-locks for balances most of the time. We
only lock the full table if we need to add one.
2018-04-04 16:31:13 -06:00
Greg Fitzgerald
dc2ec925d7 Better test 2018-04-04 16:01:43 -06:00
Greg Fitzgerald
014bdaa355 Add benchmark for parallel transaction processing 2018-04-04 12:43:27 -06:00
Greg Fitzgerald
0c60fdd2ce Make accountant thread-safe
Before this change, parallel transaction processing required locking
the full accountant. Since we only call one method,
process_verified_transaction, the global lock equates to doing no
parallelization at all.  With this change, we only lock the data that's
being written to.
2018-04-04 12:33:03 -06:00
Anatoly Yakovenko
5ac7df17f9 Implement window service
Batch out of order blobs until we have a contigious window.
2018-04-03 13:53:19 -07:00
Greg Fitzgerald
c323bd3c87 Fix clippy warnings 2018-04-03 09:55:33 -06:00
Greg Fitzgerald
2f80747dc7 Move tests
After we restructured for parallel verification, the tests here
were unreferenced by the accountant, but still meaningful to
transaction verification.
2018-04-02 21:45:21 -06:00
Greg Fitzgerald
94eea3abec fmt 2018-04-02 21:15:21 -06:00
Greg Fitzgerald
fe32159673 Add a test to ensure witness data continues to be hashed 2018-04-02 21:07:38 -06:00
Greg Fitzgerald
07aa2e1260 Add witness data to entry hash
Otherwise, witnesses can be dropped or reordered by a malicious
generator.
2018-04-02 20:47:51 -06:00
Greg Fitzgerald
6fec8fad57 Adding from to the signature is redundant 2018-04-02 20:34:18 -06:00
Greg Fitzgerald
49708e92d3 Use last_id instead of seed
It doesn't really matter, but was confusing since the seed points
to an entry before the mint's deposit.
2018-04-02 15:06:42 -06:00
Greg Fitzgerald
daadae7987 Move replaying ledger out of accountant 2018-04-02 14:51:55 -06:00
Greg Fitzgerald
2b788d06b7 Move the historian up to accountant_skel 2018-04-02 14:41:07 -06:00
Greg Fitzgerald
90cd9bd533 Move balance check so that log_* methods are only used to add logging 2018-04-02 14:14:49 -06:00