Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Adds solana-nohash-hasher #33521

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Oct 4, 2023

Problem

In accounts-db, we make lists of slots for various tasks. We put these in HashSets/HashMaps, which perform cryptographically secure hashing of the keys. Since we (1) don't always require cryptographic security, and (2) know that slots are unique identifiers, we actually don't need to hash the slot at all, but instead can use it directly.

The solana-nohash-hasher crate was designed for this.

Summary of Changes

Add solana-nohash-hasher to accounts-db.

Future PRs will use solana-nohash-hasher—explicitly not included in this PR.

@brooksprumo brooksprumo self-assigned this Oct 4, 2023
@brooksprumo brooksprumo marked this pull request as ready for review October 4, 2023 15:08
Copy link
Contributor

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brooksprumo brooksprumo added the automerge Merge this Pull Request automatically once CI passes label Oct 4, 2023
@mergify mergify bot merged commit daaeb74 into solana-labs:master Oct 4, 2023
@brooksprumo brooksprumo deleted the nohash/add branch October 4, 2023 15:58
tao-stones pushed a commit to tao-stones/solana that referenced this pull request Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants