Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented May 25, 2021

Replace the ancient (2015) Tor V2 hardcoded seeds with new Tor V3 ones. This needs to be done before 0.22 to make sure onion-only testnet nodes can still connect to the network. Continues #21560.

Ways to test:

  • Re-generate src/chainparamsseeds.h with cd contrib/seeds && python3 generate-seeds.py . > ../../src/chainparamsseeds.h, check if git tree stays the same.
  • Create a new testnet node with bitcoind -testnet -onlynet=onion -proxy=127.0.0.1:9050 (or delete ~/.bitcoin/testnet3/peers.dat), check if it is able to connect to the network and get blocks.
  • Check if the addresses are connectable for ex.:
#!/usr/bin/env python3
import subprocess
with open('contrib/seeds/nodes_test.txt') as f:
    for line in (line for line in (line.rstrip().split('#', 1)[0] for line in f) if line):
        subprocess.call(["nc", "-v", "-x", "127.0.0.1:9050", "-z"] + line.split(':'))

Thanks to jonatack for providing the list.

@laanwj laanwj added the P2P label May 25, 2021
@laanwj laanwj added this to the 22.0 milestone May 25, 2021
@DrahtBot
Copy link
Contributor

DrahtBot commented May 25, 2021

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

Conflicts

No conflicts as of last run.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 6fe0516

Ran python3 generate-seeds.py . > ../../src/chainparamsseeds.h, no change in git tree

Testnet node loads seeds and connects blocks

$ bitcoin-cli -addrinfo
{
  "addresses_known": {
    "ipv4": 0,
    "ipv6": 0,
    "torv2": 0,
    "torv3": 12,
    "i2p": 0,
    "total": 12
  }
}
2021-05-25T19:40:06Z Bitcoin Core version v21.99.0-6fe05168587e (debug build)
...
2021-05-25T19:41:27Z Missing or invalid file /home/jon/.bitcoin/testnet3/peers.dat
2021-05-25T19:41:27Z Recreating peers.dat
2021-05-25T19:41:27Z tor: Got service ID nyl4eih5tm3oflhusea6u33pvhjokiftv6iecgtmy4cv5c45g75kdfyd, advertising service nyl4eih5tm3oflhusea6u33pvhjokiftv6iecgtmy4cv5c45g75kdfyd.onion:18333
2021-05-25T19:41:27Z AddLocal(nyl4eih5tm3oflhusea6u33pvhjokiftv6iecgtmy4cv5c45g75kdfyd.onion:18333,4)
2021-05-25T19:41:27Z Leaving InitialBlockDownload (latching to false)
2021-05-25T19:41:27Z Loaded 0 addresses from "anchors.dat"
2021-05-25T19:41:27Z 0 block-relay-only anchors will be tried for connections.
2021-05-25T19:41:27Z init message: Starting network threads…
2021-05-25T19:41:27Z DNS seeding disabled
2021-05-25T19:41:27Z addcon thread start
2021-05-25T19:41:27Z init message: Done loading
2021-05-25T19:41:27Z msghand thread start
2021-05-25T19:41:27Z net thread start
2021-05-25T19:41:27Z opencon thread start
2021-05-25T19:41:27Z Imported mempool transactions from disk: 43 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
2021-05-25T19:41:27Z loadblk thread exit
2021-05-25T19:41:28Z Adding fixed seeds as -dnsseed=0, -addnode is not provided and all -seednode(s) attempted
2021-05-25T19:41:33Z New outbound peer connected: version: 70016, blocks=1976649, peer=0 (outbound-full-relay)
2021-05-25T19:41:36Z New outbound peer connected: version: 70016, blocks=1976649, peer=1 (outbound-full-relay)
2021-05-25T19:41:48Z UpdateTip: new best=000000000000001cdb87c5e2564eb312c4b4f81d6a1a3bdda3335555b266e187 height=1976638 version=0x20c00004 log2_work=74.268247 tx=60092273 date='2021-05-25T17:58:50Z' progress=0.999987 cache=0.0MiB(160txo)
2021-05-25T19:41:49Z New outbound peer connected: version: 70016, blocks=1976649, peer=2 (outbound-full-relay)
2021-05-25T19:42:03Z New outbound peer connected: version: 70016, blocks=1976649, peer=3 (outbound-full-relay)
2021-05-25T19:42:32Z New outbound peer connected: version: 70016, blocks=1976649, peer=4 (outbound-full-relay)
2021-05-25T19:42:38Z New outbound peer connected: version: 70016, blocks=1976649, peer=5 (outbound-full-relay)
2021-05-25T19:42:44Z New outbound peer connected: version: 70016, blocks=1976649, peer=6 (outbound-full-relay)
2021-05-25T19:42:56Z New outbound peer connected: version: 70016, blocks=1976649, peer=7 (outbound-full-relay)

All 12 seeds connected

$ ((HEAD detached at origin/pr/22060))$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> with open('contrib/seeds/nodes_test.txt') as f:
...     for line in (line for line in (line.rstrip().split('#', 1)[0] for line in f) if line):
...         subprocess.call(["nc", "-v", "-x", "127.0.0.1:9050", "-z"] + line.split(':'))
... 
Connection to 35k2va6vyw4oo5ly2quvcszgdqr56kcnfgcqpnpcffut4jn3mhhwgbid.onion 18333 port [tcp/*] succeeded!
0
Connection to blo2esfvk2rr7sr4jspmu3vt2vpgr5rigflsj645fnku7v4qmljurtid.onion 18333 port [tcp/*] succeeded!
0
Connection to fuckcswupr5rmlvx2kqqrrosxvjyong4hatmuvxsvtcwe4dsh5rus7qd.onion 18333 port [tcp/*] succeeded!
0
Connection to gblylyacjlitd2ywdmo2qqylwtdky7kgeqfvlhiw4zdag4x62tx54hyd.onion 18333 port [tcp/*] succeeded!
0
Connection to gzwpduv33l7yze3bcdzj3inebiyjwddjnwvnjhh5wvnv4me76mjt2kad.onion 18333 port [tcp/*] succeeded!
0
Connection to h3rphzofxzq52tb63mg5f6kc4my3fkcrgh3m5qryeatts43iljbawiid.onion 18333 port [tcp/*] succeeded!
0
Connection to kf4qlhek34b3kgyxyodlmvgm4bxfrjsbjtgayyaiuyhr2eoyfgtm3bad.onion 18333 port [tcp/*] succeeded!
0
Connection to mc7k47ndjvvhcgs54wmjzxvate4rtuybbjoryikdssjhcxlx27psbyqd.onion 18333 port [tcp/*] succeeded!
0
Connection to mrhiniicugfo7mgrwv3wtolk3tptlcw2uq7ih6sq43fa4k4zbilut3yd.onion 18333 port [tcp/*] succeeded!
0
Connection to uiudyws3qizgmepfoh7wwjmsoxoxut4qrmotjjhrn247xnjopr7sfcid.onion 18333 port [tcp/*] succeeded!
0
Connection to zc2wvoqcezcrf64trji6jmhtss34a5ds5ntzdhqegzvex3ynrd7nxcad.onion 18333 port [tcp/*] succeeded!
0
Connection to zd5m3dgdn46naj36pxvvcalfw2paecle6sdxq64ptwxtxjomkywpklqd.onion 18333 port [tcp/*] succeeded!
0
>>> exit()

@laanwj laanwj merged commit 811aa24 into bitcoin:master May 27, 2021
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants