-
Notifications
You must be signed in to change notification settings - Fork 80
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: remove default values for p2p-tcp-address
and p2p-udp-address
#1248
Conversation
Codecov ReportBase: 53.58% // Head: 53.66% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1248 +/- ##
==========================================
+ Coverage 53.58% 53.66% +0.08%
==========================================
Files 139 139
Lines 16298 16365 +67
==========================================
+ Hits 8733 8782 +49
- Misses 6303 6324 +21
+ Partials 1262 1259 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
flags.StringVar(&config.Denylist, "p2p-denylist", "", "Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.") | ||
func bindP2PFlags(cmd *cobra.Command, config *p2p.Config) { | ||
cmd.Flags().StringSliceVar(&config.UDPBootnodes, "p2p-bootnodes", []string{"http://bootnode.lb.gcp.obol.tech:3640/enr"}, "Comma-separated list of discv5 bootnode URLs or ENRs.") | ||
cmd.Flags().BoolVar(&config.BootnodeRelay, "p2p-bootnode-relay", true, "Enables using bootnodes as libp2p circuit relays. Useful if some charon nodes are not publicly accessible.") |
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.
Since, now the defaults are:
--p2p-udp-address==""
--p2p-bootnode-relay=false
--p2p-bootnodes-from-lockfile==false
we need to enable anyone of the above by default. Else, bindP2PFlags
will always return an error.
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.
Question: Do we want to enable anyone of the above flags?
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.
Yeah, error by default is probably not good UX. And most people run with bootnode relay, so making this true is probably fine.
0d61b8f
to
6fe7ea4
Compare
cmd.Flags().StringVar(&config.Denylist, "p2p-denylist", "", "Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.") | ||
|
||
preRunE := cmd.PreRunE // Allow multiple wraps of PreRunE. | ||
cmd.PreRunE = func(cmd *cobra.Command, args []string) error { |
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.
I think it is time to extract this wrapping preRunE
as a function, since we do it in a few places. func wrapPreRunE(cmd, func(cmd *cobra.Command, args []string) error)
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.
Sure. I'll raise a separate PR to extract this.
p2p-tcp-address
andp2p-udp-address
.--p2p-udp-address==""
and--p2p-bootnode-relay=false
and--p2p-bootnodes-from-lockfile==false
.--p2p-bootnode-relay
default value to true.charon enr --verbose
.category: feature
ticket: #998