Skip to content
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

0.16.0-rc1: Routing.Methods should be null #9312

Closed
3 tasks done
lidel opened this issue Sep 27, 2022 · 2 comments · Fixed by #9313
Closed
3 tasks done

0.16.0-rc1: Routing.Methods should be null #9312

lidel opened this issue Sep 27, 2022 · 2 comments · Fixed by #9313
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Sep 27, 2022

Checklist

Installation method

ipfs-update or dist.ipfs.tech

Version

0.16.0-rc1

Config

{
	"API": {
		"HTTPHeaders": {}
	},
	"Addresses": {
		"API": "/ip4/0.0.0.0/tcp/5001",
		"Announce": [],
		"AppendAnnounce": [],
		"Gateway": "/ip4/0.0.0.0/tcp/8080",
		"NoAnnounce": [],
		"Swarm": [
			"/ip4/0.0.0.0/tcp/4001",
			"/ip6/::/tcp/4001",
			"/ip4/0.0.0.0/udp/4001/quic",
			"/ip6/::/udp/4001/quic"
		]
	},
	"AutoNAT": {},
	"Bootstrap": [
		"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
		"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt"
	],
	"DNS": {
		"Resolvers": {}
	},
	"Datastore": {
		"BloomFilterSize": 0,
		"GCPeriod": "1h",
		"HashOnRead": false,
		"Spec": {
			"mounts": [
				{
					"child": {
						"path": "blocks",
						"shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
						"sync": true,
						"type": "flatfs"
					},
					"mountpoint": "/blocks",
					"prefix": "flatfs.datastore",
					"type": "measure"
				},
				{
					"child": {
						"compression": "none",
						"path": "datastore",
						"type": "levelds"
					},
					"mountpoint": "/",
					"prefix": "leveldb.datastore",
					"type": "measure"
				}
			],
			"type": "mount"
		},
		"StorageGCWatermark": 90,
		"StorageMax": "10GB"
	},
	"Discovery": {
		"MDNS": {
			"Enabled": true
		}
	},
	"Experimental": {
		"AcceleratedDHTClient": false,
		"FilestoreEnabled": false,
		"GraphsyncEnabled": false,
		"Libp2pStreamMounting": false,
		"P2pHttpProxy": false,
		"StrategicProviding": false,
		"UrlstoreEnabled": false
	},
	"Gateway": {
		"APICommands": [],
		"HTTPHeaders": {
			"Access-Control-Allow-Headers": [
				"X-Requested-With",
				"Range",
				"User-Agent"
			],
			"Access-Control-Allow-Methods": [
				"GET"
			],
			"Access-Control-Allow-Origin": [
				"*"
			]
		},
		"NoDNSLink": false,
		"NoFetch": false,
		"PathPrefixes": [],
		"PublicGateways": null,
		"RootRedirect": "",
		"Writable": false
	},
	"Identity": {
		"PeerID": "12D3KooWKq3tiXPxyYTJKMrDisk3Mh5EEoSAfcB1xeRwMfQGVVor"
	},
	"Internal": {},
	"Ipns": {
		"RecordLifetime": "",
		"RepublishPeriod": "",
		"ResolveCacheSize": 128
	},
	"Migration": {
		"DownloadSources": [],
		"Keep": ""
	},
	"Mounts": {
		"FuseAllowOther": false,
		"IPFS": "/ipfs",
		"IPNS": "/ipns"
	},
	"Peering": {
		"Peers": null
	},
	"Pinning": {
		"RemoteServices": {}
	},
	"Plugins": {
		"Plugins": null
	},
	"Provider": {
		"Strategy": ""
	},
	"Pubsub": {
		"DisableSigning": false,
		"Router": ""
	},
	"Reprovider": {
		"Interval": "12h",
		"Strategy": "all"
	},
	"Routing": {
		"Methods": {
			"find-peers": {
				"RouterName": ""
			},
			"find-providers": {
				"RouterName": ""
			},
			"get-ipns": {
				"RouterName": ""
			},
			"provide": {
				"RouterName": ""
			},
			"put-ipns": {
				"RouterName": ""
			}
		},
		"Routers": null,
		"Type": "dht"
	},
	"Swarm": {
		"AddrFilters": null,
		"ConnMgr": {
			"GracePeriod": "20s",
			"HighWater": 900,
			"LowWater": 600,
			"Type": "basic"
		},
		"DisableBandwidthMetrics": false,
		"DisableNatPortMap": false,
		"RelayClient": {},
		"RelayService": {},
		"ResourceMgr": {},
		"Transports": {
			"Multiplexers": {},
			"Network": {},
			"Security": {}
		}
	}
}

Description

This is a cosmetic one, but we may want to fix it before final release.

ipfs init creates config with confusing Routing.Methods :

"Routing": {
		"Methods": {
			"find-peers": {
				"RouterName": ""
			},
			"find-providers": {
				"RouterName": ""
			},
			"get-ipns": {
				"RouterName": ""
			},
			"provide": {
				"RouterName": ""
			},
			"put-ipns": {
				"RouterName": ""
			}
		},
		"Routers": null,
		"Type": "dht"
	},

Given that Routers is null, my expectation would be for Methods to be null as well.

cc @ajnavarro @guseggert if this was discussed before and is a desired behavior i was not aware of.
cc #9237

@lidel lidel added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Sep 27, 2022
@lidel lidel moved this to 🥞 Todo in IPFS Shipyard Team Sep 27, 2022
@ajnavarro
Copy link
Member

Hi @lidel !

It is the desired behavior. I thought that it would make the users' life easier, avoiding looking into the documentation to know the method keys.

@lidel
Copy link
Member Author

lidel commented Sep 27, 2022

Ack, but this creates UX issue of inconsistency: you dont have "Router template" in Routers, it is null.

Also, we are not doing that in other places like (some of them are more likely to be changed that Routing Methods):

                "RelayClient": {},
		"RelayService": {},
		"ResourceMgr": {},
		"Transports": {
			"Multiplexers": {},
			"Network": {},
			"Security": {}
		}

So we already ask users to read config for opt-in features,
and remove implicit defaults from config where possible.

I suggest ipfs init creates only:

"Routing": {
		"Methods": null,
		"Routers": null,
		"Type": "dht"
	},

@ajnavarro ajnavarro moved this from 🥞 Todo to 🔎 In Review in IPFS Shipyard Team Sep 27, 2022
Repository owner moved this from 🔎 In Review to 🎉 Done in IPFS Shipyard Team Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants