-
Notifications
You must be signed in to change notification settings - Fork 37.4k
refactor: Removal of circular dependency between index/txindex, validation and index/base #13942
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
c2a55e7
to
d22e36a
Compare
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
How about splitting the content further to fit more functional areas? E.g. there's a pretty clear division between disk-oriented functions and block-index-oriented functions, seems they are independent of the other globals. |
You'll want to squash 86e36e0 |
In each file, you'll want to be sure each of the definitions used are included in the file directly or in the .h for that file if used there, or forward-declared. E.g.
I'm concerned about the fact that the globals are still set in |
051e981
to
d2caa43
Compare
Rebased, conflict solved, 86e36e064b18067f8c09f0a4f4bee55c76cbacf0 squashed. @Empact : Globals from Direct includes were added for both symbols used in |
…ation and index/base translation units
…ved from lint-circular-dependencies.sh
…es in validation_... files
…ckpoints circular dependency removed
93f2553
to
b9bc7ac
Compare
The refactor in #13144 also breaks the cyclic dependency cited as the motivation for this PR. That said, I still like the idea of breaking validation into multiple files. Though I prefer grouping them in a |
Needs rebase |
@jimpo Thanks for pointing it out. I'll close it after #13144 being merged and continue to work on splitting edit: Please note that also |
Still needs rebase, so closing for now. Let me know when you want to work on this again, so I can reopen. |
After PR #13033 and PR #13243 there is a useful framework to add more indexes other than txindex, however circular dependencies detected by lint (
index/txindex -> validation -> index/txindex
andindex/txindex -> index/base -> validation -> index/txindex
) would prevent such solution to pass CI checks without adding an exception rule in check scrypt. In case one calls newly added index method invalidation.cpp
, another circular dependency is created because new index is supposed to inherit from index/base. My proposition is to splitvalidation.cpp
into two parts, one with its core features / functionalities and other with utils used in other translation units that require includingvalidation
. No functional change in code is expected here as it is only moved between files, and a circular dependency is removed.