Remove -feefilter option #21583

pull AdityaNG wants to merge 1 commits into bitcoin:master from AdityaNG:feefilter_cleanup changing 1 files +0 −1
  1. AdityaNG commented at 2:33 PM on April 3, 2021: none

    Removed the -feefilter option from src/net_processing.cpp. #21545 To make sure everything works, I ran make check and then ran test_runner.py with p2p_feefilter.py

    $ test/functional/test_runner.py p2p_feefilter.py
    Temporary test directory at /tmp/test_runner_₿_🏃_20210403_190347
    Running Unit Tests for Test Framework Modules
    ..........
    ----------------------------------------------------------------------
    Ran 10 tests in 0.633s
    
    OK
    Remaining jobs: [p2p_feefilter.py]
    1/1 - p2p_feefilter.py passed, Duration: 15 s
    
    TEST             | STATUS    | DURATION
    
    p2p_feefilter.py | ✓ Passed  | 15 s
    
    ALL              | ✓ Passed  | 15 s (accumulated) 
    Runtime: 15 s
    

    Regarding splitting up the feefilter logic and moving it to a seperate function for better readability, the g_filter_rounder.round() function is not thread safe and is currently inside a LOCK(cs_main); called at the begining of PeerManagerImpl::SendMessages(CNode* pto). Didn't make any changes for this, how would I proceed for this?

  2. Removed -feefilter option 830007a065
  3. fanquake added the label P2P on Apr 3, 2021
  4. DrahtBot commented at 7:57 PM on April 3, 2021: member

    <!--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:

    • #21506 (p2p, refactor: make NetPermissionFlags an enum class by jonatack)

    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. glozow commented at 6:02 PM on April 6, 2021: member

    To completely remove the -feefilter option you'll want to remove other uses (grep -feefilter), the surrounding unused variables, and the user option in init.cpp.

  6. ccdle12 commented at 6:24 PM on April 6, 2021: contributor

    In terms of extracting the logic into a separate function, one option you can use is an assert to make sure cs_main is held before entering the main function logic e.g. AssertLockHeld(cs_main) like used here.

  7. fanquake deleted a comment on Apr 6, 2021
  8. AdityaNG commented at 6:59 PM on April 16, 2021: none

    @ccdle12 understood the usage of AssertLockHeld(cs_main). In #21509 @jnewbery and @MarcoFalke talk about

    1. removing the -feefilter option ( as @glozow mentioned I have looked through all usages of 'feefilter')
    2. factoring out the feefilter logic out into its own function (will do so with AssertLockHeld(cs_main) ).

    From what I understand about the goal of #21545 , was to remove the feefilter check from the message handler loop in net_processing.cpp. Wouldn't removing it from the init.cpp be problematic as it would entirely remove the option? Or is removing feefilter completely the goal? I would like some clarity on this.

    Feefilter usage

    Looked around and pulled up files with refrences to feefilter and understood the context of the refrence which was a good exercise that got me familiar with the codebase.

    1. init.cpp - argsman.AddArg("-feefilter", ...)
    2. net_processing.cpp
    3. net.cpp and net.h
    if (m_tx_relay != nullptr) {
        stats.minFeeFilter = m_tx_relay->minFeeFilter;
    } else {
        stats.minFeeFilter = 0;
    }
    
    1. protocol.cpp and protocol.h
    const char *FEEFILTER="feefilter";
    ...
    const static std::string allNetMessageTypes[] = {
        ...
        NetMsgType::FEEFILTER,
    };
    
    1. validation.h static const bool DEFAULT_FEEFILTER = true;
    2. version.h static const int FEEFILTER_VERSION = 70013;
    3. fees.cpp and fees.h explicit FeeFilterRounder(const CFeeRate& minIncrementalFee); (the non-thread safe round function)
    4. net.cpp
    RPCResult::Type::NUM, "minfeefilter", "The minimum fee rate for transactions this peer accepts"
    ...
    static RPCHelpMan getpeerinfo() {
        ...
        obj.pushKV("minfeefilter", ValueFromAmount(stats.minFeeFilter));
    }
    
    1. policy_fee_tests.cpp FeeFilterRounder fee_rounder{CFeeRate{1000}};
    2. fees.cpp FeeFilterRounder fee_filter_rounder{minimal_incremental_fee};
    3. process_message.cpp FUZZ_TARGET_MSG(feefilter);
    4. Multiple python tests in test/functional a. p2p_feefilter.py b. p2p_ibd_txrelay.py c. p2p_leak.py d. rpc_net.py e. test_runner.py f. messages.py g. p2p.py
  9. jnewbery commented at 12:59 PM on April 19, 2021: member

    is removing feefilter completely the goal

    Yes. The -feefilter config option is not used anywhere else, so it should be removed from the init code.

    Looked around and pulled up files with refrences to feefilter and understood the context of the refrence which was a good exercise that got me familiar with the codebase...

    All of these instances of minFeeFilter, FEEFILTER, FEEFILTER_VERSION, etc are separate from the -feefilter option, which is used to control whether we'll ever send feefilter messages to our peer.

  10. jnewbery renamed this:
    Removed -feefilter option
    Remove -feefilter option
    on Apr 19, 2021
  11. jnewbery commented at 1:05 PM on April 19, 2021: member

    Please also add rationale to the commit log. Why is it ok to remove -feefilter?

  12. MarcoFalke commented at 9:44 AM on May 3, 2021: member

    Closing for now due to inactivity. Let me know when you want to work on this again.

  13. MarcoFalke closed this on May 3, 2021

  14. MarcoFalke deleted a comment on May 3, 2021
  15. DrahtBot locked this on Aug 18, 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-04-15 15:14 UTC

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