Pankaj Garg
f4287d70bb
Move accounts-db code to its own crate ( #32766 )
2023-08-09 13:03:36 -07:00
behzad nouri
cfb028819a
deprecates Signature::new in favor of Signature::{try_,}from ( #32481 )
2023-07-14 22:51:12 +00:00
steviez
debe794987
Replace improper &Arc<...> with Arc<...> in Bank and Accounts ( #31892 )
...
The callstack updated in this PR passed an &Arc<...> down only to have
the bottom level clone the reference. Thus, we are giving shared
ownership so the reference is a bit redundant and arguably obscures the
intention to clone further down the callstack.
2023-05-31 12:36:44 -05:00
Alexander Meißner
520c647918
Refactor - Merges `BuiltinPrograms` into `LoadedPrograms` ( #31654 )
...
* Merges BuiltinPrograms into LoadedPrograms.
* Prevents built-ins from being pruned.
2023-05-18 22:18:28 +02:00
Jeff Washington (jwash)
122b05b9f5
pass include_slot_in_hash through hash calcs to allow rehashing if hash is not stored ( #31579 )
...
* pass include_slot_in_hash through hash calcs to allow rehashing
* tests use each include_slot_in_hash value
* move include_slot_in_hash
* typo
* reorder struct init
* spelling is hard
2023-05-11 13:23:29 -07:00
Alexander Meißner
ae75c7cb3f
Refactoring - Remove redundant definition of `BuiltinProgram` ( #31429 )
...
* Replaces BuiltinProgram in the program-runtime with the one from solana_rbpf.
* Adjusts the runtimes built-ins to use Arc<LoadedProgram>.
* Adjusts the tests and benchmarks.
2023-05-02 23:01:28 +02:00
Alexander Meißner
e5490b8d09
Refactor - Use builtin function interface from rbpf ( #31221 )
...
* Removes test_program_entry_debug().
* Uses declare_process_instruction!() in all tests and benchmarks.
* Replaces with ProcessInstructionWithContext with solana_rbpf::BuiltInFunction.
2023-04-21 18:08:32 +02: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
Andrew Fitzgerald
f226a34f48
Only need bank reference for update ( #30879 )
2023-03-24 09:48:04 -07:00
Brooks
8325b0f591
Do not use ancestors in get_snapshot_storages ( #30772 )
...
* Do not use ancestors in get_snapshot_storages
* fixup verify_accounts_hash bench
2023-03-17 22:48:47 +00:00
Tao Zhu
17ba051e1f
Revert "add default_cost as mandatory field for Builtin ( #30639 )" ( #30749 )
...
This reverts commit 7b95c8e698
.
2023-03-16 11:21:06 -05:00
Brooks
8be99c1c7d
Verifies incremental accounts hash in verify_accounts_hash_and_lamports ( #30735 )
2023-03-16 09:48:06 -04:00
Brooks
17b48edd7b
Renames types to be consistent with verify_accounts_hash ( #30674 )
2023-03-10 20:02:14 -05:00
Brooks
63623e4df2
Renames fns to verify_accounts_hash ( #30672 )
2023-03-10 18:11:47 -05:00
Tao Zhu
7b95c8e698
add default_cost as mandatory field for Builtin ( #30639 )
...
* add default_cost as mandatory field for Builtin
* updated tests
* set zkp program default to VerifyTransfer CUs
---------
Co-authored-by: Jon Cinque <joncinque@pm.me>
2023-03-10 14:02:24 -06:00
Yueh-Hsuan Chiang
a78ef393bf
Generalize the return value of append_accounts() ( #30571 )
...
#### Problem
The existing append_accounts returns a vector of offsets, which accounts-db
later uses it to infer the storage size of each account. However, such inference
does not apply to the new hot/cold storage format.
#### Summary of Changes
This PR changes the return value of append_accounts() to `Vec<StoredAccountInfo>`,
which includes both offset and storage size information of an account.
2023-03-06 09:52:05 -08:00
Alexander Meißner
38e74325e3
Refactor - Remove `process_instruction` parameter `first_instruction_account` ( #30579 )
...
* Stops using first_instruction_account parameter in bpf_loader.
* Removes first_instruction_account parameter from process_instruction().
2023-03-06 17:37:37 +01:00
Yueh-Hsuan Chiang
33e179905f
getter functions for StoredAccountMeta ( #30447 )
...
This PR makes all the StoredAccountMeta fields pub(crate)
and provides getter functions to access its member fields.
This PR is a preparation step for abstracting out StoredAccountMeta.
2023-02-27 10:03:22 -08:00
Jeff Washington (jwash)
e39626ab14
add second type to accounts index for disk ( #30446 )
2023-02-23 13:05:06 -08:00
Yueh-Hsuan Chiang
ac7e7aa8f0
Move account-meta structs from append_vec.rs to account_meta.rs ( #30443 )
...
#### Problem
As we start supporting new storage formats, those account-meta
structs will be shared by different storage formats and thus need
a new home.
#### Summary of Changes
This PR creates meta.rs under account_storage and moves all the account-meta
structs out from append_vec.rs.
2023-02-22 16:10:34 -08:00
HaoranYi
615d1a8b69
Extract BankHashLamportsVerifyConfig ( #30320 )
...
* refactor BankHashLamportsVerifyConfig
* clippy
* comments
* fix bench
2023-02-15 16:03:50 -06:00
Brooks
bda0c606a1
Renames fn to calculate_accounts_delta_hash() ( #29876 )
2023-01-24 18:55:56 -05:00
behzad nouri
272e667cb2
deprecates Pubkey::new in favor of Pubkey::{,try_}from ( #29805 )
...
The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.
2023-01-21 18:06:27 +00:00
Jeff Washington (jwash)
4a64f6d421
test_utils::create_test_accounts pre-allocates an append vec first ( #29336 )
...
* test_utils::create_test_accounts pre-allocates an append vec first
* remove comment
2022-12-21 09:02:42 -08:00
Jeff Washington (jwash)
b77bef4ee3
write_version -> write_version_obsolete ( #29176 )
2022-12-14 07:43:40 -08:00
Jeff Washington (jwash)
3e649d2aa0
remove add_root(caching_enabled) ( #29245 )
2022-12-13 11:26:28 -08:00
Jeff Washington (jwash)
7034f4cbbe
remove new_with_config_for_benches(caching_enabled) ( #29231 )
2022-12-13 07:19:24 -08:00
behzad nouri
9524c9dbff
patches errors from clippy::uninlined_format_args
...
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Jeff Washington (jwash)
5d88a9b32b
improve perf of storing accounts for shrink/ancient ( #28880 )
...
* improve perf of storing accounts for shrink/ancient
* rename
* phantom data
* update comment
* make impl Borrow<Hash> consistent
* remove unused static
2022-11-22 15:36:57 -08:00
Jeff Washington (jwash)
813f1f993a
remove test only append_account ( #28850 )
2022-11-17 12:26:51 -08:00
Brooks Prumo
4d6653598b
Upgrades to Rust 1.65.0 ( #28741 )
2022-11-09 17:15:03 -05:00
Brooks Prumo
d1ba42180d
clippy for rust 1.65.0 ( #28765 )
2022-11-09 19:39:38 +00:00
Brooks Prumo
e79c1cba03
Renames fn to update_accounts_hash_for_tests() ( #28571 )
2022-10-25 14:03:19 -04:00
Jeff Washington (jwash)
28a89a1d99
remove expected rent collection and rehashing completely ( #28422 )
2022-10-17 07:24:42 -07:00
Jeff Washington (jwash)
435d4aded9
run initial hash calc in background, using background threads ( #28239 )
2022-10-05 19:42:06 -07:00
Jeff Washington (jwash)
cfc124c825
acct idx can no longer use write cache ( #28150 )
2022-09-30 10:55:27 -07:00
behzad nouri
9a57c64f21
patches clippy errors from new rust nightly release ( #27996 )
2022-09-22 22:23:03 +00:00
Jeff Washington (jwash)
1db7da5c32
pass enable_rehashing to verify_bank_hash_and_lamports ( #27827 )
2022-09-17 06:09:06 -07:00
Jeff Washington (jwash)
d242c0fc97
pass 'enable_rehashing' through all accounts hash functions ( #27701 )
2022-09-12 12:18:09 -07:00
Jeff Washington (jwash)
765c628546
use exit signal for acct idx bg threads ( #27483 )
2022-09-12 11:51:12 -07:00
Alexander Meißner
12d2147efa
Adds `IndexOfAccount` type ( #27599 )
...
Adds the type `IndexOfAccount`.
2022-09-06 11:31:40 +02:00
Tao Zhu
8bb039d08d
collect min prioritization fees when replaying sanitized transactions ( #26709 )
...
* Collect blocks' minimum prioritization fees when replaying sanitized transactions
* Limits block min-fee metrics reporting to top 10 writable accounts
* Add service thread to asynchronously update and finalize prioritization fee cache
* Add bench test for prioritization_fee_cache
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-08-31 08:00:55 -05:00
Brooks Prumo
2fd9a4f373
Add clean_accounts_for_tests() ( #27200 )
2022-08-17 18:45:59 -04:00
Brooks Prumo
bc0d01110c
Remove `fn slot_deltas()` from StatusCache ( #26931 )
2022-08-16 06:08:29 -04:00
Justin Starry
69598ed4c0
Refactor: Add `RuntimeConfig` field to Bank ( #26946 )
...
* Refactor: Simplify arguments for bank constructor methods
* Refactor: Add RuntimeConfig to Bank fields
* Arc wrap runtime_config
* Arc wrap all runtime config usages
* Remove Copy trait derivation from RuntimeConfig
* Remove some arc wrapping
2022-08-05 20:49:00 +01:00
Jeff Washington (jwash)
c7462b7a52
ledger tool verify can store debug info on hash calc ( #26837 )
2022-07-29 15:54:56 -05:00
Jeff Washington (jwash)
b582e4ce0f
introduce UpsertReclaim ( #26462 )
2022-07-07 15:40:17 -05:00
Michael Vines
fdb186ba3b
pacify nightly clippy
2022-06-30 21:31:49 -07:00
Brooks Prumo
23c50a2389
Add StatusCache::root_slot_deltas() and use it ( #26170 )
2022-06-23 15:19:06 -05:00
Brooks Prumo
97bd81a32b
Add bench for StatusCache::slot_deltas() ( #26123 )
2022-06-22 07:41:06 -05:00