config, net, test: asmap feature refinements and functional tests #17812

pull jonatack wants to merge 9 commits into bitcoin:master from jonatack:feature-asmap changing 8 files +153 −35
  1. jonatack commented at 1:15 pm on December 28, 2019: member

    This PR builds on PR #16702 to add functional tests / sanity checks and user-facing refinements for passing -asmap to configure ASN-based IP bucketing in addrman. As per our review discussion in that PR, the idea here is to handle aspects like functional tests and config arg handling that can help the PR be merged while enabling the author to focus on the bucketing itself.

    • add feature functional tests to verify node behaviour and debug log output when launching

      • bitcoind with no -asmap arg

      • bitcoind -asmap=RELATIVE_FILENAME to the unit test data skeleton asmap

      • bitcoind -asmap with no filename specified using the default asmap file

      • bitcoind -asmap with no filename specified and a missing default asmap file

    • add the ability to pass absolute path filenames to the -asmap config arg in addition to datadir-relative path filenames as per #16702 (review), and add test coverage

    • separate the asmap file finding and parsing checks, which allows adding tests for the case of a found but unparseable or empty asmap

    • add test for an empty asmap

    • various asmap fixups

    • move the asmap init code earlier in the init process to provide immediate feedback when passing an -asmap config arg. This speeds up the feature_asmap functional test from 60 to 5 seconds! Credit to Wladimir J. van der Laan for the suggestion.

  2. jonatack force-pushed on Dec 28, 2019
  3. jonatack force-pushed on Dec 28, 2019
  4. fanquake added the label P2P on Dec 28, 2019
  5. jonatack force-pushed on Dec 28, 2019
  6. jonatack force-pushed on Dec 28, 2019
  7. DrahtBot commented at 5:30 pm on December 28, 2019: 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:

    • #18038 (P2P: Mempool tracks locally submitted transactions to improve privacy by amitiuttarwar)
    • #16224 (gui: Bilingual GUI error messages by hebasto)

    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.

  8. jonatack force-pushed on Dec 28, 2019
  9. fanquake commented at 9:49 pm on December 28, 2019: member
    Shouldn’t e4f5aa4b09a0f0c51def6b859609aee01b61d2df, b380e9a48e5c6cb7e1ed6558e7fbbde5feb0069b and eeb1a42341c9a5a9517a244506dd2a609962ee5c just be left as feedback/review on #16702? Especially if one of those commits is required for the CI to pass.
  10. fanquake renamed this:
    net, test: asmap functional tests and feature refinements
    test: asmap functional tests and feature refinements
    on Dec 28, 2019
  11. fanquake added the label Tests on Dec 28, 2019
  12. jonatack commented at 10:18 pm on December 28, 2019: member

    Yes, those can be pulled into the PR if helpful. I have more important review questions on that PR that I’d like to concentrate on (the unit tests and actual bucketing) without adding further nit review at the moment.

    The idea here, as per our review discussion in that PR, is to handle other aspects (functional tests, config arg handling, user-facing interface) that can help it be merged without the author needing to bother with it.

  13. jonatack force-pushed on Dec 30, 2019
  14. jonatack renamed this:
    test: asmap functional tests and feature refinements
    config, test: asmap functional tests and feature refinements
    on Dec 30, 2019
  15. jonatack force-pushed on Dec 30, 2019
  16. jonatack force-pushed on Dec 30, 2019
  17. jonatack force-pushed on Dec 30, 2019
  18. jonatack closed this on Jan 6, 2020

  19. jonatack reopened this on Jan 6, 2020

  20. laanwj commented at 1:10 pm on January 15, 2020: member
    +1 for allowing absolute asmap paths
  21. DrahtBot added the label Needs rebase on Jan 29, 2020
  22. jonatack force-pushed on Jan 30, 2020
  23. DrahtBot removed the label Needs rebase on Jan 30, 2020
  24. DrahtBot added the label Needs rebase on Jan 30, 2020
  25. jonatack force-pushed on Jan 30, 2020
  26. jonatack commented at 11:11 pm on January 30, 2020: member
    Rebased and added #16702 (comment) and #16702 (review) in the last 2 commits.
  27. fanquake removed the label Needs rebase on Jan 30, 2020
  28. fanquake commented at 0:17 am on January 31, 2020: member
    Can you squash a bunch of these? cd6d6d138f4844d35537f07c6c106e42dc0d8581 and b5cf2db1a4cd20175f37fc039c2bc0e15ccef1e4 could be combined. I don’t think we need separate commits just to remove full stops and then add spaces to logging. 8554077e5532c26b28be95249992d96b68feebd7 reorders includes, which generally we don’t do by itself, maybe combine into e44e8842b4da2829bbdcd982c83bb5ffb665b472.
  29. gmaxwell commented at 0:18 am on January 31, 2020: contributor
    Has anyone fuzzed the asmap file reader? I anticipate users accepting asmaps from third parties…
  30. gmaxwell commented at 0:19 am on January 31, 2020: contributor
    Oh, nevermind, I just saw #18033
  31. jonatack force-pushed on Jan 31, 2020
  32. jonatack commented at 10:55 am on January 31, 2020: member
    @fanquake thanks for having a look and the suggestions. Done, squashed all those down into e30a4691bacc232a984e049fb887b08860fa7c94.
  33. jonatack force-pushed on Jan 31, 2020
  34. jonatack force-pushed on Jan 31, 2020
  35. laanwj commented at 1:38 pm on February 5, 2020: member
    Needs rebase (due to sipa’s asmap changes in #18023, I think)
  36. DrahtBot added the label Needs rebase on Feb 5, 2020
  37. jonatack force-pushed on Feb 6, 2020
  38. jonatack force-pushed on Feb 6, 2020
  39. jonatack renamed this:
    config, test: asmap functional tests and feature refinements
    config, net, test: asmap functional tests and feature refinements
    on Feb 6, 2020
  40. jonatack commented at 4:11 pm on February 6, 2020: member
    Rebased, added 366aab9 for items found during review of other now-merged asmap PRs, and updated the new tests to use self.chain rather than ‘regtest’.
  41. DrahtBot removed the label Needs rebase on Feb 6, 2020
  42. in src/init.cpp:412 in 614b082b01 outdated
    408@@ -409,7 +409,7 @@ void SetupServerArgs()
    409                  ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
    410 
    411     gArgs.AddArg("-addnode=<ip>", "Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info). This option can be specified multiple times to add multiple nodes.", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
    412-    gArgs.AddArg("-asmap=<file>", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Path should be relative to the -datadir path.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
    413+    gArgs.AddArg("-asmap=<file>", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Relative paths will be prefixed by a net-specific datadir location.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
    


    sipa commented at 5:52 pm on February 6, 2020:
    By the net-specific datadir location?

    jonatack commented at 8:34 am on February 7, 2020:
    Done. There are 3 other instances of “a net-specific datadir location” (bitcoind -help | grep -B1 -A2 net-specific) but I left them alone here.
  43. in src/addrman.cpp:18 in d2203094b8 outdated
    15     uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetCheapHash();
    16     uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup(asmap) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash();
    17     int tried_bucket = hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
    18     uint32_t mapped_as = GetMappedAS(asmap);
    19-    LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to tried bucket %i.\n", ToStringIP(), mapped_as, tried_bucket);
    20+    LogPrint(BCLog::NET, "IP %s mapped to AS %i belongs to tried bucket %i\n", ToStringIP(), mapped_as, tried_bucket);
    


    sipa commented at 5:58 pm on February 6, 2020:
    AS numbers are usually written “ASnnn”, so I think this is intentional.

    jonatack commented at 8:35 am on February 7, 2020:
    Thank you – done.
  44. in src/addrman.cpp:29 in d2203094b8 outdated
    25@@ -26,7 +26,7 @@ int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src, const std:
    26     uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetCheapHash();
    27     int new_bucket = hash2 % ADDRMAN_NEW_BUCKET_COUNT;
    28     uint32_t mapped_as = GetMappedAS(asmap);
    29-    LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to new bucket %i.\n", ToStringIP(), mapped_as, new_bucket);
    30+    LogPrint(BCLog::NET, "IP %s mapped to AS %i belongs to new bucket %i\n", ToStringIP(), mapped_as, new_bucket);
    


    sipa commented at 5:58 pm on February 6, 2020:
    Same here.

    jonatack commented at 8:36 am on February 7, 2020:
    Done.
  45. in src/rpc/net.cpp:86 in 1d0c754f8a outdated
    82@@ -83,7 +83,7 @@ static UniValue getpeerinfo(const JSONRPCRequest& request)
    83             "    \"addr\":\"host:port\",      (string) The IP address and port of the peer\n"
    84             "    \"addrbind\":\"ip:port\",    (string) Bind address of the connection to the peer\n"
    85             "    \"addrlocal\":\"ip:port\",   (string) Local address as reported by the peer\n"
    86-            "    \"mapped_as\":\"mapped_as\", (string) The AS in the BGP route to the peer used for diversifying peer selection\n"
    87+            "    \"mapped_as\":\"mapped_as\", (numeric) The AS in the BGP route to the peer used for diversifying peer selection\n"
    


    sipa commented at 5:59 pm on February 6, 2020:
    If this is numeric, the \" around mapped_as should go as well.

    jonatack commented at 8:36 am on February 7, 2020:
    Good catch – done. Replaced with \"mapped_as\": n,
  46. jonatack force-pushed on Feb 7, 2020
  47. jonatack commented at 8:48 am on February 7, 2020: member

    Thank you @sipa for reviewing, updated as per git diff 11a1028..1e26a1a

     0diff --git a/src/addrman.cpp b/src/addrman.cpp
     1index ef34edc0a0..2f8a3a0bd5 100644
     2-    LogPrint(BCLog::NET, "IP %s mapped to AS %i belongs to tried bucket %i\n", ToStringIP(), mapped_as, tried_bucket);
     3+    LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to tried bucket %i\n", ToStringIP(), mapped_as, tried_bucket);
     4 
     5-    LogPrint(BCLog::NET, "IP %s mapped to AS %i belongs to new bucket %i\n", ToStringIP(), mapped_as, new_bucket);
     6+    LogPrint(BCLog::NET, "IP %s mapped to AS%i belongs to new bucket %i\n", ToStringIP(), mapped_as, new_bucket);
     7 
     8diff --git a/src/init.cpp b/src/init.cpp
     9index 6591852a7f..7b5e536b8f 100644
    10-    gArgs.AddArg("-asmap=<file>", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Relative paths will be prefixed by a net-specific datadir location.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
    11+    gArgs.AddArg("-asmap=<file>", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Relative paths will be prefixed by the net-specific datadir location.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
    12
    13diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
    14index 59d299e749..2f66fb9299 100644
    15-            "    \"mapped_as\":\"mapped_as\", (numeric) The AS in the BGP route to the peer used for diversifying peer selection\n"
    16+            "    \"mapped_as\": n,            (numeric) The AS in the BGP route to the peer used for diversifying peer selection\n"
    17+            "                                         (only available if the asmap config flag is set)\n"
    
  48. in test/functional/feature_asmap.py:60 in 1e26a1af96 outdated
    55+        os.remove(filename)
    56+
    57+    def test_asmap_with_relative_path(self):
    58+        self.log.info('Test bitcoind -asmap=<relative path>')
    59+        self.stop_node(0)
    60+        name = 'ASN map'
    


    pinheadmz commented at 3:59 pm on February 11, 2020:
    Are you sure it’s ok to have a space in a command line argument? Some OSes/shells might interpret this as -asmap=ASN and stop parsing, but I’m not sure

    jonatack commented at 4:05 pm on February 11, 2020:
    The CI builds didn’t have an issue, but since there are no ACKs yet to lose, I can change it.
  49. in test/functional/feature_asmap.py:86 in 1e26a1af96 outdated
    81+
    82+    def test_empty_asmap(self):
    83+        self.log.info('Test bitcoind -asmap with empty map file')
    84+        self.stop_node(0)
    85+        with open(self.default_asmap, "w", encoding="utf-8") as f:
    86+            f.write("")
    


    pinheadmz commented at 4:08 pm on February 11, 2020:
    I tried running this test with junk data here (f.write("helloworld")) bitcoind didn’t mind interpreting that junk as a valid asmap file, didn’t throw the expected parsing error. I suspect that’s because the map file is just raw bytes, is there no way to check it for integrity?

    jonatack commented at 4:28 pm on February 11, 2020:
    I think that’s outside the scope of this PR; perhaps as a follow-up.
  50. pinheadmz commented at 4:39 pm on February 11, 2020: member
    ACK 1e26a1af96438edf96ecb2268569d5bec4a7f43e optional nit #17812 (review) happy to reack if you decide to address that
  51. jonatack force-pushed on Feb 11, 2020
  52. jonatack commented at 7:18 pm on February 11, 2020: member

    Thanks @pinheadmz for reviewing, updated as per git diff 1e26a1a..dccc6bf:

    0test/functional/feature_asmap.py
    1-        name = 'ASN map'
    2+        name = 'ASN_map'
    
  53. pinheadmz commented at 7:43 pm on February 11, 2020: member
    ACk dccc6bfc04e43bbdf8db35e0fb7288231b05973f
  54. naumenkogs commented at 7:02 pm on February 13, 2020: member
    Great work, thanks! Especially those tests. ACK dccc6bfc04e43bbdf8db35e0fb7288231b05973f
  55. luke-jr referenced this in commit 75798ad061 on Feb 16, 2020
  56. luke-jr referenced this in commit 44a2a4c35c on Feb 16, 2020
  57. luke-jr referenced this in commit 5ac01f769f on Feb 16, 2020
  58. luke-jr referenced this in commit 821809b64c on Feb 16, 2020
  59. luke-jr referenced this in commit 96a9bdba15 on Feb 16, 2020
  60. luke-jr referenced this in commit 306f89acee on Feb 16, 2020
  61. luke-jr referenced this in commit 7a552eb8f5 on Feb 16, 2020
  62. luke-jr referenced this in commit 58a0c9dcc2 on Feb 16, 2020
  63. luke-jr referenced this in commit e8bb88a82d on Feb 16, 2020
  64. MarcoFalke commented at 1:54 am on February 17, 2020: member

    ACK dccc6bfc04 🐔

    Signature:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA512
     2
     3ACK dccc6bfc04 🐔
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
     7pUh6Cgv+M0g7bjlY1yqXorkNkyNeTx6YJpaqnM+w5VCirwJxVpH7hXGo8USv2t6d
     8N2u0oyAslzwupoD83ucutnx8yxbZ1cqDXvRasDX1I2pFACgKjSmd9NqkKOlpO6Qi
     98KSSsvFeGBv2IO5dmIoRpDdUsebewBMnCdbJXh0g59+hkKo0GUU0NLcHIpdBgR1C
    10Un/ffCCmnF2KlvZAi1jje9fDc0ws2oMUzjb8NP7Zw2jtSEFev22j8lPpVX3efiWe
    110l6+9eJ+La5B5OxwHx2afhEjybmlKSnEM5BidpYdDJRlN6/8GdkWACvCi9yr+uCV
    12NMfSVSV5lGXAGArf+lFH5j8ru1VelBy/GB2291q42b/wo/PvGMOn59IurgK4sfGr
    13/lzT66I+8Z8WtU4o8IDIShObkt4nJtHlosROun7Rx6XFC4enA5b82HkDnPfpY0vb
    1419r3DaJwTxQ22gEo1EhFAcKKTJThPbcwMtoNpsOMi+hzdBLunNTcCVbC2SN9ymoh
    15/PXwblvP
    16=zKAr
    17-----END PGP SIGNATURE-----
    

    Timestamp of file with hash 9e9a24d432005b3d1790df265d0b15fa6227860ab58337e3ed405bd9b7b94cba -

  65. DrahtBot added the label Needs rebase on Feb 17, 2020
  66. jonatack force-pushed on Feb 18, 2020
  67. jonatack commented at 12:13 pm on February 18, 2020: member
    Rebased. Thank you to the reviewers. Mind re-ACKing?
  68. DrahtBot removed the label Needs rebase on Feb 18, 2020
  69. naumenkogs commented at 1:29 pm on February 18, 2020: member
    reACK d3ec323d151c5b19a7c4fa78000087266c9c6d2e
  70. pinheadmz commented at 3:57 pm on February 18, 2020: member

    Confirming rebase didn’t change anything:

     0$ git range-diff 712b7d9b4..dccc6bfc0  36f42e1bf..d3ec323d1
     1 1:  c4dc420cb =  1:  610cc93e9 test: add feature_asmap functional tests
     2 2:  919f4d7dd =  2:  a8a82d5bf config: use default value in -asmap config
     3 3:  429129440 =  3:  d7b1a5b04 config: enable passing -asmap an absolute file path
     4 4:  eacb2458e =  4:  b321be999 config: separate the asmap finding and parsing checks
     5 5:  0c3b1499b =  5:  366600e83 test: add functional test for an empty, unparsable asmap
     6 6:  89177df7a =  6:  d6e44f0b9 logging: asmap logging and #include fixups
     7 7:  392798830 =  7:  91ff62ff0 net: extract conditional to bool CNetAddr::IsHeNet
     8 8:  317bf6aea <  -:  --------- rpc: fix getpeerinfo RPCResult `mapped_as` type
     9 -:  --------- >  8:  ab8a6cbcb rpc: fix getpeerinfo RPCResult `mapped_as` type
    10 9:  dccc6bfc0 =  9:  d3ec323d1 init: move asmap code earlier in init process
    
     0<              "    \"addr\":\"host:port\",      (string) The IP address and port of the peer\n"
     1<              "    \"addrbind\":\"ip:port\",    (string) Bind address of the connection to the peer\n"
     2<              "    \"addrlocal\":\"ip:port\",   (string) Local address as reported by the peer\n"
     3< -            "    \"mapped_as\":\"mapped_as\", (string) The AS in the BGP route to the peer used for diversifying peer selection\n"
     4< +            "    \"mapped_as\": n,            (numeric) The AS in the BGP route to the peer used for diversifying peer selection\n"
     5< +            "                                         (only available if the asmap config flag is set)\n"
     6<              "    \"services\":\"xxxxxxxxxxxxxxxx\",   (string) The services offered\n"
     7<              "    \"servicesnames\":[              (array) the services offered, in human-readable form\n"
     8---
     9>              "    \"addr\" : \"host:port\",      (string) The IP address and port of the peer\n"
    10>              "    \"addrbind\" : \"ip:port\",    (string) Bind address of the connection to the peer\n"
    11>              "    \"addrlocal\" : \"ip:port\",   (string) Local address as reported by the peer\n"
    12> -            "    \"mapped_as\" : \"mapped_as\", (string) The AS in the BGP route to the peer used for diversifying peer selection\n"
    13> +            "    \"mapped_as\" : n,             (numeric) The AS in the BGP route to the peer used for diversifying peer selection\n"
    14> +            "                                           (only available if the asmap config flag is set)\n"
    15>              "    \"services\" : \"xxxxxxxxxxxxxxxx\",   (string) The services offered\n"
    16>              "    \"servicesnames\" : [              (json array) the services offered, in human-readable form\n"
    

    reACK d3ec323d1

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA256
     2
     3reACK d3ec323d1
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAl5MCRYACgkQ5+KYS2KJ
     7yToEbA//eNfaa06Lt1kslQn4CgV6QBILrLFCcHct6/SMFDCGO1nHUAF+2m70j7Ro
     8PbgUaOKyuSZHreeVeoVfZtxJxjJnWhKUOugvEPCI0sMfezxznx9xSuYXxVCyJ1GG
     9e+sY9IWkTT/99blMqlSNAj1WVjr0p8LZlfBNDpbxJPd/zdTuqdFk0lMLsFA2/mdl
    10i9uDLsF9WxjfDdHb4rIL3CjUe22j+9idQuetkVZY/0BqwuQEjuSpVGeE/9ROkvyF
    112RBUrIQfjcylq5NUv7NXBEX75xcvefsxv/fTKBbAU1yksKLckEAu87PLS5KscwCf
    12fCK5KydD/5f2bRE5Fi5t9VOmlTmj8WyMrvcd/Y3Wu/89hRQ0J70I8RYHP1xr+7TR
    13wgGL+Dwk4VPy34KEbZk9MZRvREm2xpqsKFl4/F8lUzYo4CYzYG/dhf2avpUUjS3O
    14198pydlsf6mIBXbWo2Qczzz5rzl334kY+g4T8I7B1IcZ/MlOd5RODOwCIBRXrFIN
    15xNJQ92S5lesLz+IkNFq0gMXp7ncPsSKEvdqyLeKD4BrKoSiS7T858fGgu/f1jnch
    16G+RZCXJf8fd2kF4bcu2fA/h8SiGD14NyULzPYvAog/bzqVwPBluSWr3dxRmpv6mr
    17sk31H1CbGGaFv31fNaVVv1zjZc1H32IpMty8TKhq0IQKqbac52c=
    18=s/w5
    19-----END PGP SIGNATURE-----
    
  71. DrahtBot added the label Needs rebase on Mar 1, 2020
  72. jonatack renamed this:
    config, net, test: asmap functional tests and feature refinements
    config, net, test: asmap feature refinements and functional tests
    on Mar 2, 2020
  73. jonatack force-pushed on Mar 2, 2020
  74. jonatack commented at 10:05 am on March 2, 2020: member
    rebased
  75. DrahtBot removed the label Needs rebase on Mar 2, 2020
  76. naumenkogs commented at 3:55 pm on March 2, 2020: member
    reACK 0b7ad4aba1c6a850d5ba927766ccd38cc003571c
  77. pinheadmz commented at 8:48 pm on March 2, 2020: member

    Rebase looks cool

     0git range-diff 36f42e1bf..d3ec323d1 54a7ef612..0b7ad4aba
     1 1:  610cc93e9 =  1:  1fa86bb61 test: add feature_asmap functional tests
     2 2:  a8a82d5bf =  2:  499ff12f3 config: use default value in -asmap config
     3 3:  d7b1a5b04 =  3:  ca845a1aa config: enable passing -asmap an absolute file path
     4 4:  b321be999 =  4:  0ca73d89c config: separate the asmap finding and parsing checks
     5 5:  366600e83 =  5:  dc69b77e4 test: add functional test for an empty, unparsable asmap
     6 6:  d6e44f0b9 !  6:  74dea5777 logging: asmap logging and #include fixups
     7    @@ src/init.cpp
     8      #include <util/system.h>
     9      #include <util/threadnames.h>
    10      #include <util/translation.h>
    11    - #include <util/validation.h>
    12     -#include <util/asmap.h>
    13      #include <validation.h>
    14      #include <hash.h>
    15 7:  91ff62ff0 =  7:  295cd2b96 net: extract conditional to bool CNetAddr::IsHeNet
    16 8:  ab8a6cbcb =  8:  9ee5e8b0a rpc: fix getpeerinfo RPCResult `mapped_as` type
    17 9:  d3ec323d1 =  9:  0b7ad4aba init: move asmap code earlier in init process
    

    reACK 0b7ad4aba1c6a850d5ba927766ccd38cc003571c

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA256
     2
     3reACK 0b7ad4aba1c6a850d5ba927766ccd38cc003571c
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAl5dcNAACgkQ5+KYS2KJ
     7yTqiug//WdU8pZVxuxH2eF+Ky8+VUPynP7btq2cwqmhtPUcp/WMRRS+i8NAPcUWm
     8PP4DXaNaDbb5k/+/HmxWqju1v4kJRDxNVFzsK7KZ+515YKu6Vn3Zor/uV/XIKlwm
     9hOwNpC3w7ypoot2r8AbjZ8kWwPvUCdPqgXKt4p3VedxQ8XGsxnVmQ0/CpyI6Szb9
    10A4AmjoRW+VfEp8hOuhFTsE12BHfPJqGcskxLDiKVdyV31nE7U69yEj4T83lvBLUA
    11BoGysXQJKjuNbMYU9W7oGJsO/iX4Gu0hdRhYpbOjgCDM3p9AqSqDHDoYDNoHLA1c
    12Jk6qhwsK6HKde9Xd4tDrFxN6i2iTJ3d+Maw72Fnd2MKyapoWfQIefXU8pUnQN/A7
    13Kz6EpfTH+Oph089tQzJhRIkMapopV7gTVsGe1d9BL5/vMW9gQ5RjevOBPgY1pPwu
    14zxXNYdPeewF3Pb3qQ6Qq25RC8AHCE9OYuLl2F3i0UldDTRGY69AWNN7vxjYwCGPc
    153EjGCKbzjas+iSaPyTwwcioZ+KN+N/ZVJC4f98RtcSCjeYOeESVWmt7mixen6QpH
    163RrrCPPiJtmF9uB313xszgKEY+mDvv1iIeLj56eYvY4q4m/pJqCelOvS3X79E/OV
    17W1ngpN7Yq07x6zmlsa1H00bVBn68v7HIcIjwS49xxBPgHvLV2e4=
    18=9FZk
    19-----END PGP SIGNATURE-----
    
  78. test: add feature_asmap functional tests
    to verify node behaviour and debug log when launching bitcoind in these cases:
    
    1. `bitcoind` with no -asmap arg, using /16 prefix for IP bucketing
    
    2. `bitcoind -asmap=<relative path>`, using the unit test skeleton asmap
    
    3. `bitcoind -asmap/-asmap=` with no file specified, using the default asmap
    
    4. `bitcoind -asmap` with no file specified, and a missing default asmap file
    
    The tests are order-independent. The slowest test (missing default asmap file)
    is placed last.
    08b992675c
  79. config: use default value in -asmap config
    and move to sorted position
    fbe9b024f0
  80. config: enable passing -asmap an absolute file path
    - allow passing an absolute file path to the -asmap config arg
    
    - update the -asmap config help
    
    - add a functional test in feature_asmap.py
    81c38a2497
  81. config: separate the asmap finding and parsing checks
    and update the tests.
    b8d0412b21
  82. test: add functional test for an empty, unparsable asmap
    This is now testable after separating the asmap finding and parsing checks in
    the previous commit.
    dcaf543ba0
  83. logging: asmap logging and #include fixups
    - move asmap #includes to sorted positions in addrman and init (move-only)
    
    - remove redundant quotes in asmap InitError, update test
    
    - remove full stops from asmap logging to be consistent with debug logging,
      update tests
    819fb5549b
  84. net: extract conditional to bool CNetAddr::IsHeNet
    and remove redundant public declaration
    c90b9a2399
  85. rpc: fix getpeerinfo RPCResult `mapped_as` type
    and mention it is only available if the asmap config flag is set.
    5ba829e12e
  86. init: move asmap code earlier in init process
    and update feature_asmap.py and test_runner.py
    
    This commit moves the asmap init.cpp code from the end of "Step 12: start node"
    to "Step 6: network initialization" to provide feedback on passing an -asmap
    config arg much more quickly. This change speeds up the feature_asmap.py
    functional test file from 60 to 5 seconds by accelerating the 2 tests that use
    `assert_start_raises_init_error`.
    
    Credit to Wladimir J. van der Laan for the suggestion.
    1ba3e1cc21
  87. jonatack force-pushed on Mar 4, 2020
  88. jonatack commented at 2:00 pm on March 4, 2020: member
    rebased due to #17809
  89. practicalswift commented at 7:06 pm on March 4, 2020: contributor

    In the sentence …

    “The AS in the BGP route to the peer …”

    … isn’t the correct technical term “AS path” rather than “BGP route”? :)

  90. jonatack commented at 8:52 am on March 5, 2020: member
    Thanks @practicalswift, taking note for a follow-up (asmap release notes), at this point I prefer to preserve the 3 ACKs. Mind acking?
  91. practicalswift commented at 11:07 am on March 5, 2020: contributor

    @jonatack Sure! :)

    ACK 1ba3e1cc21150abe632a5b82a1a38998b33815dc – diff looks correct

  92. fanquake approved
  93. fanquake commented at 12:13 pm on March 5, 2020: member
    ACK 1ba3e1cc21150abe632a5b82a1a38998b33815dc
  94. fanquake merged this on Mar 5, 2020
  95. fanquake closed this on Mar 5, 2020

  96. jonatack deleted the branch on Mar 5, 2020
  97. jasonbcox referenced this in commit 930510cbf4 on Oct 30, 2020
  98. kittywhiskers referenced this in commit ec9b8028a9 on Mar 9, 2021
  99. kittywhiskers referenced this in commit 48b03c4535 on Mar 9, 2021
  100. kittywhiskers referenced this in commit 26d1b0992f on Mar 9, 2021
  101. kittywhiskers referenced this in commit 6fed7e59d1 on Mar 9, 2021
  102. kittywhiskers referenced this in commit 635b5278e1 on Mar 9, 2021
  103. kittywhiskers referenced this in commit 7dc09bd461 on Mar 9, 2021
  104. kittywhiskers referenced this in commit 7a9f8d6507 on Mar 9, 2021
  105. kittywhiskers referenced this in commit 29c72a3ee9 on Mar 9, 2021
  106. kittywhiskers referenced this in commit 36b001df8d on Mar 9, 2021
  107. kittywhiskers referenced this in commit c519b342dd on Mar 9, 2021
  108. kittywhiskers referenced this in commit a702e14114 on Mar 9, 2021
  109. kittywhiskers referenced this in commit 3bb6a55e24 on Mar 9, 2021
  110. kittywhiskers referenced this in commit c3f6076b36 on Mar 9, 2021
  111. kittywhiskers referenced this in commit 3d842e49e9 on Mar 9, 2021
  112. kittywhiskers referenced this in commit c3e2c94712 on Mar 9, 2021
  113. kittywhiskers referenced this in commit 54169b3b1f on Mar 9, 2021
  114. kittywhiskers referenced this in commit 1f8fb2267b on Mar 9, 2021
  115. kittywhiskers referenced this in commit f06f77819b on Mar 9, 2021
  116. kittywhiskers referenced this in commit 218dec2497 on Mar 9, 2021
  117. kittywhiskers referenced this in commit a04045f4b6 on Mar 9, 2021
  118. kittywhiskers referenced this in commit 78b67d7559 on Mar 9, 2021
  119. kittywhiskers referenced this in commit 35e37f858f on Mar 9, 2021
  120. kittywhiskers referenced this in commit 3e814798e0 on Mar 9, 2021
  121. kittywhiskers referenced this in commit f52370aa81 on Mar 9, 2021
  122. kittywhiskers referenced this in commit 45fcc506f2 on Mar 9, 2021
  123. kittywhiskers referenced this in commit 301ddddefb on Mar 9, 2021
  124. kittywhiskers referenced this in commit ce2d48e876 on Mar 9, 2021
  125. kittywhiskers referenced this in commit 312bffef1d on Mar 9, 2021
  126. kittywhiskers referenced this in commit e04eff181e on Mar 9, 2021
  127. kittywhiskers referenced this in commit 9f9b625c28 on Mar 9, 2021
  128. kittywhiskers referenced this in commit 51540eff87 on Mar 9, 2021
  129. kittywhiskers referenced this in commit 390f32a9ec on Mar 9, 2021
  130. kittywhiskers referenced this in commit 4cc529de8b on Mar 9, 2021
  131. kittywhiskers referenced this in commit d7547d4694 on Mar 9, 2021
  132. kittywhiskers referenced this in commit a39078e30d on Mar 9, 2021
  133. kittywhiskers referenced this in commit 97a34c2360 on Mar 9, 2021
  134. kittywhiskers referenced this in commit 1ea2e097c6 on Mar 9, 2021
  135. kittywhiskers referenced this in commit 267426d180 on Mar 9, 2021
  136. kittywhiskers referenced this in commit c37bcce61d on Mar 9, 2021
  137. kittywhiskers referenced this in commit a6d1734a47 on Mar 9, 2021
  138. kittywhiskers referenced this in commit 6dfa4f02e4 on Mar 9, 2021
  139. kittywhiskers referenced this in commit cdf7bab799 on Mar 9, 2021
  140. kittywhiskers referenced this in commit 76e544af55 on Mar 9, 2021
  141. kittywhiskers referenced this in commit 3f5fe7255b on Mar 9, 2021
  142. kittywhiskers referenced this in commit c14491b0d5 on Mar 9, 2021
  143. kittywhiskers referenced this in commit d4dab07633 on Mar 9, 2021
  144. kittywhiskers referenced this in commit f23af0adbb on Mar 9, 2021
  145. kittywhiskers referenced this in commit 71bf42e3e3 on Mar 9, 2021
  146. kittywhiskers referenced this in commit 851e098ecb on Mar 9, 2021
  147. kittywhiskers referenced this in commit 572704a068 on Mar 9, 2021
  148. kittywhiskers referenced this in commit 2c07fb45ac on Mar 9, 2021
  149. kittywhiskers referenced this in commit cc3e7dd27b on Mar 9, 2021
  150. kittywhiskers referenced this in commit 25adf789c5 on Mar 9, 2021
  151. kittywhiskers referenced this in commit 9012494c18 on Mar 9, 2021
  152. kittywhiskers referenced this in commit ecadab4db2 on Mar 9, 2021
  153. kittywhiskers referenced this in commit d711e16ed1 on Mar 9, 2021
  154. kittywhiskers referenced this in commit 8e2223ccab on Mar 9, 2021
  155. kittywhiskers referenced this in commit fbf5edaf7f on Mar 9, 2021
  156. kittywhiskers referenced this in commit c3b091c877 on Mar 9, 2021
  157. kittywhiskers referenced this in commit 7c970984ac on Mar 9, 2021
  158. kittywhiskers referenced this in commit 9f2de4613d on Mar 9, 2021
  159. kittywhiskers referenced this in commit 58ac88a22d on Mar 9, 2021
  160. kittywhiskers referenced this in commit 7849424a2f on Mar 9, 2021
  161. kittywhiskers referenced this in commit d77a562679 on Mar 9, 2021
  162. kittywhiskers referenced this in commit e6a4ede6d4 on Mar 9, 2021
  163. kittywhiskers referenced this in commit 825aae61c4 on Mar 9, 2021
  164. kittywhiskers referenced this in commit 394de4a0f8 on Mar 9, 2021
  165. kittywhiskers referenced this in commit 4cafd5ae68 on Mar 9, 2021
  166. kittywhiskers referenced this in commit 0b1280d925 on Mar 9, 2021
  167. kittywhiskers referenced this in commit f57b9fafe0 on Mar 12, 2021
  168. kittywhiskers referenced this in commit 4a287d14cd on Mar 12, 2021
  169. kittywhiskers referenced this in commit f8c52aab8e on Mar 12, 2021
  170. kittywhiskers referenced this in commit fc3095f5f5 on Mar 12, 2021
  171. kittywhiskers referenced this in commit abb1ac57ea on Mar 12, 2021
  172. kittywhiskers referenced this in commit 23cfa2d218 on Mar 12, 2021
  173. kittywhiskers referenced this in commit 27e6662a03 on Mar 12, 2021
  174. kittywhiskers referenced this in commit 8d39c7ee14 on Mar 12, 2021
  175. kittywhiskers referenced this in commit 97e0b8f88d on Mar 12, 2021
  176. kittywhiskers referenced this in commit 38b07c94a2 on Mar 12, 2021
  177. kittywhiskers referenced this in commit bda15f9d4c on Mar 12, 2021
  178. kittywhiskers referenced this in commit ef8d23b156 on Mar 12, 2021
  179. kittywhiskers referenced this in commit 155d1c2dc5 on Mar 12, 2021
  180. kittywhiskers referenced this in commit 777c9c966d on Mar 12, 2021
  181. kittywhiskers referenced this in commit d3a62deb79 on Mar 12, 2021
  182. kittywhiskers referenced this in commit 5ef9a8d5dd on Mar 12, 2021
  183. kittywhiskers referenced this in commit d16baeafb9 on Mar 12, 2021
  184. kittywhiskers referenced this in commit 3e9d08867b on Mar 12, 2021
  185. kittywhiskers referenced this in commit c1032e8fda on Mar 12, 2021
  186. kittywhiskers referenced this in commit a511f96062 on Mar 12, 2021
  187. kittywhiskers referenced this in commit 9607fe85f2 on Mar 12, 2021
  188. kittywhiskers referenced this in commit 0fe58248c8 on Mar 12, 2021
  189. kittywhiskers referenced this in commit f8fd9783c8 on Mar 12, 2021
  190. kittywhiskers referenced this in commit b34b985350 on Mar 12, 2021
  191. kittywhiskers referenced this in commit ed550d7775 on Mar 12, 2021
  192. kittywhiskers referenced this in commit 60330c9549 on Mar 12, 2021
  193. kittywhiskers referenced this in commit d2901c2a37 on Mar 12, 2021
  194. kittywhiskers referenced this in commit 88aab45bb2 on Mar 14, 2021
  195. kittywhiskers referenced this in commit 399baca88d on Mar 14, 2021
  196. kittywhiskers referenced this in commit f333853679 on Mar 14, 2021
  197. kittywhiskers referenced this in commit cd1158bd3b on Mar 14, 2021
  198. kittywhiskers referenced this in commit 4609d39a2c on Mar 14, 2021
  199. kittywhiskers referenced this in commit 587bd3e696 on Mar 14, 2021
  200. kittywhiskers referenced this in commit 6243c0973b on Mar 14, 2021
  201. kittywhiskers referenced this in commit dfeaf31853 on Mar 14, 2021
  202. kittywhiskers referenced this in commit 9e3770e515 on Mar 14, 2021
  203. kittywhiskers referenced this in commit 7d8b165e6b on Mar 18, 2021
  204. kittywhiskers referenced this in commit a199678a12 on Mar 18, 2021
  205. kittywhiskers referenced this in commit 5868788920 on Mar 18, 2021
  206. kittywhiskers referenced this in commit a48766f955 on Mar 18, 2021
  207. kittywhiskers referenced this in commit 8cf4cc9630 on Mar 18, 2021
  208. kittywhiskers referenced this in commit a03a183c66 on Mar 18, 2021
  209. kittywhiskers referenced this in commit b61aaec1b8 on Mar 18, 2021
  210. kittywhiskers referenced this in commit e2dcdc9886 on Mar 18, 2021
  211. kittywhiskers referenced this in commit 208f7aad31 on Mar 18, 2021
  212. kittywhiskers referenced this in commit d6650cf879 on Mar 19, 2021
  213. kittywhiskers referenced this in commit 32c9237a00 on Mar 19, 2021
  214. kittywhiskers referenced this in commit 4465c7cfc0 on Mar 19, 2021
  215. kittywhiskers referenced this in commit 21ff3c6267 on Mar 19, 2021
  216. kittywhiskers referenced this in commit a6d8403a6a on Mar 19, 2021
  217. kittywhiskers referenced this in commit 7210d055aa on Mar 19, 2021
  218. kittywhiskers referenced this in commit db69fc4eb1 on Mar 19, 2021
  219. kittywhiskers referenced this in commit 4672618c98 on Mar 19, 2021
  220. kittywhiskers referenced this in commit 68c56c740e on Mar 19, 2021
  221. kittywhiskers referenced this in commit 578da6c1e4 on Apr 21, 2021
  222. kittywhiskers referenced this in commit 2ded0b7614 on Apr 21, 2021
  223. kittywhiskers referenced this in commit 66b43f7a6f on Apr 23, 2021
  224. kittywhiskers referenced this in commit 5972077e4a on Apr 23, 2021
  225. kittywhiskers referenced this in commit 4d1405f0fb on Apr 23, 2021
  226. kittywhiskers referenced this in commit 12b190afb5 on Apr 23, 2021
  227. kittywhiskers referenced this in commit 5ed504b43b on May 11, 2021
  228. kittywhiskers referenced this in commit af5fea8252 on May 11, 2021
  229. kittywhiskers referenced this in commit 8e0ac4d73f on May 11, 2021
  230. UdjinM6 referenced this in commit ce2a436922 on May 15, 2021
  231. kittywhiskers referenced this in commit a58dbb3404 on May 18, 2021
  232. kittywhiskers referenced this in commit d4c9628c6b on May 18, 2021
  233. UdjinM6 referenced this in commit 53ee45e898 on May 19, 2021
  234. kittywhiskers referenced this in commit e7442b5a28 on May 19, 2021
  235. kittywhiskers referenced this in commit 401098283e on May 19, 2021
  236. PastaPastaPasta referenced this in commit 2f555f87d1 on May 19, 2021
  237. kittywhiskers referenced this in commit 4d41afb781 on May 20, 2021
  238. random-zebra referenced this in commit 85f000ecbe on Jul 30, 2021
  239. random-zebra referenced this in commit b4751e10ce on Aug 11, 2021
  240. DrahtBot locked this on Feb 15, 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 06:12 UTC

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