Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
oid: use `std::hash::Hasher::hash` over `Hasher::write`
Merged fintohaps opened 6 months ago

Previously, the RepoId was backed by the git2::Oid type, which has a Hash implementation that uses std::hash::Hasher::hash. This uses a length prefixed form for hashing.

When switching to radicle_oid::Oid and implementing Hash without the length prefix, this subtly changed the hashes going forward.

These hashes are used in BloomFilter, which is the type underlying Filter. This resulted in cases where a previous Filter that certainly contained rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 were suddenly reporting that they did not contain this repository.

Changing the implementation of Hash for radicle_oid::Oid fixes this, and is confirmed by adding the regression test in filter.rs.

fintohaps opened with revision f8b8c296 on base b7a7f55e +58 -1 6 months ago

Previously, the RepoId was backed by the git2::Oid type, which has a Hash implementation that uses std::hash::Hasher::hash. This uses a length prefixed form for hashing.

When switching to radicle_oid::Oid and implementing Hash without the length prefix, this subtly changed the hashes going forward.

These hashes are used in BloomFilter, which is the type underlying Filter. This resulted in cases where a previous Filter that certainly contained rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 were suddenly reporting that they did not contain this repository.

Changing the implementation of Hash for radicle_oid::Oid fixes this, and is confirmed by adding the regression test in filter.rs.

lorenz pushed revision 2 87622b5f on base b7a7f55e +48 -1 6 months ago

Review

fintohaps pushed revision 3 c556f01e on base cef0ff57 +0 -0 6 months ago

Rebase

fintohaps merged revision c556f01e at cef0ff57 6 months ago