Commit Graph

189 Commits

Author SHA1 Message Date
GoodDaisy 03386cc7b9
Fix typos (#34459)
* Fix typos

* Fix typos

* fix typo
2023-12-21 13:06:00 -07:00
Brooks 62681b1089
Removes unnecessary #[allow(dead_code)] in bucket map (#34323) 2023-12-05 16:41:32 +00:00
HaoranYi e088eb2be0
Code clean up (#33417)
clean up

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-26 22:35:25 +00:00
Jeff Washington (jwash) 642d76b8cd
update comments (#33399) 2023-09-25 13:26:27 -07:00
Jeff Washington (jwash) 027f3dc6de
disk idx: try to reuse disk index's exisiting data on startup (#33388)
* disk idx: try to reuse disk index's exisiting data on startup

* add tests

* fix test and add test

* update test comments

* update comments
2023-09-25 12:48:05 -07:00
Jeff Washington (jwash) 18231e9a5a
dump final startup index stats only after startup is complete (#33400) 2023-09-25 12:19:52 -07:00
Jeff Washington (jwash) 27f59e809d
disk idx: apply_grow_index does not delete index file (#33384) 2023-09-24 12:26:17 -07:00
Jeff Washington (jwash) 5c57641313
disk idx: restart re-uses disk index files (#33382) 2023-09-24 12:25:50 -07:00
Jeff Washington (jwash) 967a78bbc1
diskidx: keep track if bucket file was reused so we can gen idx faster (#33380) 2023-09-24 12:23:48 -07:00
Jeff Washington (jwash) 1b15464414
diskidx: stats for created vs reused (#33385) 2023-09-23 06:22:12 -07:00
Jeff Washington (jwash) e92d90b674
DiskIdx: reuse disk bucket file if possible (#33379) 2023-09-22 17:25:21 -07:00
Jeff Washington (jwash) c750ac5d38
data bucket holds RestartableBucket (#33381) 2023-09-22 14:42:08 -07:00
Jeff Washington (jwash) 456563b9e9
pass RestartableBucket through disk index (#33377) 2023-09-22 13:46:04 -07:00
Jeff Washington (jwash) fcddeb446b
add disk bucket get_restart_file (#33373)
* add disk bucket get_restart_file

* add get_restartable_buckets
2023-09-22 12:34:43 -07:00
Jeff Washington (jwash) 5eb61ddf21
simple cleanup in bucket map (#33376) 2023-09-22 11:47:32 -07:00
Jeff Washington (jwash) d2464d9d7c
use bytemuck for disk bucket restart (#33371) 2023-09-22 10:17:04 -07:00
Jeff Washington (jwash) 97d53be16e
add Restart structs for disk index (#33361) 2023-09-22 06:49:55 -07:00
Jeff Washington (jwash) 1fc4264a1c
add bucket::load_on_restart (#33328) 2023-09-21 06:47:28 -07:00
Jeff Washington (jwash) a32ef97592
fix comments (#33330) 2023-09-20 13:38:12 -07:00
Jeff Washington (jwash) b7bac74d47
refactor header alignment check in bucket storage (#33326) 2023-09-20 12:57:27 -07:00
HaoranYi 1e56b88f59
Update index bucket after data bucket updated (#33315)
* typos

* update index bucket after data bucket

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-20 11:12:42 -05:00
Jeff Washington (jwash) 5f58d2dd4a
add occupy_if_matches to bucket map (#33318) 2023-09-20 08:12:07 -07:00
Jeff Washington (jwash) cfd0a00ae2
drop disk index bucket files on drop by default (#33316) 2023-09-20 07:50:17 -07:00
Jeff Washington (jwash) 7a8a492d4c
fix clippy error (#33317)
* fix clippy error

* fix fmt that somehow got merged
2023-09-19 20:28:55 -07:00
Jeff Washington (jwash) 58f980a19b
refactor bucket storage file open (#33314) 2023-09-19 19:26:43 -07:00
Jeff Washington (jwash) 288e8a682a
conditionally erase folders on drop of `BucketMap` (#33309) 2023-09-19 13:02:22 -07:00
Jeff Washington (jwash) 056e7cc240
bucket storage refactoring (#33308) 2023-09-19 13:01:49 -07:00
Alexander Meißner 9e703f85de
Upgrades Rust to 1.72.0 & nightly-2023-08-25 (#32961)
* allow pedantic invalid cast lint

* allow lint with false-positive triggered by `test-case` crate

* nightly `fmt` correction

* adapt to rust layout changes

* remove dubious test

* Use transmute instead of pointer cast and de/ref when check_aligned is false.

* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.

* bump rust nightly to 2023-08-25

* Upgrades Rust to 1.72.0

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-09-01 07:26:13 +00:00
Jeff Washington (jwash) 9a7d503fe4
rework sorting during generate_index (#33076)
* drag data len around during generate_index

* fix tests

* update comments
2023-08-31 12:51:56 -07:00
Brooks f8789c79a2
Refactor bucket storage bad header size test (#33091) 2023-08-31 13:01:20 -04:00
Jeff Washington (jwash) 551317dd31
return file name as u128 for disk buckets (#33044) 2023-08-29 08:16:54 -07:00
Jeff Washington (jwash) 9b4feddb55
add PartialEq and Debug to bucket map (#33043) 2023-08-29 07:13:21 -07:00
Alexander Meißner 29bbda0c11
General cleanup (Part 2) (#32998)
* bucket-map: remove unused `mut`

* remove unnecessary explicit `into_iter()` calls

* don't default-construct unit-structs

* prefer `or_default()` to `or_insert_with(T::default())`

* replace "slow zero-filled vec initialization"

---------

Co-authored-by: Trent Nelson <trent@solana.com>
2023-08-25 19:07:38 +02: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
Jeff Washington (jwash) 3b5e35e819
disk bucket: factor out allocate_bucket (#32920) 2023-08-22 14:21:07 -07: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
behzad nouri d54b6204be
removes instances of clippy::manual_let_else (#32417) 2023-07-09 21:41:36 +00:00
Jeff Washington (jwash) 4f677ff4f8
remove compiler warning (#32081) 2023-06-12 13:48:17 -07:00
Jeff Washington (jwash) bace5679a1
avoid unnecessary disk bucket data file allocation (#31659) 2023-05-16 07:10:46 -07:00
Brooks 9a4618a049
bucket_map: Length must be 1 if including header in get_slice() (#31445) 2023-05-03 10:44:58 -04:00
Brooks 26809522b7
bucket_map: get_from_bytes should check alignment (#31444) 2023-05-02 15:17:36 -04:00
Brooks 1a6c75a115
bucket_map: Moves get_from_bytes() to index_entry.rs (#31443) 2023-05-02 16:58:16 +00:00
Brooks bac1b2a584
bucket_map: Renames fns to get_slice and get_slice_mut (#31442) 2023-05-02 10:49:25 -04:00
dependabot[bot] 2b2eccfff9
Bump num_enum from 0.5.9 to 0.6.1 (#31122)
* Bump num_enum from 0.5.9 to 0.6.0

Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.9 to 0.6.0.
- [Release notes](https://github.com/illicitonion/num_enum/releases)
- [Commits](https://github.com/illicitonion/num_enum/compare/0.5.9...0.6.0)

---
updated-dependencies:
- dependency-name: num_enum
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use workspace dep for bucket_map

* Bump num_enum to v0.6.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
2023-04-17 23:49:43 -06:00
Jeff Washington (jwash) 0121be5a9f
disk index: add more tests (#31135) 2023-04-11 07:30:11 -07:00
Jeff Washington (jwash) 4f0adcde89
disk index: correctly keep track of count during batch add (#31133) 2023-04-10 14:01:25 -07:00
Jeff Washington (jwash) d63359a3ff
disk index: batch insert (#31094) 2023-04-10 11:08:54 -07:00
Jeff Washington (jwash) 03abaf76d0
disk index: bucket_index_ix doesn't % by capacity (#31096) 2023-04-07 06:59:35 -07:00
Jeff Washington (jwash) 3422823932
disk index: keep same random during resize (#31095) 2023-04-07 06:54:50 -07:00
Jeff Washington (jwash) 06461fb348
disk index: index files grow by bytes instead of doubling (#31013) 2023-04-05 06:30:37 -07:00