ipfs / ipfs/kubo

namesys/routing.go imports dht package preventing dht.Quorum() from being used with a custom routing option

Open
#5,957 1 comment 0 reactions 0 assignees View on GitHub
effort/hours exp/intermediate help wanted P3 status/ready
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

If a user is using a custom routing option (like for example, we are using a modified DHT in openbazaar) and they pass in a `DhtRecordCount` to `namesys.Resolve`. The routing resolver will call `dht.Quorum(int(options.DhtRecordCount))` however, the `dht` package imported by routing.go is the native dht package and not the one set by the user. The quorum function doesn't apply the option to the custom routing option.

```
func Quorum(n int) ropts.Option {
return func(opts *ropts.Options) error {
if opts.Other == nil {
opts.Other = make(map[interface{}]interface{}, 1)
}
opts.Other[quorumOptionKey{}] = n
return nil
}
}
```

I think the issue using a struct defined inside the package for `quorumOptionKey` rather than, say, a string.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.