-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2750: Refactor chain following r=piotr-iohk a=Anviking ### Issue Number Based on #2745 ADP-871 ### Motivation Simplify and clean up the chain following code, in the hope of making the wallet more robust against node disconnects. In particular, reduce the number of threads used to run the ChainSync protocol. ### Overview * The `chainSync` function now takes a record of callbacks, `ChainFollower`, as an argument. These callbacks are used to request the current intersection, as well as react to roll forward and roll backwards messages. * Remove the old `Cursor` type. * Reduce the number of threads used for implementing the above. ### Progress - [x] Integration tests run without errors - [ ] Clean up / review more closely - [x] Corner cases - [x] Logging - [x] Aggregation of sync progress works again - [x] Ensure that all `ChainFollowLog` messages are traced or removed if redundant. - [x] `withFollowStatsMonitoring` runs in a separate thread so that it can compute statistics in regular time intervals. - [ ] Node disconnect errors - [x] … are thrown as exceptions in `connectTo` and are handled by `recoveringNodeConnection` - [ ] Check again at the end that the PR solves the bug - [x] Can we property-test this? (Probably no benefit.) - [x] Check for performance regressions (running the chain-sync and db operations on the same thread might make it slightly slower) - Actually seemed 10% faster running integration tests locally with -j 8. - ef3fdc3 -> 274s (n=2) - master -> 303s (n=1) <- but I only ran once - Speedup _could be_ related to chain-following now being able to rollback without necessarily re-negotiating the intersection. ### Comments <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Heinrich Apfelmus <[email protected]> Co-authored-by: Johannes Lund <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,057 additions
and
1,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.