View Issue Details

IDProjectCategoryView StatusLast Update
0007136GNUnetDHT servicepublic2026-01-25 14:13
Reporterschanzen Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.16.0Fixed in Version0.16.0 
Summary0007136: Distance metric update
DescriptionWe had offline discussions wrt the distance metric. Currently it is measured as uint64_t.
I _think_ we said we want to change this to 512 bit (HashCode, same length as keys to compare) and use a more basic XOR metric.
TagsNo tags attached.

Activities

schanzen

2021-12-31 14:18

administrator   ~0018612

Last edited: 2021-12-31 14:19

I also think the function definition is currently flawed and can be misunderstood:
The "bucket" argument is not really referring to a bucket, but an offset to check.
The get_distance() is preceded in the code by a matching_bits() call in order to find a "bucket": https://git.gnunet.org/gnunet.git/tree/src/dht/gnunet-service-dht_neighbours.c?id=9e0d7d411363999bca89f7e7b4e2896b8f6ec931#n1019

Now, IF matching_bits() is more efficient to call than the loop from index 0 in get_distance() we should do that, of course. But in get_distance()!
Because a caller may assume the get_distance() "bucket" argument has actually something to do with buckets and will never know that instead of calling find_bucket() the matching_bits() function must be called to get an offset.

It is just bad function signature design.

I propose to simplify the get_distance() function to ONLY take two keys as argument.

Christian Grothoff

2022-01-03 13:39

manager   ~0018624

I believe this has been resolved.

schanzen

2022-02-26 22:10

administrator   ~0018742

0.16.0 released

Issue History

Date ModifiedUsernameFieldChange
2021-12-31 08:24schanzenNew Issue
2021-12-31 08:24schanzenStatusnew => assigned
2021-12-31 08:24schanzenAssigned To => Christian Grothoff
2021-12-31 08:24schanzenTag Attached: lsd0004
2021-12-31 14:18schanzenNote Added: 0018612
2021-12-31 14:18schanzenNote Edited: 0018612
2021-12-31 14:19schanzenNote Edited: 0018612
2022-01-03 13:39Christian GrothoffNote Added: 0018624
2022-01-03 13:39Christian GrothoffStatusassigned => resolved
2022-01-03 13:39Christian GrothoffResolutionopen => fixed
2022-01-03 13:39Christian GrothoffFixed in Version => 0.16.0
2022-02-26 22:10schanzenNote Added: 0018742
2022-02-26 22:10schanzenStatusresolved => closed
2026-01-25 14:13Christian GrothoffTag Detached: lsd0004