Commit Graph

26 Commits

Author SHA1 Message Date
Ryo Onodera 4fe0812f3c
Make should_panic tests compatible with 1.73+ panic format (#33099)
* Adjust should_panic tests for 1.73+ panic format

* Update more panic format change affected tests...
2023-09-01 02:04:22 +00:00
Ryo Onodera 92a0b310c1
Add #[repr(C)] for more future-proof byte mangling (#33085)
* Add #[repr(C)] for more future-proof byte manglng

* Improve comments after code-review
2023-08-31 22:48:24 +09:00
Jeff Washington (jwash) 48f27d5e73
add stats for generate_index (#33061) 2023-08-30 06:43:27 -07:00
Trent Nelson b8dc5daedb
preliminaries for bumping nightly to 2023-08-25 (#33047)
* remove unnecessary hashes around raw string literals

* remove unncessary literal `unwrap()`s

* remove panicking `unwrap()`

* remove unnecessary `unwrap()`

* use `[]` instead of `vec![]` where applicable

* remove (more) unnecessary explicit `into_iter()` calls

* remove redundant pattern matching

* don't cast to same type and constness

* do not `cfg(any(...` a single item

* remove needless pass by `&mut`

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

* `filter_map()` better written as `filter()`

* incorrect `PartialOrd` impl on `Ord` type

* replace "slow zero-filled `Vec` initializations"

* remove redundant local bindings

* add required lifetime to associated constant
2023-08-29 23:05:35 +00:00
Jeff Washington (jwash) 00bfc6abd3
remove unused previous_uncleaned_roots (#33033) 2023-08-29 14:54:17 -07:00
Jeff Washington (jwash) 4d452fc5e9
update lru for read only cache if it has been long enough since last access (#32560)
* update lru for read only cache if it has been long enough since last access

* update comment

* use acq/rel
2023-08-29 10:37:55 -07:00
HaoranYi 555741e4d6
Refactor total_items, bin_min/max size calcualtion (#33034)
refactor total_items, bin_min/max size calcuation

Co-authored-by: HaoranYi <haoran.yi@solana.com>
2023-08-29 10:37:25 -05:00
Jeff Washington (jwash) 9bc09c9610
get unique keys while finding dups (#33039)
* get unique keys while finding dups

* pr feedback
2023-08-29 15:06:35 +00:00
Jeff Washington (jwash) 35bd2df0a6
speedup populate_and_retrieve_duplicate_keys_from_startup (#33013) 2023-08-28 10:20:29 -07:00
Jeff Washington (jwash) f4dcb20d2e
add overall measurement for generating index (#33008) 2023-08-28 08:40:54 -07: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
Brooks c6989189ef
Renames CalcAccountsHashFlavor to CalcAccountsHashKind (#32905) 2023-08-21 15:41:07 +00:00
Brooks a563b4cccb
Renames AccountsHashEnum to AccountsHashKind (#32904) 2023-08-21 10:34:56 -04:00
Jeff Washington (jwash) a7d340538e
cache hash files: separate get_file_reference_to_map_later and map (#32891) 2023-08-21 07:30:29 -07:00
Jeff Washington (jwash) 48e51134d7
refactor cache hash data stats (#32884) 2023-08-18 09:24:59 -07:00
Jeff Washington (jwash) 9260c0f645
move invariant code outside loop (#32837) 2023-08-17 15:28:04 -07:00
Ryo Onodera e700dde617
dcou: Update qualifier_attr to 0.2.2 (#32838)
Update qualifier_attr to 0.2.2
2023-08-15 13:10:47 +00:00
Brooks e316db2ab4
dcou: set_accounts_hash() (#32829) 2023-08-15 07:18:59 -04:00
steviez 6bbf514e78
Add ability to output components that go into Bank hash (#32632)
When a consensus divergance occurs, the current workflow involves a
handful of manual steps to hone in on the offending slot and
transaction. This process isn't overly difficult to execute; however, it
is tedious and currently involves creating and parsing logs.

This change introduces functionality to output a debug file that
contains the components go into the bank hash. The file can be generated
in two ways:
- Via solana-validator when the node realizes it has diverged
- Via solana-ledger-tool verify by passing a flag

When a divergance occurs now, the steps to debug would be:
- Grab the file from the node that diverged
- Generate a file for the same slot with ledger-tool with a known good
  version
- Diff the files, they are pretty-printed json
2023-08-15 00:12:05 -05:00
Brooks ce57cac370
Use update_accounts_hash() in AccountsHashVerifier (#32830) 2023-08-14 13:11:23 -04:00
Jeff Washington (jwash) 9212ac347c
accounts hash sort_slot_storage_scan sorts in place (#32810) 2023-08-14 07:47:33 -07:00
Ryo Onodera ce63640d6d
dcou: make internal function `pub` conditionally (#32822)
dcou: make internal function pub conditionally
2023-08-13 14:12:20 +09:00
Jeff Washington (jwash) 4e6fb8e343
removed unused accounts hash code (#32791) 2023-08-11 06:49:07 -07:00
Jeff Washington (jwash) c9f7cb5b7e
keep active stats lock held (#32763) 2023-08-10 08:56:00 -07:00
Pankaj Garg f4287d70bb
Move accounts-db code to its own crate (#32766) 2023-08-09 13:03:36 -07:00