-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fire TransactionRemovedFromMempool callbacks from mempool #14384
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
Fire TransactionRemovedFromMempool callbacks from mempool #14384
Conversation
c22e3aa
to
249df58
Compare
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. |
249df58
to
a60a187
Compare
Concept ACK Let's get rid of these ugly circular dependencies! :-) |
48d4bb2
to
1c2b458
Compare
1c2b458
to
e729c6f
Compare
e729c6f
to
1ac729f
Compare
1ac729f
to
e72cd85
Compare
e72cd85
to
b58bbc9
Compare
ACK 37fd92b This is basically some helpful code-shuffling; the change removes unneeded code to absorb the |
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 37fd92b
Nice cleanup that improves separation of concerns and enables removing MempoolEntryRemoved
, RegisterWithMempoolSignals
, and UnregisterWithMempoolSignals
.
This isn't strictly worse, but its still super awkward....CTxMemPool is (mostly) a "dumb datastructure", with all the adding/removing happening in validation.cpp. Currently its double awkward cause they're signals that go back to validation so that validation can fire appropriate events, but just firing the events inside a datastructure is also really awkward. Is there an equally-easy way to move the event-firing back into validation.cpp? |
I don't think there is. That would require that every site that validation calls a
There are probably more. I don't think those call sites have ever handled firing the events, and adding that functionality would be new data structures, function signatures and logic. This seems to be a strict improvement to me. The events are being fired from exactly the same place as before, except that there's no weird indirection in the validation interface. |
Re-run ci |
Right, certainly don't interpret my comment as a NACK, then. Longer-term it would be nice, indeed, to move the event-firing into those callsites, cause the responsibility right now is very awkwardly split (hence why we're checking the reason in the first place - validation fires some similar things), but this isn't worse than master and if other PR's need this, do it! |
argh, needs trivial rebase for the linter |
This commit fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code.
37fd92b
to
e20c72f
Compare
ACK e20c72f |
e20c72f Fire TransactionRemovedFromMempool from mempool (251) Pull request description: This pull request fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. It also resolves the `txmempool -> validation -> validationinterface -> txmempool` circular dependency. Ideally, `validationinterface` is a dumb component that doesn't have any knowledge of the sub-systems it sends its notifications to. The commit that aims to resolve this circular dependency by moving `txmempool` specific code out of `validationinterface` to `txmempool` where it belongs. ACKs for top commit: jnewbery: ACK e20c72f Tree-SHA512: 354c3ff1113b21a0b511d80d604edfe3846dddae3355e43d1387f68906e54bf5dc01e7c029edc0b8e635b500b2ab97ee50362e2486eb4319f7347ee9a9e6cef3
ACK e20c72f, only rebased. |
Posthumous ACK e20c72f |
…m mempool e20c72f Fire TransactionRemovedFromMempool from mempool (251) Pull request description: This pull request fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. It also resolves the `txmempool -> validation -> validationinterface -> txmempool` circular dependency. Ideally, `validationinterface` is a dumb component that doesn't have any knowledge of the sub-systems it sends its notifications to. The commit that aims to resolve this circular dependency by moving `txmempool` specific code out of `validationinterface` to `txmempool` where it belongs. ACKs for top commit: jnewbery: ACK e20c72f Tree-SHA512: 354c3ff1113b21a0b511d80d604edfe3846dddae3355e43d1387f68906e54bf5dc01e7c029edc0b8e635b500b2ab97ee50362e2486eb4319f7347ee9a9e6cef3
The reason parameter was removed in bitcoin#14384 as part of a clean-up but the reason would be useful to log according to comments on the PR.
Summary: This commit fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. This is a backport of Core [[bitcoin/bitcoin#14384 | PR14384]] policyestimator_tests was modified to use TestingSetup because it uses the `CTxMemPool::TrimToSize` function which now may trigger the signal, but the signals handlers are not setup properly to do so using `BasicTestingSetup`. Test Plan: ninja all check-all Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6451
…m mempool e20c72f Fire TransactionRemovedFromMempool from mempool (251) Pull request description: This pull request fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. It also resolves the `txmempool -> validation -> validationinterface -> txmempool` circular dependency. Ideally, `validationinterface` is a dumb component that doesn't have any knowledge of the sub-systems it sends its notifications to. The commit that aims to resolve this circular dependency by moving `txmempool` specific code out of `validationinterface` to `txmempool` where it belongs. ACKs for top commit: jnewbery: ACK e20c72f Tree-SHA512: 354c3ff1113b21a0b511d80d604edfe3846dddae3355e43d1387f68906e54bf5dc01e7c029edc0b8e635b500b2ab97ee50362e2486eb4319f7347ee9a9e6cef3
…fication fix f2734f0 [Tests] Fix policyestimator and validation_block tests (random-zebra) 3448bc8 wallet: Minimal fix to restore conflicted transaction notifications (Antoine Riard) ba9d84d feature_notifications.py mimic upstream is_wallet_compiled() function to make future back ports easier. (furszy) 37c9944 [mempool] Remove NotifyEntryAdded and NotifyEntryRemoved callbacks (John Newbery) 5cc619f [validation] Remove pool member from ConnectTrace (John Newbery) 1e453b7 [validation] Remove NotifyEntryRemoved callback from ConnectTrace (John Newbery) e774bfd [validation] Remove conflictedTxs from PerBlockConnectTrace (John Newbery) 389680a [validation interface] Remove vtxConflicted from BlockConnected (furszy) 19c9383 [wallet] Notify conflicted transactions in TransactionRemovedFromMempool (John Newbery) 139882d Fire TransactionRemovedFromMempool from mempool This commit fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code. (furszy) Pull request description: PR built on top of #2209, #2235 and #2240 (don't get scared by the amount of commits, most of them are coming from 2209. Will disappear as soon as that one gets merged). Based on the brief talk originated in #2209 (comment) . Solving the conflicted transactions external listeners notification. Adapting the following PRs: bitcoin#14384, bitcoin#17477 and bitcoin#18982. Without functional test support, for the time being, for the lack of RBF functionality. ACKs for top commit: Fuzzbawls: ACK f2734f0 random-zebra: re-utACK f2734f0 and merging... Tree-SHA512: 07d437e0d5e5d9798b16d982b6f58585d1f0dcd82251c5ac06f47e44233433831243d451ce43068e33c6002a64b76fa4d165167a2cbaeeedc28cde2019853565
This pull request fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code.
It also resolves the
txmempool -> validation -> validationinterface -> txmempool
circular dependency.Ideally,
validationinterface
is a dumb component that doesn't have any knowledge of the sub-systems it sends its notifications to. The commit that aims to resolve this circular dependency by movingtxmempool
specific code out ofvalidationinterface
totxmempool
where it belongs.