Add -maxoutfullrelay #21815

pull ghost wants to merge 1 commits into bitcoin:master from changing 1 files +7 −1
  1. ghost commented at 9:50 am on April 30, 2021: none
    • User can set maximum outbound full relay connections in bitcoin.conf
    • Value can be anything between 0(MIN) and 8(MAX)
    • Default value is 8
    • Can be helpful for some users who prefer to keep only 1-2 peers which are automatically selected for outbound full relay connections, add other peers using addnode if required and use 2 block relay connections always. Gives users more control and freedom related to outbound connections and Maximum Outbound Full Relay always stays <=8(ignoring addnode connections`)

    maxoutfullrelay=0

    image

    maxoutfullrelay=1

    image

    maxoutfullrelay=2

    image

    maxoutfullrelay=N (N >=8)

    image

  2. Add `-maxoutfullrelay`
    + User can set maximum outbound full relay connections in `bitcoin.conf`
    + Value can be anything between 0 and 8
    a3eabdf860
  3. ghost commented at 9:50 am on April 30, 2021: none
    Had few questions earlier: https://www.reddit.com/r/Bitcoin/comments/n1fg1y/maximum_number_of_outbound_full_relay_connections/. I think most of them are answered now.
  4. MarcoFalke commented at 10:21 am on April 30, 2021: member
    -0. I don’t see the use case. Mind explaining?
  5. DrahtBot commented at 10:29 am on April 30, 2021: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #21710 (doc: update helps for addnode rpc and -addnode/-maxconnections config options 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.

  6. ghost commented at 5:28 pm on April 30, 2021: none

    -0. I don’t see the use case. Mind explaining?

    Not sure if I understand your question correctly. If you are asking about usecase for maxoutfullrelay=0, below are two examples:

    Example 1: User wants to have 2 Block Relay outbound connections and 1 Full Relay outbound connection with his other node

    image

    Example 2: User wants to have only Block Relay outbound connections (2) for a while

    If you are asking about overall usecases for this option maxoutfullrelay, they are already mentioned above and not possible using maxconnections.

  7. amitiuttarwar commented at 8:31 pm on April 30, 2021: contributor
    I also don’t understand why a user would want to reduce the number of outbound connections- having multiple connections to the network is fundamental to safety against eclipse attacks. If a user configured the node to only have outbound block-relay-only connections, they wouldn’t be participating in addr relay, so wouldn’t have a diverse addrman to identify candidates to connect to. If the user was interested in, for example, reducing bandwidth usage, they could startup in -blocksonly, and give the trusted peer forcerelay permission (see https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-traffic.md for more details).
  8. ghost commented at 9:52 pm on April 30, 2021: none

    I also don’t understand why a user would want to reduce the number of outbound connections- having multiple connections to the network is fundamental to safety against eclipse attacks.

    1. Default is 8 and number of outbound full relay connections can only be reduced by power users who normally experiment with different options in bitcoin.conf
    2. Already mentioned few examples above. One more example: Consider someone running a business has two nodes. Node A for personal usage and Node B for business. Node A runs with default settings but user doesn’t want Node B to connect with random 8 nodes around the world. So user wants to configure Node B to only have 2 Outbound Full Relay connections (One with Node A) and 2 Block Relay only connections. How would you configure this right now? I don’t think its possible. So user will save maxoutfullrelay=1 and use addnode to connect with Node A.
    3. Having multiple connections is good IMO but everyone has different needs and the way they want to use the network. I would like to have MAX_OUTBOUND_FULL_RELAY_CONNECTIONS = 32 and it can be done with something like this: https://bitcoin.stackexchange.com/a/105879/ however according to @laanwj (in PR #6014):

    Making it easily possible to increase the default outgoing connections above 8 would put undue load on the network. See the discussion in #4687 as well as many previous discussions.

    But this can not be merged unless you cap the maximum to 8.

    So I capped the maximum to 8 in this PR.

    1. I am not a fan of hardcoded values for certain things. Mentioned similar approach in other PR to use Default, MIN and MAX: #21061 (comment) I don’t even know what should be the response if someone asks why is this 30 and not 25? Or why is this 8 and not 10 or 6? There should be RANGE in which user can decide the value if required.
    2. IMO it makes things difficult for anyone spying if users have different values for lot of things in Bitcoin Core instead of creating patterns with hardcoded values that do not change for years.

    If a user configured the node to only have outbound block-relay-only connections, they wouldn’t be participating in addr relay, so wouldn’t have a diverse addrman to identify candidates to connect to.

    maxoutfullrelay=0 and no nodes added with addnode is just one of combinations and not necessary everyone will use it. Users who don’t care to experiment with bitcoin.conf options will use default value 8 so nothing changes for many users.

    If the user was interested in, for example, reducing bandwidth usage, they could startup in -blocksonly, and give the trusted peer forcerelay permission (see https://github.com/bitcoin/bitcoin/blob/master/doc/reduce-traffic.md for more details).

    Thanks for sharing this. However -blocksonly=1 is not same as some of the examples I mentioned above for different values of maxoutfullrelay

  9. sipa commented at 3:22 am on May 1, 2021: member
    1. In that case they can just run with -connect=<ip adres of A>. If you have a trusted node that’s already well connected, there is no need to make more connections yourself.

    2. What different needs do people have? You can say care more about bandwidth or computing resources, but if that’s the case, they can just reduce the number of connections. I think that’s a more useful trade-off than setting the number of block-only connections.

    3. I understand hardcoded constants aren’t appealing to everyone’s aesthetics, but that’s not a good basis for doing design. Real-world protocol implementations are full of hardcoded constants (have you ever looked at https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L42L153 ?). Just because there is a range of potentially reasonable numbers doesn’t mean it needs to be configurable - it just means several options existed and the person who coded it up picked one & convinced others that it’s a decent choice. Things need to be configurable when you can give concrete advice about when someone should change it. I don’t see that here.

    4. Quite the contrary. Almost nobody changes defaults. Making things configurable just makes users who change them stand out.

  10. ghost commented at 12:51 pm on May 1, 2021: none
    @sipa Thanks for your response. Closing this PR for now. Will reopen if I have better arguments and some data to support adding such option.
  11. unknown closed this on May 1, 2021

  12. laanwj added the label P2P on May 3, 2021
  13. 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: 2024-11-17 09:12 UTC

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