Commit Graph

987 Commits

Author SHA1 Message Date
Anatoly Yakovenko 7e657d65f3 merged f2ab08c65e 2018-07-02 16:34:49 -06:00
Anatoly Yakovenko a166bb816e wtfr 2018-07-02 16:34:49 -06:00
Anatoly Yakovenko 2952027d04 wtfr 2018-07-02 16:34:49 -06:00
Anatoly Yakovenko 430d9d9314 fixup! 2018-07-02 16:34:49 -06:00
Anatoly Yakovenko fa247196c0 fullnode lib 2018-07-02 16:34:49 -06:00
Greg Fitzgerald 5d17c2b58f Return output receivers from each stage
Reaching into the stages' structs for their receivers is, in hindsight,
more awkward than returning multiple values from constructors. By
returning the receiver, the caller can name the receiver whatever it
wants (as you would with any return value), and doesn't need to
reach into the struct for the field (which is super awkward in
combination with move semantics).
2018-07-02 16:18:32 -06:00
Michael Vines 3e0e09555a Undo UPnP UDP port binding 2018-07-02 14:38:01 -07:00
Michael Vines 67e0100866 Bind to 0.0.0.0 2018-07-02 14:38:01 -07:00
Michael Vines f2ab08c65e Reuse request UDP port for responses 2018-07-02 14:38:01 -07:00
Greg Fitzgerald 04a93050e7 No need to share a write lock across single-threaded methods 2018-07-02 15:25:16 -06:00
Michael Vines 03401041db Correct signature argument name 2018-07-02 11:24:13 -07:00
Michael Vines ae29e2085f Init env_logger 2018-07-02 10:59:09 -07:00
Michael Vines ea5663c0da Demote log 2018-07-02 10:28:43 -07:00
Greg Fitzgerald 4e3526394e Use IntoInterator to simplify write_entries() usage 2018-07-02 09:51:39 -06:00
Greg Fitzgerald 6806a14a3f Use Cursor instead of tempfile.
Faster and one less dependency.
2018-07-02 09:51:39 -06:00
Greg Fitzgerald ec7e50b37d Consolidate ledger serialization code
The new read_entries() works, but is overly-contrained. Not
using that function yet, but adding it here in the hopes some
Rust guru will tell us how to get that lifetime constraint out
of there.

Fixes #517
2018-07-02 09:51:39 -06:00
Greg Fitzgerald e7b7dfebf5 Add tests for process_ledger() 2018-07-02 09:51:39 -06:00
Greg Fitzgerald 669164bada Boot EntryWriter's Mutex
Finally!
2018-07-01 17:29:24 -06:00
Greg Fitzgerald 4f3a291391 Move the writer into EntryWriter 2018-07-01 17:29:24 -06:00
Greg Fitzgerald 56e37ad2f4 Limit sticky mutex to WriteStage 2018-07-01 17:29:24 -06:00
Greg Fitzgerald 17de79a83a Remove dead code 2018-07-01 17:29:24 -06:00
Greg Fitzgerald 09e9139855 Move channel code to write stage 2018-07-01 17:29:24 -06:00
Greg Fitzgerald 76fc5822c9 Send Vec<Entry> between stages instead of Entry
Might see a performance boost here.
2018-07-01 17:29:24 -06:00
Greg Fitzgerald c767a854ed Remove useless Arc 2018-07-01 11:35:32 -07:00
Greg Fitzgerald b60802ddff Refactor such that genesis can use entry_writer 2018-07-01 11:35:32 -07:00
Greg Fitzgerald 1c35d59f26 Receive entries first, then write 2018-07-01 11:35:32 -07:00
Greg Fitzgerald adcaf715c6 Cleanup write_entries 2018-07-01 11:35:32 -07:00
Greg Fitzgerald 1f9494221b Make space for a write_entry() that only writes entries 2018-07-01 11:35:32 -07:00
Greg Fitzgerald 466d6f76b9 Don't hide error in write_entry() 2018-07-01 11:35:32 -07:00
Greg Fitzgerald b05e6ce3db Cleanup solana-genesis 2018-07-01 11:35:32 -07:00
Michael Vines 450f271cf7 Move public IP address detection out of bash 2018-06-29 21:12:05 -07:00
Tyera Eulberg ba6a6f5227 Use clap crate for wallet CLI subcommands and arguments 2018-06-29 21:30:20 -06:00
Michael Vines 903ec27754 Add BROKEN_NAT env variable to select Udp sender port workaround 2018-06-29 20:02:28 -07:00
Michael Vines 0b56d603c2 Client NAT traversal 0.1
UPnP is now used to request a port on the NAT be forwarded to the local machine.
This obviously only works for NATs that support UPnP, and thus is not a panacea
for all NAT-related connectivity issues.

Notable hacks in this patch include a transmit/receive UDP socket pair to work
around current protocol limitations whereby the full node assumes its peer can
receive on the same UDP port it transmitted from.
2018-06-29 17:36:26 -07:00
Greg Fitzgerald 816246ebee Add doc 2018-06-29 17:28:12 -06:00
Greg Fitzgerald a9881aee05 Add base58-encoded addresses 2018-06-29 17:28:12 -06:00
Greg Fitzgerald 7b5b989cfe Print usage is a command is not provided 2018-06-29 17:28:12 -06:00
Greg Fitzgerald c4b62e19f2 Do Proof of History verification before appending entries to the bank
Note: replicate_stage is still using `process_entries()` because
changing it to `process_blocks()` causes the `test_replicate` test to
fail.
2018-06-29 15:35:39 -06:00
Greg Fitzgerald 9a4733bde7 Remove interactive behavior from wallet 2018-06-29 13:22:20 -06:00
Greg Fitzgerald 517d08c637 Cleanup 2018-06-29 09:51:13 -07:00
Greg Fitzgerald 90dd794ae5 cargo fmt
rustfmt 0.6.1-stable (49279d71 2018-05-08)
2018-06-29 09:51:13 -07:00
Tyera Eulberg e0dbbba8a3 fmt 2018-06-29 09:51:13 -07:00
Tyera Eulberg d354e85a9a Return bool on signature check 2018-06-29 09:51:13 -07:00
Tyera Eulberg e4e1f8ec1e Missing -m parameter handling 2018-06-29 09:51:13 -07:00
Tyera Eulberg 0112a24179 Add confirm command to wallet, and update RPU to check bank for a signature 2018-06-29 09:51:13 -07:00
Stephen Akridge a094507bb8 Lower default benchmarking numbers to make CI timeout 2018-06-29 07:14:47 -06:00
Stephen Akridge 8effa4e3e0 Clear old blobs before putting in the new one
Otherwise we will just warn about overrun and not insert new blob
Also, break if the index we find is less than consumed otherwise
we can infinite loop
2018-06-29 07:14:47 -06:00
Stephen Akridge 1c9e7dbc45 Don't recycle in the replicate stage
Windowing stage owns all the blobs now
2018-06-29 07:14:47 -06:00
Stephen Akridge 799b249f02 Don't null blob window until we have to 2018-06-29 07:14:47 -06:00
Michael Vines 47917d00d1 Always bind to 0.0.0.0 regardless of what's being advertised to other nodes 2018-06-28 19:13:36 -07:00
Michael Vines 1c1d7d1e0e Log get_last_id errors 2018-06-28 19:13:36 -07:00
Stephen Akridge d28536d76e Fix spelling of signature 2018-06-28 16:31:33 -07:00
Greg Fitzgerald 63cfbb9497 Only register last entry after a split 2018-06-28 16:54:06 -06:00
Greg Fitzgerald 231040b93e Add tests 2018-06-28 12:28:43 -07:00
Greg Fitzgerald 7c74afc35a Relax recycler
Instead of asserting ref count is 1 before recycling, allow users
to recycle items early. If it turns out that was too early, and
allocate() wants to return it, then boot it and take a memory
allocation performance hit instead.
2018-06-28 12:28:43 -07:00
Greg Fitzgerald 7878a011eb Use a Mint to configure the wallet
* Send transactions from the mint's private key
* By default, send full balance to oneself
* By default, request the mint's number of tokens for airdrops
2018-06-27 17:35:50 -06:00
Greg Fitzgerald c05416e27d Turn simple-client-demo into a simpler wallet 2018-06-27 17:35:50 -06:00
Rob Walker 2f42658cd4 ... 2018-06-27 14:51:18 -07:00
Rob Walker d95e8030fc ... 2018-06-27 14:51:18 -07:00
Greg Fitzgerald 4aedd3f1b6 Cleanup type aliases and imports 2018-06-27 15:06:18 -06:00
Greg Fitzgerald bb89d6f54d Get back to 500k transactions 2018-06-27 13:50:27 -07:00
Greg Fitzgerald ed10841e3d No longer spin up accounts for client-demo
Now that the Bank is single-threaded again, we can spin up new
accounts on the fly without concern of thread contention. Likewise,
we can send all transactions from a single account, which was also
problematic in the multi-threaded bank. Sending from one account will
also make client-demo straightforward to port to solana-drone.
2018-06-27 13:50:27 -07:00
Tyera Eulberg a167d0d331 CI cleanup 2018-06-27 13:01:29 -06:00
Tyera Eulberg eed37820b5 Comments 2018-06-27 13:01:29 -06:00
Tyera Eulberg ac40434cdf Initial simple client demo commit 2018-06-27 13:01:29 -06:00
Greg Fitzgerald 56b09bf0ac cargo fmt 2018-06-26 16:51:07 -06:00
Stephen Akridge f4c4b9df9c Only free in replicate if we did not hold the reference in window stage
And then free when we are consuming blobs
2018-06-26 16:51:07 -06:00
Greg Fitzgerald 6e568c69a7 Preemptive strike
Should that blob have been passed to a recycler, it would have
had too high a reference count.
2018-06-26 16:51:07 -06:00
Greg Fitzgerald 14d624ee40 Fix benchmarks too
This change will make these benchmarks way slower, because its now
cloning the transaction vector each iteration instead of the ref
counts. We need to rethink these.
2018-06-26 16:51:07 -06:00
Greg Fitzgerald d5c0557891 Fix test_replicate too 2018-06-26 16:51:07 -06:00
Greg Fitzgerald 1691060a22 Assert recycler is given last reference to data
This patch likely fixes the sporadic failures in the following tests:

```
test server::tests::validator_exit ... FAILED
test streamer::test::streamer_send_test ... FAILED
test thin_client::tests::test_bad_sig ... FAILED
test drone::tests::test_send_airdrop ... FAILED
test thin_client::tests::test_thin_client ... FAILED
```
2018-06-26 16:51:07 -06:00
Greg Fitzgerald 05edfad13a Fix compiler warnings 2018-06-26 15:03:15 -07:00
Greg Fitzgerald 136b43f461 Fix whitespace
TODO: Why didn't "cargo fmt" fail the build.
2018-06-26 15:03:15 -07:00
Rob Walker ac40c1818f .. 2018-06-26 13:57:10 -07:00
Rob Walker eb63dbcd2a an Entry needs to be multiple of 4 bytes long 2018-06-26 13:57:10 -07:00
Rob Walker 4e2f1a519e whack next_entries_batched 2018-06-26 13:57:10 -07:00
Rob Walker 55ec7f9fe9 add entry.has_more
* quick fix for really big genesis
 * longer term fix for possible parallel verification over multiple
      Blobs/Entries
2018-06-26 13:57:10 -07:00
OEM Configuration (temporary user) 551f639259 Some pull request fixes(linting + documentation) 2018-06-26 12:31:04 -06:00
OEM Configuration (temporary user) da3bb6fb93 ran linter 2018-06-26 12:31:04 -06:00
OEM Configuration (temporary user) 08bcb62016 added remote table to update respones 2018-06-26 12:31:04 -06:00
Greg Fitzgerald 4a534d6abb Don't clone() Arc before recycling
This might fix an awful bug where the streamer reuses a Blob
before the current user is done with it. Recycler should probably
assert ref count is one?

* Also don't collect() an iterator before iterating over it.
2018-06-25 17:33:07 -06:00
Stephen Akridge b48a8c0555 Chunk blobs into window size to avoid window overrun
Fixes #447
2018-06-25 17:33:07 -06:00
Rob Walker 1919ec247b add a clock to validator windows (part 3 of #309) (#448)
* count entries processed by Bank
 * initialize windows with initial height of Entries
2018-06-25 15:07:48 -07:00
Stephen Akridge c22ef50cae Client fixes, poll for unique last id and cache clients
So we don't keep running up the port range
2018-06-25 10:02:29 -06:00
Anatoly Yakovenko 8ef8a8dea7 borrow checker 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko e929404676 comments 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko c2258bedae fixed! 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko 215fdbb7ed nits 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko ee998f6882 fix docs 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko 826e95afca fix logs 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko 47583d48e7 get rid of dummy test 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko e759cdf061 tests 2018-06-24 11:17:55 -06:00
Anatoly Yakovenko 88503c2a09 generic array fail case 2018-06-24 11:17:55 -06:00
Tyera Eulberg d5be23dffe fmt 2018-06-24 10:44:17 -06:00
Tyera Eulberg 80c01dc085 Use leader.json or ReplicatedData to get ports for drone 2018-06-24 10:44:17 -06:00
Tyera Eulberg 45b2549fa9 Reset bad TestNode edit 2018-06-24 10:44:17 -06:00
Greg Fitzgerald c7ce454188 Use pnet_datalink instead of all of pnet
pnet_transport takes a long time to build. It's been especially
painful from within a docker container for reasons I don't care
to understand. pnet_datalink is the only part of pnet we're using
so booting the rest.
2018-06-24 10:39:59 -06:00
Greg Fitzgerald 737dc1ddde Per rustc 1.27.0, we can ensure nested results are used 2018-06-22 22:42:47 -07:00
Greg Fitzgerald f2198c2e9a cargo fmt
rustc 1.27.0

```
$ cargo fmt --version
rustfmt 0.6.1-stable (49279d71 2018-05-08)
```
2018-06-22 22:23:55 -07:00
Rob Walker eec19c6d2c move genesis to new Entry generation 2018-06-22 17:46:45 -07:00
Tyera Eulberg 662bfb7b88 fmt 2018-06-22 14:52:36 -07:00
Tyera Eulberg 5f3e3a17d3 Fix test_send_airdrop cap; add helpful panic msgs 2018-06-22 14:52:36 -07:00
Tyera Eulberg feba2d9975 Set request cap to a reasonable number, based on 30min reset noted in issue #341 2018-06-22 14:52:36 -07:00
Tyera Eulberg e3e3a1c457 Better drone request cap handling 2018-06-22 14:52:36 -07:00
Tyera Eulberg 90628f3c8d Edit TestNode port logic to be consistent with new_leader (fixes hanging test_send_airdrop) 2018-06-22 14:52:36 -07:00
Tyera Eulberg f6bcadb79d Make airdrop amount variable 2018-06-22 14:52:36 -07:00
Tyera Eulberg d4ac16773c fmt 2018-06-22 14:52:36 -07:00
Tyera Eulberg 96f044d2bf Clean up; add new_from_server_addr routine 2018-06-22 14:52:36 -07:00
Tyera Eulberg f31868b913 Rename drone bin; fix usage statement 2018-06-22 14:52:36 -07:00
Tyera Eulberg 73b0ff5b55 Add request-count check and tests; fmt 2018-06-22 14:52:36 -07:00
Tyera Eulberg 64cf69045a Add request-count check; Clean up solana-drone and fmt 2018-06-22 14:52:36 -07:00
Tyera Eulberg e57dae0f31 Update config and dependencies for solana-drone 2018-06-22 14:52:36 -07:00
Tyera Eulberg 6386e7d5cf Leave some tokens in the mint for solana-drone 2018-06-22 14:52:36 -07:00
Tyera Eulberg 4bad103da9 Add solana-drone CLI 2018-06-22 14:52:36 -07:00
Tyera Eulberg 30a26adb7c Add solana-drone module to library 2018-06-22 14:52:36 -07:00
Stephen Akridge 8be4adfc0a Rename tr => tx and add back comments 2018-06-22 14:34:46 -07:00
Stephen Akridge fed4cc3965 Remove commented code/imports 2018-06-22 14:34:46 -07:00
Stephen Akridge 7d1e074683 bump last_ids 2018-06-22 14:34:46 -07:00
Stephen Akridge 00516e50a1 last_ids opt 2018-06-22 14:34:46 -07:00
Stephen Akridge e83d76fbd9 Remove mutexes 2018-06-22 14:34:46 -07:00
Stephen Akridge 304f152315 rwlock balances table 2018-06-22 14:34:46 -07:00
Stephen Akridge 3a82ebf7fd Add multiple source accounts for benchmark 2018-06-22 14:34:46 -07:00
Rob Walker 3dbbb398df use next_entries() in recorder, recycle blobs in reconstruct_from_blobs 2018-06-22 14:17:36 -07:00
Rob Walker 5e91d31ed3 issue 309 part 1
* limit the number of Tntries per Blob to at most one
* limit the number of Transactions per Entry such that an Entry will
    always fit in a Blob

With a one-to-one map of Entries to Blobs, recovery of a validator
  is a simple fast-forward from the end of the initial genesis.log
  and tx-*.logs Entries.

TODO: initialize validators' blob index with initial # of Entries.
2018-06-22 09:58:51 -07:00
Greg Fitzgerald fad9d20820 Add assertion for now next_entry must be called 2018-06-21 21:24:32 -07:00
Greg Fitzgerald fe9a1c8580 Fix comment 2018-06-21 21:24:32 -07:00
Greg Fitzgerald cd6d7d5198 Remove redundant clones 2018-06-21 21:24:32 -07:00
Anatoly Yakovenko effcef2184 fixed sleep bug 2018-06-20 16:58:10 -07:00
Greg Fitzgerald 410272ee1d Update generic_array
Warning: this may have performance implications.
2018-06-20 11:41:54 -07:00
Greg Fitzgerald 1c97bf50b6 Fix nightly
No longer ignore failures in the nightly build.
2018-06-19 17:38:04 -07:00
Greg Fitzgerald 2f4a92e352 Cleanup test 2018-06-19 12:36:02 -07:00
OEM Configuration (temporary user) ceafc29040 fix linting errors, add retransmission fix to repair requests 2018-06-19 12:36:02 -07:00
OEM Configuration (temporary user) b20efabfd2 added retransmission of repair messages 2018-06-19 12:36:02 -07:00
Rob Walker 6aced927ad improve ledger initialization for fullnode
* use a line iterator on stdin instead of a line iterator on a buffer
 * move some unwrap() to expect(), documenting failures
 * bind entry type earlier (for kicks)
2018-06-19 09:28:35 -07:00
Rob Walker 0de5e7a285 attempt to understand entry 2018-06-18 16:48:59 -07:00
Greg Fitzgerald c40000aeda Fix compiler warning 2018-06-18 15:49:41 -07:00
Stephen Akridge 31198bc105 Fix cargo bench nightly 2018-06-18 13:20:39 -07:00
Michael Vines 92599acfca Abort when -l is not present or unreadable 2018-06-16 09:55:03 -07:00
Greg Fitzgerald f6e70779fe Don't panic if sent a bad packet 2018-06-16 09:51:45 -06:00
Greg Fitzgerald 9d84ec4bb3 Delete TODO
That comment predates the separation of RPU and TPU.
2018-06-16 08:59:30 -06:00
Anatoly Yakovenko 586141adb2 Cleanup TVU docs 2018-06-15 22:45:35 -06:00
Michael Vines 15c7f36ea3 Improve error reporting 2018-06-15 17:10:00 -07:00
Greg Fitzgerald 327ee1dae8 Apply feedback from @aeyakovenko 2018-06-15 17:01:38 -06:00
Greg Fitzgerald 22885c3e64 Add TVU ASCII art 2018-06-15 17:01:38 -06: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
Stephen Akridge 5f1d8c95eb Fix blob data size 2018-06-15 11:54:01 -06:00
Anatoly Yakovenko 7d9e032407 make sure we test large tables 2018-06-15 06:56:35 -06:00
Anatoly Yakovenko bc918a5ad5 purger 2018-06-15 06:56:35 -06:00
Anatoly Yakovenko ee54ce4727 min table size before purge 2018-06-15 06:56:35 -06:00