-
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
sdk: fix fromEthersEvent
ranges fetching in case of temporary connectivity loss
#1924
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1924 +/- ##
==========================================
- Coverage 95.74% 95.61% -0.14%
==========================================
Files 155 155
Lines 5809 5816 +7
Branches 1094 1095 +1
==========================================
- Hits 5562 5561 -1
- Misses 189 197 +8
Partials 58 58
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a50f22a
to
68548b7
Compare
68548b7
to
57f6d6b
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.
I need a call for this. The queue functionality is not clear to me. Sorry 😑
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.
We had a pretty good call together. This algorithm is much more complex and beautiful than I initially thought. I had some misconceptions in my mind. Thanks for helping me out. Now I'm confident that is a really good fix!! 🚀
Fixes #1923
Follow-up of #1832
Short description
This PR fixes the issue by using a
fromBlock
queue, instead of a single value, so we always keep track of "[range] successful requests in the past", and can proceed with the correct ranges even in case of connectivity loss or exceptions thrown.Also, the queue is only walked over (i.e. popping the front we just queried, pushing to the back the new block for future range request) if the request didn't throw, allowing us to safely ignore any network error/exception thrown while scanning ranges and retrying the previous
fromBlock
when a newblock
event is emitted, which indicates connectivity was restored.Definition of Done
Steps to manually test the change (dApp)