-
Notifications
You must be signed in to change notification settings - Fork 31
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
Improve network address discovery / NAT setup #323
Conversation
4e5f77d
to
eed4a1e
Compare
Finished up the logic. Could use another pass for a bigger refactor and changes, but it would depend on some other features that one might want to add so I kept it to a minimum for now and did not go there in this PR. Some of those items that could be added/changed, but probably better in another PR:
|
* Add specific error log when no route is found * Use bindIP if it is public * Adjust some log levels
return (some(ip), some(tcpPort), some(udpPort)) | ||
except ValueError: | ||
error "Not a valid IP address", address = nat[6..^1] | ||
quit QuitFailure |
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 this is a function in a library, we really shouldn't be quitting..
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, good point. Thought about that actually and was also one of the reasons why I don't quit on for example https://github.com/status-im/nim-eth/pull/323/files#diff-161c148740a4e155d7afca5fd40f23461ba6581e2949c694ffd89aca776b0d0dR293 .
I guess I could already split the parsing of the options with the actual logic, and keep the first in nimbus-eth2. Was planning on doing that together with possible cli option changes (if we decided on that). Either that or returning a result, but that is a bit silly unless I provide the currently logged error messages in (and possibly an enum) and remove the logs there. Not really needed imo.
Testing out logic for now. Moving also the
setupNat
(nowsetupAddress
) inside nim-eth, as the same or similar code is used for nimbus-eth2, waku v1, waku v2, nimbus-eth1 and dcli.Needs further polish on error passing, log messages, etc.