-
Notifications
You must be signed in to change notification settings - Fork 233
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
refactor: document and expose Amino DHT defaults #990
Conversation
the intention here is to have public source of truth we can reference rather than hardcoding the same amino defaults everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @lidel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Couple of questions.
@@ -20,7 +21,7 @@ type options struct { | |||
// defaults are the default crawler options. This option will be automatically | |||
// prepended to any options you pass to the crawler constructor. | |||
var defaults = func(o *options) error { | |||
o.protocols = []protocol.ID{"/ipfs/kad/1.0.0"} | |||
o.protocols = amino.Protocols | |||
o.parallelism = 1000 | |||
o.connectTimeout = time.Second * 5 | |||
o.perMsgTimeout = time.Second * 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be defined in defaults.go
as well, even if not exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem to be specific to crawler and really part of "Amino DHT contract", so could
I'm going to merge thus PR as-is, we can figure out what to do remaining magic numbers in follow-up PR.
o.Resiliency = 3 | ||
o.BucketSize = amino.DefaultBucketSize | ||
o.Concurrency = amino.DefaultConcurrency | ||
o.Resiliency = amino.DefaultResiliency | ||
o.LookupCheckConcurrency = 256 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another candidate for defaults? Also, wish there was some explanation why 256 is the chosen value for concurrency.
The intention here is to have
github.com/libp2p/go-libp2p-kad-dht/amino
as a single public source of truth about Amino DHT we can reference rather than hardcoding the same defaults everywhere in IPFS implementations (boxo, kubo etc).