refactor: AcceptToMemoryPool #23437

pull lsilva01 wants to merge 2 commits into bitcoin:master from lsilva01:remove_atmp_time changing 3 files +27 −31
  1. lsilva01 commented at 1:36 AM on November 4, 2021: contributor

    This PR refactors AcceptToMemoryPool.

    . Remove AcceptToMemoryPoolWithTime (after #23173, this function is no longer needed). . Remove the CChainParams chainparams parameter from ATMP as they can be inferred from the current chain state. . Update the tx_pool test with new function signature.

  2. DrahtBot added the label P2P on Nov 4, 2021
  3. DrahtBot added the label RPC/REST/ZMQ on Nov 4, 2021
  4. DrahtBot added the label Utils/log/libs on Nov 4, 2021
  5. DrahtBot added the label Validation on Nov 4, 2021
  6. DrahtBot commented at 8:23 AM on November 4, 2021: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #23546 (scripted-diff: Use clang-tidy syntax for C++ named arguments (tests only) by MarcoFalke)
    • #23465 (Remove CTxMemPool params from ATMP by lsilva01)

    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.

  7. in src/validation.h:212 in 20867dc152 outdated
     210 | - * exposed only for testing. Client code should use ChainstateManager::ProcessTransaction()
     211 | + * Try to add a transaction to the mempool with a specified acceptance time. This is an internal
     212 | + * function and is exposed only for testing. Client code should use ChainstateManager::ProcessTransaction()
     213 |   *
     214 | - * @param[in]  active_chainstate  Reference to the active chainstate.
     215 | + * @param[in]  chainparams        Tweakable parameters of this instance.
    


    jnewbery commented at 8:27 AM on November 4, 2021:

    I don't think this description "Tweakable parameters of this instance." is very illuminating. Tweakable suggests to me that the user can modify these parameters, but that isn't the case here.


    lsilva01 commented at 3:55 AM on November 5, 2021:

    Changed the description in 034e827 .

  8. jnewbery commented at 8:28 AM on November 4, 2021: member

    Concept ACK

    I also have a branch that does this (amongst other things) here: https://github.com/jnewbery/bitcoin/tree/2021-09-process-transaction-2. Feel free to take anything you find useful from that branch.

  9. in src/validation.h:224 in 20867dc152 outdated
     224 |   */
     225 | -MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, CTxMemPool& pool, const CTransactionRef& tx,
     226 | -                                       bool bypass_limits, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
     227 | +MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
     228 | +                                                        CChainState& active_chainstate, const CTransactionRef &tx,
     229 | +                                                        int64_t nAcceptTime, bool bypass_limits, bool test_accept)
    


    glozow commented at 2:46 PM on November 4, 2021:

    prefer snake case accept_time. Doxygen comment should be more descriptice, e.g. that this is the time that the mempool entry will record and will be used to determine when the entry expires.


    lsilva01 commented at 3:56 AM on November 5, 2021:

    Changed nAcceptTime to accept_time and improved the field description in 034e827

  10. glozow commented at 2:49 PM on November 4, 2021: member

    Concept ACK, good cleanup.

  11. DrahtBot cross-referenced this on Nov 4, 2021 from issue net_processing: lock clean up by ajtowns
  12. lsilva01 force-pushed on Nov 5, 2021
  13. lsilva01 commented at 4:01 AM on November 5, 2021: contributor

    @jnewbery and @glozow thanks for reviews. I addressed your suggestions in 034e827.

    As these changes are already implemented in another branch, with more other commits, I can close this PR if it's better.

  14. DrahtBot cross-referenced this on Nov 5, 2021 from issue validation/refactor: refactoring for package submission by glozow
  15. in src/validation.h:209 in 034e827efc outdated
     205 | @@ -206,12 +206,26 @@ struct PackageMempoolAcceptResult
     206 |  };
     207 |  
     208 |  /**
     209 | - * (Try to) add a transaction to the memory pool.
     210 | - * @param[in]  bypass_limits   When true, don't enforce mempool fee limits.
     211 | - * @param[in]  test_accept     When true, run validation checks but don't submit to mempool.
     212 | + * Try to add a transaction to the mempool with a specified acceptance time. This is an internal
    


    jnewbery commented at 7:32 AM on November 5, 2021:

    "with a specified acceptance time" is redundant with the parameter documentation below.


    lsilva01 commented at 8:25 PM on November 5, 2021:

    Removed in 9a0b0fc

  16. in src/validation.h:227 in 034e827efc outdated
     227 |   */
     228 | -MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, CTxMemPool& pool, const CTransactionRef& tx,
     229 | -                                       bool bypass_limits, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
     230 | +MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
     231 | +                                                        CChainState& active_chainstate, const CTransactionRef &tx,
     232 | +                                                        int64_t accept_time, bool bypass_limits, bool test_accept)
    


    jnewbery commented at 7:34 AM on November 5, 2021:

    Please align arguments on new lines after the opening parens:

    MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
                                           CChainState& active_chainstate, const CTransactionRef &tx,
                                           int64_t accept_time, bool bypass_limits, bool test_accept)
    

    (We use clang-style AlignAfterOpenBracket: true)


    lsilva01 commented at 8:25 PM on November 5, 2021:

    Done in 9a0b0fc

  17. in src/test/fuzz/tx_pool.cpp:233 in 034e827efc outdated
     229 | @@ -230,7 +230,7 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
     230 |          Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
     231 |                 it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
     232 |  
     233 | -        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx_pool, tx, bypass_limits));
     234 | +        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(Params(), tx_pool, chainstate, tx, GetTime(), bypass_limits, false /* test_accept */));
    


    jnewbery commented at 7:35 AM on November 5, 2021:

    Please use clang-tidy style bugprone-argument-comment:

            const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(Params(), tx_pool, chainstate, tx, GetTime(), bypass_limits, /*test_accept=*/false));
    

    See also #22981

    (same comment below)


    lsilva01 commented at 8:25 PM on November 5, 2021:

    Done in 9a0b0fc

  18. in src/validation.cpp:1082 in 034e827efc outdated
    1011 | @@ -1011,15 +1012,13 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
    1012 |  
    1013 |  } // anon namespace
    1014 |  
    1015 | -/** (try to) add transaction to memory pool with a specified acceptance time **/
    1016 | -static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPool& pool,
    1017 | -                                                      CChainState& active_chainstate,
    1018 | -                                                      const CTransactionRef &tx, int64_t nAcceptTime,
    1019 | -                                                      bool bypass_limits, bool test_accept)
    1020 | +MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
    


    jnewbery commented at 7:36 AM on November 5, 2021:

    Again, please align new lines with the opening parens.


    lsilva01 commented at 8:27 PM on November 5, 2021:

    Done in 9a0b0fc

  19. in src/validation.cpp:352 in 034e827efc outdated
     348 | @@ -349,8 +349,9 @@ void CChainState::MaybeUpdateMempoolForReorg(
     349 |      while (it != disconnectpool.queuedTx.get<insertion_order>().rend()) {
     350 |          // ignore validation errors in resurrected transactions
     351 |          if (!fAddToMempool || (*it)->IsCoinBase() ||
     352 | -            AcceptToMemoryPool(
     353 | -                *this, *m_mempool, *it, true /* bypass_limits */).m_result_type !=
     354 | +            AcceptToMemoryPool(Params(),
    


    jnewbery commented at 7:47 AM on November 5, 2021:

    Consider using the global namespace operator ::Params() to explicitly show that you're calling a global function. I think the long-term goal is to remove these global calls to make it easier to unit test.

    Same comment for the ATMP calls below.


    lsilva01 commented at 8:27 PM on November 5, 2021:

    Removed calls to global Params() in ATMP and in the tx_pool test file ( aac6548 )

  20. jnewbery commented at 7:48 AM on November 5, 2021: member

    A few more comments inline

    As these changes are already implemented in another branch, with more other commits, I can close this PR if it's better.

    No, please continue with this PR! Just feel free to take anything from the other branch that you find useful.

  21. DrahtBot cross-referenced this on Nov 5, 2021 from issue validation: mempool validation and submission for packages of 1 child + parents by glozow
  22. theStack commented at 2:48 PM on November 5, 2021: contributor

    Concept ACK

  23. lsilva01 force-pushed on Nov 5, 2021
  24. lsilva01 force-pushed on Nov 5, 2021
  25. lsilva01 cross-referenced this on Nov 5, 2021 from issue refactor, consensus: remove calls to global `Params()` in validation layer by lsilva01
  26. DrahtBot cross-referenced this on Nov 6, 2021 from issue Erlay: bandwidth-efficient transaction relay protocol by naumenkogs
  27. theStack commented at 1:31 AM on November 7, 2021: contributor

    Possible follow-up idea that came to my mind while reviewing this PR: couldn't we simplify the interface of AcceptToMemoryPool by getting rid of both the CChainParams and CTxMemPool parameters, since those can be deduced from the chainstate anyway? The change would look something like

    -MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
    -                                       CChainState& active_chainstate, const CTransactionRef& tx,
    +MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, const CTransactionRef& tx,
                                            int64_t accept_time, bool bypass_limits, bool test_accept)
         EXCLUSIVE_LOCKS_REQUIRED(cs_main)
     {
    +    const CChainParams& chainparams{active_chainstate.m_params};
    +    assert(active_chainstate.m_mempool != nullptr);
    +    CTxMemPool& pool{*active_chainstate.m_mempool};
         std::vector<COutPoint> coins_to_uncache;
         MemPoolAccept::ATMPArgs args { chainparams, accept_time, bypass_limits, coins_to_uncache,
                                        test_accept, /* m_allow_bip125_replacement */ true };
    

    I couldn't think of a case where passing chainparams or a mempool instance that doesn't belong to the active chainstate makes much sense. Drawback though: currently the member m_mempool is protected and thus not accessible from outside, that one would need to move to the public section, like it was done for m_params in the last commit of this PR.

  28. lsilva01 cross-referenced this on Nov 8, 2021 from issue Remove CTxMemPool params from ATMP by lsilva01
  29. lsilva01 commented at 6:19 AM on November 8, 2021: contributor

    Thanks for the review @theStack . I opened PR #23465 to test your suggestion. It seems to work fine.

  30. DrahtBot added the label Needs rebase on Nov 9, 2021
  31. jnewbery commented at 1:55 PM on November 10, 2021: member

    #23173 is merged. Please rebase and I'll review.

  32. lsilva01 force-pushed on Nov 10, 2021
  33. DrahtBot removed the label Needs rebase on Nov 10, 2021
  34. lsilva01 force-pushed on Nov 10, 2021
  35. in src/test/fuzz/tx_pool.cpp:234 in 9f967515f4 outdated
     229 | @@ -230,7 +230,8 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
     230 |          Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
     231 |                 it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
     232 |  
     233 | -        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx_pool, tx, bypass_limits));
     234 | +        CChainState& chainstate{node.chainman->ActiveChainstate()};
     235 | +        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate.m_params, tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */false));
    


    jnewbery commented at 12:03 PM on November 11, 2021:

    Its seems odd to change this to:

            const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(::Params(), tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */false));
    

    in the first commit, and then update it again to use chainstate.m_params in the second commit. You can just go straight to using chainstate.m_params in the first commit.


    lsilva01 commented at 2:31 AM on November 12, 2021:

    Agreed. Changed it to the first commit.

  36. in src/test/fuzz/tx_pool.cpp:334 in 9f967515f4 outdated
     330 | @@ -330,7 +331,7 @@ FUZZ_TARGET_INIT(tx_pool, initialize_tx_pool)
     331 |          const auto tx = MakeTransactionRef(mut_tx);
     332 |          const bool bypass_limits = fuzzed_data_provider.ConsumeBool();
     333 |          ::fRequireStandard = fuzzed_data_provider.ConsumeBool();
     334 | -        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(node.chainman->ActiveChainstate(), tx_pool, tx, bypass_limits));
     335 | +        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate.m_params, tx_pool, node.chainman->ActiveChainstate(), tx, GetTime(), bypass_limits, /* test_accept= */false));
    


    jnewbery commented at 12:03 PM on November 11, 2021:
            const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate.m_params, tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */false));
    

    lsilva01 commented at 2:31 AM on November 12, 2021:

    Done.

  37. in src/validation.h:214 in 9f967515f4 outdated
     212 | - * exposed only for testing. Client code should use ChainstateManager::ProcessTransaction()
     213 | + * Try to add a transaction to the mempool. This is an internal function and is exposed only for testing.
     214 | + * Client code should use ChainstateManager::ProcessTransaction()
     215 |   *
     216 | - * @param[in]  active_chainstate  Reference to the active chainstate.
     217 | + * @param[in]  chainparams        Chain paramenters.
    


    jnewbery commented at 12:09 PM on November 11, 2021:

    This argument could be removed. AcceptToMemoryPool() could just take the m_params from the active_chainstate that's passed in.


    lsilva01 commented at 2:44 AM on November 12, 2021:

    Done. As this PR is removing the CChainParams& chainparams from ATMP (commit 863703c), I also added a new commit to remove CTxMemPool& pool as suggested in #23437 (comment).

  38. in src/validation.h:220 in 9f967515f4 outdated
     218 |   * @param[in]  pool               Reference to the node's mempool.
     219 | + * @param[in]  active_chainstate  Reference to the active chainstate.
     220 |   * @param[in]  tx                 The transaction to submit for mempool acceptance.
     221 | + * @param[in]  accept_time        The timestamp for adding the transaction to the mempool. Usually
     222 | + *                                the current system time, but may be different (eg when loading
     223 | + *                                mempool txs from disk on startup).
    


    jnewbery commented at 12:09 PM on November 11, 2021:

    It's generally not a good idea to document how the function is called in the function comment (since that may change over time, and this comment would be out of date:

     *                                the current system time, but may be different.
    

    lsilva01 commented at 2:32 AM on November 12, 2021:

    Makes sense. Comment removed.

  39. jnewbery commented at 12:11 PM on November 11, 2021: member

    Please update the PR description now that #23173 is merged.

  40. MarcoFalke cross-referenced this on Nov 11, 2021 from issue rpc: Only allow specific types to be P2(W)SH wrapped in decodescript by MarcoFalke
  41. lsilva01 force-pushed on Nov 11, 2021
  42. lsilva01 force-pushed on Nov 11, 2021
  43. lsilva01 force-pushed on Nov 11, 2021
  44. lsilva01 commented at 2:46 AM on November 12, 2021: contributor

    Thanks for review @jnewbery . New commits were added to address the suggestions.

  45. in src/validation.h:215 in a4fc09b156 outdated
     212 | - * exposed only for testing. Client code should use ChainstateManager::ProcessTransaction()
     213 | + * Try to add a transaction to the mempool. This is an internal function and is exposed only for testing.
     214 | + * Client code should use ChainstateManager::ProcessTransaction()
     215 |   *
     216 |   * @param[in]  active_chainstate  Reference to the active chainstate.
     217 | - * @param[in]  pool               Reference to the node's mempool.
    


    jnewbery commented at 11:25 AM on November 12, 2021:

    This causes the tx_pool fuzz test to fail since it operates on a mempool that isn't referenced by the CChainState object. See #23173 (review).

    That should probably be fixed in the fuzz test, but it can be left for a future PR. For now, I suggest you just remove the final commit.


    MarcoFalke commented at 11:35 AM on November 12, 2021:

    For reference, this can trivially be fixed by something like:

    struct MockedChainstate:public CChainstate{
    SwapTxPool(CTxMempool*tx_pool){m_mempool=tx_pool;}
    }
    
    ...
    
       CTxMempool fuzzed_pool;
       (MockedChainstate*)(&chainstate)->SwapTxPool(&fuzzed_pool);
    

    lsilva01 commented at 4:46 AM on November 13, 2021:

    Final commit removed.


    lsilva01 commented at 2:50 PM on November 13, 2021:

    I also addressed the tx_pool.cpp issue using a different approach in #23465. The fuzz test performed successfully on local machine and CI.

    - const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx_pool, tx, bypass_limits));
    + CChainState& chainstate{node.chainman->ActiveChainstate()};
    + chainstate.m_mempool = &tx_pool;
    
    + const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx, GetTime(), bypass_limits, /* test_accept= */false));
    
  46. lsilva01 force-pushed on Nov 12, 2021
  47. lsilva01 renamed this:
    refactor, mempool: remove AcceptToMemoryPoolWithTime
    refactor, mempool: refactor AcceptToMemoryPool
    on Nov 12, 2021
  48. in src/validation.cpp:1087 in f4c45cd09f outdated
    1090 | +                                       int64_t accept_time, bool bypass_limits, bool test_accept)
    1091 | +    EXCLUSIVE_LOCKS_REQUIRED(cs_main)
    1092 |  {
    1093 |      std::vector<COutPoint> coins_to_uncache;
    1094 | -    auto args = MemPoolAccept::ATMPArgs::SingleAccept(chainparams, nAcceptTime, bypass_limits, coins_to_uncache, test_accept);
    1095 | +    auto args = MemPoolAccept::ATMPArgs::SingleAccept(chainparams, accept_time, bypass_limits, coins_to_uncache, test_accept);
    


    mjdietzx commented at 5:35 PM on November 15, 2021:

    can this be const?


    lsilva01 commented at 9:25 PM on November 15, 2021:

    Refers to the args variable?


    glozow commented at 7:08 PM on November 22, 2021:

    No - contrary to what the name args suggests, it cannot be const because it contains coins_to_uncache, which is populated with coins and returned. If coins_to_uncache were removed from ATMPArgs then it could be const.

    As a side thought, I personally think it would be nice/more RAII-like if uncaching would be handled by MemPoolAccept (see #21146), which is one approach to removing it from args.


    lsilva01 commented at 7:14 PM on November 22, 2021:

    It seems this change also implies changing MemPoolAccept::AcceptSingleTransaction. Maybe it can be a follow-up PR.


    glozow commented at 7:29 PM on November 22, 2021:

    Just to clarify, I didn't mean to suggest that you change it - out of scope for this PR. Marking resolved.

  49. in src/validation.h:226 in f4c45cd09f outdated
     228 |   */
     229 | -MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, CTxMemPool& pool, const CTransactionRef& tx,
     230 | -                                       bool bypass_limits, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
     231 | +MempoolAcceptResult AcceptToMemoryPool(const CChainParams& chainparams, CTxMemPool& pool,
     232 | +                                       CChainState& active_chainstate, const CTransactionRef& tx,
     233 | +                                       int64_t accept_time, bool bypass_limits, bool test_accept)
    


    mjdietzx commented at 5:35 PM on November 15, 2021:

    Curious why you removed default false value for test_accept?


    lsilva01 commented at 9:25 PM on November 15, 2021:

    Since this PR removes AcceptToMemoryPoolWithTime where bool test_accept has no default value, I think making it explicit is better.

  50. in src/test/fuzz/tx_pool.cpp:233 in f4c45cd09f outdated
     229 | @@ -230,7 +230,7 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
     230 |          Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
     231 |                 it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
     232 |  
     233 | -        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx_pool, tx, bypass_limits));
     234 | +        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(::Params(), tx_pool, chainstate, tx, GetTime(), bypass_limits, /* test_accept= */false));
    


    mjdietzx commented at 5:39 PM on November 15, 2021:

    nit: sometimes throughout your changes you don't have a space between the last */ and the value, ie: /* test_accept= */false => /* test_accept= */ false


    lsilva01 commented at 9:26 PM on November 15, 2021:

    Thanks. I will fix it.


    lsilva01 commented at 7:12 PM on November 22, 2021:

    Fixed.

  51. mjdietzx commented at 5:40 PM on November 15, 2021: contributor

    Concept and Approach ACK

  52. DrahtBot cross-referenced this on Nov 18, 2021 from issue scripted-diff: Use clang-tidy syntax for C++ named arguments by MarcoFalke
  53. DrahtBot cross-referenced this on Nov 18, 2021 from issue scripted-diff: Use clang-tidy syntax for C++ named arguments (tests only) by MarcoFalke
  54. stratospher commented at 7:21 PM on November 20, 2021: contributor

    ACK 863703c.

    • f4c45cd
      • m_params is made a public member of CChainParams.
      • It's also added as an additional parameter to AcceptToMemoryPool() along with accept_time and call sites updated.
      • AcceptToMemoryPoolWithTime() is removed.
    • e1c221b
      • In the tx_pool fuzz test, ::Params() is replaced with CChainStateobject's m_params.
    • 863703c
      • CChainParams's m_params is removed as a parameter from AcceptToMemoryPool() since it can be derived from the CChainState object parameter.
  55. theStack approved
  56. theStack commented at 7:06 PM on November 21, 2021: contributor

    Code-review ACK 863703c63311bf816b2dcdb7edd70be0bf069014 🍵

    Tiny nit: there is an intermediate typo in the doxygen description for the chainparams parameter in AcceptToMemoryPool (=> s/paramenters/parameters). The first and third commits could also simply be squashed, in order to avoid introducing a temporary parameter (and its doxygen description) and hence also lower the review burden a bit. Not sure if its worth invalidating ACKs now, but I'm happy to re-review in case.

  57. MarcoFalke removed the label RPC/REST/ZMQ on Nov 22, 2021
  58. MarcoFalke removed the label P2P on Nov 22, 2021
  59. MarcoFalke removed the label Validation on Nov 22, 2021
  60. MarcoFalke removed the label Utils/log/libs on Nov 22, 2021
  61. MarcoFalke added the label Refactoring on Nov 22, 2021
  62. MarcoFalke renamed this:
    refactor, mempool: refactor AcceptToMemoryPool
    refactor: AcceptToMemoryPool
    on Nov 22, 2021
  63. MarcoFalke requested review from glozow on Nov 22, 2021
  64. MarcoFalke requested review from jnewbery on Nov 22, 2021
  65. lsilva01 force-pushed on Nov 22, 2021
  66. lsilva01 commented at 7:15 PM on November 22, 2021: contributor

    @theStack and @stratospher thanks for the review. The commit were squashed, as suggested.

  67. in src/test/fuzz/tx_pool.cpp:233 in 61e20cc2a3 outdated
     229 | @@ -230,7 +230,8 @@ FUZZ_TARGET_INIT(tx_pool_standard, initialize_tx_pool)
     230 |          Assert(it->second.m_result_type == MempoolAcceptResult::ResultType::VALID ||
     231 |                 it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
     232 |  
     233 | -        const auto res = WITH_LOCK(::cs_main, return AcceptToMemoryPool(chainstate, tx_pool, tx, bypass_limits));
     234 | +        CChainState& chainstate{node.chainman->ActiveChainstate()};
    


    theStack commented at 2:19 PM on November 23, 2021:

    I think this line could simply be removed, as it is merely shadowing another reference with the same name and content on top of the fuzz test?


    lsilva01 commented at 4:43 AM on November 24, 2021:

    Good catch. Line removed in 4ec8b96.


    MarcoFalke commented at 4:46 PM on December 1, 2021:

    not addressed?


    lsilva01 commented at 12:16 AM on December 2, 2021:

    Yes, it was addressed in 4ec8b96.


    MarcoFalke commented at 7:45 AM on December 2, 2021:

    In the future, it might be good to keep a clean history and not introduce unused stuff in one commit and remove it in the next.

  68. lsilva01 force-pushed on Nov 24, 2021
  69. theStack approved
  70. theStack commented at 3:21 PM on November 27, 2021: contributor

    re-ACK 4ec8b96e077a359c7ba877fc4f78d55ac7d5fb22

  71. DrahtBot added the label Needs rebase on Dec 1, 2021
  72. jnewbery commented at 1:27 PM on December 1, 2021: member

    utACK 4ec8b96e077a359c7ba877fc4f78d55ac7d5fb22

    Happy to rereview this once it's rebased.

  73. Remove AcceptToMemoryPoolWithTime 9360778d6e
  74. Remove calls to global Params() in tx_pool test 123f5de826
  75. lsilva01 force-pushed on Dec 1, 2021
  76. theStack approved
  77. theStack commented at 4:19 PM on December 1, 2021: contributor

    re-ACK 123f5de8265af07ff1c95ed8078085af6cb589cb

  78. jnewbery commented at 4:33 PM on December 1, 2021: member

    reACK 123f5de8265af07ff1c95ed8078085af6cb589cb

  79. DrahtBot removed the label Needs rebase on Dec 1, 2021
  80. glozow commented at 4:37 PM on December 1, 2021: member

    light code review ACK 123f5de8265af07ff1c95ed8078085af6cb589cb

  81. in src/validation.h:218 in 9360778d6e outdated
     216 | - * @param[in]  active_chainstate  Reference to the active chainstate.
     217 |   * @param[in]  pool               Reference to the node's mempool.
     218 | + * @param[in]  active_chainstate  Reference to the active chainstate.
     219 |   * @param[in]  tx                 The transaction to submit for mempool acceptance.
     220 | + * @param[in]  accept_time        The timestamp for adding the transaction to the mempool. Usually
     221 | + *                                the current system time, but may be different.
    


    MarcoFalke commented at 4:53 PM on December 1, 2021:

    nit: I don't think we need to explain what the argument means at the call site.

  82. MarcoFalke merged this on Dec 1, 2021
  83. MarcoFalke closed this on Dec 1, 2021

  84. lsilva01 deleted the branch on Dec 1, 2021
  85. mjdietzx cross-referenced this on Dec 1, 2021 from issue test: Extend test coverage of BIP125 and document confusing/inconsistent behavior by mjdietzx
  86. mjdietzx cross-referenced this on Dec 1, 2021 from issue Implement RBF inherited signaling and fix getmempoolentry returned bip125-replaceable status by mjdietzx
  87. sidhujag referenced this in commit 3734ee44f3 on Dec 2, 2021
  88. MarcoFalke referenced this in commit 84d921e79c on Dec 8, 2021
  89. sidhujag referenced this in commit ff6e1bdf71 on Dec 8, 2021
  90. RandyMcMillan referenced this in commit 087aa3d27c on Dec 23, 2021
  91. RandyMcMillan referenced this in commit 1cd9ee7a8f on Dec 23, 2021
  92. Fabcien referenced this in commit 9e6cbdc2c1 on Oct 13, 2022
  93. bitcoin locked this on Dec 2, 2022

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-19 13:53 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me