-
Notifications
You must be signed in to change notification settings - Fork 38.7k
net: make m_mempool optional in PeerManager #33029
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
base: master
Are you sure you want to change the base?
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33029. ReviewsSee the guideline for information on the review process. 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. |
80efcb1 to
e3f9f2a
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
e3f9f2a to
4a2a159
Compare
maflcko
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.
I think the changes are conceptually nice, but hard to see a user-visible benefit from this alone. Combined with the difficulty to review this (in its current state) around nullptr deref, it will probably be a hard sell.
4a2a159 to
1ad5238
Compare
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
1ad5238 to
6f5f78b
Compare
6f5f78b to
140a1cd
Compare
- Make m_mempool a pointer in the initialization of PeerManager - Check that m_mempool exists before dereferencing the pointer in PeerManager functions - If m_mempool is a nullptr, turn off transaction relay with all peers by setting m_tx_relay to nullptr - rename pool parameter to mempool for consistency
140a1cd to
448a67c
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
This PR is a continuation of →#22850, to make m_mempool an optional pointer in PeerManager instead of a reference.
some benefits, as mentioned here:#26247 (comment) are:
In Chainstate: https://github.com/bitcoin/bitcoin/blob/master/src/validation.h#L532
In BlockAssembler: https://github.com/bitcoin/bitcoin/blob/master/src/node/miner.h#L168
So adding this to PeerManager improves consistency.
-nomempoolis still being considered, but if it is, then this pointer approach would be a necessary prerequisite.There was a suggestion here -> #26247 (comment) to refactor/introduce helper functions like
RejectIncomingTxsthat would returnm_mempool, but I’m not entirely sure about this approach.this wouldn't be ideal since in some call sites likePushNodeVersionandNetMsgType::SENDTXRCNCL, mempool isn’t needed at all.I'd like to continue working on this, and I'm looking for feedback on whether this is still relevant and which approach to go with. Should I follow the suggestion to add helper functions that return the m_mempool pointer, or should I stick with checking if m_mempool is null, or perhaps consider a different approach altogether?