]> Untitled Git - bdk/commit
docs(core): document hashbrown feature's fixed-key hashing
authorRomansage6 <182553131+Romansage6@users.noreply.github.com>
Wed, 14 Oct 2026 07:02:11 +0000 (00:02 -0700)
committer志宇 <hello@evanlinjin.me>
Mon, 19 Oct 2026 12:19:52 +0000 (12:19 +0000)
commit360898e08226482b0ed4951f28b63f53053b89da
treea8ffadb99852b72956be67ffca0a6ca7fb2358a4
parent8b15e743e99a67be7d1d06a632b5f96bb7e365da
docs(core): document hashbrown feature's fixed-key hashing

With the `hashbrown` feature, this crate's `HashMap`/`HashSet` are
hashbrown's (on `std` builds too), which hash with `ahash`. Unless
`ahash`'s `runtime-rng` or `compile-time-rng` feature is enabled
somewhere in the dependency graph, `ahash` uses fixed, publicly known
keys, so a malicious chain source can craft colliding txids and make
`TxGraph` insertion quadratic.

Document this, and how to randomize the keys by depending on `ahash`
directly with one of those features.

Fixes #2342

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/core/src/lib.rs