Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

[WIP] experimental routers to make ipns faster #2201

Closed
wants to merge 19 commits into from

Conversation

hugomrdias
Copy link
Member

No description provided.

Alan Shaw and others added 8 commits June 18, 2019 08:40
Printing raw buffers can end up outputting characters into the terminal
that mess up the encoding for all subsequent lines, which is a pain
when debugging things.

This change just encodes the buffer before printing to stop that from
happening.
@hugomrdias hugomrdias changed the base branch from master to feat/name-resolve-dns June 26, 2019 15:39
@hugomrdias hugomrdias requested a review from alanshaw June 26, 2019 15:40
fixes: #1918

`ipns name resolve` dns tests moved to interface-core
resolve call now returns a string as per documention.
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note for the future - I'm finding this really difficult to review. I don't have any context at all (no description in the PR) and there's no changes or additions to docs in the commits.

Are there some docs where I can read about what this is and how it works?

Minor, but there are lots of console.log statements in this PR that need to be replaced with called to debug.

}

log(`ipns record for ${key.toString()} was stored in the routing`)
log(`ipns record for /ipns/${peerId.toB58String()} was stored in the routing`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change from key to peerId?

ipnsStores.push(new DnsDatastore(ipfs._options.ipns))
ipnsStores.push(new MDnsDatastore(ipfs._options.ipns))
return new ExperimentalTieredDatastore(ipnsStores)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No DHT or pubsub datastore if ipnsDNS is enabled?

ipnsStores.push(offlineDatastore)
} else {
// Add DHT if we are online
if (ipfs.isOnline()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the reason behind this change?

const keyStr = keyToBase32(key)
const data = await ky
.put(
'https://ipns.dev',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be configurable.

// https://dns.google.com/experimental
// https://cloudflare-dns.com/dns-query
// https://mozilla.cloudflare-dns.com/dns-query
return dohBinary('https://cloudflare-dns.com/dns-query', 'dns.ipns.dev', key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be configurable?

.catch(err => {
log.error(err)
setImmediate(() => callback(Errors.notFoundError()))
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promises force then and catch onto a future tick so setImmediate should not be necessary here unless there's a different reason I'm missing?


// DNS datastore aims to mimic the same encoding as routing when storing records
// to the local datastore
class MDNSDataStore {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this is MDNS?


// Workers datastore aims to mimic the same encoding as routing when storing records
// to the local datastore
class WorkersDataStore {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from the MDNS datastore?

ipnsPubsub: argv.enableNamesysPubsub,
dht: argv.enableDhtExperiment,
sharding: argv.enableShardingExperiment
},
ipns: {
alias: argv.experimentalIpnsAlias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new constructor options need to be documented on the README.

const log = debug('ipfs:ipns:doh')
log.error = debug('ipfs:ipns:doh:error')

async function dohBinary (url, domain, key) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does DOH stand for?

@alanshaw
Copy link
Member

@hugomrdias do you want to merge this and send the fixups as a seperate PR?

I could get an RC released?

@alanshaw
Copy link
Member

@hugomrdias what's the status on this?

@hugomrdias hugomrdias mentioned this pull request Jul 17, 2019
15 tasks
@alanshaw alanshaw changed the title experimental routers to make ipns faster [WIP] experimental routers to make ipns faster Nov 6, 2019
@hugomrdias hugomrdias closed this Apr 8, 2023
@hugomrdias hugomrdias deleted the feat/fast-ipns branch April 8, 2023 11:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants