Commit Graph

331 Commits

Author SHA1 Message Date
Yueh-Hsuan Chiang 7c49b9c59e
[TieredStorage] Use BufWriter in TieredWritableFile (#261)
#### Problem
TieredWritableFile currently uses File instead of BufWriter.
This will introduce more syscall when doing file writes.

#### Summary of Changes
This PR makes TieredWritableFile uses BufWriter to allow the
write-call to be more optimized to reduce the number of syscalls.

#### Test Plan
Existing tiered-storage test.
Will run experiments to verify its performance improvement.

#### Dependency
https://github.com/anza-xyz/agave/pull/260
2024-03-18 14:27:55 -07:00
Yueh-Hsuan Chiang 6441209682
[TieredStorage] TieredStorageFile -> TieredReadonlyFile and TieredWritableFIle (#260)
#### Problem
TieredStorageFile struct currently offers new_readonly() and new_writable()
to allow both read and write work-load to share the same struct.  However,
as we need the writer to use BufWriter to improve performance as well as
enable Hasher on writes.  There is a need to refactor TieredStorageFile to
split its usage for read-only and writable.

#### Summary of Changes
Refactor TieredStorageFile to TieredReadonlyFIle and TieredWritableFile.

#### Test Plan
Existing tiered-storage tests.
2024-03-18 12:24:19 -07:00
Jeff Washington (jwash) 1fc4e38a4f
add stats for write cache flushing (#233)
* add stats for write cache flushing

* some renames
2024-03-18 09:53:44 -05:00
HaoranYi dcc6f1eb3a
fix typos (#247)
Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-15 09:15:23 -05:00
Yihau Chen 51dc7e6fb7
[anza migration]: add 'agave=info' to default log level (#223) 2024-03-14 20:35:33 +08:00
Jeff Washington (jwash) 794cb2f856
allow FlushStats to accumulate (#215) 2024-03-13 18:47:55 -05:00
Yueh-Hsuan Chiang 69b6d5a376
[TieredStorage] Remove the general-purposed TieredStorageWriter (#196)
#### Problem
tiered_storage/writer.rs was added when we planned to support multiple
tiers in the tiered-storage (i.e., at least hot and cold).  However, as we
changed our plan to handle cold accounts as state-compressed accounts,
we don't need a general purposed tiered-storage writer at this moment.


#### Summary of Changes
Remove tiered_storage/writer.rs as we currently don't have plans to develop cold storage.

#### Test Plan
Existing tiered-storage tests.
2024-03-13 10:26:37 -07:00
Yueh-Hsuan Chiang e13fbeb198
[TieredStorage] Repurpose TieredReadableAccount to HotAccount (#218)
#### Problem
As we further optimize the HotStorageMeta in #146, there is a need
for a HotAccount struct that contains all the hot account information.
Meanwhile, we currently don't have plans to develop a cold account
format at this moment.  As a result, this makes it desirable to repurpose
TieredReadableAccount to HotAccount.

#### Summary of Changes
Repurpose TieredReadableAccount to HotAccount.

#### Test Plan
Existing tiered-storage tests.
2024-03-13 10:07:11 -07:00
Brooks 7020864d6c
Adds a new bench for accounts delta hash (#210) 2024-03-12 14:25:47 -04:00
Brooks 88f6a7a459
Removes holding storages in AccountsHashVerifier for fastboot (#120) 2024-03-11 17:09:26 -04:00
Brooks 1a085c8d46
Removes atomic-ness from AccountStorageEntry `id` and `slot` fields (#119) 2024-03-11 17:09:08 -04:00
Brooks 5c1df15e92
Removes the storage recycler (#118) 2024-03-11 15:38:34 -04:00
Jeff Washington (jwash) 158c4e05d5
remove dead code (#176) 2024-03-11 12:21:51 -05:00
Brooks 0e12172ddd
Moves accounts benches into accounts-db crate (#164) 2024-03-11 11:34:08 -04:00
HaoranYi 1ac523c121
Move delta hash test function to dev-context-utils (#151)
move delta hash test function to dev-context-utils

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2024-03-08 12:14:40 -06:00
Yueh-Hsuan Chiang 0bf9ec861a
[TieredStorage] Deprecate the use of account-hash in HotStorage (#93)
#### Problem
TieredStorage stores account hash as an optional field inside its HotStorage.
However, the field isn't used and we have already decided to deprecate
the account hash.

#### Summary of Changes
Remove account-hash from the tiered-storage.

#### Test Plan
Existing tiered-storage tests.
Running validators w/ tiered-storage in mainnet-beta w/o storing account-hash.
2024-03-06 18:51:50 -08:00
Justin Starry 9cc55349f7
Refactor transaction account unlocking (#103)
refactor: unlock accounts
2024-03-07 09:52:23 +08:00
Brooks 1e133bc067
Increases account hash's stack buffer to hold 200 bytes of data (#56) 2024-03-05 12:02:47 -05:00
Brooks 93f5b514fa
Adds StartingSnapshotStorages to AccountsHashVerifier (#58) 2024-03-04 16:32:51 -05:00
Brooks 570d1a9197
Adds a bench for hash_account() (#47) 2024-03-04 13:59:35 -05:00
Yueh-Hsuan Chiang 608329b974
[TieredStorage] rent_epoch() returns 0 for zero-lamport accounts (#35344)
#### Problem
In TieredAccountMeta, RENT_EXEMPT_RENT_EPOCH will be used when
its optional field rent_epoch is None.  However, for legacy reasons, 0
should be used for zero-lamport accounts.

#### Summary of Changes
Return 0 for TieredAccountMeta::rent_epoch() for zero-lamport accounts.

#### Test Plan
accounts_db::tests::test_clean_zero_lamport_and_dead_slot
2024-03-01 15:18:12 -08:00
Brooks 564a9f78a0
Casts executable bool to integer when computing account hash (#35373) 2024-03-01 14:28:28 -05:00
Brooks 59ed049dc5
Gives back 8 bytes to stack buffer for account data when hashing (#35374) 2024-03-01 14:27:48 -05:00
Brooks 83de6a5930
Moves in_mem_accounts_index.rs into accounts_index directory (#35360) 2024-02-29 06:51:18 -05:00
Brooks 9146236f02
Removes ouroboros dependency (#35355) 2024-02-28 17:58:14 -05:00
Brooks 2e10b3b64f
Removes InMemAccountsIndex::get() (#35354) 2024-02-28 17:57:55 -05:00
Brooks 140c21f8a9
Removes ReadAccountMapEntry (#35351) 2024-02-28 16:08:00 -05:00
Brooks 6aaaf858c9
Adds more info to panic message in AccountsHashVerifier (#35353) 2024-02-28 15:55:05 -05:00
Brooks 7c48cbb7aa
Replaces InMemAccountsIndex::get() with AccountsIndex::get_cloned() (#35352) 2024-02-28 14:45:08 -05:00
Brooks 6402198902
Replaces ReadAccountMapEntry in calculate_accounts_hash_from_index() (#35349) 2024-02-28 14:38:19 -05:00
Brooks f340c1c181
Replaces ReadAccountMapEntry in do_scan_secondary_index() (#35219) 2024-02-28 11:43:33 -05:00
Brooks a4e1a9ac98
Adds AccountsIndex::get_account_info_with_and_then() (#35336) 2024-02-27 20:01:29 -05:00
Brooks da088681ba
Adds safer alternatives to get_internal() (#35325) 2024-02-27 18:08:25 -05:00
Brooks bf2e8ee32f
AccountsIndex::get_cloned() *must* add entry to in-mem cache (#35322) 2024-02-26 18:20:21 -05:00
Brooks 8143fc3f4a
Replaces ReadAccountMapEntry in read_index_for_accessor_or_load_slow() (#35220) 2024-02-26 14:19:18 -05:00
Brooks 8235feefc4
Removes get_for_tests() (#35311) 2024-02-26 14:17:33 -05:00
Brooks 54706a885b
Adds get_with_and_then() to AccountsIndex (#35307) 2024-02-23 18:48:36 -05:00
Brooks 1e47aacd0d
Removes get_account_read_entry() (#35309) 2024-02-23 22:25:30 +00:00
Brooks 58c1b7aefb
Replaces ReadAccountMapEntry in more tests (#35308) 2024-02-23 21:20:42 +00:00
Brooks 923cac8d7f
Replaces ReadAccountMapEntry in exhaustively_verify_refcounts() (#35243) 2024-02-23 11:13:57 -05:00
Brooks b5ffc24a38
Replaces ReadAccountMapEntry in retry_to_get_account_accessor() (#35244) 2024-02-23 11:12:24 -05:00
Brooks db2071a225
Removes get_account_read_entry_with_lock() (#35240) 2024-02-21 11:25:38 -05:00
Dmitri Makarov 0acee67891
SVM: move transaction_results from accounts-db to SVM (#35183)
SVM: Remove accounts-db deps in accounts_loader tests
2024-02-20 12:54:56 -08:00
Brooks 0b5cc03aa3
Replaces ReadAccountMapEntry in ancient append vecs (#35238) 2024-02-20 13:52:11 -05:00
Brooks ce72c22b3a
Replaces ReadAccountMapEntry in accounts index (#35239) 2024-02-20 13:51:54 -05:00
Brooks 2ec136a1ea
Adds get_and_then() & family to AccountsIndex (#35218) 2024-02-19 10:22:00 -05:00
Yueh-Hsuan Chiang 69345899f3
[TieredStorage] Make TieredStorage::write_accounts() thread-safe (#35143)
#### Problem
While accounts-db might not invoke appends_account twice
for the same AccountsFile, TieredStorage::write_accounts()
itself isn't thread-safe, and it depends on the above accounts-db
assumption.

#### Summary of Changes
This PR makes TieredStorage::write_accounts() thread-safe.
So only the first thread that successfully updates the already_written
flag can proceed and write the input accounts.  All subsequent
calls to write_accounts() will be a no-op and return AttemptToUpdateReadOnly
Error.
2024-02-17 16:10:58 -08:00
Yueh-Hsuan Chiang cb61ce435e
[TieredStorage] Put commonly used test functions into test_utils.rs (#35065)
#### Problem
There're some test functions that have been used in different
mod in TieredStorage.  It's better to have one same place for
all tiere-storage related test functions.

#### Summary of Changes
Created test_utils.rs under /tiered_storage and move test-related
functions into it.

#### Test Plan
Existing tests.
2024-02-09 16:35:40 -08:00
Brooks b5e903d1d7
Refactors AccountsIndex::get() (#35163) 2024-02-09 18:26:51 -05:00
Dmitri Makarov 245d1c4087
SVM: Move TransactionCheckResult definition from accounts-db to SVM (#35153) 2024-02-08 21:13:00 -05:00