Why does my full node need to load IP addresses from DNS seeds on restart?

3

I stop one of my Bitcoin Core full nodes (v0.19.1) with 10 connections and then start it again. It needs to load IP addresses from DNS seeds. Why is this? Why doesn't it try the addresses of peers it was connected to prior to the shut down? Are they not persisted in addrman? It could then obtain more IP addresses through gossiping from those peers and not need to keep going back to the DNS seeds.

Michael Folkson

Posted 2021-01-19T14:40:59.720

Reputation: 4 963

I found this https://github.com/bitcoin/bitcoin/pull/16939 and this https://github.com/bitcoin/bitcoin/issues/15434 but will look into more before attempting an answer.

– Michael Folkson – 2021-01-19T14:43:44.397

And this Bitcoin Core PR review club: https://bitcoincore.reviews/16939

– Michael Folkson – 2021-01-19T14:50:00.010

What do you see in the debug.log that indicates it is using the DNS seeds? – Andrew Chow – 2021-01-19T16:19:32.650

"Loading addresses from DNS seed dnsseed.emzy.de" etc followed by the other DNS seeds. Then "277 addresses found from DNS seeds" and "dnsseed thread exit" – Michael Folkson – 2021-01-19T16:44:15.733

Do you have the same problem with v0.21.0? – Pieter Wuille – 2021-01-28T01:18:26.177

No I haven't been able to replicate on v0.21.0 – Michael Folkson – 2021-02-13T12:57:40.460

Answers

0

This appears to be resolved for me in v0.21 with this merged PR 16939 and some additional context in this issue and this Bitcoin Core PR review club.

Falling back to load IP addresses from DNS seeds should be the last resort and as you say addresses of previous peers should be persisted in addrman after stopping bitcoind and restarting.

Michael Folkson

Posted 2021-01-19T14:40:59.720

Reputation: 4 963