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 |
pinheadmz
left a comment
There was a problem hiding this comment.
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.badasscase 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.