Commit Graph

20 Commits

Author SHA1 Message Date
Jeff Washington (jwash) b0b4e1f0c0
remove IncludeSlotInHash after feature activation on mnb (#33816)
* remove IncludeSlotInHash after feature activation on mnb

* fix compile errors

* compile errors

* fix tests

* fix test results
2023-10-23 15:12:02 -07:00
Brooks 1045548606
Uses AccountHash in StorableAccountsWithHashesAndWriteVersions (#33751) 2023-10-18 18:58:19 -04:00
HaoranYi 167dac204f
Retry hash file allocation (#33565)
* retry hash file allocation

* add sleep

* submit a datapoint for retry

* typo

* more typos

* Update accounts-db/src/accounts_hash.rs

Co-authored-by: Brooks <brooks@prumo.org>

* fmt

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
Co-authored-by: Brooks <brooks@prumo.org>
2023-10-16 09:21:08 -05:00
Brooks fc73813db2
Adds AccountHash newtype (#33597) 2023-10-09 16:00:52 -04:00
HaoranYi 72574dac02
Assert acount hash mmap file capacity > 0 (#33575)
assert mmap capacity > 0

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-10-09 09:38:00 -05:00
HaoranYi bb19ebed49
Convert tuple into dedup result struct (#33450)
convert tupe into dedup result struct

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-29 21:12:50 -05:00
HaoranYi 25c27d452c
hash dedup vec (#33246)
* hash_dedup vec algo

* reviews

* reviews

* more reviews

* simplify working_set init with add_next_item

* refactor to remove special case "new" from add_item.

The new change is that, even the new item is the new min, it will still be added to working_set.
This change will make init working_set code simpler and the loop loop check simpler.
Since the item is inserted in at the end of the vector, the cost of push into and pop from the working will be O(1), shouldn't affect performance much.

* comments

* refactor unnamed tuple in working set to SlotGroupPointer type

* use SlotGroupPointer in ItemLocation

* Add Copy traits to avoid explicty call of clone on SlotGroupPointer

* consume next in add_next_item fn (credit to jeff).

note that the old code is still correct, since before call to
add_next_item, we will have already overwritten `next` to correct value.

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-28 08:58:08 -05: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
Brooks f77b3d9389
Derives Pod for CalculateHashIntermediate (#33267) 2023-09-15 12:47:38 -04:00
Brooks 4c42413c1f
Refactors out `unsafe` from MmapAccountHashesFile::read() (#33266) 2023-09-15 15:09:01 +00:00
Brooks 09936aac0e
Removes `new()` from POD CalculateHashIntermediate and CumulativeOffset (#33211) 2023-09-11 22:33:25 +00:00
Brooks 659fc6837b
Removes `pub` from accounts_hash.rs items (#33209) 2023-09-11 20:49:51 +00:00
Jeff Washington (jwash) d724af863c
add a few accounts hash dedup tests (#33208) 2023-09-11 13:20:28 -07:00
Jeff Washington (jwash) 4dfe62a2f0
rework accounts hash calc dedup to avoid kernel file error (#33195)
* in hash calc, calculate max_inclusive_num_pubkeys

* in hash calc, dedup uses mmap files to avoid os panic

* as_mut_ptr

* remove unsafe code

* refactor count in hash files

---------

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-11 10:57:21 -07:00
HaoranYi a8bc6ebe38
Use `write_all` for binned account hash file writes (#33095)
write_all

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-09-06 11:03:05 -05:00
Jeff Washington (jwash) 524274d8b5
update comment (#32919) 2023-08-21 10:04:37 -07:00
Brooks a563b4cccb
Renames AccountsHashEnum to AccountsHashKind (#32904) 2023-08-21 10:34:56 -04:00
Jeff Washington (jwash) c9f7cb5b7e
keep active stats lock held (#32763) 2023-08-10 08:56:00 -07:00
Brooks 6ff390802b
Uses fold+reduce in de_dup_accounts() (#32765) 2023-08-09 17:27:04 -04:00
Pankaj Garg f4287d70bb
Move accounts-db code to its own crate (#32766) 2023-08-09 13:03:36 -07:00