Commit Graph

137 Commits

Author SHA1 Message Date
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
Greg Fitzgerald 4a980568ac Rename sig variables to signature
We'll avoid introducing three-letter terms to free up the namespace
for three-letter acronyms.

But recognize the term "sigverify", a verb, to verify a digital
signature.
2018-08-09 13:41:37 -06:00
Greg Fitzgerald ad331e6d56 Rename PublicKey type to Pubkey
Recognize pubkey as a noun meaning the public key of a keypair.
2018-08-09 13:41:37 -06:00
Greg Fitzgerald c2bbe4344e Rename KeyPair to Keypair 2018-08-09 13:41:37 -06:00
Greg Fitzgerald ca7d4c42dd Rename cur_hashes to num_hashes 2018-08-09 10:15:10 -06:00
Stephen Akridge 38be61bd22 Check for log level before doing perf counter work
Perf counters, especially when running the dynamic test can cause
functions like crdt::apply_updates to be really slow (>500ms).
2018-08-08 00:16:53 -07:00
Stephen Akridge 1ac5d300a4 Rearrange start hash for process_ledger and add a unit test 2018-08-07 14:10:36 -07:00
Stephen Akridge db2392a691 Use last_id from the entries stream instead of last_id from bank
bank will only register ids when has_more is not set because those are
the only ids it has advertised, so it will not register all ids,
however the entry stream will contain unbroken last_id chain, so we
need to track that to get the correct start hash.
2018-08-07 08:14:06 -07:00
Rob Walker 63d2b2eb42 adjust bank notion of entry_count to aid debugging 2018-08-06 11:20:52 -07:00
Rob Walker 906d18a709 move VOTE to trace, info too verbose 2018-08-03 23:04:54 -07:00