Commit Graph

146 Commits

Author SHA1 Message Date
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
anatoly yakovenko 6ec0e42220
budget as separate contract and system call contract (#1189)
* budget and system contracts and verification

* contract check_id methods
* system call contract
* verify contract execution rules
* move system into its own file
* allocate before transfer for budget
* store error in budget context
* budget contract and tests without bank
* moved budget of of bank
2018-09-17 13:36:31 -07:00
Anatoly Yakovenko fd36954477 clippy 2018-09-15 05:12:53 -06:00
Michael Vines 4196cf43e8 cargo fmt 2018-09-14 16:37:49 -07:00
sakridge 9d80eefb81
Log the number of accounts each 250k txes (#1178) 2018-09-10 17:40:00 -07:00
Michael Vines 2be0dbddbb
Correct spelling 2018-09-10 13:48:43 -07:00
anatoly yakovenko a89b611e9e
comments (#1165) 2018-09-09 07:07:38 -07:00
anatoly yakovenko c34d911eaf
Migrate Budget DSL to use the Account state (#979)
* Migrate Budget DSL to use the Account state instead of global bank data structures.

* Serialize Instruction into Transaction::userdata.
* Store the pending set in the Account::userdata
* Enforce the token balance rules on contract execution. This becomes the entry point for generic contracts.
* This pr will have a performance impact on the bank. The next set of changes will fix this by locking each account during multi threaded execution of all the contracts.
* With this change a contract transaction needs to store its state under an address. That address could be the destination of the tokens, or any random address. For the latter, an extra step would be needed to claim the tokens which isn't implemented by budget_dsl at the moment.
* test tracking issue 1157
2018-09-07 20:18:36 -07:00
Tyera Eulberg 5169c8d08f Add method to return hash of bank state 2018-09-07 15:38:53 -06:00
Pankaj Garg 05460eec0d
Open multiple sockets for transaction UDP port (#1128)
* Reuse UDP port and open multiple sockets for transaction address

* Fixed failing crdt tests

* Add tests for reusing UDP ports

* Address review comments

* Updated bench-streamer to use multiple receive sockets

* Fix minimum number of recv sockets for bench-streamer

* Address review comments

Fixes #1132

* Moved bind_to function to nat.rs
2018-09-06 14:13:40 -07:00
Greg Fitzgerald d5ef18337c Remove redundant return value
And don't log the same error twice.
2018-09-04 06:01:32 -10:00
sakridge f1785c76a4
Rework counter increment outside apply_debits loop (#1046)
Reduces prints/atomics work inside the process_transactions loop
2018-08-23 09:42:59 -07:00
Greg Fitzgerald 2d35345c50 Boot unused creates 2018-08-20 16:48:37 -06:00
Pankaj Garg b9ec97a30b
Add counter for bank transaction errors (#1015) 2018-08-20 14:56:01 -07:00
Anatoly Yakovenko a284030ecc Account type with state
comments

fixups!

fixups!

fixups for a real Result<> from get_balance()

on 2nd thought, be more rigorous

Merge branch 'rob-solana-accounts_with_state' into accounts_with_state

update

review comments

comments

get rid of option
2018-08-16 14:44:51 -07:00
anatoly yakovenko 88d6fea999 Revert "Accounts with state (#954)"
This reverts commit c23fa289c3.
2018-08-15 19:44:39 -07:00
anatoly yakovenko c23fa289c3
Accounts with state (#954)
* Account type with state

* fixed test according to @rob-solana
2018-08-15 14:32:11 -07:00
Greg Fitzgerald 2727067b94 Move winow into its own module 2018-08-13 20:17:16 -06:00
Pankaj Garg bf15cad36b
Add get_finality request and use it from multinode test (#941) 2018-08-13 08:55:13 -07:00
Rob Walker 5dbcb43abd more enhancements 2018-08-10 19:53:58 -07:00
anatoly yakovenko 2318ffc704
Use a different counter for validator account not found errors. (#931)
* Use a different counter for validator account not found errors.  This is a usefull signal of something going wrong with the ledger
2018-08-10 15:18:44 -07:00