-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactoring] Break deterministic mns circular dependencies #2649
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
furszy
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.
Code review ACK f7c2663.
extra nit: would rename the specialtx.h/cpp files to validation_specialtx.h/cpp.
f7c2663 to
cbc874e
Compare
|
Rebased, file renamed, and dropped unused header imports. |
furszy
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 cbc874e
cbc874e to
0a67b8f
Compare
|
Rebased, fixing conflict in the circular dependency list. |
furszy
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.
re-ACK 0a67b8f after rebase.
In order to validate the masternode collateral utxo. Instead encapsulate GetUTXOCoin in CCoinsViewCache, and provide a pointer/reference to the view from the validation code to CheckSpecialTx/ProcessSpecialTxsInBlock. Remove unneeded GetUXOHeight.
thus breaking the circular dependency deterministicmns <-> specialtx
thus making providertx responsible only of the definition of the payload primitives (therefore not depending on deterministicmns). this breaks several circular dependencies.
which eliminates 5 circular dependencies
0a67b8f to
037abb5
Compare
furszy
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.
rebase utACK 037abb5
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 037abb5
This PR removes several circular dependencies related to deterministic masternodes code.
The chain of dependencies now is:
validation->specialtx(containing the specialtx validation/processing code) ->deterministicmns(containing the dmn manager)Functions defined in
specialtxnow take a view of the coins cache as parameter, thus no longer depend onvalidationand only requirecoins.Both
specialtxanddeterministicmnsdepend onprovidertx, which now is responsible only for the definition of each payload class and does not depend on any of the previous modules.Also, add more unit tests for invalid collateral in ProReg txes.