Commit Graph

143 Commits

Author SHA1 Message Date
Rob Walker 1c1d83bd56
skip syscall_id in hash and delta (#4500)
* skip syscall_id in hash and delta

* add more tests, skip syscalls
2019-05-31 12:26:45 -07:00
Sathish 182096dc1a
Create bank snapshots (#4244)
* Revert "Revert "Create bank snapshots (#3671)" (#4243)"

This reverts commit 81fa69d347.

* keep saved and unsaved copies of status cache

* fix format check

* bench for status cache serialize

* misc cleanup

* remove appendvec storage on purge

* fix accounts restore

* cleanup

* Pass snapshot path as args

* Fix clippy
2019-05-30 21:31:35 -07:00
Michael Vines 9843c3a5cb Restrict transaction fee payers to system accounts (#4198)
automerge
2019-05-24 13:06:55 -07:00
Michael Vines 9784bbf154 Pay for storage transactions with a system account (#4423)
automerge
2019-05-24 11:04:05 -07:00
Tyera Eulberg 943cd0a24a
Add credit-only info to AccountMetadata (#4405)
* Add credit-only flag to AccountMeta, default to false

* Sort keys by is_credit_only within signed/unsigned groupings

* Process and de-dupe program keys along with other account keys

* Add message helper functions

* Fix test

* Improve comment

* s/is_credit_only/is_debitable

* Add InstructionKeys helper struct, and simplify program_position method
2019-05-23 18:19:53 -04:00
Tyera Eulberg 99d2428041
Transaction format changes toward Credit-Only accounts (#4386)
* Add num_readonly_accounts slice

* Impl programs in account_keys

* Emulate current account-loading functionality using program-account_keys (breaks exchange_program_api tests)

* Fix test

* Add temporary exchange faucet id

* Update chacha golden

* Split num_credit_only_accounts into separate fields

* Improve readability

* Move message field constants into Message

* Add MessageHeader struct and fixup comments
2019-05-22 18:23:16 -04:00
Pankaj Garg b2ce5dc9f5
Adjust log level for counter metrics (#4323) 2019-05-17 07:00:06 -07:00
Greg Fitzgerald fff1631a8b
Return a better error when a program account isn't found (#4310) 2019-05-16 11:32:27 -06:00
carllin 7501ed65e5
Initialize and Update EpochSlots in RepairService (#4255)
* Initialize EpochSlots in RepairService

* Fix flaky test
2019-05-13 15:37:50 -07:00
Jack May f567877d1d
Cleanup metrics (#4230) 2019-05-10 08:33:58 -07:00
Rob Walker 81fa69d347
Revert "Create bank snapshots (#3671)" (#4243)
This reverts commit abf2b300da.
2019-05-09 19:27:27 -07:00
Sathish abf2b300da Create bank snapshots (#3671)
* Be able to create bank snapshots

* fix clippy

* load snapshot on start

* regenerate account index from the storage

* Remove rc feature dependency

* cleanup

* save snapshot for slot 0
2019-05-09 19:27:06 -07:00
carllin 69eeb7cf08
Fix parent record locks usage in child banks (#4159)
* Introduce record locks on txs that will be recorded

* Add tests for LockedAccountsResults

* Fix broken bench

* Exit process_entries on detecting conflicting locks within same entry
2019-05-07 15:51:35 -07:00
Tyera Eulberg 71f9b44687
Add Confirmations parameter to RPC Subscriptions (#4154)
* Add optional depth parameter to pubsub, and store in subscriptions

* Pass bank_forks into rpc_subscription; add method to check depth before notify and impl for account subscriptions

* Impl check-depth for signature subscriptions

* Impl check-depth for program subscriptions

* Plumb fork id through accounts

* Use fork id and root to prevent repeated account notifications; also s/Depth/Confirmations

* Write tests in terms of bank_forks

* Fixup accounts tests

* Add pubsub-confirmations tests

* Update pubsub documentation
2019-05-06 08:31:50 -06:00
Rob Walker 5406d82d89
fix race in get_exclusive_storage() and load() (#3941)
* Revert "Revert "account storage is not in sync with the index after gc (#3914)" (#3936)"

This reverts commit 4f47fc00bc.

* fix get_exclusive_storage

* clippy
2019-04-23 09:56:36 -07:00
Pankaj Garg 4f47fc00bc
Revert "account storage is not in sync with the index after gc (#3914)" (#3936)
This reverts commit 101d6b92ee.
2019-04-22 17:14:41 -07:00
anatoly yakovenko 101d6b92ee
account storage is not in sync with the index after gc (#3914)
* account storage is not in sync with the index after gc

* builds

* clippy fmt

* test

* purge dead forks on store

* rm println

* also fixed count_stores

* comments
2019-04-20 20:50:50 -05:00
carllin 083090817a
Fix DuplicateSignatures caused by races on frozen banks (#3819)
* Duplicate parent account locks into children in new_from_parent, check parent locks in lock_account()
2019-04-17 13:45:33 -07:00
anatoly yakovenko f73d38739a
Split AccountsDB from Accounts (#3808)
Split AccountsDB from Accounts
2019-04-16 13:32:22 -07:00
anatoly yakovenko 0ff2bfdd0c
Fewer unsafe hacks for AppendVec (#3801)
* storage account changes

* cleanup

* checks

* comments

* clippy

* tests

* woot!

* comments

* benches
2019-04-16 08:50:05 -07:00
anatoly yakovenko 68fc303b9b
Rework Accounts for fast squash, hashing state and checkpoint recovery. (#3613)
* accounts rewrite

* ignore grow tests

* skip duplicate roots

* allow for a root race

* logger

* accounts_index tests

* tests

* tests
2019-04-15 17:15:50 -07:00
Greg Fitzgerald 80f3568062
Upgrade to Rust 1.34.0 (#3781)
* Upgrade to Rust 1.34.0

* Remove redundant closures

Thanks Clippy!
2019-04-15 15:56:08 -06:00
anatoly yakovenko 8b08fe265a
AppendVec PR with using "/tmp" as the default directory and a random file (#3743)
* AppendVec with raw pointers
* fixed test target directory
2019-04-12 04:30:17 -07:00
Greg Fitzgerald 485013b7ce Revert "AppendVecs that can return references and read/append without locks (#3713)"
This reverts commit f669ae5868.
2019-04-11 14:47:30 -07:00
anatoly yakovenko f669ae5868
AppendVecs that can return references and read/append without locks (#3713)
* AppendVec with raw pointers

* appendvecs

* imports

* review

* review comments

* clippy
2019-04-11 13:16:56 -07:00
Sathish 7b2abf2087 Update count for the right store (#3683) 2019-04-09 13:48:13 -07:00
Rob Walker a5b5248a09
move vote_accounts up (#3647) 2019-04-05 14:23:00 -07:00
Rob Walker 9f046a023e
move transaction_count up (#3618)
* move transaction_count up

* fixup
2019-04-05 10:42:25 -07:00
Greg Fitzgerald 46e6911ec1 Add get_signature_status() to SyncClient
And move bank::Result to transaction module.
2019-04-05 10:22:05 -07:00
Greg Fitzgerald 4c0bc1fd88 Add program_ids() methods
Added CompiledInstruction::program_id() so that we don't need to pass
around instruction indexes just for Message::program_id().

Also added Message.program_ids() that returns a slice so that we
can move those pubkeys into Message::account_keys.
2019-04-02 19:00:35 -06:00
Greg Fitzgerald a0041cec97 Rename Runtime to MessageProcessor 2019-04-02 12:49:26 -06:00
Sathish Ambley 3152090a66 update with review comments 2019-04-01 15:54:53 -06:00
Sathish Ambley f853c39169 remove unused member 2019-04-01 15:54:53 -06:00
Sathish Ambley 75ad1305c0 Cache vote accounts and optimize squash 2019-04-01 15:54:53 -06:00
Greg Fitzgerald fcef54d062 Add a constructor to generate random pubkeys 2019-03-31 16:23:18 -06:00
Greg Fitzgerald 5646daa820 Delete lots of fee parameters
So many zeros!
2019-03-29 19:21:51 -06:00
Greg Fitzgerald 7896e8288d Replace Transaction::fee with a FeeCalculator 2019-03-29 19:21:51 -06:00
Greg Fitzgerald 31f8b6d352 Integrate Message into Transaction 2019-03-29 13:03:29 -07:00
Stephen Akridge 0482f153d0 Lower a bunch of debug
Can't afford to be printing on every transaction error, it will slow
the system down.
2019-03-28 12:24:47 -07:00
Jack May 92e1c4c531
Report which account is in use (#3539) 2019-03-28 08:17:49 -07:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -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
Michael Vines 0dc364c17a Relocate transaction reference verification to join the other validity checks 2019-03-20 07:46:01 -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 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 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
Rob Walker 9f916f9d47 remove Option<> wrapper for accounts 2019-03-12 15:03:26 -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
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
Stephen Akridge 61fbea3ee4 Cleanup AccountStorage apis
Remove duplicate code
2019-03-06 18:30:36 -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
Sagar Dhawan 9349f90a59
Inherit transaction count from parent (#3134) 2019-03-05 12:34:21 -08:00
Tyera Eulberg b4084c6298 Fix random comment typo 2019-03-05 09:33:27 -07: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
Rob Walker e4dba03e12
accounts shedding (#3078)
* accounts shedding

* fixup
2019-03-03 16:04:04 -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
Greg Fitzgerald 1edf6c361e
Move Vote program out of the SDK 2019-03-02 16:44:36 -08:00
Sagar Dhawan d22a13257e
Refactor bank get vote accounts (#3052) 2019-03-02 16:44:36 -08:00
Rob Walker f4c5b9ccb0 remove remove_dir_all() of paths' parents (which we didn't make to begin with) 2019-03-02 12:36:41 -08:00
Michael Vines a94880574b block_hash => blockhash 2019-03-02 12:13:30 -07:00
Michael Vines 258cf21416 Purge remaining last_id (now called block_hash) 2019-03-02 12:13:30 -07:00
Stephen Akridge 16b71a6be0 Cleanup fork id generation
Accounts could end up with id collision depending on how
banks are created, this shouldn't happen.
2019-03-02 10:34:41 -08:00
Stephen Akridge 4ee857ab7d More vote account fixes
vote_index not being maintained correctly during a squash.
The tokens==0 shielding accounts were being inserted with
owner=default Pubkey so they didn't know they are vote accounts
and should update the vote accounts set.
2019-03-01 16:25:14 -08:00
Sagar Dhawan 20e4edec61
Refactor Vote Program Account setup (#2992) 2019-02-28 17:08:45 -08:00
Stephen Akridge 1c44b738fe Fix vote_accounts test 2019-02-28 15:22:47 -08:00
Sathish Ambley 0f2226901d Fix transaction count after squash 2019-02-27 23:21:49 -08:00
Rob Walker d23f8a3e99
increase accounts coverage (#2993) 2019-02-27 21:42:14 -08:00
Michael Vines 0dc5af62ff Standardize on 'use log::*' for easy access to all log level macros 2019-02-27 21:16:23 -08:00
Rob Walker 7fd40f1eb9
add failing test for #2994 (#2995) 2019-02-27 20:46:26 -08:00
Rob Walker 163874d4da
remove `purge` parameter to accounts (#2990) 2019-02-27 16:06:06 -08:00
Sathish Ambley ca0f16ccc0 Fix test failure 2019-02-27 08:22:52 -08:00
Stephen Akridge c241a56fb0 Remove extraneous print. 2019-02-27 08:22:52 -08:00
Sathish Ambley 4149f7fd1c Fix review comments 2019-02-27 08:22:52 -08:00
Sathish Ambley 96b349dcbb Performance optimizations 2019-02-27 08:22:52 -08:00
Stephen Akridge 5216952691 Change benchmark path to target/ or OUT_DIR
Also reduce some code duplication with cleanup_dirs fn.
2019-02-27 08:22:52 -08:00
Sathish Ambley c46b2541fe - Fix lock/unlock of accounts
- Fix format check warnings
2019-02-27 08:22:52 -08:00
Stephen Akridge 2158ba5863 tx count per fork 2019-02-27 08:22:52 -08:00
Stephen Akridge 180d297df8 Rebase and panic with no accounts
Add Accounts::has_accounts function for hash_internal_state calculation.
2019-02-27 08:22:52 -08:00
Sathish Ambley c276375a0e Persistent account storage across directories 2019-02-27 08:22:52 -08:00
Rob Walker 87281f6ed5
ensure at Accounts level that tokens == 0 means None (#2960) 2019-02-26 13:51:39 -08:00
Rob Walker 25690ff078
merge_parents() => squash() (#2943) 2019-02-25 20:34:05 -08:00
Michael Vines 897279eddb Encapsulate log::Level so counter macro users don't need to use it 2019-02-25 20:01:30 -08:00
Rob Walker f6ff33db8e
* add merge_parents(), which means 'eat your parent' (#2851)
* add is_root(), which is false if the bank has a parent
* use is_root() for store_slow and store_accounts to decide whether to purge on zero balance
2019-02-21 12:08:50 -08:00
Pankaj Garg a33921ed34 address review comments 2019-02-20 08:12:37 -07:00
Pankaj Garg a27cdf55e7 Credit transaction fees to the slot leader 2019-02-20 08:12:37 -07:00
Greg Fitzgerald dde886f058 Move Bank to its own crate
Also:
* counters.rs to solana_metrics
* genesis_block.rs to solana_sdk
2019-02-19 07:17:04 -07:00