Commit Graph

1713 Commits

Author SHA1 Message Date
jackcmay f8516b677a
Load program data in chunks (#1556)
Load program data in chunks
2018-10-19 18:28:38 -07:00
Greg Fitzgerald 26b99d3f85 Ensure witness and timestamp keys are signed
Before this patch, an attacker could point Budget instructions to
unsigned keys, and authorize a transaction from an unauthorized
party.
2018-10-19 10:06:59 -06:00
Greg Fitzgerald 2f9c0d1d9e Add method to lookup signed keys 2018-10-19 10:06:59 -06:00
carllin 0bd1412562
Switch leader scheduler to use PoH ticks instead of Entry height (#1519)
* Add PoH height to process_ledger()

* Moved broadcast_stage Leader Scheduling logic to use Poh height instead of entry_height

* Moved LeaderScheduler logic to PoH in ReplicateStage

* Fix Leader scheduling tests to use PoH instead of entry height

* Change is_leader detection in repair() to use PoH instead of entry height

* Add tests to LeaderScheduler for new functionality

* fix Entry::new and genesis block PoH counts

* Moved LeaderScheduler to PoH ticks

* Cleanup to resolve PR comments
2018-10-18 22:57:48 -07:00
Stephen Akridge 37a0b7b132 Initial validator code for rust side hooks for chacha cuda parallel encrypt 2018-10-18 13:50:19 -07:00
Stephen Akridge c30b605047 Actually submit the storage mining proof
Get an aidrop so replicator can submit mining transaction

Some other minor type cleanup.
2018-10-18 13:50:19 -07:00
Rob Walker 76076d6fad move last_id age checking into the HashMap
* allows for simpler chaining of banks
  * looks 1.5-2% faster than looping through a VecDequeue

TODO: remove timestamp()?
2018-10-18 11:07:00 -07:00
jackcmay 0a819ec4e2
Programs were not spawned by SystemProgram (#1533)
* SystemProgram spawns programs
2018-10-18 10:33:30 -07:00
Michael Vines 57a717056e Delegate accounts now record the original approved amount 2018-10-18 08:53:25 -07:00
Greg Fitzgerald 856c48541f Restore elaborate attack
The test is showing how you can sneak by verify_plan() but not
verify_signature().
2018-10-18 08:46:02 -06:00
Greg Fitzgerald 2045091c4f Add SystemProgram::Move ix to Budget tx 2018-10-18 08:46:02 -06:00
Greg Fitzgerald 03ac5a6eef Move all source tokens into Budget account
Budget now assumes the source account holds all tokens the program
should spend.

Note: the static guarantees implied by verify_plan() are meaningless
under the new contract engine. The bank no longer calls it. This
serves as a nice example of where comparing code coverage between
integration tests and unit tests would have shown us where a
change rendered unit tests meaningless.
2018-10-18 08:46:02 -06:00
Greg Fitzgerald 32fadc9c30 Merge debits and credits
Debits no longer need to be applied before credits. Instead, we
lock any accounts we'd debit and so error out on the second attempt
to lock the same account.
2018-10-18 08:46:02 -06:00
Greg Fitzgerald 15a89d4f17 Boot Contract type from Budget
In the old bank (before the contract engine), Contract wasn't specific
to Budget. It provided the same service as what is now called
SystemProgram::Move, but without requiring a separate account.
2018-10-18 08:46:02 -06:00
Rob Walker d0f43e9934 consolidate tmp ledgers 2018-10-18 08:45:31 -06:00
Pankaj Garg 31e779d3f2
Added counters to track more metrics on dashboard (#1535)
- Total number of IP packets TX/RX from all nodes in the testnet
- Last consumed index on validator
- Last transmitted index on leader
2018-10-17 17:32:50 -07:00
Pankaj Garg 639c93460a
Write stage optimizations (#1534)
- Testnet dashboard shows that channel pressure for write stage
  is incrementing on every iteration of write.
- This change optimizes ledger writing by removing cloning of map
  and reducing calls to flush
2018-10-17 13:02:32 -07:00
Jack May 63caca33be SystemProgram test was failing due to expected panic 2018-10-16 18:02:44 -07:00
Rob Walker 912eb5e8e9
remove bank.is_leader, dead code (#1516) 2018-10-16 15:26:44 -07:00
Jack May d0c19c2c97 cargo fmt 2018-10-16 14:11:04 -07:00
Jack May 926fdb7519 Rename dynamic_program.rs to native_loader.rs 2018-10-16 14:11:04 -07:00
jackcmay c886625c83
Move from solana/rbpf fork to qmonnet/rbpf (#1511) 2018-10-16 13:13:54 -07:00
Pankaj Garg f6c10d8a2e
Add channel pressure for validator TVU stages (#1509) 2018-10-16 12:54:23 -07:00
anatoly yakovenko 2bd877528f
Par process entries (#1499)
* Parallel entry processor.
2018-10-16 12:09:48 -07:00
jackcmay d09889b1dd
Program bank integration (#1462)
Native, BPF and Lua loaders integrated into the bank
2018-10-16 09:43:49 -07:00
Tyera Eulberg 1b2e9122d5 Pubsub listen on random open port when rpc does (quiet some test errors) 2018-10-16 00:11:26 -06:00
Tyera Eulberg 7424388924 Fix session drop 2018-10-16 00:11:26 -06:00
Michael Vines 537436bd5e RPC PubSub now uses a well-known socket 2018-10-16 00:11:26 -06:00
Tyera Eulberg fb99494858
Improve rpc code coverage (#1487) 2018-10-15 11:01:40 -06:00
Greg Fitzgerald 515c200d86 Refactor and add test for new Entry::serialized_size() 2018-10-14 10:53:47 -06:00
Greg Fitzgerald 32aab82e32 Don't allocate to see if transactions will fit in a blob 2018-10-14 10:53:47 -06:00
anatoly yakovenko 6aaa350145
effeciently pack gossip responsens and only respond up to max size. (#1493) 2018-10-14 06:45:02 -07:00
Michael Vines d3b4dfe104 Add bool return to entrypoint signature to permit programs to fail transactions 2018-10-13 20:01:43 -07:00
Michael Vines 2d0f07091d Handle dynamic program dlopen failures gracefully 2018-10-13 11:31:10 -07:00
Michael Vines 3828eda507 Demote log messages 2018-10-13 11:31:10 -07:00
Michael Vines 1e736ec16d Demote log messages 2018-10-12 20:16:57 -07:00
Anatoly Yakovenko bba6437ea9 Use a single structure for last_ids and last_ids_sigs 2018-10-12 16:39:35 -07:00
Pankaj Garg e5ab9a856c
Upload bench output as build artifacts (#1478)
* Upload bench output as build artifacts

* Fix tags types

* Pull previous stats from metrics

* Change the default branch for comparison

* Fix formatting

* Fix build errors

* Address review comments

* Dedup some common code

* Add eval for channel info to find branch name
2018-10-12 15:13:10 -07:00
Tyera Eulberg 1515bba9c6
Use cluster_info in rpc to get current leader addresses (#1480) 2018-10-12 14:25:56 -06:00
Rob Walker 14a9ef4bbe
move PoH verification off bank.last_id() (#1476) 2018-10-12 11:50:34 -07:00
Michael Vines 041040c659 pubsub.rs -> rpc_pubsub.rs 2018-10-12 08:39:06 -07:00
carllin 47f69f2d24
1) Switch broken tests to generate an empty tick in their ledgers to use as last_id, 2) Fix bug where PoH generator in BankingStage did not referenced the last tick instead of the last entry on startup, causing ledger verification to fail on the new tick added by the PoH generator (#1479) 2018-10-12 00:39:10 -07:00
Stephen Akridge 9dd4dc2088 Mark failing tests as ignore 2018-10-11 15:32:36 -07:00
Stephen Akridge 183f560d06 Add raw entries interface to ledger for getting slices as [u8] 2018-10-11 09:40:34 -07:00
anatoly yakovenko 5c85e037f8
Tick entry ids as only valid last_ids (#1441)
Generate tick entry ids and only register ticks as the last_id expected by the bank.  Since the bank is MT, the in-flight pipeline of transactions cannot be close to the end of the queue or there is a high possibility that a starved thread will encode an expired last_id into the ledger.  The banking_stage therefore uses a shorter age limit for encoded last_ids then the validators.

Bench client doesn't send transactions that are older then 30 seconds.
2018-10-10 17:23:06 -07:00
Michael Vines 02225aa95c Look for native programs in same directory as the current executable 2018-10-10 16:49:48 -07:00
carllin 9931ac9780
Leader scheduler plumbing (#1440)
* Added LeaderScheduler module and tests

* plumbing for LeaderScheduler in Fullnode + tests. Add vote processing for active set to ReplicateStage and WriteStage

* Add LeaderScheduler plumbing for Tvu, window, and tests

* Fix bank and switch tests to use new LeaderScheduler

* move leader rotation check from window service to replicate stage

* Add replicate_stage leader rotation exit test

* removed leader scheduler from the window service and associated modules/tests

* Corrected is_leader calculation in repair() function in window.rs

* Integrate LeaderScheduler with write_stage for leader to validator transitions

* Integrated LeaderScheduler with BroadcastStage

* Removed gossip leader rotation from crdt

* Add multi validator, leader test

* Comments and cleanup

* Remove unneeded checks from broadcast stage

* Fix case where a validator/leader need to immediately transition on startup after reading ledger and seeing they are not in the correct role

* Set new leader in validator -> validator transitions

* Clean up for PR comments, refactor LeaderScheduler from process_entry/process_ledger_tail

* Cleaned out LeaderScheduler options, implemented LeaderScheduler strategy that only picks the bootstrap leader to support existing tests, drone/airdrops

* Ignore test_full_leader_validator_network test due to bug where the next leader in line fails to get the last entry before rotation (b/c it hasn't started up yet). Added a test test_dropped_handoff_recovery go track this bug
2018-10-10 16:49:41 -07:00
Michael Vines 262f26cf76 SystemProgram transactions now fail on invalid arguments 2018-10-10 15:19:03 -07:00
Tyera Eulberg 785c619198
Add pubsub module for rpc info subscriptions (#1439) 2018-10-10 14:51:43 -06:00
Michael Vines 24a993710d Avoid panic when account.source is None 2018-10-10 10:53:00 -07:00
Michael Vines eed3b9db94 Add ERC20-like Token program 2018-10-09 12:53:37 -07:00
Greg Fitzgerald 95701114e3 Crdt -> ClusterInfo 2018-10-09 03:49:39 -06:00
Rob Walker a99d17c3ac
put temp, test files in OUT_DIR (#1448) 2018-10-08 16:15:17 -07:00
Tyera Eulberg 517149d325 Move rpc request methods from wallet into separate module 2018-10-08 13:02:08 -06:00
Michael Vines 32aa2575b5 Purge BudgetTransaction from entry 2018-10-08 11:34:04 -07:00
Michael Vines 8fe7b96629 Purge BudgetTransaction from banking_stage 2018-10-08 11:34:04 -07:00
anatoly yakovenko 9350619afa
log to influx once (#1438) 2018-10-06 14:37:14 -07:00
anatoly yakovenko d8d8f0bfc8
Fund all the keys with move many transactions (#1436)
* Fund all the keys with move many transactions

* logs
2018-10-05 16:45:27 -07:00
Greg Fitzgerald b508fdb62c Cleanup field names 2018-10-04 16:51:05 -07:00
Jack May 680f90df21 Fix comment 2018-10-04 14:21:06 -07:00
anatoly yakovenko 1a68807ad9
Enable mt-bank (#1368)
* Enable mt-bank

* cleanup and interleaving lock tests
2018-10-04 13:15:54 -07:00
jackcmay 13d4443d4d
Add BPF support & C-based BPF tic-tac-toe (#1422)
Add initial support for BPF and a C port of tictactoe
2018-10-04 09:44:44 -07:00
Carl 74b63c12a0 Add tests to LeaderScheduler to increase code coverage 2018-10-03 21:58:29 -07:00
Carl cd42f6591a PR fixes - remove redundant case 2018-10-03 21:58:29 -07:00
Carl 5491422b12 Fix validator_to_leader_transition test to not start up tpu after shutting down tvu, as the tpu now outputs ticks that will mess up the verification check 2018-10-03 21:58:29 -07:00
Carl 23f3ff3cf0 Added LeaderScheduler module and tests 2018-10-03 21:58:29 -07:00
Michael Vines f90488c77b Demote 'not enough peers in crdt table' log message 2018-10-02 22:00:54 -07:00
Stephen Akridge 3fa46dd66d Add replicator sha sampling
replicator will submit mining proofs with the result of sampling
the encrypted file with a hashing algorithm.
2018-10-02 17:04:46 -07:00
Michael Vines 6db961d256
Correct comment 2018-09-30 00:08:09 -07:00
Michael Vines 83409ded59 Correctly deserialize large userdata 2018-09-29 19:39:54 -07:00
Michael Vines 396b2e9772 Ignore keep alive for completed games 2018-09-29 19:39:54 -07:00
Greg Fitzgerald b6b5455917 Fix test in coverage build 2018-09-28 19:19:16 -07:00
Michael Vines c79acac37b Add tic-tac-toe dashboard program 2018-09-28 18:48:34 -07:00
Michael Vines a5f2aa6777 s/grid/board/g 2018-09-28 18:48:34 -07:00
Michael Vines 4169e5c510 Simplify game setup messaging 2018-09-28 18:48:34 -07:00
Michael Vines 0727c440b3 Add KeepAlive message so players can detect abandoned games 2018-09-28 18:48:34 -07:00
Tyera Eulberg 52d50e6bc4 Update for new solana-jsonrpc 2018-09-28 17:53:41 -06:00
anatoly yakovenko e7de7c32db
Transactions with multiple programs. (#1381)
Transactions contain a vector of instructions that are executed atomically.
Bench shows a 2.3x speed up when using 5 instructions per tx.
2018-09-28 16:16:35 -07:00
Stephen Akridge a5f07638ec Use static str define for ledger files 2018-09-28 14:23:37 -07:00
Stephen Akridge aa2a3fe201 Add chacha module to encrypt ledger files 2018-09-28 14:23:37 -07:00
Jack May abd13ba4ca move program tests to integration 2018-09-28 11:30:10 -07:00
Greg Fitzgerald 423e7ebc3f Pacify clippy 2018-09-27 16:21:12 -06:00
Stephen Akridge 6cdbdfbbcb Enable bench and fix upload-perf 2018-09-27 14:16:56 -07:00
Tyera Eulberg dbc1ffc75e Use jsonrpc fork 2018-09-27 12:50:38 -06:00
Michael Vines 1fdbe893c5 Improve game setup experience: X now shares game key and accepts O 2018-09-27 10:44:13 -07:00
Pankaj Garg 55a542bff0 Fix erasure and cuda related compilation errors 2018-09-27 10:42:37 -06:00
Pankaj Garg e10574c64d Remove recycler and it's usage
- The memory usage due to recycler was high, and incrementing with
  time.
2018-09-27 10:42:37 -06:00
Anatoly Yakovenko 2e00be262e Remove data from BankError.
This reduces how much memory is written to last_id_sigs table on very TX, and has a 40% impact on
`cargo +nightly watch -x 'bench bench_banking_stage'`
2018-09-27 09:07:56 -06:00
Greg Fitzgerald 4172bde081 Only send a vote once a second 2018-09-27 09:06:41 -06:00
jackcmay 9c47e022dc
break dependency of programs on solana core (#1371)
* break dependency of programs on Solana core
2018-09-27 07:49:26 -07:00
Greg Fitzgerald 874addc51a Move KeyedAccount into Account
Now programs don't need to depend on dynamic_program and its
dependencies.
2018-09-26 20:40:40 -06:00
Greg Fitzgerald b7ae5b712a Move Pubkey into its own module 2018-09-26 20:40:40 -06:00
Greg Fitzgerald c6d7cd2d33 Move Account into its own module
Also use default Default generator, since system program ID is
[0; 32]. Bank should probably be the one to set this anyway.
2018-09-26 20:40:40 -06:00
Michael Vines b238c57179 Add trace! when an error is mapped to GenericFailure 2018-09-26 19:30:20 -07:00
Michael Vines 1821e72812 Add getSignatureStatus 2018-09-26 19:00:34 -07:00
Rob Walker a23c230603
fix reverse loop in write_stage, simplify banking_stage, add tooling to help find this (#1366) 2018-09-26 18:37:24 -07:00
Greg Fitzgerald 4e01fd5458 Update test to show when we should collect tx fees
See #1157 for details. The `from` account should be cloned
before execute_transaction(), and that's the only one that should
be stored if there's an error executing the program.
2018-09-26 19:30:27 -06:00
Greg Fitzgerald e416cf7adf Let clients know when transactions failed 2018-09-26 19:30:27 -06:00
Anatoly Yakovenko 93c4f6c9b8 Synchronize PoH, bank last_id queue and ledger entry channel.
PoH, bank's last_id queue and the Entry channel need to have a synchronized order of ids.
2018-09-26 16:19:03 -07:00
Stephen Akridge d546614936 Handle deserialize failure with error 2018-09-26 15:17:07 -07:00
Greg Fitzgerald ac8d738045 Don't call unwrap() in StorageProgram::process_tx 2018-09-26 15:17:07 -07:00
Greg Fitzgerald ca962371b8 Fix build
Two PRs crossed in flight.
2018-09-26 14:40:48 -06:00
Rob Walker e6f8922e35
fix issue #1347 (#1355) 2018-09-26 13:31:39 -07:00
Greg Fitzgerald 7292ece7ad Free up term instruction for new multi-instruction feature 2018-09-26 14:17:15 -06:00
Greg Fitzgerald df3b78c18c Move BudgetTransaction into its own module 2018-09-26 14:17:15 -06:00
Greg Fitzgerald c83dcea87d Move SystemTransaction into its own module 2018-09-26 14:17:15 -06:00
Greg Fitzgerald be20c99758 Promote the one true transaction constructor 2018-09-26 14:17:15 -06:00
Greg Fitzgerald 694add9919 Move budget-specific and system-specific tx constructors into traits
These functions pull in budget-specific and system-specific
dependencies that aren't needed by the runtime.
2018-09-26 14:17:15 -06:00
Tyera Eulberg 113c8b5880 Rollback jsonrpc SendTransaction pool for signature; ignore flaky tests 2018-09-26 10:25:29 -07:00
Stephen Akridge a5b28349ed Add max entry height to download for replicator 2018-09-26 09:57:22 -07:00
Tyera Eulberg 14bc160674 Clean up test and add signature return to rpc send tx 2018-09-25 16:38:51 -07:00
Tyera Eulberg d438c22618 Update RFC 2018-09-25 16:38:51 -07:00
Tyera Eulberg bcbae0a64f Fix witness functionality 2018-09-25 16:38:51 -07:00
Tyera Eulberg f636408647 Fix timestamp and cancel functionality
- Also serialize and send helper fn
2018-09-25 16:38:51 -07:00
Tyera Eulberg 3ffc7aa5bc Add helper fn to get last id 2018-09-25 16:38:51 -07:00
Tyera Eulberg 7b7e8c0d3f Clippy 2018-09-25 16:38:51 -07:00
Tyera Eulberg 11ea9e7c4b Add cancelable handling 2018-09-25 16:38:51 -07:00
Tyera Eulberg 5038e5ccd7 Preliminary Wallet-Budget functionality 2018-09-25 16:38:51 -07:00
Tyera Eulberg e943ed8caf Expand parse_command and add tests 2018-09-25 16:38:51 -07:00
Tyera Eulberg c196952afd Flesh out Wallet CLI & add placeholder WalletCommands 2018-09-25 16:38:51 -07:00
carllin e7383a7e66
Validator to leader (#1303)
* Add check in window_service to exit in checks for leader rotation, and propagate that service exit up to fullnode

* Added logic to shutdown Tvu once ReplicateStage finishes

* Added test for successfully shutting down validator and starting up leader

* Add test for leader validator interaction

* fix streamer to check for exit signal before checking socket again to prevent busy leaders from never returning

* PR comments - Rewrite make_consecutive_blobs() function, revert genesis function change
2018-09-25 15:41:29 -07:00
Rob Walker 8a7545197f
move tick generation back to banking_stage, add unit tests (#1332)
* move tick generation back to banking_stage, add unit tests

fixes #1217

* remove channel() stuff for synchronous comm; use a mutex
2018-09-25 15:01:51 -07:00
Greg Fitzgerald 680072e5e2 No need to special case vote failures 2018-09-25 13:43:35 -06:00
Greg Fitzgerald 4ca377a655 Delete dead code 2018-09-25 13:43:35 -06:00
Tyera Eulberg 751dd7eebb Move vote into ReplicateStage after process_entries 2018-09-25 13:43:35 -06:00
Michael Vines 8f0e0c4440 Add tic-tac-toe program 2018-09-25 12:07:41 -07:00
Tyera Eulberg db310a044c
Add Budget::And element, and supporting functions (#1329) 2018-09-25 12:38:13 -06:00
Rob Walker 88a609ade5 groom write_stage 2018-09-25 00:18:35 -07:00
Rob Walker 304d63623f give replication some time to happen
fixes #1307
2018-09-24 23:57:09 -07:00
Rob Walker 407b2682e8 remove dead code 2018-09-24 23:12:09 -07:00
Pankaj Garg 0f4fd8367d
Add counters for channel pressure and time spent in TPU pipeline (#1324)
* Add counters for channel pressure and time spent in TPU pipeline

* Fixed failing tests

* Fix rust format issue
2018-09-24 17:13:49 -07:00
Greg Fitzgerald 747ba6a8d3 Boot BudgetState::last_error 2018-09-24 17:14:23 -06:00
Greg Fitzgerald bb99fd40de Update transaction status in the bank
This will allow jsonrpc to query the system to find out if a
recent transaction failed.
2018-09-24 17:14:23 -06:00
Greg Fitzgerald e972d6639d Return errors from BudgetProgram::process_transaction 2018-09-24 17:14:23 -06:00
Greg Fitzgerald 22e77c9485 Add a way of getting transaction errors out of the bank 2018-09-24 17:14:23 -06:00
Greg Fitzgerald 95677a81c5 Pacify clippy 2018-09-24 13:36:31 -06:00
Greg Fitzgerald ea37d29d3a Pass Bank::process_transactions() a reference to the txs instead of moving them 2018-09-24 13:36:31 -06:00
sakridge e030673c9d
Do a recv on join to prevent channel destruction (#1320)
before window thread join
2018-09-24 11:50:37 -07:00
sakridge 3e76efe97e
Fix bench compilation (#1311) 2018-09-24 10:40:42 -07:00
Stephen Akridge f5a30615c1 Ignore replicator startup for now 2018-09-24 09:43:58 -06:00
Rob Walker 9e3d2956d8 remove last recycle? 2018-09-24 08:09:41 -06:00
jackcmay 26b1466ef6
Initial integration of dynamic contracts and native module loading (#1256)
* Integration of native dynamic programs
2018-09-23 22:13:44 -07:00
Jack May a1f01fb8f8 revert is_some to not is_none, causes test failure 2018-09-23 17:09:18 -06:00
Jack May b2be0e2e5e fix clippy warning 2018-09-23 17:09:18 -06:00
Jack May 1a45587c08 fix clippy warnings 2018-09-23 17:09:18 -06:00
Rob Walker a51c2f193e fix Rob and Carl crossing wires 2018-09-21 21:37:25 -07:00
Rob Walker be31da3dce
lastidnotfound step 2: (#1300)
lastidnotfound step 2:
  * move "record stage", aka poh_service into banking stage
  * remove Entry.has_more, is incompatible with leader rotation
  * rewrite entry_next_hash in terms of Poh
  * simplify and unify transaction hashing (no embedded nulls)
  * register_last_entry from banking stage, fixes #1171 (w00t!)
  * new PoH doesn't generate empty ledger entries, so some fixes necessary in 
         multinode tests that rely on that (e.g. giving validators airdrops)
  * make window repair less patient, if we've been waiting for an answer, 
          don't be shy about most recent blobs
   * delete recorder and record stage
   * make more verbost  thin_client error reporting
   * more tracing in window (sigh)
2018-09-21 21:01:13 -07:00
sakridge 54b407b4ca
Wait on blob fetch before window, Seems to fix instability (#1304)
also cleanup ledger.
2018-09-21 18:56:20 -07:00
Tyera Eulberg e87cac06da Request/reqwest improvements
- Use json macro to simplify request builds
- Add proxy option for reqwest to use TLS
- Add rpc port options for configured nodes
2018-09-21 18:06:20 -06:00
Tyera Eulberg ad4fef4f09 Doc for rpc_port configuration 2018-09-21 18:06:20 -06:00