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

cmd/devp2p: Bootnodes are not populated when using crawl subcommand #28897

Closed
ryanschneider opened this issue Jan 30, 2024 · 1 comment · Fixed by #29091
Closed

cmd/devp2p: Bootnodes are not populated when using crawl subcommand #28897

ryanschneider opened this issue Jan 30, 2024 · 1 comment · Fixed by #29091
Assignees

Comments

@ryanschneider
Copy link
Contributor

If I run:

go build ./cmd/devp2p && ./devp2p discv5 crawl /tmp/nodes.json
INFO [01-30|15:50:42.862] New local node record                    seq=1,706,658,642,861 id=66355c79f58631fc ip=127.0.0.1 udp=57825 tcp=0
no input nodes to start crawling

However, the readme seems to indicate that it should work w/ an empty nodeset.

I traced the issue down to this block:

https://github.com/ethereum/go-ethereum/blame/eaac53ec383342fa6ef9c333659d40f7c5dac108/cmd/devp2p/discv4cmd.go#L271

	if commandHasFlag(ctx, bootnodesFlag) {
		bn, err := parseBootnodes(ctx)
		if err != nil {
			exit(err)
		}
		cfg.Bootnodes = bn
	}

The issue is that parseBootnodes is only called if --bootnodes flag is set, but that's also where the standard bootnodes are parsed. Removing the if commandHasFlag check "fixes" the issue and allows me to start crawling, but I'm not sure if that breaks some other command. I see this changed was introduced some time ago in #20094 so it seems like it's been in this state for quite awhile, so I'm not sure how actively maintained/used this tool is.

@fjl
Copy link
Contributor

fjl commented Feb 1, 2024

The tool is actively maintained! The behavior looks like a bug in CLI parsing logic. The crawl command accepts the --bootnodes flag, so it should be detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants