-
Notifications
You must be signed in to change notification settings - Fork 433
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
feat: request missing on chain events on error #2298
feat: request missing on chain events on error #2298
Conversation
🦋 Changeset detectedLatest commit: cebffb7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
}; | ||
} | ||
|
||
// TODO(aditi): Make sure we don't make multiple requests for a single fid |
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.
Hmm, this is not a problem now, but when you remove the await when calling the retry function, it will become an issue. You might need to add a lock around the duplicate check. I would add a test case when submitting 10 messages via mergeMessages for the same fid, it only calls retry once.
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 currently pretty hard to test. We mock the l2 events provider in most tests -- which I think is a good practice. The l2 events tests are slow and the setup for each test is really complicated. It's hard to test the logic that checks for duplicates via mergeMessage
I don't think I understand the failure mode here though. All this code is in JS-land so we don't need to worry about concurrency issues right? Are you worried about the JS runtime switching to a new task between the has
and set
calls? I also don't think it's the biggest issue if we end up with multiple concurrent calls.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2298 +/- ##
===========================================
- Coverage 74.05% 44.44% -29.62%
===========================================
Files 99 146 +47
Lines 9425 25563 +16138
Branches 2097 9063 +6966
===========================================
+ Hits 6980 11362 +4382
- Misses 2327 12481 +10154
- Partials 118 1720 +1602 ☔ View full report in Codecov by Sentry. |
2365e16
to
5b5c5fe
Compare
01b163e
to
6b19220
Compare
6b19220
to
1508b0b
Compare
if ( | ||
result.error.errCode === "bad_request.no_storage" || | ||
"bad_request.unknown_signer" || | ||
"bad_request.missing_fid" |
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.
Q: Should that be bad_request.unknown_fid
as the name suggested in line 1237
Why is this change needed?
Our hubs regularly fail to get into sync because some of them are missing onchain events. This feature will have us request missing onchain events if there are errors related to missing on chain events when messages are submitted.
Deployed to hoyt for testing: Logs
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewPR-Codex overview
The focus of this PR is to enhance error handling and retry mechanisms for on-chain events in the Hubble application.
Detailed summary