Commit Graph

9 Commits

Author SHA1 Message Date
Brooks 4e5c545e23
Uses AccountHash in tiered storage (#33763) 2023-10-19 11:52:36 -04:00
Brooks 1045548606
Uses AccountHash in StorableAccountsWithHashesAndWriteVersions (#33751) 2023-10-18 18:58:19 -04:00
Yueh-Hsuan Chiang 94273434ce
[TieredStorage] HotStorageReader::get_account_meta_from_offset() (#33724)
#### Problem
HotStorageReader currently only implements get_footer().  It does not
have a function to obtain the account meta.

#### Summary of Changes
This PR implements HotStorageReader::get_account_meta_from_offset().
A function that returns the account meta located at the specified offset.
This will be the helper function that will be later used to obtain the account
meta when the offset is available from the index block of a hot storage file. 

#### Test Plan
A new test is included in this PR.
2023-10-18 12:27:39 -07:00
Yueh-Hsuan Chiang 0b05e8db11
[TieredStorage] Footer test for HotStorageReader (#33718)
#### Problem
HotStorageReader currently doesn't have a test that covers its footer.

#### Summary of Changes
This PR includes a test for HotStorageReader that verifies the footer.
2023-10-17 15:24:38 -07:00
Brooks bb27bd88d4
Removes write version from tiered storage (#33566) 2023-10-06 16:19:35 -04:00
Alexander Meißner a8be70fa7a
General cleanup (#32980)
* Fixes `cargo::` in build.rs

* Fixes overshadowing reexports.

* Removes unnecessary `as *const u8`.

* Removes unnecessary `.into_iter()`.

* cargo clippy
2023-08-24 21:44:19 +02:00
Jon Cinque 0fe902ced7
Bump rand to 0.8, rand_chacha to 0.3, getrandom to 0.2 (#32871)
* sdk: Add concurrent support for rand 0.7 and 0.8

* Update rand, rand_chacha, and getrandom versions

* Run command to replace `gen_range`

Run `git grep -l gen_range | xargs sed -i'' -e 's/gen_range(\(\S*\), /gen_range(\1../'

* sdk: Fix users of older `gen_range`

* Replace `hash::new_rand` with `hash::new_with_thread_rng`

Run:
```
git grep -l hash::new_rand | xargs sed -i'' -e 's/hash::new_rand([^)]*/hash::new_with_thread_rng(/'
```

* perf: Use `Keypair::new()` instead of `generate`

* Use older rand version in zk-token-sdk

* program-runtime: Inline random key generation

* bloom: Fix clippy warnings in tests

* streamer: Scope rng usage correctly

* perf: Fix clippy warning

* accounts-db: Map to char to generate a random string

* Remove `from_secret_key_bytes`, it's just `keypair_from_seed`

* ledger: Generate keypairs by hand

* ed25519-tests: Use new rand

* runtime: Use new rand in all tests

* gossip: Clean up clippy and inline keypair generators

* core: Inline keypair generation for tests

* Push sbf lockfile change

* sdk: Sort dependencies correctly

* Remove `hash::new_with_thread_rng`, use `Hash::new_unique()`

* Use Keypair::new where chacha isn't used

* sdk: Fix build by marking rand 0.7 optional

* Hardcode secret key length, add static assertion

* Unify `getrandom` crate usage to fix linking errors

* bloom: Fix tests that require a random hash

* Remove some dependencies, try to unify others

* Remove unnecessary uses of rand and rand_core

* Update lockfiles

* Add back some dependencies to reduce rebuilds

* Increase max rebuilds from 14 to 15

* frozen-abi: Remove `getrandom`

* Bump rebuilds to 17

* Remove getrandom from zk-token-proof
2023-08-21 19:11:21 +02:00
Yueh-Hsuan Chiang 66b72a61be
TieredStorage struct (5/N) -- tests for write_accounts (#32850)
#### Problem
Having a PR that is self-contained with a big picture while having it testable
for TieredStorage::write_accounts is challenging, as it requires all the write-side
code, read-side code, and test code.

#### Summary of Changes
This PR solves part of the problem by having one dedicated PR for tests.
Specifically, it includes test utils that allow us to generate test accounts,
invoke write_accounts, and verify the written tiered-storage instance.

With this PR, it will be easier to write future PRs. 

#### Test Plan
A new set of unit-tests and test utils is included in this PR.
2023-08-18 11:29:53 -07:00
Pankaj Garg f4287d70bb
Move accounts-db code to its own crate (#32766) 2023-08-09 13:03:36 -07:00