Commit Graph

466 Commits

Author SHA1 Message Date
Greg Fitzgerald c40000aeda Fix compiler warning 2018-06-18 15:49:41 -07:00
Michael Vines 92599acfca Abort when -l is not present or unreadable 2018-06-16 09:55:03 -07:00
Michael Vines 15c7f36ea3 Improve error reporting 2018-06-15 17:10:00 -07:00
Stephen Akridge 94ededb54c Add comments and limit digits for tps prints 2018-06-15 11:54:01 -06:00
Stephen Akridge af6a07697a Change client-demo to run continuosly for some amount of time
Also retry for get_last_id/transaction_count if dropped.
2018-06-15 11:54:01 -06:00
Rob Walker 7fe1fd2f95 clean up fullnode cmdline
* fix documentation, other opt parameters
 * add support for a named output file, remove hardcoded "leader.log"
 * resurrect stdout as the default output
2018-06-15 00:41:07 -07:00
Greg Fitzgerald 7575d3c726 Add timestamp to log messages
Upgraded env_logger and now we have timestamps and colorful messages.

Fixes #318
2018-06-14 17:07:58 -06:00
Stephen Akridge 8b9713a934 Skip link_local v4 addresses and v6 address when v6 is not enabled 2018-06-14 16:10:31 -06:00
Robert Kelly 34e0cb0092 cargo fmt 2018-06-13 19:17:21 -07:00
Robert Kelly 7b7c7cba21 changed atty library 2018-06-13 19:17:21 -07:00
Greg Fitzgerald 5435bb734c Upgrade rand 2018-06-11 15:51:25 -06:00
Greg Fitzgerald 7aa05618a3 data_replicator -> ncp
Fixes #327
2018-06-07 17:11:17 -06:00
anatoly yakovenko 77c9e801aa
fixed client demo (#325)
* fixed client demo
2018-06-07 13:51:15 -07:00
Stephen Akridge cb81f80b31 Enable logging for client demo 2018-06-05 15:32:25 -06:00
Stephen Akridge 4a44498d45 Fix args in validator script, readme version, client-demo perf print 2018-06-02 21:55:27 -06:00
anatoly yakovenko 216510c573
repair socket and receiver thread (#303)
repair socket and receiver thread
2018-06-02 08:32:51 -07:00
Greg Fitzgerald 9b54c1542b Move defaults from bash to Rust 2018-05-31 17:18:11 -07:00
Greg Fitzgerald 93d5d1b2ad Default to 1 node 2018-05-31 17:18:11 -07:00
Greg Fitzgerald 4c0f3ed6f3 Attempt to revive the singlenode demo 2018-05-31 17:18:11 -07:00
Greg Fitzgerald 6ab0dd4df9 Remove config options from fullnode 2018-05-31 16:15:02 -06:00
Greg Fitzgerald 4b8c36b6b9 Add solana-fullnode-config 2018-05-31 16:15:02 -06:00
Greg Fitzgerald 359a8397c0 Make bootstrapping functions accessible to other binaries 2018-05-31 16:15:02 -06:00
Greg Fitzgerald c9fd5d74b5 Boot futures 0.1
We added them thinking it'd be a good stepping stone towards an
asynchronous thin client, but it's used inconsistently and where
it used, the function is still synchronous, which is just confusing.
2018-05-31 14:13:09 -06:00
Greg Fitzgerald 391744af97 Speed up the creation of the million accounts
All threads were locked on the same set of signatures.
2018-05-31 12:13:18 -06:00
Greg Fitzgerald 80f07dadc5 Generalize process_entries()
And use it in fullnode
2018-05-31 12:13:18 -06:00
Greg Fitzgerald 60609a44ba Initialize recorder from bank's last_id 2018-05-31 12:13:18 -06:00
Ubuntu 6c380e04a3 fix 2018-05-30 14:04:48 -06:00
Anatoly Yakovenko cef1c208a5 Crdt pipeline, coalesce window repair requests in the listener by examining all of them at once, and ublock those threads from doing io. 2018-05-30 14:04:48 -06:00
Greg Fitzgerald 9c9c63572b cargo fmt
rustfmt was updated with 1.26.1
2018-05-29 20:33:45 -07:00
Greg Fitzgerald ac0791826a plan.rs -> payment_plan.rs 2018-05-29 18:09:03 -06:00
Greg Fitzgerald ad00d7bd9c Move plan methods to a trait 2018-05-29 18:09:03 -06:00
Greg Fitzgerald 52145caf7e Cleanup: make 'verified' qualifier implicit
History: Qualifying the method names with 'verified' was done to
distinguish them from methods that first did signature verification.
After we moved all signature verication to SigVerifyStage, we removed
those methods from Bank, leaving only the 'verified' ones.

This patch removes the word 'verified' from all method names, since
it is now implied by any code running after SigVerifyStage.
2018-05-29 10:38:58 -06:00
Anatoly Yakovenko 2dbf9a6017 rename 2018-05-26 20:13:42 -06:00
Anatoly Yakovenko fe93bba457 logs
poll both endpoints in client

logs

logs

logs

names

verify plan not sig

log

set udp buffer to max

drop output

more verbose about window requests

log the leader

load leader identity

readme for single node demo

update

asserts

update

replay all

rsync

dynamic file read in testnode

fix

cleanup

readme

sum

fix scripts

cleanup

cleanup

readme
2018-05-26 20:13:42 -06:00
Greg Fitzgerald 733b31ebbd testnode -> fullnode
It's the real deal.
2018-05-25 17:31:07 -06:00
Greg Fitzgerald dac9775de0 Replace client-demo with multinode-demo 2018-05-25 17:31:07 -06:00
Greg Fitzgerald aaeb5ba52f tr -> tx 2018-05-25 16:47:21 -06:00
Greg Fitzgerald 9f5a3d6064 events -> transactions 2018-05-25 16:47:21 -06:00
Greg Fitzgerald 4cdf873f98 Delete event.rs 2018-05-25 16:47:21 -06:00
Anatoly Yakovenko 75c37fcc73 names 2018-05-25 07:02:39 -06:00
Anatoly Yakovenko 5be71a8a9d logs 2018-05-25 07:02:39 -06:00
Anatoly Yakovenko b9ae7d1ebb logs 2018-05-25 07:02:39 -06:00
Anatoly Yakovenko 342cc7350a poll both endpoints in client 2018-05-25 07:02:39 -06:00
Anatoly Yakovenko c2c80232e3 logs 2018-05-24 17:40:33 -06:00
Anatoly Yakovenko 2128c58fbe logs and tps counting 2018-05-24 10:35:23 -06:00
Greg Fitzgerald e12e154877 Boot Event timestamp/singature constructors 2018-05-24 10:10:41 -06:00
Greg Fitzgerald cc907ba69d Add Instruction type 2018-05-24 10:10:41 -06:00
Greg Fitzgerald 0d980e89bc cargo fmt
@aeyakovenko: https://github.com/rust-lang/rust.vim#formatting-with-rustfmt
2018-05-23 20:05:08 -06:00
Anatoly Yakovenko 7faa2b8698 fixed demo 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko 65352ce8e7 fix 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko f1988ee1e3 help 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko 82ac8eb731 use client ports 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko ae47e34fa5 fix 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko 28e781efc3 break early 2018-05-23 17:24:58 -06:00
Anatoly Yakovenko 5c3ceb8355 aws demo2 2018-05-23 17:24:58 -06:00
Stephen Akridge 2a0095e322 Remove unused variable in multinode-demo fix compiler warning 2018-05-23 16:55:45 -06:00
anatoly yakovenko 9ad5f3c65b
fix option (#246) 2018-05-23 14:48:00 -07:00
Greg Fitzgerald d4200a7b1e Fix build
GenKeys() fix and new multinode module crossed in flight.
2018-05-23 14:10:26 -06:00
Greg Fitzgerald 84477835dc
Fix nondeterministic key generation (#243)
Our one and only unsafe operation was ...unsafe.
2018-05-23 14:04:07 -06:00
anatoly yakovenko 504b318ef1 Hooks for binaries to run as leader or replicator and attach to network (#221) 2018-05-23 14:03:19 -06:00
Anatoly Yakovenko 8049323ca8 @garious review 2018-05-23 12:07:44 -06:00
Anatoly Yakovenko 8646ff4927 refactor wip 2018-05-23 12:07:44 -06:00
Anatoly Yakovenko 437c485e5c cleanup 2018-05-23 12:07:44 -06:00
Greg Fitzgerald 2e059f8504 Rename TransactionData to Contract
No longer a single place to get all the data that was signed.
2018-05-22 17:00:40 -06:00
Stephen Akridge 8454eb79d0 Send events to the right address and set recv socket timeout 2018-05-22 13:52:50 -07:00
Greg Fitzgerald 6c1f1c2a7a Promote create_entry() to Entry::new() 2018-05-16 23:18:58 -07:00
Greg Fitzgerald 3f38c0a245 Feed events socket into the server 2018-05-15 11:19:58 -06:00
Greg Fitzgerald cfe8b3fc55 Wrap the RPU with new object Server 2018-05-15 11:00:01 -06:00
Greg Fitzgerald e9ee020b5f Rename constructors 2018-05-15 10:45:36 -06:00
Greg Fitzgerald 99dc4ea4a9 Spin up threads from Rpu/Tpu constructors 2018-05-15 10:30:52 -06:00
Greg Fitzgerald 0aaa500f7c Rpu/Tpu serve() functions now only spin up threads 2018-05-15 10:10:45 -06:00
Greg Fitzgerald 5f5be83a17 Hoist socket creation/configuration
TODO: Add a library for socket configuration.
2018-05-15 10:05:23 -06:00
Greg Fitzgerald ee3fb985ea Hoist set_timeout 2018-05-15 09:42:28 -06:00
Greg Fitzgerald d2dd005a59 accountant -> bank 2018-05-14 15:33:11 -06:00
Greg Fitzgerald 685de30047 Purge EventProcessor from RPU 2018-05-14 14:35:25 -06:00
Greg Fitzgerald 3f10bf44db Config recorder with any kind of Duration, not just milliseconds 2018-05-14 14:12:36 -06:00
Greg Fitzgerald a3d2831f8c Free up the name 'accounting_stage' 2018-05-12 14:05:57 -06:00
Greg Fitzgerald 4180571660 Don't pass events_socket to RPU 2018-05-12 11:11:30 -06:00
Greg Fitzgerald 421d9aa501 Free up the name 'tpu' 2018-05-12 10:53:25 -06:00
Greg Fitzgerald b4ca414492 More object-oriented 2018-05-12 00:19:12 -06:00
Greg Fitzgerald 600a1f8866 Initialize thin client with events port 2018-05-11 16:35:53 -06:00
Greg Fitzgerald 95bf68f3f5 Correct some strange naming 2018-05-11 16:24:18 -06:00
Greg Fitzgerald bcdb058492 cargo fmt 2018-05-11 13:06:05 -06:00
Code Cobain 3d77fa5fbc
Merge branch 'master' into 153-panic-cleanup 2018-05-11 11:40:20 -07:00
Jackson Sandland 250830ade9 cargo fmt run 2018-05-11 11:38:52 -07:00
Robert Kelly a49e664e63 Merge branch '156__remove_user_keys_in_mintdemo' of github.com:rlkelly/solana into 156__remove_user_keys_in_mintdemo 2018-05-11 14:07:48 -04:00
Robert Kelly f20380d6b4 changed RwLock to RefCell 2018-05-11 14:07:41 -04:00
Rob Kelly 05a5e551d6
Merge branch 'master' into 156__remove_user_keys_in_mintdemo 2018-05-11 13:00:44 -04:00
Robert Kelly d278b71cb2 added tests and utility method for key generation 2018-05-11 12:55:05 -04:00
Tyera Eulberg 8b7f7f1088 Generalize next tick functions to carry events 2018-05-11 09:45:42 -06:00
Greg Fitzgerald 4f629dd982 Add events socket instead of modifying the existing socket 2018-05-10 16:54:43 -06:00
Stephen Akridge a80991f2b3 Fixes for serializing entries over blobs and reorg into ledger 2018-05-10 15:30:30 -07:00
Greg Fitzgerald 7ce11b5d1c Cleanup: use full words for field names
and optionally for variable names
2018-05-09 16:19:42 -06:00
Greg Fitzgerald f2d4799491 Cleanup: field names should be nouns 2018-05-09 16:14:40 -06:00
Greg Fitzgerald ded28c705f Tuck away the Historian
The Historian is now just a utility of the accounting stage.
2018-05-09 12:25:19 -06:00
Greg Fitzgerald 6967cf7f86 Boot sync_channel()
This is less useful now that we send Vec<Event> instead of Event.
2018-05-09 11:43:16 -06:00
Greg Fitzgerald 52f1a02938 Delete historical artifact
This was just to explain Proof of History. We have better explanations
elsewhere. Delete!
2018-05-09 07:53:24 -06:00
Robert Kelly 40c50aef50 deterministic random wallet generationg 2018-05-09 00:07:19 -04:00
Greg Fitzgerald 1dca17fdb4 cargo +nightly fmt 2018-05-08 18:59:01 -06:00
Greg Fitzgerald 785e971698 AccountantSkel -> Tpu
The terms Stub and Skel come from OMG IDL and only made sense while
the Stub was acting as an RPC client for the the Accountant object.
Nowadays, the Stub interface looks nothing like the Accountant and
meanwhile we've recognized the multithreaded implementation is more
reminiscent of a pipelined CPU. Thus, we finally bite the bullet and
rename our modules.

AccountantSkel -> Tpu
AccountantStub -> ThinClient

Up next will be moving much of the TPU code into separate modules,
each representing a stage of the pipeline. The interface of each
will follow the precedent set by the Historian object.
2018-05-08 17:40:02 -06:00
Greg Fitzgerald 2bfa20ff85
Merge pull request #182 from garious/split-request
Control port prep
2018-05-08 17:11:34 -06:00
Greg Fitzgerald 474a9af78d
Merge pull request #187 from sakridge/fix_blob_size_check
Trust the recorder not to give us more than we can serialize
2018-05-08 17:11:18 -06:00
Stephen Akridge 4870def1fb Fix default client port, server uses 8000-8002 for gossip. 2018-05-08 15:40:55 -07:00
Stephen Akridge 3e73fb9233 Trust the recorder not to give us more than we can serialize
Also run client for 10 seconds, 5 is bit too short
2018-05-08 15:23:41 -07:00
Greg Fitzgerald 9ff1a6f0cd Add a thread to support thin clients 2018-05-07 21:44:44 -06:00
Greg Fitzgerald 893011c3ba Process events instead of processing only transactions
Prep work to allow clients to send any type that can end up in
the ledger.
2018-05-07 14:51:13 -06:00
Stephen Akridge e8f5fb35ac Multinode fixes and test
* Replace magic numbers for 64k event size
* Fix gossip, dont ping yourself
* Retransmit only to listening nodes
* Multinode test in stub marked unstable
2018-05-06 21:36:06 -07:00
Greg Fitzgerald de680c2a8e Remove duplicate state 2018-05-03 13:24:37 -06:00
Anatoly Yakovenko c2e2960bf7 Add broadcast impl 2018-05-03 10:34:01 -07:00
Greg Fitzgerald 385d2a580c Merge pull request #168 from aeyakovenko/fix_multi_host_client_demo
multi host client demo
2018-05-03 10:21:41 -06:00
Anatoly Yakovenko b65f04d500 multi host client demo
Bind to the same interface as the user supplied client address.
2018-05-03 08:28:11 -07:00
Greg Fitzgerald 4b9f115586 Hoist Historian input 2018-05-02 16:35:37 -06:00
Greg Fitzgerald c5cc91443e Rename sender/receiver to input/output 2018-05-02 15:54:53 -06:00
Greg Fitzgerald d415b17146 sleepless demo to complement sleepless nights
18 ktps on macbook pro, no gpu
2018-04-26 13:17:38 -06:00
Greg Fitzgerald 9ed953e8c3 Fix rebase fails 2018-04-26 09:35:10 -06:00
Greg Fitzgerald b60a98bd6e Startup log can reference IDs without itself 2018-04-26 08:42:34 -06:00
Greg Fitzgerald a15e30d4b3 Report transactions processed 2018-04-26 08:42:34 -06:00
Greg Fitzgerald d5d133353f Port blocking stub functions to new stateful ones 2018-04-26 08:42:34 -06:00
Greg Fitzgerald 58860ed19f WIP: New demo that makes better use of the parallelized accountant 2018-04-26 08:42:34 -06:00
Greg Fitzgerald 583f652197 Generate genesis log for the demo
This log contains a bunch of transactions that generate new
accounts, so that transactions to and from them can be processed
in parallel.
2018-04-26 08:42:34 -06:00
Greg Fitzgerald 38fdd17067 Add initializing log message to server
Handy when gesesis block is large.
2018-04-26 08:42:34 -06:00
Greg Fitzgerald 807ccd15ba Add solana-mint-demo CLI
This extends solana-mint with additional data that will be used by
both solana-client-demo and creating the demo's genesis block.
2018-04-26 08:42:34 -06:00
Robert Kelly 34d1805b54 Add FutureResult to return a Future that immediately resolves 2018-04-25 19:23:24 -07:00
rleungx 3da1fa4d88 improve the error messages 2018-04-21 21:52:55 +08:00
Stephen Akridge 8181bc591b Add -h/--help options for client-demo and testnode 2018-04-19 10:22:31 -07:00
rleungx 60015aee04 report serde parse errors to stderr 2018-04-19 23:51:57 +08:00
rleungx b91f6bcbff report parse errors to stderr 2018-04-19 22:24:46 +08:00
Greg Fitzgerald 0a30bd74c1 Tell verifiers when not to parallelize accounting
Without this patch, many batches of transactions could be tossed
into a single entry, but the parallelized accountant can only
guarentee the transactions in the batch can be processed in
parallel.

This patch signals the historian to generate a new Entry after
each batch. Validators must maintain sequential consistency
across Entries.
2018-04-12 21:08:53 -06:00
Greg Fitzgerald 3b9ef5ccab Fix the nightly build 2018-04-11 20:24:14 -06:00
Anatoly Yakovenko c934a30f66 commandline options for client and testnode 2018-04-09 21:14:52 -07:00
Stephen Akridge f4466c8c0a Change for cuda verify integration 2018-04-05 20:00:44 -07: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 94eea3abec fmt 2018-04-02 21:15:21 -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 da2b4962a9 Move verify_slice() into a trait 2018-04-02 11:43:38 -06:00
Greg Fitzgerald 46e8c09bd8 Revoke API access to first_id 2018-04-02 09:30:10 -06:00
Greg Fitzgerald 2f1e585446 Better benchmark
Tolerates dropped UDP packets
2018-03-29 13:41:11 -06:00
Greg Fitzgerald 878ca8c5c5 Add microbenchmark for signature verification 2018-03-28 22:02:47 -06:00
Greg Fitzgerald 0bec360a31 Revert TCP sync of ledger
The feature was too rushed. We technically don't need it until we
implement consensus. It'll come back another day (with many more tests!)
2018-03-28 20:16:15 -06:00
Greg Fitzgerald 98c0a2af87 tx confirmed/sec ---> tx processed/sec
Before this patch, we were waiting until the full log was
sent back across the wire, parsed, and interpreted. That was giving
us a metric of "transactions confirmed per second" instead of
"transactions processed per second". Instead, we'll just send one
tiny packet back with the balance. As soon as the balance is what
we expect it to be, we end the benchmark.
2018-03-28 16:51:21 -06:00
Greg Fitzgerald 849bced602 Fix up client demo 2018-03-28 14:40:58 -06:00
Greg Fitzgerald 27f29019ef
Merge pull request #83 from garious/tcp-client
TCP subscription service
2018-03-28 13:19:38 -06:00
Greg Fitzgerald 116166f62d Rename project: silk -> solana 2018-03-27 16:25:12 -06:00
Greg Fitzgerald 13206e4976 Let clients subscribe to the ledger over TCP
TODO: Add more tests

Fixes #27
2018-03-27 14:46:24 -06:00
Greg Fitzgerald ddb21d151d Nightly rustfmt
Format code with the nightly version of rustfmt, which sorts imports.
2018-03-26 22:03:28 -06:00
Anatoly Yakovenko 14239e584f fix writer 2018-03-26 21:36:29 -06:00
Greg Fitzgerald 9a437f0d38 Revive silk-testnode 2018-03-23 21:49:28 -06:00
Greg Fitzgerald 383d445ba1 Clippy review 2018-03-22 14:15:29 -06:00
Greg Fitzgerald 803dcb0800 Mutex<bool> -> AtomicBool 2018-03-22 14:05:23 -06:00
Greg Fitzgerald 9f232bac58 Allow clients to sync the ledger
Fixes #4
2018-03-21 15:46:49 -06:00
Greg Fitzgerald 64af37e0cd logger -> recorder
Free up namespace for a traditional runtime logger.
2018-03-19 10:16:21 -06:00
Greg Fitzgerald 9f9b79f30b log -> ledger
Free up namespace for traditional runtime logs.
2018-03-19 10:09:19 -06:00
Anatoly Yakovenko eb94613d7d Use streaming socket interface within accountant
Pull messages from streamer process them and forward them to the sender.
2018-03-11 23:41:09 -05:00
Greg Fitzgerald 49281b24e5 Move Tick out of Event
Every Entry is now a Tick and the entries contain events.
2018-03-09 17:22:17 -07:00
Greg Fitzgerald cc9f0788aa Batch events
It's now a Tick that locks down event order. Before this change, the
event order would be locked down in the order the server sees it.

Fixes #59
Fixes #61
2018-03-09 16:16:33 -07:00
Greg Fitzgerald 5dd567deef Rename Genesis to Mint
Genesis is a story of creation. We should only use that term to
for the event log that bootstraps the system.
2018-03-07 17:08:15 -07:00
Greg Fitzgerald b6d8f737ca Introducing, the mint
Use the mint to pair a new private key with new tokens.
2018-03-07 16:58:04 -07:00
Greg Fitzgerald 491ba9da84 Add accessors to keypairs and signatures 2018-03-07 15:32:22 -07:00
Greg Fitzgerald a420a9293f Fix demo 2018-03-07 11:37:30 -07:00
Greg Fitzgerald 9834c251d0 Boot genesis block helper
Before this change, if you wanted to use a new Transaction
feature in the genesis block, you'd need to extend its
Creator object and associated methods.  With yesterday's
addtions to Transcation, it's now so easy to work with
Transactions directly that we can get rid of the middleman.

Also added a KeyPair type alias, so that ring could be easily swapped
out with a competing library, if needed.
2018-03-07 11:10:15 -07:00
Greg Fitzgerald d1b6206858 Monomorphisize Entry and Event
Transaction turned out to be the only struct worth making generic.
2018-03-06 20:29:18 -07:00
Greg Fitzgerald b725fdb093 Sha256Hash -> Hash
Because in Loom, there's just the one. Hopefully no worries that it
shares a name with std::Hash.
2018-03-06 17:40:01 -07:00
Greg Fitzgerald 1436bb1ff2 Move entry into its own module
Hmm, Logger doesn't depend on log.
2018-03-06 17:40:01 -07:00
Greg Fitzgerald 5a44c36b1f Move hash into its own module 2018-03-06 17:40:01 -07:00
Greg Fitzgerald f09952f3d7 DRY up transaction signing
Cleanup the big mess I copy-pasted myself into.
2018-03-06 16:34:25 -07:00
Greg Fitzgerald 4376032e3a data -> asset
'data' is too vague.
2018-03-06 14:50:32 -07:00
Greg Fitzgerald 624c151ca2 Add signature module
Because things other than transactions can be signed.
2018-03-06 12:48:28 -07:00
Greg Fitzgerald b019416518 Move verify into methods
A little overly-coupled to Serialize, but makes the code a lot tighter
2018-03-06 12:27:08 -07:00
Greg Fitzgerald 4fcd9e3bd6 Give Transaction its own module 2018-03-06 12:18:17 -07:00
Greg Fitzgerald 66bf889c39 Rename Transfer to Transaction
struct names should be nouns
2018-03-06 11:54:47 -07:00
Greg Fitzgerald 6543497c17 Move Transaction data into its own struct
This will allow us to add addition transfer types to the log.
2018-03-06 10:50:32 -07:00
Greg Fitzgerald 720c54a5bb Allow balances to be negative
* Will allow owners to loan token to others.
* Will allow for parallel verification of balances without spilling
  over 64 bits.

Fixes #43
2018-03-05 17:30:53 -07:00
Greg Fitzgerald a4336a39d6 Initialize the testnode from a log
$ cargo run --bin silk-genesis-file-demo > demo-genesis.json
$ cat demo-genesis.json | cargo run --bin silk-genesis-block > demo-genesis.log
$ cat demo-genesis.log | cargo run --bin silk-testnode
2018-03-05 15:34:44 -07:00
Greg Fitzgerald 298989c4b9 Generate log from Genesis 2018-03-05 13:03:56 -07:00
Greg Fitzgerald 48c28c2267 Transactions now require a hash of the last entry they've seen
This ensures the transaction cannot be processed on a chain
that forked before that ID. It will also provide a basis for
expiration constraints. A client may want their transaction
to expire, and the generators may want to reject transactions
that have been floating in the ether for years.
2018-03-05 12:48:14 -07:00
Greg Fitzgerald d76ecbc9c9 Don't block the server 2018-03-05 11:39:59 -07:00
Greg Fitzgerald 955f76baab Finally, genesis block generation without channels 2018-03-04 14:32:30 -07:00
Greg Fitzgerald b1e9512f44 Rename end_hash to id 2018-03-04 07:50:26 -07:00
Greg Fitzgerald 608def9c78 Consolidate imports 2018-03-04 07:28:51 -07:00
Greg Fitzgerald 9b26892bae Add a demo app to generate the genesis file 2018-03-04 01:21:40 -07:00
Greg Fitzgerald 572475ce14 Load the genesis block 2018-03-04 00:15:17 -07:00
Greg Fitzgerald b8655e30d4 Make client-demo standalone
And remove deposit() methods from the API. Those should only be
used on the server to bootstrap.
2018-03-03 21:15:51 -07:00
Greg Fitzgerald 7cf0d55546 Remove optional 'from' field 2018-03-03 20:41:07 -07:00
Greg Fitzgerald cebcb5b92d Start genesis with a Tick, so that its hash can be used to bootstrap verification 2018-03-03 19:57:22 -07:00
Greg Fitzgerald 11a0f96f5e Add command-line tool for generating a genesis block 2018-03-03 17:35:05 -07:00
Greg Fitzgerald 1c9b5ab53c Report performance of signature verification too 2018-03-03 11:59:34 -07:00
Greg Fitzgerald c10faae3b5 More readable metrics 2018-03-03 11:52:50 -07:00
Greg Fitzgerald 2104dd5a0a Fix benchmark
Was measuring the creation of the iterator, not running it.
2018-03-03 11:45:23 -07:00
Greg Fitzgerald d8c50b150c Move key generation and signing from transaction benchmark
Key generation, signing and verification are not the performance
bottleneck. Something is probably wrong here.
2018-03-03 11:11:46 -07:00
Greg Fitzgerald a148454376 Update readme 2018-03-02 12:07:05 -07:00
Greg Fitzgerald 0d0fee1ca1 Sign Claim's 'to' field
Otherwise, the accountant will treat deposits of the same amount as
duplicates.
2018-03-02 11:46:22 -07:00
Greg Fitzgerald a0410c4677 Pipe all Claim constructors through a function 2018-03-02 10:58:43 -07:00
Greg Fitzgerald 8fe464cfa3 Rename Claim's key field to match same field in Transaction 2018-03-02 10:47:21 -07:00
Greg Fitzgerald 32d677787b Reduce transactions sent by demo
We don't do retries yet, so keep tx count to something that won't
trigger any packet loss.
2018-03-02 10:35:38 -07:00
Greg Fitzgerald 1b77e8a69a Move Event into its own crate
The log crate was starting to be the catch-all for all things
related to entries, events, signatures, and hashes. This split
shows us that:

* Event depends only on signatures, not on hashes [directly]
* All event testing was done via log testing (shame on me)
* Accounting depends only on events
2018-03-02 08:43:57 -07:00
Greg Fitzgerald 9e16937914 Delete the Discovery event
Not useful to the accountant.
2018-03-01 17:02:41 -07:00
Greg Fitzgerald 570e71f050 Check for duplicate signatures
TODO: have client add recent hash to each message
2018-03-01 14:07:39 -07:00
Greg Fitzgerald c9cc4b4369 Switch to UDP from TCP
And remove all the sleep()'ing around.
2018-03-01 13:47:53 -07:00
Greg Fitzgerald 4610de8fdd Switch to sync_channel to preserve order 2018-02-28 19:33:28 -07:00
Greg Fitzgerald 3fcc2dd944 Add testnode
Fixes #20
2018-02-28 18:05:20 -07:00
Greg Fitzgerald 8299bae2d4 Add accountant stub 2018-02-28 16:01:12 -07:00
Greg Fitzgerald 604ccf7552 Add network interface for accountant 2018-02-28 14:00:04 -07:00
Greg Fitzgerald c6134cc25b Allow the historian to track ownership of any type of data 2018-02-26 17:01:22 -07:00
Greg Fitzgerald 8b0b8efbcb Allow Entry to hold events of any kind of data 2018-02-26 15:37:33 -07:00
Greg Fitzgerald 97449cee43 Allow events to hold any kind of data 2018-02-26 15:31:01 -07:00
Greg Fitzgerald b8d52cc3e4 Make the Discovery event into a struct instead of a tuple 2018-02-24 11:15:03 -07:00
Greg Fitzgerald 29a607427d Rename UserDataKey to Discovery
From the perspective of the log, when some data's hash is added,
that data is "discovered" by the historian.  Another event
might be a "claim" that some signed data belongs to the owner of a
public key.
2018-02-24 05:25:19 -07:00
Greg Fitzgerald 7871b38c80 Update demo to use self-ticking logger 2018-02-21 11:52:03 -07:00
Greg Fitzgerald b34d2d7dee Allow the logger to inject Tick events on its own 2018-02-21 11:33:42 -07:00
Greg Fitzgerald d97112d7f0 Explain proof-of-history in the readme
Also:
* Hash userdata so that verification works as the readme describes.
* Drop itertools package. Found a way to use std::iter instead.

Fixes #8
2018-02-20 14:04:49 -07:00
Greg Fitzgerald 0297edaf1f Use sha256 hashes instead of Rust's builtin hasher.
Causes a 20x performance degradation. Enabling asm did not
speed things up.
2018-02-19 16:23:53 -07:00
Greg Fitzgerald 10a70a238b Cleanup demo 2018-02-19 12:25:57 -07:00
Greg Fitzgerald d88d1b2a09 Reset historian's hasher between events
Hasher will generate different hashes for the same input if it
had already generated a hash.

Also add a binary to ensure the example in the README works.
2018-02-19 12:03:06 -07:00