-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Use shared pointers only in validation interface #18354
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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, 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. |
Simplify patch, make more fuzzing test
|
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.
#18338 may still have some issues, but I think it is probably a better approach and I would suggest abandoning this.
Use future instead of raw loop for waiting pending callbacks. It still much matters to me compared to #18338 |
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.
Approach NACK. The problem is not in the scheduler, but in the invalid assumption that it's safe to delete a CValidationInterface
instance right after UnregisterValidationInterface
- it's wrong because of boost::signals2 threading model.
@promag same as your approach with more aggressive refactor + missing virtual desctructors. |
Concept ACK, though this is making a lot of changes in a single commit. The changes will probably get simpler if #18338 is merged first, and maybe they can be broken up into smaller commits. Could consider rebasing on top of #18338 of you don't want to wait for it to be merged. I'd also encourage you to review #18338! |
Oh, just saw this PR has expanded since I looked at it previously. I think some of the uses of shared_ptr / weak_ptr here like the new ones added in CWalletTx do not make sense. shared_ptr / weak_ptr only make sense when lifetime of the reference doesn't have a definite scope. For cases like CWalletTx where the wallet reference can't outlive the wallet, It would probably make sense to break this PR up into multiple commits so individual changes here can be understood and reviewed more easily |
I agree, in plus it defines no ownership. I agree, that reference makes much more sense here, too |
Is this still a bug fix? Do you think you can split in multiple commits? |
Hi @promag mostly it's not an issue, AFAIK. It has some side effects in Qt gui, it was fixed i think. Notification proxy can extend notification lifetime which isn't correct to me. As well as using shared pointers only to validation interface, missing virtual destructors to interface classes like NetEventsInterface (it's not a problem since it's not deleted through base pointer till now). |
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
Refactor pwallet to wallet (wallet* to wallet shared_ptr) is removed. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
Needs rebase if still relevant |
I will investigate if it still needed, actually @ryanofsky does excellent work to well define shared interfaces ownership. |
There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Closing for now. Feel free to ask for this to be reopened or create a new pull request. |
This pull request fully replace #18279 it fix 3 issues with wallet