Commit Graph

166 Commits

Author SHA1 Message Date
jackcmay 5ca52d785c
Preload BPF loader (#1573)
Preload BPF loader
2018-10-23 14:44:41 -07:00
Michael Vines 7977b97227 Surface AccountInUse to JSON RPC users so they know to retry the transaction 2018-10-23 13:55:30 -07: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
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
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
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
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 3828eda507 Demote log messages 2018-10-13 11:31:10 -07:00
Anatoly Yakovenko bba6437ea9 Use a single structure for last_ids and last_ids_sigs 2018-10-12 16:39:35 -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
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 eed3b9db94 Add ERC20-like Token program 2018-10-09 12:53:37 -07:00
Greg Fitzgerald b508fdb62c Cleanup field names 2018-10-04 16:51:05 -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
Michael Vines c79acac37b Add tic-tac-toe dashboard program 2018-09-28 18:48:34 -07: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
Greg Fitzgerald 423e7ebc3f Pacify clippy 2018-09-27 16:21:12 -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
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
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
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 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 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
Michael Vines 8f0e0c4440 Add tic-tac-toe program 2018-09-25 12:07:41 -07: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
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
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 a9355c33b2
Placeholder storage contract and replicator client (#1286)
* Add hooks for executing the storage contract

* Add store_ledger stage
  Similar to replicate_stage but no voting/banking stuff, just convert
  blobs to entries and write the ledger out

* Add storage_addr to tests and add new NodeInfo constructor
  to reduce duplication...
2018-09-21 15:32:15 -07:00
Tyera Eulberg c0e7e43e96 fixup! s/contract/program 2018-09-20 19:33:54 -07:00
Anatoly Yakovenko 9bfead2e01 s/contract/program 2018-09-20 19:33:54 -07:00
Michael Vines 1f08b22c8e Tweak log messages 2018-09-18 16:17:08 -07:00
Michael Vines aebf7f88e5
Various spelling fixes 2018-09-17 19:37:59 -07:00
Michael Vines aac1571670 mint now uses the SystemContract instead of Budget 2018-09-17 18:02:40 -07:00