Skip to content
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

net: Split DNS resolving functionality out of net structures #5005

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Feb 19, 2021

  1. Replace setInventoryKnown with a rolling bloom filter.

    Mruset setInventoryKnown was reduced to a remarkably small 1000
     entries as a side effect of sendbuffer size reductions in 2012.
    
    This removes setInventoryKnown filtering from merkleBlock responses
     because false positives there are especially unattractive and
     also because I'm not sure if there aren't race conditions around
     the relay pool that would cause some transactions there to
     be suppressed. (Also, ProcessGetData was accessing
     setInventoryKnown without taking the required lock.)
    gmaxwell authored and str4d committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    994a094 View commit details
    Browse the repository at this point in the history
  2. Remove mruset as it is no longer used.

    gmaxwell authored and str4d committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    12ddfca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    021ff72 View commit details
    Browse the repository at this point in the history
  4. Only use filterInventoryKnown with MSG_TX inventory messages.

    Previously this logic could erroneously filter a MSG_BLOCK inventory message.
    pstratem authored and str4d committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    2391de6 View commit details
    Browse the repository at this point in the history
  5. Actually only use filterInventoryKnown with MSG_TX inventory messages.

    Previously this logic could erroneously filter a MSG_BLOCK inventory message.
    gmaxwell authored and str4d committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    227933f View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2021

  1. Allow block announcements with headers

    This replaces using inv messages to announce new blocks, when a peer requests
    (via the new "sendheaders" message) that blocks be announced with headers
    instead of inv's.
    
    Since headers-first was introduced, peers send getheaders messages in response
    to an inv, which requires generating a block locator that is large compared to
    the size of the header being requested, and requires an extra round-trip before
    a reorg can be relayed.  Save time by tracking headers that a peer is likely to
    know about, and send a headers chain that would connect to a peer's known
    headers, unless the chain would be too big, in which case we revert to sending
    an inv instead.
    
    Based off of @sipa's commit to announce all blocks in a reorg via inv,
    which has been squashed into this commit.
    
    Rebased-by: Pieter Wuille
    
    Zcash: Includes changes from the following subsequent upstream commits
    from bitcoin/bitcoin#7112 (which we already backported):
    
    - 012fc91
    - 4082e46
    - 9af5f9c
    sdaftuar authored and nuttycom committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    752f815 View commit details
    Browse the repository at this point in the history
  2. Documentation updates for BIP 130

    sipa authored and nuttycom committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    200779c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dfd7f04 View commit details
    Browse the repository at this point in the history
  4. Replace trickle nodes with per-node/message Poisson delays

    We used to have a trickle node, a node which was chosen in each iteration of
    the send loop that was privileged and allowed to send out queued up non-time
    critical messages. Since the removal of the fixed sleeps in the network code,
    this resulted in fast and attackable treatment of such broadcasts.
    
    This pull request changes the 3 remaining trickle use cases by random delays:
    * Local address broadcast (while also removing the the wiping of the seen filter)
    * Address relay
    * Inv relay (for transactions; blocks are always relayed immediately)
    
    The code is based on older commits by Patrick Strateman.
    sipa authored and nuttycom committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    4f46824 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ff83f5e View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2021

  1. net: require lookup functions to specify all arguments

    To make it clear where DNS resolves are happening
    
    (cherry picked from commit e9fc71e)
    theuni authored and nuttycom committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    9d35ba1 View commit details
    Browse the repository at this point in the history
  2. net: manually resolve dns seed sources

    Note: Some seeds aren't actually returning an IP for their name entries, so
    they're being added to addrman with a source of [::].
    
    This commit shouldn't change that behavior, for better or worse.
    
    (cherry picked from commit a98cd1f)
    theuni authored and nuttycom committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    7a5c700 View commit details
    Browse the repository at this point in the history
  3. Combine common error strings for different options so translations ca…

    …n be shared and reused
    
    (cherry picked from commit 5e10922)
    luke-jr authored and nuttycom committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    6fec2fb View commit details
    Browse the repository at this point in the history
  4. net: resolve outside of storage structures

    Rather than allowing CNetAddr/CService/CSubNet to launch DNS queries, require
    that addresses are already resolved.
    
    This greatly simplifies async resolve logic, and makes it harder to
    accidentally leak DNS queries.
    
    (cherry picked from commit 3675699)
    theuni authored and nuttycom committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    d0fa195 View commit details
    Browse the repository at this point in the history
  5. net: disable resolving from storage structures

    CNetAddr/CService/CSubnet can no longer resolve DNS.
    
    (cherry picked from commit d39f5b4)
    theuni authored and nuttycom committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    796e8ce View commit details
    Browse the repository at this point in the history