Testnet fixed seeds don’t work #29574

issue fanquake openend this issue on March 6, 2024
  1. fanquake commented at 11:07 am on March 6, 2024: member

    Compile master (0fa9f17332a6d9b2eb6e3d9f9102bfd2d9c6f516). Remove peers.dat & anchors.dat. Run bitcoind -dns=0 -dnsseed=0 -testnet:

    02024-03-06T11:04:41Z init message: Done loading
    12024-03-06T11:04:41Z msghand thread start
    22024-03-06T11:04:42Z Adding fixed seeds as -dnsseed=0 (or IPv4/IPv6 connections are disabled via -onlynet) and neither -addnode nor -seednode are provided
    32024-03-06T11:04:42Z Added 0 fixed seeds from reachable networks.
    

    Mainnet seems to work as expected:

    02024-03-06T11:05:42Z msghand thread start
    12024-03-06T11:05:42Z opencon thread start
    22024-03-06T11:05:42Z Adding fixed seeds as -dnsseed=0 (or IPv4/IPv6 connections are disabled via -onlynet) and neither -addnode nor -seednode are provided
    32024-03-06T11:05:42Z Added 801 fixed seeds from reachable networks.
    42024-03-06T11:05:47Z New outbound-full-relay v1 peer connected: version: 70016, blocks=833399, peer=2
    52024-03-06T11:05:48Z Synchronizing blockheaders, height: 833399 (~100.00%)
    

    From what I can tell (using the release bins) this has been broken since at least 24.x.

  2. fanquake added the label P2P on Mar 6, 2024
  3. willcl-ark commented at 12:17 pm on March 6, 2024: member

    This is because all the seeds we have for testnet are NET_ONION: https://paste.256k1.dev/xosamodiga.log and so get filtered by the predicate in ThreadOpenConnections:

    0seed_addrs.erase(std::remove_if(seed_addrs.begin(), seed_addrs.end(),
    1                                [&fixed_seed_networks](const CAddress& addr) { return fixed_seed_networks.count(addr.GetNetwork()) == 0; }),
    2                 seed_addrs.end());
    
    0>>> p fixed_seed_networks
    1$3 = std::unordered_set with 2 elements = {
    2  [0] = NET_IPV6,
    3  [1] = NET_IPV4
    4}
    

    In fact, as far as I can tell it doesn’t appear that we have ever had ipv4 seeds for testnet? So perhaps this is a (historical and) purposeful decision. It appears this has been the case since 2014 when this file was introduced. I roughly checked a few version previous and only found references to mainnet seeds. This would seem like an odd decision to me though, so perhaps I’m missing something here.

    For mainnet we have nodes_main.txt which includes auto-fetched addresses from a dns seeder, and nodes_main_manual.txt which adds onion and I2P seeds. By contrast for testnet nodes_test.txt is not in fact ipv4 addresses, but manually-added tor v3 addresses.

    If we want testnet nodes to be able to sync without relying on dns seeds then we should consider adding some testnet IPV4 addresses.

  4. fanquake commented at 1:30 pm on March 6, 2024: member

    This would seem like an odd decision to me though, so perhaps I’m missing something here.

    I agree. I’m not sure why we’d only want to ship onion seeds for testnet, as that only makes it, if anything, slightly less usable. Maybe they can be added, and the test in feature_config_args extended to cover testnet.

  5. mzumsande commented at 2:37 pm on March 6, 2024: contributor

    I’m not sure why we’d only want to ship onion seeds for testnet, as that only makes it, if anything, slightly less usable.

    I think the reason is that we have working dns seeds for testnet, but since these don’t provide onion addresses, we needed some mechanism to find peers to make it possible to bootstrap with -onlynet=onion. If we added fixed IPv4 and IPv6 seeds for testnet, they would just have the role of a backup mechanism anyway. This is obviously important for mainnet, but maybe not really necessary for testnet?

  6. fanquake commented at 2:40 pm on March 6, 2024: member

    This is obviously important for mainnet, but maybe not really necessary for testnet?

    Possibly, but it seems to just slightly reduce usability for no real benefit? I guess we were also inconsistently not shipping fixed i2p or cjdns seeds for testnet either, but with the current update i2p will now be shipped.

  7. achow101 commented at 4:38 pm on March 6, 2024: member
    I’m currently working on a new DNS seeder and crawler that we’d be able to use for generating the fixed seeds for all networks. This will also include onion, i2p, and cjdns nodes so they don’t have to be done manually as we are doing now.
  8. willcl-ark commented at 9:40 am on May 1, 2024: member
    See #30008
  9. fanquake commented at 3:18 pm on September 12, 2024: member
    This was fixed.
  10. fanquake closed this on Sep 12, 2024


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-12-21 15:12 UTC

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