Commit Graph

3976 Commits

Author SHA1 Message Date
Jeff Washington (jwash) 318f981274
add `is_recyclable` to `AccountsFile` (#31257) 2023-04-19 11:36:44 -07:00
Jeff Washington (jwash) 9124d1f35d
rework assert_no_shrink_in_progress to get assert stack easily (#31251) 2023-04-19 11:36:24 -07:00
Jeff Washington (jwash) 812d899c7f
add lifetimes to refs in ReadableAccount (#31258) 2023-04-19 11:35:59 -07:00
Xiang Zhu a5275f8839
Remove bank_snapshots_dir param (#31249)
* Remove bank_snapshots_dir param

* Remove outdated comment

* Revert "Remove outdated comment"

This reverts commit e4441432bec57edb0dc22c4bacf4d48ce26ed818.

* Handle parent() error

* Fix format error
2023-04-19 09:37:46 -07:00
Brooks ca1bde3591
Use Arc instead of &Arc in AccountsBackgroundService::new (#31268) 2023-04-19 11:10:41 -04:00
Alexander Meißner 8162358b8b
Refactor - Moves the system program into its own crate (#31244)
* Moves the system program into its own crate in "programs/system".

* Moves bank tests back into the runtime to resolve cyclic dependency.
2023-04-19 12:58:08 +02:00
bji a45710838d
Add new vote state version that replaces Lockout with LandedVote to a… (#30831)
Add new vote state version that replaces Lockout with LandedVote to allow vote latency to be tracked in a future change.

Includes a feature to be enabled which will when enabled cause the vote state to be written in the new form.
2023-04-18 20:27:38 -07:00
Trent Nelson f34a6bcfce
runtime: transpose `VoteAccount::vote_state()` return to improve ergonomics (#31256) 2023-04-18 14:48:52 -06:00
Jeff Washington (jwash) ad30a60059
update stats for packed ancient (#31255) 2023-04-18 13:33:02 -07:00
Jeff Washington (jwash) fb4b5c4fb8
add comment (#31252) 2023-04-18 13:13:57 -07:00
Jeff Washington (jwash) 30b62c0e1e
remove unused metrics (#31250)
pack ancient: add test for addref_accounts_failed_to_shrink_ancient
2023-04-18 12:29:37 -07:00
Brennan 2164a50d00
Move BankIncrementalSnapshotPersistence (#31236)
* Move BankIncrementalSnapshotPersistence

* Update bank serialize ABI digest
2023-04-18 11:18:17 -07:00
Brennan f5fe2607b6
Make VerifyAccountsHashConfig private (#31235) 2023-04-18 07:31:23 -07:00
Jeff Washington (jwash) 3cf4ffc88d
pack ancient: add test for addref_accounts_failed_to_shrink_ancient (#31228) 2023-04-17 20:05:59 -07:00
Xiang Zhu e74bc4e2e7
Add a filter_by_type param for purge_old_bank_snapshots (#31191)
* Add a type_select param for purge_old_bank_snapshots

* Use flags to make the function calls more readable

* Remove the extra purge calls

* replace select_type with filter_by_type

* Add test

* Use matches

* Fix CI test on reference

* use match and call do_purge once

* Let bank_snapshots_dir be TempDir

* remove account_paths in the test

* replace bank with _bank

* Remove create_snapshot_dirs_for_tests, will take the lastest from master

* Fix merge errors
2023-04-17 16:16:41 -07:00
Xiang Zhu 667fad6da7
Refactor the common test snapshot dirs creation code (#31223)
* Create fn create_snapshot_dirs_for_tests to refactor the common test snapshot dirs creation code

* Fix trailing space

* Fix missed set_accounts_delta_hash
2023-04-17 14:14:01 -07:00
Jeff Washington (jwash) 3d6d34ebd0
packed ancient: add revisit_accounts_with_many_refs (#31209) 2023-04-17 13:52:26 -07:00
Xiang Zhu f066ea9f71
Define bank_snapshots_dir as tmpdir (#31216)
* Let bank_snapshots_dir be TempDir

* Same change in test_bank_from_latest_snapshot_dir

* Use borrow to avoid releasing the tmp dir

* One more to change to reference
2023-04-17 08:07:24 -07:00
Jeff Washington (jwash) 8fccbadbc3
ancient append vecs: better application of offset (#31208)
* ancient append vecs: better application of offset

* fix subtle bug in get_oldest_slot_within_one_epoch_prior

* add tests
2023-04-17 06:50:32 -07:00
Jeff Washington (jwash) a8134b8e73
packed ancient: addref when pack operation fails (#31211) 2023-04-16 12:24:25 -07:00
Jeff Washington (jwash) 09bcf59003
packed ancient: shrink_collect accounts in parallel (#31212) 2023-04-16 12:23:11 -07:00
Xiang Zhu 5747290d51
Move reference-holding last_snapshot_storages from ABS to AHV (#31175)
* Let AHV hold and update last_snapshot_storages

* Clean up comment

* Move cloning after enqueued_time

* Minor positon change

* Remove  type last_snapshot_storages annotation
2023-04-14 14:38:44 -07:00
Jeff Washington (jwash) c008a557c5
packed ancient: parallel write to append vecs (#31144) 2023-04-14 13:57:46 -07:00
Brennan 93d0d25d77
Move rent debit out of bank (#31204)
* Move rent debit out of bank

* Clean up imports and visibility

* Fix imports

* rename public mod rent_debits
2023-04-14 19:41:10 +00:00
Andrew Fitzgerald 8fe28c3798
RootBankCache: only cache weak reference to avoid keeping a bank alive (#31189) 2023-04-14 11:33:18 -07:00
Alexander Meißner 8eb31f6cfd
Refactor - Syscalls in RBPF CLI (#31109)
* Makes members of SyscallContext public.
Removes check_aligned and check_size from SyscallContext.

* Replaces InvokeContext::set_syscall_context() in tests with mock_create_vm!().

* Passes SyscallContext directly to InvokeContext::set_syscall_context().

* Merges TraceLogStackFrame into SyscallContext.

* Removes the create_vm!() macro.

* Moves BpfAllocator from bpf_loader into program_runtime.

* Frees BpfAllocator from Rc<RefCell<>>.

* Removes unused code from BpfAllocator.

* Consume CUs for heap before doing the allocation.

* Exposes syscalls in rbpf-cli.

* Adds debugging_features parameter to load_program_from_bytes() and load_program_from_account().

* Removes test_bpf_loader_non_terminating_program() as that is already tested in RBPF.

* Moves stack and heap allocation back onto the program runtime stack.
2023-04-14 15:20:08 +02:00
Brooks d43e19bb03
Refactors the Full/Incremental SnapshotHash types (#31186) 2023-04-13 18:01:27 -04:00
Xiang Zhu 9f53c42339
bank_from_latest_snapshot_dir (#31115)
* bank_from_latest_snapshot_dir

* Clear the account paths before constructing a bank from a snapshot dir

* Clear the account paths before constructing a bank from a snapshot dir (#31170)

* use the highest POST snapshot dir to construct a bank

* Use POST to fix test_bank_from_latest_snapshot_dir

* Revert "Clear the account paths before constructing a bank from a snapshot dir"

This reverts commit 272bb9fee14a09d7fde3cddb3d439f2cdadb5493.

* Remove the set_accounts_hash_for_tests call

* Revert "Revert "Clear the account paths before constructing a bank from a snapshot dir""

This reverts commit 2e345d8b98b8fb3b07f00ce050132c678acf88d4.
2023-04-13 12:44:56 -07:00
Brooks 1f67591e21
Removes `base` from `IncrementalSnapshotHash` (#31185) 2023-04-13 17:35:35 +00:00
Xiang Zhu 78d061a3d3
Clear the account paths before constructing a bank from a snapshot dir (#31170) 2023-04-12 16:03:19 -07:00
HaoranYi 1db0683a50
Refactor reward payout code - part 4 (#31159)
extract redeem_reward fn
2023-04-12 10:20:21 -05:00
HaoranYi f2e3a0d821
Refactor reward payout code - part 3 (#31157)
extract calculate points fn
2023-04-12 09:36:23 -05:00
HaoranYi 9e14cdc19f
Refactor reward payout code - part 2 (#31156)
* extract load_vote_stake_accounts fn

* rename
2023-04-12 08:40:08 -05:00
Xiang Zhu 31784b2ecc
Add remove_incomplete_bank_snapshot_dir (#31131)
* Add remove_incomplete_bank_snapshot_dir

* Remove incomplete snapshot dir if incomplete

* Revert "Add remove_incomplete_bank_snapshot_dir"

This reverts commit aaafef74803ca4e2050b8cd83ef352c5a59509b4.

* Replace metadata's is_file with simple PathBuf's is_file

* In test verify the deletion of the incomplete snapshot dir

* Add comments to explain the snapshot dir cleanup
2023-04-11 17:56:26 -07:00
HaoranYi 20d1615ccd
Refactor reward payout code - part 1 (#31155)
type alias
2023-04-11 16:23:52 -05:00
Tao Zhu 5816d33b57
Add test for transaction has too high prioritization fee (#31097)
* Add test for transaction has too high prioritization fee than payer account balance
2023-04-11 16:22:19 -05:00
Pankaj Garg 12e3e8b467
Add provisions to unload a program from the cache (#31036) 2023-04-10 16:42:05 -07:00
HaoranYi e12c250cf5
Extract new_epoch processing out of new_bank (#31127)
* extract new epoch processing out of new_bank

* review feedbacks

* remove epoch_schedule param

* use RewardCalcTracer
2023-04-10 16:10:45 -05:00
Jeff Washington (jwash) d63359a3ff
disk index: batch insert (#31094) 2023-04-10 11:08:54 -07:00
Andrew Fitzgerald 15011eaa5a
separate check_transaction_age from check_age (#30994) 2023-04-07 09:04:03 -07:00
Alexander Meißner 0cd57addcf
Cleanup - mock_process_instruction() (#31088)
* Uses declare_process_instruction!() in all tests.

* Adds post_adjustments to mock_process_instruction().
Removes "solana_sbf_rust_external_spend" from assert_instruction_count() as it panics.
2023-04-07 12:53:19 +02:00
Jeff Washington (jwash) 6dc18fe241
fix cli arg for ancient append vecs (#31066) 2023-04-06 12:03:31 -07:00
HaoranYi 684901879d
Refactor squash timing report (#31041)
* typo

* refactor squash timing report

* address review comments
2023-04-05 08:53:49 -05:00
Alexander Meißner 24a87f33a8
Refactor - Cleanup error handling in program runtime (#30693)
* Moves stable_log::program_invoke(), stable_log::program_success() and stable_log::program_failure() calls from bpf_loader into InvokeContext::process_executable_chain().

* Turns result of ProcessInstructionWithContext from InstructionError into Box<dyn std::error::Error>.

* Bump to solana_rbpf v0.3.0

* Removes Result from return type of EbpfVm::new().

* Turns EbpfError into Box<dyn std::error::Error>.

* Removes BpfError.

* Removes SyscallError::InstructionError.

* Adds a type alias for Box<dyn std::error::Error> in syscalls.
2023-04-05 15:50:34 +02:00
Xiang Zhu fac76715e9
bank_from_snapshot_dir returns BankFromDirTimings (#31051) 2023-04-04 17:10:56 -07:00
Jeff Washington (jwash) aa3e0b9c20
disk index: add stat: disk_index_failed_resizes (#31039) 2023-04-04 09:39:06 -07:00
Jeff Washington (jwash) bc343a431c
disk index: set_anticipated_count to optimally grow disk buckets at startup (#31033)
* disk index: set_anticipated_count to optimally grow disk buckets at startup

* remove atomic
2023-04-03 20:28:50 -07:00
Alexander Meißner a0c7fde90e
Cleanup - mock InvokeContext (#31007)
* Turns with_mock_invoke_context() into a macro.

* Removes prepare_mock_invoke_context().

* Replaces InvokeContext::new_mock() with with_mock_invoke_context().

* Removes InvokeContext::new_mock().

* Removes Cow from InvokeContext::sysvar_cache.

* Removes override parameters from mock_process_instruction().

* cargo fmt
2023-04-03 17:23:24 +02:00
Jeff Washington (jwash) 07f4789257
fix assert (#31012) 2023-04-03 06:40:54 -07:00
Jeff Washington (jwash) 9600643860
reduce contention on startup index generation (#31006) 2023-03-31 12:46:42 -07:00