Commit Graph

251 Commits

Author SHA1 Message Date
Greg Fitzgerald cecdb7061e Remove blockhash parameter from Bank::transfer
That parameter is an artifact from the Loom days, when I thought
Bank should implement the same interace as ThinClient.
2019-03-27 08:51:10 -06:00
Greg Fitzgerald 0ac865f08c Remove BankClient::process_instructions 2019-03-27 08:51:10 -06:00
Greg Fitzgerald 55115d0eeb Add process_message() to BankClient 2019-03-27 08:51:10 -06:00
Greg Fitzgerald 8c69c40834 Make space for a new Transaction::new 2019-03-26 20:06:05 -06:00
Greg Fitzgerald ca2ac1e5ea Remove a mostly unused Transaction constructor 2019-03-26 15:46:58 -07:00
Rob Walker 215b07c1a9
remove status_cache.freeze (#3506) 2019-03-26 11:56:25 -07:00
Greg Fitzgerald df333e8b6e Move new_move_many to SystemInstruction 2019-03-26 09:22:29 -07:00
Greg Fitzgerald 573dec63da Fix runtime benches 2019-03-25 14:32:01 -06:00
Greg Fitzgerald b53cbdd9e6 Punt on the Script abstraction
Low ROI
2019-03-24 14:52:06 -06:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00
Rob Walker 31b8743052
delay freeze of status_cache until squash (#3453) 2019-03-22 22:14:56 -07:00
Sathish 06b0c98c75
Remove accounts when the fork is removed (#3384)
* Fix test

* Cleanup accounts when the fork is removed

* Update test to check for deleted accounts
2019-03-21 17:36:10 -07:00
Greg Fitzgerald d2415613de Migrate loader tests to BankClient 2019-03-21 09:19:24 -06:00
anatoly yakovenko 148e08a8a5
Enable cluster tests (#3372)
* Cluster tests

* stable!

* fixup! stable!

* fixup! fixup! stable!

* fixup! fixup! fixup! stable!

* fixup! fixup! fixup! fixup! stable!

* fixed space

* add getNumBlocksSinceSignatureConfirmation entry for the json rpc docs

* Check in upcoming epochs for potential leadership slots in next_leader_slot()
2019-03-21 07:43:21 -07:00
Stephen Akridge bcb190a12a Remove erroneous comment 2019-03-20 16:15:25 -07:00
Stephen Akridge 4126461f87 Fix dupe port on cluster_info
and remove unintended grow file
2019-03-20 14:17:21 -07:00
Rob Walker 3048de18bb
add doc that should have been copy-pasta'd from bench (#3389) 2019-03-20 11:10:42 -07:00
Rob Walker df9fd2bc0b
stop copying Blooms (#3379)
* stop copying Blooms

* fixup

* clippy
2019-03-20 11:06:39 -07:00
Michael Vines 0dc364c17a Relocate transaction reference verification to join the other validity checks 2019-03-20 07:46:01 -07:00
Michael Vines da77789881
Revert "Drop 'unchecked' from get_subset_mut()"
This reverts commit 70b21b3795.
2019-03-19 17:52:02 -07:00
Greg Fitzgerald 94b5835738 Make AccountMeta a traditional struct instead of a tuple struct 2019-03-19 17:22:39 -06:00
Greg Fitzgerald a4652a9aaf Label tuple with AccountMeta 2019-03-19 17:22:39 -06:00
Michael Vines 70b21b3795 Drop 'unchecked' from get_subset_mut() 2019-03-19 16:12:53 -07:00
Carl 5e21268ca0 PR comments 2019-03-18 20:46:11 -07:00
Carl b38e3bef01 Modify bank_forks to support squashing/filtering new root and also don't remove parents from bank_forks when inserting, otherwise we lose potential fork points when querying blocktree for child slots 2019-03-18 20:46:11 -07:00
Greg Fitzgerald f16f88873d Add multiple signer support to BankClient 2019-03-18 16:07:45 -06:00
Greg Fitzgerald 8d032aba9d Merge InstructionError and ProgramError
From the user's perspective, it's just an instruction error.
For program-specific errors, we still have
InstructionError::CustomError.
2019-03-18 10:39:20 -06:00
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
Rob Walker b9e878ee80
slot_height considered harmful (#3135)
* slot_height considered harmful
* fix test_tick_slot_epoch_indexes
2019-03-05 14:18:29 -08:00
Michael Vines 1997640094 Remove prints 2019-03-05 14:09:40 -08:00
Sagar Dhawan 9349f90a59
Inherit transaction count from parent (#3134) 2019-03-05 12:34:21 -08:00
Sathish Ambley 6e9d803091 Remove usage of unsafe for Accounts 2019-03-05 10:13:03 -08:00
Tyera Eulberg b4084c6298 Fix random comment typo 2019-03-05 09:33:27 -07:00
Greg Fitzgerald 885eeec3ed Boot storage program from the SDK 2019-03-05 07:16:33 -07:00
Greg Fitzgerald 5e9f802d7d Boot token_program from the SDK 2019-03-05 07:16:33 -07:00
Rob Walker 43bab23651
remove duplicate child creation (#3100)
* remove duplicate child creation
* resurrect test for partial slot
* simplify blocktree_processor some more (no tick_height, yay!)
* ensure frozen
2019-03-04 19:22:23 -08:00
Rob Walker 794e961328
use Bank's notion of leader_id where possible (#3119) 2019-03-04 18:40:47 -08:00
Sagar Dhawan dc42c12f2b
Revert to more consistent naming (#3114) 2019-03-04 17:50:19 -08:00
Stephen Akridge 97274030b9 Add test with transaction with no signatures
Add checks for no signature
2019-03-04 16:42:52 -08:00
Stephen Akridge a3016aebaf Put accounts test data files in target directory
And gitignore it so those aren't added accidentally.
2019-03-04 10:17:02 -08:00
carllin de1d7ce312
Cleanup staking utils to divide functionality between delegate and normal node utitliites. Also replaces vote_states() with more generalized vote_accounts() in Bank. (#3070) 2019-03-03 18:04:13 -08:00
Rob Walker e4dba03e12
accounts shedding (#3078)
* accounts shedding

* fixup
2019-03-03 16:04:04 -08:00
Greg Fitzgerald fc5fcd6cd4 Move native_loader into solana_runtime 2019-03-03 10:59:08 -07:00
Greg Fitzgerald 41b5899856 Move programs/Cargo.toml into bpf/ 2019-03-02 22:11:48 -08:00
Greg Fitzgerald b830449f23 Move top-level native program tests to their respective crates 2019-03-02 22:11:48 -08:00
Greg Fitzgerald 037fcf6b3d Bump all native programs up a level
Don't categorize programs by a single backend.
2019-03-02 22:11:48 -08:00
Stephen Akridge e1a1296b9b Fix cleanup_paths
Add back remove of parent in Accounts::drop, but
remove that in the cleanup_paths helper
for the account tests which do not use
make_default_dir.
2019-03-02 20:24:57 -08:00
Michael Vines a9a7fc56eb Purge MAX_RECENT_TICK_HASHES 2019-03-02 17:04:42 -08:00
Greg Fitzgerald 1edf6c361e
Move Vote program out of the SDK 2019-03-02 16:44:36 -08:00
Sagar Dhawan b99e3eafdd
Fix stakes not being setup correctly 2019-03-02 16:44:36 -08:00
Greg Fitzgerald e6486b2824
Move Budget out of the SDK 2019-03-02 16:44:36 -08:00