-
Notifications
You must be signed in to change notification settings - Fork 12
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
Sync error handling #133
base: unstable
Are you sure you want to change the base?
Sync error handling #133
Conversation
I retested it locally. Could not get it to crash now. Nice! But I noticed that right now, this error condition does not properly apply any backoff: Lines 413 to 414 in b5ffff4
This got me thinking once more about the approach. How do you feel about, instead of having to apply |
@dknopik Threw together a quick POC. I think I that approach works very nice. Take a look when you have a sec and if thats along the lines of what you were thinking ill clean it up and make sure it works. |
.await | ||
.expect("Failed to construct event syncer"); | ||
let mut event_syncer = | ||
SsvEventSyncer::new(db.clone(), config, Arc::new(AtomicBool::new(false))) |
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 feel like it would be bit cleaner to create the Arc within the new
method.
yea, seems good! This is what I meant. :) |
Issue Addressed
#119
Proposed Changes
This PR introduces a way to handle rpc errors and signal if sync is stalled.
If a websocket goes down or an rpc endpoint is having issues,
OPERATIONAL_STATUS
is set to false. The rest of the application can be conditioned on this value to determine if the execution layer is having sync issues.If there is an rpc error, there is nothing we can do until the endpoint is operational again. The simplest way to test this is just to continuously poll for a block number with exponential backoffs. There is no longer a set number of retries. It just keeps retrying until it is valid again.