274 Commits

Author SHA1 Message Date
Greg Fitzgerald
122c7bc2ef Rename TransactionCompiler to Script and use it to replace the type alias 2019-03-18 08:22:54 -07:00
Greg Fitzgerald
0c0716abfb Move Bank-based tests into unit-tests 2019-03-18 08:22:54 -07:00
Greg Fitzgerald
c09accb685 Rename StaticEntrypoint to ProcessInstruction 2019-03-18 08:22:54 -07:00
Greg Fitzgerald
ae4d14a2ad Introducing Scripts
A sequence of instructions. A client compiles the script and then uses
the compiled script to construction a transaction. Then it adds a
adds a blockhash, signs the transaction, and sends it off for
processing.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald
55cdbedb52 Allow tests to add instruction processors
Make runtime a private module again.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald
ee39f31d81 Add Runtime object. Allow any number of static loaders. 2019-03-18 08:22:54 -07:00
Greg Fitzgerald
70b45de012 Get access to runtime errors in Budget unit-tests 2019-03-18 08:22:54 -07:00
Sathish
9566a5cc68 Organize accounts on a per fork basis (#3336)
* Organize accounts by fork

* Keep track of vote accounts in account info

* update comments
2019-03-16 23:42:32 -07:00
Greg Fitzgerald
24d9138067 Abandon Builder pattern 2019-03-15 14:46:44 -06:00
Greg Fitzgerald
aca739b800 Boot fees from TransactionBuilder 2019-03-15 14:46:44 -06:00
Greg Fitzgerald
e091aa87ea More precise constructor names 2019-03-15 14:46:44 -06:00
Greg Fitzgerald
968022a1b0 Instruction name swap
* Instruction -> GenericInstruction
* Instruction<u8, u8> -> CompiledInstruction
* Instruction<Pubkey, (Pubkey, bool)> -> Instruction
2019-03-15 14:46:44 -06:00
Greg Fitzgerald
42d5dde5b1 new_singleton -> new_with_instruction 2019-03-15 09:06:54 -06:00
Greg Fitzgerald
142eeffe5d Add BankClient to minimize copypasta 2019-03-15 09:06:54 -06:00
Greg Fitzgerald
73bd396dfb Rewrite system integration test
Create Client helpers instead of Bank helpers.
2019-03-15 09:06:54 -06:00
Greg Fitzgerald
7b4568b9bf Migrate to sign_checked() 2019-03-15 09:06:54 -06:00
Sagar Dhawan
3f2fc21bb3 Rename hash_queue and fix boundary condition (#3289) 2019-03-14 11:56:36 -07:00
Greg Fitzgerald
c1eec0290e Rename userdata to data (#3282)
* Rename userdata to data

Instead of saying "userdata", which is ambiguous and imprecise,
say "instruction data" or "account data".

Also, add `ProgramError::InvalidInstructionData`

Fixes #2761
2019-03-14 10:48:27 -06:00
Greg Fitzgerald
e58220282a Move TransactionError into the SDK 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
4ca4038d54 Rename BankError to TransactionError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
150cd31ec0 Blur the line between Bank and Runtime 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
6fd0d4dcf5 Boot error piggybacking on BankError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
296415945a Generalize error codes 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
1de5ae1ef0 Remove SystemError from ProgramError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
6a89c68a1d Add utility function to help get System error out of ProgramError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald
c14cce4c85 Add InstructionError for runtime instruction errors 2019-03-13 21:26:57 -06:00
carllin
af03df38b9 Don't vote for empty leader transmissions (#3248)
* Don't vote for empty leader transmissions

* Add is_delta flag to bank to detect empty leader transmissions

* Plumb new is_votable flag through replay stage

* Fix PohRecorder tests

* Change is_delta to AtomicBool to avoid making Bank references mutable

* Reset start slot in poh_recorder when working bank is cleared, so that connsecutive TPU's will start from the correct place

* Use proper max tick height calculation

* Test for not voting on empty transmission

* tests for is_votable
2019-03-13 14:06:12 -07:00
Rob Walker
9f916f9d47 remove Option<> wrapper for accounts 2019-03-12 15:03:26 -07:00
Michael Vines
1ee43a7633 Remove non-essential programs from runtime/ 2019-03-12 15:11:59 -05:00
Michael Vines
3d2b7dd1ef Move programs/system into runtime/ 2019-03-12 11:30:58 -05:00
Michael Vines
6899bd7099 0.13.0 2019-03-11 16:21:19 -07:00
Tyera Eulberg
fe1676bc3a Review comments 2019-03-11 16:58:43 -06:00
Tyera Eulberg
804378e8f7 Add ProgramError::CustomError and truncate value to 32 bytes 2019-03-11 16:58:43 -06:00
Sagar Dhawan
78bb96ee51 Reduce bootstrap leader stake (#3218) 2019-03-11 13:29:44 -07:00
Rob Walker
195a880576 pass Pubkeys as refs, copy only where values needed (#3213)
* pass Pubkeys as refs, copy only where values needed

* Pubkey is pervasive

* fixup
2019-03-09 19:28:43 -08:00
Greg Fitzgerald
3dc22e7323 Simulate auto-creation of system accounts 2019-03-07 19:18:53 -07:00
Greg Fitzgerald
17dcd1f62a Resurrect the tests 2019-03-07 19:18:53 -07:00
Tyera Eulberg
259c820f15 Review comments 2019-03-07 17:21:32 -07:00
Tyera Eulberg
b053bc2790 Load accounts by program owner for program subscriptions 2019-03-07 17:21:32 -07:00
Stephen Akridge
8d80da6b46 Fix picking account store paths
Store the set of accounts paths in AccountsDB and choose with an rng
when we need to create a new one. Remove path from AccountStorageEntry object.
2019-03-07 14:58:52 -08:00
Stephen Akridge
22855def27 Fix race condition in store.
Multiple threads can enter the read lock and
all store the new empty set to account_maps.
Check again after taking write lock to make sure
only one thread actually inserts the new entry.
2019-03-07 14:58:52 -08:00
Greg Fitzgerald
505f77b108 Move a more generic process_transaction to runtime.rs 2019-03-07 12:42:13 -07:00
Greg Fitzgerald
5b672f8921 Generalize Budget tests to work on multi-ix txs 2019-03-07 12:42:13 -07:00
Stephen Akridge
61fbea3ee4 Cleanup AccountStorage apis
Remove duplicate code
2019-03-06 18:30:36 -08:00
Rob Walker
01fb76f4bd add epoch warmup (#3166)
add epoch warmup
2019-03-06 16:32:23 -08:00
Rob Walker
63a4ed74a4 consolidate logic for epoch and slot_index into Bank (#3144) 2019-03-06 14:44:21 -08:00
Pankaj Garg
9163e5b004 Fix sorting order of stakes in confirmation time calculations 2019-03-06 13:11:04 -08:00
Stephen Akridge
b850f3c1dd Remove unnecessary cleanup_paths
drop handles it
2019-03-06 11:17:37 -07:00
Michael Vines
53f09c44f3 Rename tokens to lamports in sdk/ 2019-03-05 17:28:06 -08:00
Rob Walker
cb0560df92 remove dead code 2019-03-05 15:35:24 -08:00