refactor: Nuke policy/fees->mempool circular dependencies #17786

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:20191221-mempool-circ-dep changing 18 files +190 −160
  1. hebasto commented at 5:08 PM on December 21, 2019: member

    This PR:

    • gets rid of the policy/fees -> txmempool -> policy/fees circular dependency
    • is an alternative to #13949, which nukes only one circular dependency
  2. fanquake added the label Refactoring on Dec 21, 2019
  3. hebasto commented at 5:09 PM on December 21, 2019: member
  4. DrahtBot commented at 7:04 PM on December 21, 2019: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky, theStack, glozow
    Concept ACK practicalswift, JeremyRubin, Empact
    Stale ACK promag

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #26153 (Reduce wasted pseudorandom bytes in ChaCha20 + various improvements by sipa)
    • #25361 (BIP324: Cipher suite by dhruv)
    • #25325 (Add pool based memory resource by martinus)
    • #24545 (BIP324: Enable v2 P2P encrypted transport by dhruv)
    • #23962 (Use int32_t type for transaction size/weight consistently by hebasto)
    • #23561 (BIP324: Handshake prerequisites by dhruv)
    • #23233 (BIP324: Add encrypted p2p transport {de}serializer by dhruv)

    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.

  5. promag commented at 7:30 PM on December 21, 2019: member

    Concept ACK.

  6. promag commented at 12:09 PM on December 22, 2019: member

    ACK fbf6b7524eac8a7668e49b7c340d06447a9d248d.

    I'd squash 1st and 2nd commits. 3rd commit is unrelated but is a nice cleanup.

  7. practicalswift commented at 12:39 PM on December 22, 2019: contributor

    Concept ACK: thanks for nuking circular dependencies

  8. hebasto force-pushed on Dec 22, 2019
  9. hebasto commented at 12:47 PM on December 22, 2019: member

    @promag

    I'd squash 1st and 2nd commits. 3rd commit is unrelated but is a nice cleanup.

    Done.

  10. hebasto commented at 1:16 PM on December 22, 2019: member

    ~I stumble on UB sanitizer. How could a move-only change cause an error?~

    ~Is this a side effect of circular dependencies resolving?~ nm

  11. hebasto force-pushed on Dec 22, 2019
  12. hebasto force-pushed on Dec 22, 2019
  13. hebasto commented at 2:42 PM on December 22, 2019: member

    Travis is happy now ;)

  14. JeremyRubin commented at 3:32 PM on January 17, 2020: contributor

    Generally agree with this change, I've thought about doing it myself a few times myself. It also seems to be a good alternative to the observer pattern mentioned as we change far fewer things to get the same circular dependency break. So a slight code review ACK that this seems correct.

    Slightly short of concept ack for a few reasons:

    1. Needs a simple benchmark to show that we haven't made functions calling the CTxMemPoolEntry's non-header functions slower because they are no longer within the same compilation unit
    2. Some other changes I've been working on lately w.r.t. epoch mempool introduce some new classes & move code between the CTxMemPool and CTxMemPoolEntry classes; while those can be rebased, it's not clear where some of the shared code should live (perhaps in a third additional header, or a new circular dependency). We already have some things which are inherent circular dependencies (that won't get picked up by the linter, maps of MemPoolChildren/MemPoolParents) that will deliver a big performance win to get rid of (I think it will at least), so I'd rather kill those circular dependencies first so that it doesn't become harder to do later -- I'm happy to open up a PR for that once the first step of my #17268 Project, #17925, goes through.
  15. JeremyRubin added this to the "Unrelated Refactors (Project Conflicts)" column in a project

  16. hebasto commented at 12:07 PM on January 22, 2020: member

    @JeremyRubin

    ... to show that we haven't made functions calling the CTxMemPoolEntry's non-header functions slower because they are no longer within the same compilation unit

    How is it possible?

  17. JeremyRubin commented at 5:45 PM on January 22, 2020: contributor

    It's annoying, but because these functions were previously in the same translation unit then it's possible they can get completely inlined, but now they're in separate units they will definitely trigger function calls.

    Because these updater functions get called in hot loops you have possibly replaced something optimized previously with something slow.

    This matters a bit because we may expect these loops/regions to get even hotter if we increase mempool limits.

    One way of addressing this would be to make CTxMemPoolEntry header only...

  18. hebasto commented at 7:47 AM on January 24, 2020: member

    @JeremyRubin

    It's annoying, but because these functions were previously in the same translation unit then it's possible they can get completely inlined, but now they're in separate units they will definitely trigger function calls.

    IIUC, making function inline depends on compiler and its optimization settings. The bitcoind compiled with GCC 7.4.0 was checked with nm tool, and CTxMemPoolEntry member function symbols are present, therefore those functions are not inlined (except those which are defined in class declaration, as expected).

    It seems runtime performance issues and circular dependency resolving are orthogonal. And "yes", we could

    ... make CTxMemPoolEntry header only...

  19. JeremyRubin commented at 6:27 PM on January 24, 2020: contributor

    Correct; this is compiler dependent behavior. But we happen to compile with optimizations enabled for release builds -- not sure if we do different flags for non release builds (I think it's the same?).

    Presence of the symbols doesn't prove that they aren't also inlined. An inline function is a hint to inline, not a mandate, and the function can be either called or or inlined depending on context, you would need to check the actual call sites.

    I agree it's not a large issue; but specifically code organization does affect emitted code (this is what LTO is intended, in a sense, to get around, but I don't think we do that other than experimentally)

  20. hebasto commented at 6:35 PM on January 24, 2020: member

    Presence of the symbols doesn't prove that they aren't also inlined. An inline function is a hint to inline, not a mandate, and the function can be either called or or inlined depending on context, you would need to check the actual call sites.

    I mean if a function is inlined in all call sites, there is no dedicated assembly code and no symbol. Could a compiler inline a function in some call sites and make a standard function call of the same function in other call sites?

  21. gmaxwell commented at 6:54 PM on January 24, 2020: contributor

    Unless the symbol isn't exported there will be a separate copy of it included in the object for external callers. That extra copy will persist in the final binary so long as there are any non-inlined callers.

    For a quick check, just look at the size of all functions in dump of the binary. If they're all the same size then it's very likely that all you did was move things around.

  22. sipa commented at 7:19 PM on January 24, 2020: member

    In C++, inline is more than a hint, and actually has a meaning: it's a function that may be defined (and exported from) multiple translation units without conflicting with itself (it's only well defined if all definitions are identical, though). This is what allows having code in .h files. In practice it means the linker will merge all the definitions into one symbol.

  23. JeremyRubin commented at 11:20 PM on January 24, 2020: contributor

    I think what @gmaxwell says is correct with my question. @sipa that sounds correct. These weren't previously marked inline either, so I guess what I meant to capture is that not marking inline is a hint not to inline but not a mandate to not inline. E.g., if some function F is called by G, F may or may not be inlined depending on the compiler if they are in the same translation unit, but certainly won't be if F is in a different translation unit, is non inline, and LTO is not enabled.

  24. JeremyRubin commented at 9:47 PM on January 28, 2020: contributor

    I think if you were to just put all the mempool entry functions into the header I wouldn't have any concerns. It doesn't seem to me like there's a really strong reason for them to be separate, and any time you change the initializers you've likely also changed the class definition so it doesn't seem like it would trigger recompilation explosions.

    It also (maybe I'm wrong here) looks like you have some unneeded dependencies in the cpp (e.g., memusage), so that can be pruned out to keep the header small.

  25. hebasto force-pushed on Jan 29, 2020
  26. hebasto commented at 8:26 PM on January 29, 2020: member

    @JeremyRubin Thank you for your review.

    I think if you were to just put all the mempool entry functions into the header I wouldn't have any concerns.

    Done.

    It also (maybe I'm wrong here) looks like you have some unneeded dependencies in the cpp (e.g., memusage), so that can be pruned out to keep the header small.

    All #includes are checked again. They all are needed, e.g., core_memusage.h is needed for RecursiveDynamicUsage.

  27. DrahtBot added the label Needs rebase on Jan 30, 2020
  28. hebasto force-pushed on Jan 30, 2020
  29. hebasto commented at 4:53 PM on January 30, 2020: member

    Rebased after #17261 has been merged.

  30. DrahtBot removed the label Needs rebase on Jan 30, 2020
  31. maflcko commented at 7:38 PM on January 30, 2020: member

    Looking at the (currently) 9 conflicts, maybe it makes sense to postpone this changeset until after some of the other user-facing/features got merged to the mempool code?

  32. DrahtBot added the label Needs rebase on Feb 3, 2020
  33. hebasto force-pushed on Feb 3, 2020
  34. hebasto commented at 7:32 PM on February 3, 2020: member

    Rebased after #17925 has been merged.

  35. DrahtBot removed the label Needs rebase on Feb 3, 2020
  36. DrahtBot cross-referenced this on Feb 11, 2020 from issue txmempool: split epoch logic into class by ajtowns
  37. DrahtBot cross-referenced this on Feb 11, 2020 from issue Remove UBSan suppressions for CTxMemPool* by hebasto
  38. DrahtBot cross-referenced this on Feb 11, 2020 from issue Switch to weight units for all feerates computation by darosior
  39. DrahtBot cross-referenced this on Feb 11, 2020 from issue rpc: Report reason for replaceable txpool transactions by maflcko
  40. DrahtBot cross-referenced this on Feb 12, 2020 from issue Add fee_est tool for debugging fee estimation code by ryanofsky
  41. DrahtBot cross-referenced this on Feb 22, 2020 from issue Change UpdateForDescendants to use Epochs by JeremyRubin
  42. DrahtBot cross-referenced this on Mar 7, 2020 from issue [WIP] Index for UTXO Set Statistics by fjahr
  43. DrahtBot cross-referenced this on Mar 12, 2020 from issue refactor: Add params to node context by maflcko
  44. hebasto commented at 4:54 PM on April 11, 2020: member

    Updated 19f6bf826d890cc78bd4a19f10dfbf59dd58c10d -> 287b930a18921716bdf6961350959804042b46b0 (pr17786.07 -> pr17786.08, diff):

  45. Empact commented at 9:20 PM on April 11, 2020: member

    Re-ACK https://github.com/bitcoin/bitcoin/pull/17786/commits/287b930a18921716bdf6961350959804042b46b0 - reviewed diff particularly changed lines as identified by git. Didn't audit the includes.

  46. DrahtBot cross-referenced this on May 28, 2020 from issue refactor: Cleanup thread ctor calls by hebasto
  47. DrahtBot cross-referenced this on Jun 20, 2020 from issue build: Do not include server symbols in wallet by maflcko
  48. DrahtBot added the label Needs rebase on Jul 1, 2020
  49. hebasto force-pushed on Jul 3, 2020
  50. hebasto commented at 7:01 AM on July 3, 2020: member

    Rebased 287b930a18921716bdf6961350959804042b46b0 -> 219324ca4fe0d466c9007c30543c88444dec3569 (pr17786.08 -> pr17786.09) due to the conflict with #19331.

  51. DrahtBot removed the label Needs rebase on Jul 3, 2020
  52. DrahtBot cross-referenced this on Jul 10, 2020 from issue Remove CTxMempool::mapLinks data structure member by JeremyRubin
  53. DrahtBot cross-referenced this on Jul 15, 2020 from issue Coinstats Index by fjahr
  54. DrahtBot cross-referenced this on Jul 30, 2020 from issue Disable fee estimation in blocksonly mode (by removing the fee estimates global) by darosior
  55. DrahtBot cross-referenced this on Aug 24, 2020 from issue rpc: Add dumpcoinstats by fjahr
  56. DrahtBot cross-referenced this on Aug 26, 2020 from issue validation: UTXO snapshot activation by jamesob
  57. DrahtBot cross-referenced this on Aug 29, 2020 from issue fuzz: Add fuzzing harness for TorController by practicalswift
  58. DrahtBot added the label Needs rebase on Sep 7, 2020
  59. hebasto force-pushed on Sep 7, 2020
  60. hebasto commented at 12:14 PM on September 7, 2020: member

    Rebased 219324ca4fe0d466c9007c30543c88444dec3569 -> 9782a8ee773a59667424353de047fd6bb9c3cb5d (pr17786.09 -> pr17786.10) due to the conflict with #19478.

  61. DrahtBot removed the label Needs rebase on Sep 7, 2020
  62. in src/txmempool_entry.h:90 in 9782a8ee77 outdated
      76 | +    LockPoints lockPoints;          //!< Track the height and time at which tx was final
      77 | +
      78 | +    // Information about descendants of this transaction that are in the
      79 | +    // mempool; if we remove this transaction we must remove all of these
      80 | +    // descendants as well.
      81 | +    uint64_t nCountWithDescendants{1}; //!< number of descendant transactions
    


    JeremyRubin commented at 6:26 PM on September 7, 2020:

    nit: slight preference to do all initialization in the constructor (for consistency/minimal diff)

  63. JeremyRubin approved
  64. JeremyRubin commented at 6:27 PM on September 7, 2020: contributor

    Looks correct / refactor only.

    CR-Ack.

  65. hebasto commented at 6:30 PM on September 7, 2020: member

    @promag @empact Mind re-reviewing?

  66. Empact commented at 11:36 PM on September 7, 2020: member
  67. DrahtBot cross-referenced this on Sep 28, 2020 from issue Move SaltedHashers to separate file and add some new ones by achow101
  68. DrahtBot cross-referenced this on Sep 29, 2020 from issue net: Use alternative port for incoming Tor connections by hebasto
  69. DrahtBot cross-referenced this on Oct 1, 2020 from issue wallet: Migrate legacy wallets to descriptor wallets by achow101
  70. DrahtBot cross-referenced this on Oct 22, 2020 from issue refactor: CTxMempool constructor clean up by ellemouton
  71. DrahtBot cross-referenced this on Nov 13, 2020 from issue Avoid signed integer overflow and invalid integer negation when loading malformed mempool.dat files by practicalswift
  72. DrahtBot added the label Needs rebase on Dec 1, 2020
  73. hebasto closed this on Aug 24, 2021

  74. hebasto cross-referenced this on Sep 21, 2021 from issue Use C++11 member initializer in CTxMemPoolEntry by maflcko
  75. maflcko commented at 2:45 PM on September 21, 2021: member

    Why the close?

  76. maflcko added the label Up for grabs on Sep 23, 2021
  77. hebasto reopened this on Sep 24, 2021

  78. hebasto force-pushed on Sep 24, 2021
  79. hebasto commented at 6:44 PM on September 24, 2021: member

    @MarcoFalke

    Why the close?

    Reopened and rebased 9782a8ee773a59667424353de047fd6bb9c3cb5d -> 77438e18478ca0a06708f3e988fdb31567bb76e0 (pr17786.10 -> pr17786.11) on top of the merged #23054 and the recent CI changes.

  80. hebasto removed the label Up for grabs on Sep 24, 2021
  81. DrahtBot removed the label Needs rebase on Sep 24, 2021
  82. in src/txmempool_entry.h:120 in 9161fefe06 outdated
     112 | +    const CTransaction& GetTx() const { return *this->tx; }
     113 | +    CTransactionRef GetSharedTx() const { return this->tx; }
     114 | +    const CAmount& GetFee() const { return nFee; }
     115 | +    size_t GetTxSize() const
     116 | +    {
     117 | +        return GetVirtualTransactionSize(nTxWeight, sigOpCost);
    


    maflcko commented at 7:49 AM on September 25, 2021:

    I think it makes sense to keep this in the cpp file, to keep the header free of unneeded includes.


    hebasto commented at 7:53 AM on September 25, 2021:

    There were concerns from @JeremyRubin:

    I think if you were to just put all the mempool entry functions into the header I wouldn't have any concerns.

  83. DrahtBot cross-referenced this on Sep 25, 2021 from issue refactor: pass CTxMemPool and CFeeRate in-param objects by const reference by jonatack
  84. DrahtBot cross-referenced this on Sep 25, 2021 from issue Package-aware fee estimation by darosior
  85. DrahtBot cross-referenced this on Sep 25, 2021 from issue fees: skip pointless fee parameter calculation during IBD by rjnrohit
  86. DrahtBot cross-referenced this on Sep 25, 2021 from issue cut the validation <-> txmempool circular dependency 2/2 by glozow
  87. DrahtBot cross-referenced this on Sep 26, 2021 from issue Mempool Update Cut-Through Optimization by JeremyRubin
  88. DrahtBot cross-referenced this on Sep 26, 2021 from issue doc: Fix several references in txmempool comments by kiminuo
  89. DrahtBot cross-referenced this on Oct 1, 2021 from issue txmempool -/-> validation 1/2: improve performance of check() and remove dependency on validation by glozow
  90. DrahtBot cross-referenced this on Oct 7, 2021 from issue refactor: move `update_*` structs from txmempool.h to .cpp file by theStack
  91. DrahtBot added the label Needs rebase on Oct 25, 2021
  92. hebasto force-pushed on Dec 4, 2021
  93. hebasto commented at 7:52 PM on December 4, 2021: member

    Rebased 77438e18478ca0a06708f3e988fdb31567bb76e0 -> 785968d88833c1fb4018050849f88b6014a4e8eb (pr17786.11 -> pr17786.12) on top of the recent conflicting changes.

  94. DrahtBot removed the label Needs rebase on Dec 4, 2021
  95. DrahtBot cross-referenced this on Dec 5, 2021 from issue rpc: getblockfrompeer by Sjors
  96. DrahtBot added the label Needs rebase on Dec 8, 2021
  97. hebasto force-pushed on Dec 29, 2021
  98. hebasto commented at 8:25 PM on December 29, 2021: member

    Rebased 785968d88833c1fb4018050849f88b6014a4e8eb -> 85a7dcb799e8f0d10f8b58d23a32aeb14ea872ef (pr17786.12 -> pr17786.13) on top of the recent conflicting changes.

  99. DrahtBot removed the label Needs rebase on Dec 29, 2021
  100. DrahtBot cross-referenced this on Dec 30, 2021 from issue refactor: Remove implicit-integer-sign-change suppressions in validation by maflcko
  101. DrahtBot added the label Needs rebase on Jan 2, 2022
  102. hebasto force-pushed on Jan 2, 2022
  103. hebasto commented at 10:31 AM on January 2, 2022: member

    Rebased 85a7dcb799e8f0d10f8b58d23a32aeb14ea872ef -> b0225a6f26876873265cc76e2ad8f68e35401bdf (pr17786.13 -> pr17786.14) due to the conflict with #23795.

  104. DrahtBot removed the label Needs rebase on Jan 2, 2022
  105. DrahtBot cross-referenced this on Jan 3, 2022 from issue Remove txmempool implicit-integer-sign-change sanitizer suppressions by maflcko
  106. DrahtBot cross-referenced this on Jan 4, 2022 from issue Use `int32_t` type for most transaction size/weight values by hebasto
  107. glozow commented at 5:20 PM on January 4, 2022: member

    Concept ACK to removing this circular dependency

    But perhaps a better approach would be to remove minerPolicyEstimator from txmempool, make it a client of CValidationInterface instead (will need to return more information to clients in the interface), and remove policy/fees as a dependency of txmempool. In fact, it seems like background fee estimator has been planned for a while (https://github.com/bitcoin/bitcoin/pull/10199#discussion_r115530273) and implemented but unmerged at some point (#11775).

  108. DrahtBot cross-referenced this on Jan 5, 2022 from issue Fix signed integer overflow in prioritisetransaction RPC by maflcko
  109. DrahtBot added the label Needs rebase on Jan 25, 2022
  110. hebasto force-pushed on Jan 26, 2022
  111. hebasto commented at 9:17 AM on January 26, 2022: member

    Rebased b0225a6f26876873265cc76e2ad8f68e35401bdf -> 122db971c4e1283d8e500b03edbc0b026ad23d5a (pr17786.14 -> pr17786.15) due to the conflict with #21464.

  112. DrahtBot removed the label Needs rebase on Jan 26, 2022
  113. DrahtBot cross-referenced this on Jan 31, 2022 from issue zmq: Fix implicit-integer-sign-change by maflcko
  114. DrahtBot added the label Needs rebase on Feb 1, 2022
  115. hebasto force-pushed on Feb 2, 2022
  116. hebasto commented at 3:57 PM on February 2, 2022: member

    Rebased 122db971c4e1283d8e500b03edbc0b026ad23d5a -> f7297485cf2388352bd36bd2d4dea6ba009bba21 (pr17786.15 -> pr17786.16) due to the conflict with #24218.

  117. DrahtBot removed the label Needs rebase on Feb 2, 2022
  118. DrahtBot cross-referenced this on Feb 11, 2022 from issue addrman: Log too low compat value by maflcko
  119. DrahtBot cross-referenced this on Feb 21, 2022 from issue refactor: Avoid implicit-integer-sign-change in bech32.cpp by maflcko
  120. DrahtBot added the label Needs rebase on Feb 25, 2022
  121. hebasto force-pushed on Apr 5, 2022
  122. hebasto commented at 6:59 PM on April 5, 2022: member

    Rebased f7297485cf2388352bd36bd2d4dea6ba009bba21 -> 8675c9ae35aa37428732ed91c04dae94183e0705 (pr17786.16 -> pr17786.17).

  123. DrahtBot removed the label Needs rebase on Apr 5, 2022
  124. DrahtBot cross-referenced this on Apr 10, 2022 from issue refactor: Split ArgsManager out of util/system by Empact
  125. DrahtBot cross-referenced this on Apr 19, 2022 from issue lint: Convert lint-circular-dependencies.sh to Python by Smlep
  126. DrahtBot added the label Needs rebase on Apr 25, 2022
  127. hebasto force-pushed on May 28, 2022
  128. hebasto commented at 11:37 AM on May 28, 2022: member

    Rebased 8675c9ae35aa37428732ed91c04dae94183e0705 -> 083b8166e032dc6ea20eed4d13d3353e90a0a633 (pr17786.17 -> pr17786.18) due to the conflict with #24915.

  129. DrahtBot removed the label Needs rebase on May 28, 2022
  130. DrahtBot cross-referenced this on Jun 1, 2022 from issue Move minRelayTxFee to policy/settings by maflcko
  131. DrahtBot cross-referenced this on Jun 7, 2022 from issue [kernel 3a/n] Decouple `CTxMemPool` from `ArgsManager` by dongcarl
  132. DrahtBot added the label Needs rebase on Jun 7, 2022
  133. hebasto force-pushed on Jun 12, 2022
  134. hebasto commented at 12:25 PM on June 12, 2022: member

    Rebased 083b8166e032dc6ea20eed4d13d3353e90a0a633 -> 4a107ebe5892272cfb4b74085b2ab4bb06500b72 (pr17786.18 -> pr17786.19) due to the conflict with #25254.

  135. DrahtBot removed the label Needs rebase on Jun 12, 2022
  136. DrahtBot cross-referenced this on Jun 15, 2022 from issue Add pool based memory resource by martinus
  137. DrahtBot cross-referenced this on Jun 21, 2022 from issue Add a `-mempoolfullrbf` node setting by ariard
  138. DrahtBot cross-referenced this on Jun 22, 2022 from issue assumeutxo: add init and completion logic by jamesob
  139. DrahtBot added the label Needs rebase on Jun 27, 2022
  140. hebasto force-pushed on Jul 19, 2022
  141. hebasto commented at 8:03 PM on July 19, 2022: member

    Rebased 4a107ebe5892272cfb4b74085b2ab4bb06500b72 -> 3a430a4700780173cf4ea98ec9b4dbc2fc7b1984 (pr17786.19 -> pr17786.20).

  142. DrahtBot removed the label Needs rebase on Jul 19, 2022
  143. DrahtBot cross-referenced this on Jul 19, 2022 from issue Move DEFAULT_MAX_ORPHAN_TRANSACTIONS to node/txorphanage.h by maflcko
  144. DrahtBot cross-referenced this on Jul 21, 2022 from issue assumeutxo: snapshot initialization by jamesob
  145. DrahtBot cross-referenced this on Jul 21, 2022 from issue refactor: Remove all policy globals by maflcko
  146. DrahtBot cross-referenced this on Jul 29, 2022 from issue assumeutxo: background validation completion by jamesob
  147. DrahtBot cross-referenced this on Jul 29, 2022 from issue tidy: add modernize-use-using by fanquake
  148. DrahtBot added the label Needs rebase on Aug 3, 2022
  149. hebasto force-pushed on Aug 3, 2022
  150. hebasto commented at 2:00 PM on August 3, 2022: member

    Rebased 3a430a4700780173cf4ea98ec9b4dbc2fc7b1984 -> c4c311ea83338709a7b66c49a2364a65ae430c50 (pr17786.20 -> pr17786.21) due to the conflict with #25648.

  151. DrahtBot removed the label Needs rebase on Aug 3, 2022
  152. DrahtBot cross-referenced this on Sep 17, 2022 from issue Wallet: Add foreign_outputs metadata to support CoinJoin transactions by luke-jr
  153. DrahtBot cross-referenced this on Sep 22, 2022 from issue Reduce wasted pseudorandom bytes in ChaCha20 + various improvements by sipa
  154. DrahtBot cross-referenced this on Oct 4, 2022 from issue fuzz: add mempool_utils.cpp by fanquake
  155. DrahtBot added the label Needs rebase on Oct 5, 2022
  156. hebasto force-pushed on Oct 5, 2022
  157. hebasto commented at 11:28 AM on October 5, 2022: member

    Rebased c4c311ea83338709a7b66c49a2364a65ae430c50 -> 11d885bc3dd9a44af4c7007a95b4fbb6076e4428 (pr17786.21 -> pr17786.22) due to the conflict with #26250.

  158. DrahtBot removed the label Needs rebase on Oct 5, 2022
  159. DrahtBot cross-referenced this on Oct 5, 2022 from issue BIP324: Cipher suite by dhruv
  160. DrahtBot cross-referenced this on Oct 6, 2022 from issue BIP324: Enable v2 P2P encrypted transport by dhruv
  161. DrahtBot cross-referenced this on Oct 6, 2022 from issue BIP324: Handshake prerequisites by dhruv
  162. DrahtBot cross-referenced this on Oct 6, 2022 from issue BIP324: Add encrypted p2p transport {de}serializer by dhruv
  163. DrahtBot added the label Needs rebase on Oct 13, 2022
  164. hebasto force-pushed on Oct 14, 2022
  165. hebasto commented at 10:55 AM on October 14, 2022: member

    Rebased 11d885bc3dd9a44af4c7007a95b4fbb6076e4428 -> f140f9468bfa505a34112d625128f3fcff18ddba (pr17786.22 -> pr17786.23) due to the conflict with #25667.

  166. DrahtBot removed the label Needs rebase on Oct 14, 2022
  167. ryanofsky approved
  168. ryanofsky commented at 6:32 PM on November 16, 2022: contributor

    Code review ACK f140f9468bfa505a34112d625128f3fcff18ddba. This seems like an improvement over status quo to remove a circular dependency and improve code organization.

    I agree with Gloria in #17786 (comment) other improvements could also be made which remove the circular dependency, but they seem complimentary and could build on this.

    I think all the other discussion about code inlining and runtime performance and build performance makes sense, but I don't think those issues are a lot more pertinent to this PR than a lot of other PRs. So it just seems unlucky for this PR that they were brought up here. It would be good if we could think of a standard approach to avoiding performance regressions that could apply more fairly.

    One other suggestion to make the PR more reviewable might be to split it into two commits: a move-only commit that just moved the CTxMemPoolEntry class definition without changing it, followed by a commit inlining its various methods. (This PR has been open a while and I probably would have reviewed it earlier if the bigger moveonly change didn't include other changes and was easier to verify.)

  169. hebasto force-pushed on Nov 16, 2022
  170. hebasto commented at 8:13 PM on November 16, 2022: member

    @ryanofsky

    Thank you for your review!

    One other suggestion to make the PR more reviewable might be to split it into two commits: a move-only commit that just moved the CTxMemPoolEntry class definition without changing it, followed by a commit inlining its various methods.

    Done.

  171. refactor: Move `CTxMemPoolEntry` class to its own module
    This change nukes the policy/fees->mempool circular dependency.
    
    Easy to review using `diff --color-moved=dimmed-zebra`.
    75bbe594e5
  172. refactor: Inline `CTxMemPoolEntry` class's functions c8dc0e3eaa
  173. hebasto force-pushed on Nov 16, 2022
  174. ryanofsky approved
  175. ryanofsky commented at 4:18 PM on November 17, 2022: contributor

    Code review ACK c8dc0e3eaa9e0f956c5177bcb69632beb0d51770. Just include and whitespace changes since last review, and there's a moveonly commit now so it's very easy to review

  176. theStack approved
  177. theStack commented at 5:55 PM on November 17, 2022: contributor

    Code-review ACK c8dc0e3eaa9e0f956c5177bcb69632beb0d51770

    Nice to see another circular dependency gone 💯

  178. maflcko removed the label Refactoring on Nov 17, 2022
  179. DrahtBot added the label Refactoring on Nov 17, 2022
  180. fanquake requested review from glozow on Nov 18, 2022
  181. glozow commented at 12:40 AM on November 19, 2022: member

    utACK c8dc0e3eaa9e0f956c5177bcb69632beb0d51770, agree these changes are an improvement.

  182. glozow merged this on Nov 19, 2022
  183. glozow closed this on Nov 19, 2022

  184. hebasto deleted the branch on Nov 19, 2022
  185. JeremyRubin commented at 9:51 PM on November 19, 2022: contributor

    the reason it was brought up historically is that circa 2019/early 2020 I thought we might be able to increase mempool limits, and these functions end up being relatively hot, especially with larger workloads, so it made sense to be careful with them. @jamesob would probably be the guy to ask about tracking perf regressions....

  186. sidhujag referenced this in commit 5c18092e84 on Nov 20, 2022
  187. in src/Makefile.am:264 in c8dc0e3eaa
     260 | @@ -261,6 +261,7 @@ BITCOIN_CORE_H = \
     261 |    torcontrol.h \
     262 |    txdb.h \
     263 |    txmempool.h \
     264 | +  txmempool_entry.h \
    


    maflcko commented at 10:13 AM on November 21, 2022:

    If this is moved, why not move it to the right place, that is to kernel/txmempool_entry.h?


    hebasto commented at 10:42 AM on November 30, 2022:
  188. in test/sanitizer_suppressions/ubsan:66 in c8dc0e3eaa
      62 | @@ -62,6 +63,7 @@ implicit-integer-sign-change:script/bitcoinconsensus.cpp
      63 |  implicit-integer-sign-change:script/interpreter.cpp
      64 |  implicit-integer-sign-change:serialize.h
      65 |  implicit-integer-sign-change:txmempool.cpp
      66 | +implicit-integer-sign-change:txmempool_entry.h
    


    maflcko commented at 10:13 AM on November 21, 2022:

    Are they still needed?


    hebasto commented at 11:02 AM on November 21, 2022:

    Apparently, they do not. Removed in needless ~#26542~ #26545.

    Thank you!

  189. hebasto cross-referenced this on Nov 21, 2022 from issue Drop unneeded UBSan suppression by hebasto
  190. maflcko cross-referenced this on Nov 21, 2022 from issue test: Remove unused sanitizer suppressions by maflcko
  191. hebasto cross-referenced this on Nov 30, 2022 from issue refactor: Move `txmempool_entry.h` --> `kernel/mempool_entry.h` by hebasto
  192. hebasto cross-referenced this on Dec 3, 2022 from issue refactor: Move calculation logic out from `CheckSequenceLocksAtTip()` by hebasto
  193. maflcko referenced this in commit 1ff79292e3 on Dec 6, 2022
  194. bitcoin locked this on Nov 30, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC