-
Notifications
You must be signed in to change notification settings - Fork 111
[adb] [sync] Update sync example client to continuously re-sync to newest server state #1305
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
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.
Pull Request Overview
Updates the sync example client to operate in a continuous synchronization mode rather than performing a single sync operation. The client now repeatedly syncs to the server's database state at configurable intervals.
- Added continuous sync loop with configurable sync interval parameter
- Updated documentation to reflect the new continuous operation mode
- Enhanced example output logs to show sync iteration tracking
…n new client connection
- **Sync Completion**: Client continues until all operations are applied and state matches server's target | ||
- **Database Closure**: Client closes the database to prepare for next iteration | ||
- **Wait Period**: Client waits for the configured sync interval before starting next iteration | ||
5. **Continuous Operation**: This process continues indefinitely, allowing the client to stay synchronized with the ever-changing server state |
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 had imagined, originally, that we'd "never end the sync" procedure (while still allowing db access) rather than continuously restarting the entire thing but I think that's a significant amount of extra work.
This was a pattern I thought could be useful for indexing-focused nodes that don't want to (or can't) run consensus (and just want to sync state proofs).
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 what you have is definitely worth keeping as part of the example in any case 👍
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.
Looks very close (too)
Once you update the code to use a single connection in the client, should be g2g. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #1305 +/- ##
=======================================
Coverage 91.20% 91.20%
=======================================
Files 248 248
Lines 62084 62084
=======================================
Hits 56623 56623
Misses 5461 5461 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
No description provided.