-
Notifications
You must be signed in to change notification settings - Fork 3
Add check for missing block data to gas-oracle #151
Conversation
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 there's a bigger issue here and that is that a bug in this component caused the Airseeker execution to end.
I think it might be a good idea to add an error check/try-catch around:
in https://github.com/API3-CTT/airseeker/blob/46f87c8b02b5207277cd2bc91a6a73b04f353699/src/update-beacons.ts#L185
with a fallback to conventional pricing.
We should expect EVM RPC endpoints to give us unexpected data because (1) good practice to expect the worst and (2) we're operating across under-served chains with new implementations.
Also, separately, we may want to add import 'source-map-support/register';
to this application to make debugging in future easier. Size won't be an issue because we're running it ourselves.
(I didn't realise Github could quote lines inline like this^, cool!)
Thanks for checking and good catch @aquarat ! Could this be wrapped in a |
I really like the go utils approach to error handling... it's very C/Go like and satisfies @Siegrift 's suggestion of keeping "unhappy paths" indented and the happy path as left as possible. I say great idea :) |
I think this is something we should consider for all Airnode, Airkeeper and Airseeker in the future. |
…racle price fetching in update-beacons
Ok I've done a bit of a refactor, here are the additions:
Please let me know what you think. |
ade39cf
to
134c6f2
Compare
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.
See comment 😄
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.
This is really neat 🥇 (and I think it'll be both efficient and robust).
Thanks again 😄
This fixes a bug where
block
isnull
(orundefined
) which causes the gas oracle to fail with an unexpected error stopping the Airseeker and adds tests for this case.