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

Network tests & updates #692

Merged
merged 17 commits into from
Apr 7, 2022
Merged

Network tests & updates #692

merged 17 commits into from
Apr 7, 2022

Commits on Dec 25, 2021

  1. test: add netaddress tests.

    nodech committed Dec 25, 2021
    Configuration menu
    Copy the full SHA
    1eda7f0 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2022

  1. test: add look/resolve tests.

    nodech committed Jan 26, 2022
    Configuration menu
    Copy the full SHA
    5232b33 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7d55fc6 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2022

  1. Configuration menu
    Copy the full SHA
    e1f4359 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2022

  1. Configuration menu
    Copy the full SHA
    f893e24 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2022

  1. Configuration menu
    Copy the full SHA
    2a07d3c View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2022

  1. Configuration menu
    Copy the full SHA
    4f094d9 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2022

  1. Configuration menu
    Copy the full SHA
    732d627 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2022

  1. pool: Use a shorter loop to get hosts for refilling peers

    Currently, pool::getHost() uses a fixed loop of 0-99 regardless
    of how many hosts it has in it's lists so it can use a percentage
    to factor in whether it should use an entry or not.
    Using network regtest and a single host of 127.0.0.1:14038, hsd
    burns a lot of CPU when refilling peers and this blocks incoming
    requests so much it times out.
    
    This is less noticeable the more hosts you have.
    
    Instead, use shorter loop of 10.
    
    This brings CPU utlisation on my NetBSD Xen DOMU on regtest with
    one host from 100% to 6% and connecting 4 to peers on testnet
    from 85% to 8%, allowing RPC commands to now work.
    
    Fixes handshake-org#220.
    rsmarples authored and nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    721dd9a View commit details
    Browse the repository at this point in the history
  2. net: remove discoverExternal() from the pool

    This commit removes the discover external check in the pool. Currently
    we already store all local addresses that are sent to us from peers in
    the hostlist, so there is no reason to rely on an external service to
    check for our local/external address. This was removed from bitcoin in
    commit 845c86d.
    kilpatty authored and nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    03b962e View commit details
    Browse the repository at this point in the history
  3. net-address: Add get group function.

    This commit adds the getGroup function to net addresses. It allows for
    network addresses to be grouped into buckets, such that we can limit the
    number of outgoing connections per group to a certain amount. This will
    allow for increased connection diversity and reduced attack surface
    area.
    
    Co-authored-by: Nodari Chkuaselidze <nodar.chkuaselidze@gmail.com>
    kilpatty and nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    4ee4a42 View commit details
    Browse the repository at this point in the history
  4. net-pool: Check outbound peers for same group before connecting

    This commit checks the outbound peers to see which group their network
    addresses lives in before connecting. By doing this, we prevent a node
    from connecting to all outbound addresses in a very close network group
    bunch. This helps prevent someone spinning up multiple nodes on a
    similar network e.g. AWS, GCP and using those to fill other nodes'
    outbounds.
    
    This commit just adds 2 operations in both addOutbound and addLoader. It
    first checks if the new address pull from hostlist belongs in the same
    group as an already connected peer. If it does not, it precedes as
    usual, and if the connection succeeds then it adds that new outbound
    group to the list of groups currently connected to.
    
    Co-authored-by: Nodari Chkuaselidze <nodar.chkuaselidze@gmail.com>
    kilpatty and nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    f52e924 View commit details
    Browse the repository at this point in the history
  5. pkg: update package-lock.

    nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    a7d214c View commit details
    Browse the repository at this point in the history
  6. test: minor.

    nodech committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    43f5c2c View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2022

  1. Configuration menu
    Copy the full SHA
    81f3736 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2022

  1. net: nits.

    nodech committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    5fc3122 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2022

  1. Configuration menu
    Copy the full SHA
    c96b6ec View commit details
    Browse the repository at this point in the history