Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: [BREAKING] use twox_64 for bucket hashing #788

Merged
merged 1 commit into from
Feb 7, 2025
Merged

opt: [BREAKING] use twox_64 for bucket hashing #788

merged 1 commit into from
Feb 7, 2025

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Feb 6, 2025

A seeded twox is suitable for this purpose - each node will have its own map. While it may be possible to convince publicly-accessible RPC nodes to leak information that enables a HashDoS, it seems unlikely for sequencers to leak it.

Furthermore, the complexity of such an attack is limited by the fact that the inputs are Page IDs. In order to write to a particular page ID, the attacker would first need to create accounts (against a cryptographic hash function) that land in those pages.

Computing the blake3 hash of each written bucket was quite CPU-intensive, and so using twox ought to be much faster.

Copy link
Contributor Author

rphmeier commented Feb 6, 2025

@rphmeier rphmeier changed the title opt: use twox_64 for bucket hashing opt: [BREAKING] use twox_64 for bucket hashing Feb 6, 2025
Copy link
Contributor

@pepyakin pepyakin left a comment

Choose a reason for hiding this comment

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

splendid

Copy link
Contributor

pepyakin commented Feb 7, 2025

Merge activity

  • Feb 7, 5:25 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 7, 5:29 AM EST: Graphite rebased this pull request as part of a merge.
  • Feb 7, 5:31 AM EST: A user merged this pull request with Graphite.

@pepyakin pepyakin changed the base branch from rh-hasher-trait-refactor to graphite-base/788 February 7, 2025 10:26
@pepyakin pepyakin changed the base branch from graphite-base/788 to master February 7, 2025 10:28
@pepyakin pepyakin merged commit b1d12d0 into master Feb 7, 2025
8 checks passed
@pepyakin pepyakin deleted the rh-twox branch February 7, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants