Commit Graph

295 Commits

Author SHA1 Message Date
Brooks Prumo
5fb6b341c4 Handle cleaning of zero-lamport accounts w.r.t. Incremental Snapshots (#18870)
* Handle cleaning zero-lamport accounts

Handle cleaning zero-lamport accounts in slots higher than the last full
snapshot slot.  This is part of the Incremental Snapshot work.

Fixes #18825
2021-08-12 15:56:08 -05:00
Jeff Washington (jwash)
651343688d Use option for account index bucket parameter (#19150) 2021-08-10 11:32:25 -05:00
Jeff Washington (jwash)
47e0d9aa95 plumb more accounts_index bins (#19123) 2021-08-10 05:45:46 -05:00
Jeff Washington (jwash)
c7b986220e Accounts::new_with_config_for_tests (#19104) 2021-08-09 09:01:12 -05:00
Jeff Washington (jwash)
f771063275 get rid of Accounts new and default (#19100) 2021-08-06 15:52:27 -05:00
Jeff Washington (jwash)
41f4973f0d accounts default refactoring stragglers (#19097) 2021-08-06 12:36:42 -05:00
Jeff Washington (jwash)
0028442e14 rework defaults and construction of accountsdb, accounts, bank (#19083)
* rework defaults and construction of accountsdb, accounts, bank

* merge issues
2021-08-05 17:27:13 -05:00
Trent Nelson
21bc43ed58 nonce: Unify NonceError with SystemError 2021-07-30 14:47:14 -06:00
Jack May
0167daa116 cleanup feature consistent_recent_blockhashes_sysvar (#18932) 2021-07-28 10:25:33 -07:00
Justin Starry
d166b9856a Move transaction sanitization earlier in the pipeline (#18655)
* Move transaction sanitization earlier in the pipeline

* Renamed HashedTransaction to SanitizedTransaction

* Implement deref for sanitized transaction

* bring back process_transactions test method

* Use sanitized transactions for cost model calculation
2021-07-15 22:51:27 -05:00
Trent Nelson
3a85b77bb5 hijack secp256k1 enablement feature plumbing for libsecp256k1 upgrade 2021-07-15 18:43:55 +00:00
Trent Nelson
568660b402 Revert "Remove feature switch for secp256k1 program (#18467)"
This reverts commit fd574dcb3b.
2021-07-15 18:43:55 +00:00
Justin Starry
e806d31224 Optimize Message::is_non_loader_key method (#18579) 2021-07-12 10:42:22 -05:00
Ryo Onodera
f029af0fca Remove sysvar special cases for rent and assign 2021-07-09 09:08:38 -07:00
Justin Starry
fd574dcb3b Remove feature switch for secp256k1 program (#18467)
* Remove feature switch for secp256k1 program

* fix tests
2021-07-09 10:08:03 -05:00
Justin Starry
100fabf469 Remove feature switch for demoting sysvar write locks (#18373) 2021-07-06 21:22:22 +00:00
Justin Starry
6319e8811a Improve account unlock performance (#18442)
* Improve account unlock performance

* fix clippy
2021-07-06 14:11:54 -05:00
Alexander Meißner
7462c27d07 Refactoring: Unify account_deps and accounts (#17898)
* Changes ThisInvokeContext::get_account() to use accounts instead of pre_accounts.

* Adds explicit keys to accounts to make them symmetric to account_deps.

* Appends account_deps to accounts in transaction loading and removes account_deps everywhere else.
2021-07-05 13:49:37 +02:00
Alexander Meißner
6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Jeff Washington (jwash)
f558b9b6bf verify bank hash on startup with ledger tool option (#17939) 2021-06-15 11:52:12 -05:00
carllin
ccc013e134 Handle removing slots during account scans (#17471) 2021-06-14 21:04:01 -07:00
Jeff Washington (jwash)
d4cc975fe9 calculate_capitalization uses hash calculation (#17443)
* calculate_capitalization uses hash calculation

* feedback

* remove debugging code, clean up slot math
2021-06-14 08:53:07 -05:00
Lijun Wang
269d995832 Make account shrink configurable #17544 (#17778)
1. Added both options for measuring space usage using total accounts usage and for individual store shrink ratio using an enum. Validator CLI options: --accounts-shrink-optimize-total-space and --accounts-shrink-ratio
2. Added code for selecting candidates based on total usage in a separate function select_candidates_by_total_usage
3. Added unit tests for the new functions added
4. The default implementations is kept at 0.8 shrink ratio with --accounts-shrink-optimize-total-space set to true

Fixes #17544
2021-06-09 21:21:32 -07:00
Michael Vines
9541411c15 Plumb transaction-level rewards (aka "rent debits") into the getTransaction RPC method 2021-05-27 03:05:05 +00:00
Trent Nelson
97eab7edf9 runtime: add rent debit charges to block metadata 2021-05-26 08:19:10 +00:00
carllin
d8bc56fa51 Refactor purge_slots_from_cache_and_store() and handle_reclaims() (#17319) 2021-05-24 13:51:17 -07:00
Jeff Washington (jwash)
44831c18d2 reuse work in is_non_loader_key (#16521) 2021-05-21 10:07:04 -05:00
Jeff Washington (jwash)
0486df02ba don't limit to thread pool when cleaning on startup (#17317) 2021-05-20 14:36:35 -05:00
Jeff Washington (jwash)
ed9cbd50f0 move Ancestors to its own module (#17316) 2021-05-19 11:50:34 -05:00
Tao Zhu
0781fe1b4f Upgrade Rust to 1.52.0 (#17096)
* Upgrade Rust to 1.52.0
update nightly_version to newly pushed docker image
fix clippy lint errors
1.52 comes with grcov 0.8.0, include this version to script

* upgrade to Rust 1.52.1

* disabling Serum from downstream projects until it is upgraded to Rust 1.52.1
2021-05-19 09:31:47 -05:00
Tyera Eulberg
27004f1b76 Return error for excluded secondary-index keys (#17193)
* Add runtime helpers to check secondary indexes for key

* Add custom rpc error

* Check secondary-index key inclusion in rpc

* Clone complete AccountSecondaryIndexes into rpc to avoid bank query
2021-05-13 21:04:21 +00:00
Jeff Washington (jwash)
7d96f78821 include/exclude keys on account secondary index (#17110)
* AccountSecondaryIndexes.include/exclude

* use normal scan if key is not indexed

* add a test to ask for a scan for an excluded secondary index

* fix up cli args
2021-05-11 22:06:22 +00:00
Jeff Washington (jwash)
f39dda00e0 type AccountSecondaryIndexes = HashSet (#17108) 2021-05-10 14:22:48 +00:00
Jeff Washington (jwash)
541aa5ad85 tests: lamports -> lamports() (#16982) 2021-05-03 10:45:54 -05:00
Jeff Washington (jwash)
6f88aeac56 tests: .lamports= -> .set_lamports() (#16977)
* .lamports= -> .set_lamports()

* another

* fix

* another
2021-04-30 18:44:15 +00:00
Jeff Washington (jwash)
c4943f3cb0 checked_sub_lamports (#16932) 2021-04-30 09:56:34 -05:00
Jeff Washington (jwash)
ca7b36ad8f lamports -> lamports() (#16920) 2021-04-29 10:44:46 -05:00
Jeff Washington (jwash)
a7a671b3aa AccountSharedData.set_executable() (#16881) 2021-04-28 14:07:43 +00:00
Jeff Washington (jwash)
da3342759b private AccountSharedData.rent_epoch (#16877) 2021-04-28 08:52:20 -05:00
Jeff Washington (jwash)
1bd623cd15 private AccountSharedData.rent_epoch (#16844) 2021-04-27 13:51:13 -05:00
Jeff Washington (jwash)
998cba74b5 AccountSharedData.executable() (#16835) 2021-04-27 09:12:17 -05:00
Jeff Washington (jwash)
603872685d private AccountSharedData.owner (#16760)
* private AccountSharedData.owner

* fix perf test
2021-04-26 14:59:17 -05:00
Jeff Washington (jwash)
f2ab0384e4 owner -> owner() (#16783) 2021-04-26 17:06:40 +00:00
Jeff Washington (jwash)
ca14c18998 owner -> owner() (#16782) 2021-04-23 22:49:47 +00:00
Jeff Washington (jwash)
5591cd6ef3 .owner -> .owner() (#16757)
* .owner -> .get_owner()

* use
2021-04-23 09:35:09 -05:00
Jeff Washington (jwash)
6c5b7ecf90 account.owner = X -> account.set_owner(X) (#16756) 2021-04-23 09:34:28 -05:00
Jeff Washington (jwash)
fc12841d95 Readonlyaccounts (#16743)
* lamports -> lamports()

* format
2021-04-22 20:04:55 +00:00
carllin
d747614b27 Account for possibility of cache flush in load() (#15454)
* Account for possibility of cache flush in load()

* More cleaning

* More cleaning

* Remove unused method and some comment cleaning

* Fix typo

* Make the detected impossible purge race panic()!

* Finally revert to original .expect()

* Fix typos...

* Add assertion for max_root for easier reasoning

* Reframe races with LoadHint as possible opt.

* Fix test

* Make race bug tests run longer for less flaky

* Delay the clone-in-lock slow path even for RPC

* Make get_account panic-free & add its onchain ver.

* Fix rebase conflicts...

* Clean up

* Clean up comment

* Revert fn name change

* Fix flaky test...

* fmt...

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2021-04-17 00:23:32 +09:00
Justin Starry
85eb37fab0 Merge pull request from GHSA-8v47-8c53-wwrc
* Track transaction check time separately from account loads

* banking packet process metrics

* Remove signature clone in status cache lookup

* Reduce allocations when converting packets to transactions

* Add blake3 hash of transaction messages in status cache

* Bug fixes

* fix tests and run fmt

* Address feedback

* fix simd tx entry verification

* Fix rebase

* Feedback

* clean up

* Add tests

* Remove feature switch and fall back to signature check

* Bump programs/bpf Cargo.lock

* clippy

* nudge benches

* Bump `BankSlotDelta` frozen ABI hash`

* Add blake3 to sdk/programs/Cargo.lock

* nudge bpf tests

* short circuit status cache checks

Co-authored-by: Trent Nelson <trent@solana.com>
2021-04-13 00:28:08 -06:00
steviez
e69f37a464 Remove old function: account_balance_for_capitalization (#16383)
This function currently returns one of its' parameters and is thus useless.
2021-04-07 23:57:40 -05:00