-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add error handling to Ethereum lookups #10
Conversation
I actually for some reason didn't have an issue with this (see below) although I agree a try/catch is needed for infura calls. (
definitely had an error:
|
You may have to try a few times sometimes it works on the first attempt because recursive may have not cached the NS record. Once the recursive sees the NS record and caches it, it will SERVFAIL for other lookups. Maybe to reproduce this more reliably you can try this :)
|
great got it thanks. SO I definitely approve of this change, just a few code style questions. ALSO -- I think when i started this i was thinking "if the name doesnt resolve on ethereum correctly, DO NOTHING" which is why the |
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.
One small nit (remove outdated comment) but otherwise this is great thanks!
There are many cases in which Infura requests could fail causing the plugin to crash. If the plugin fails, hsd returns the NS record with the Ethereum contract to the recursive resolver which leads to SERVFAIL for future lookups.
Example:
This PR checks if the resolver address returned from registry is empty the
doesntexist.badass
case but also wraps Ethereum lookups with try/catch and logs the errors to prevent any intermittent errors from Infura from causing the plugin to crash.