-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactoring] Decouple and encapsulate tier two synchronization state #2690
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
[Refactoring] Decouple and encapsulate tier two synchronization state #2690
Conversation
random-zebra
left a comment
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.
Very nice refactoring. Code ACK with some notes.
3c69135 to
a4526d1
Compare
|
Updated per feedback 👍 . |
a9a18ac to
762fbd7
Compare
8d75f27 to
4b3bcfb
Compare
|
Updated per feedback, squashed it in your 4b3bcfb zebra. |
random-zebra
left a comment
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.
ACK 4b3bcfb95145eb4ee7905899daafa62cb253c7b7
|
Just noticed that need to rebase this one once more, the new test |
4b3bcfb to
24d9fa5
Compare
|
rebased, ready to go once more. |
random-zebra
left a comment
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.
ACK 24d9fa5a554068a6261328b1b5e60562e9a2fa41
24d9fa5 to
7ac83b7
Compare
|
due conflicts with recently merged PRs, rebased on master once more. |
7ac83b7 to
75bc24f
Compare
random-zebra
left a comment
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.
ACK 75bc24f708b2f6c4d8de1ca53a462ca882b15df1
…:Process function. So the reset call only happens in the mnsync thread and not on every thread/object that calls to a getter function..
…_sync_state class which only stores the final value. And rename it to UpdateBlockchainSync.
… most of the masternode-sync dependencies.
…sync status every 30 seconds.
And remove extra call to SetBlockchainSync(false) from CMasternodeSync after calling CMasternodeSync::Reset()
75bc24f to
3e05c82
Compare
|
rebased for merge conflicts with 2697, had to dismiss the approval again. |
random-zebra
left a comment
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.
ACK 3e05c82 again. Let's get this merged.
Fuzzbawls
left a comment
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.
ACK 3e05c82
Work decoupled from #2647 which has grew a lot lately. So it can get reviewed and merged in parallel of #2607.
Essentially have encapsulated the tier two synchronization status in a separate object which is only in charge of storing and retrieving the sync status members values in a synchronic manner.
Under this new architecture, every manager/object that needs access to it can add a small dependency to the new
g_tiertwo_sync_stateobject only (which has no other dependencies), without depending on the wholemasternodesSyncobject (which is a bad name for the tier two sync manager, but.. renaming will come in another PR), which depends on every other tier two manager and lot other files.Plus, to not generate confusions, the
g_tiertwo_sync_statemembers update are only, and exclusively, done by the tier two sync manager.Fixing in this way, at least (because there are surely more), the following problems:
Circular dependencies:
Allow and guard concurrent access. (Prior to this work, the word "concurrency" was inexistent for this code).