HomePhabricator

p2p: Add DumpAnchors()

Description

p2p: Add DumpAnchors()

Summary:

This is an implementation of #17326:

  • all (currently 2) outbound block-relay-only connections are dumped to anchors.dat file
  • on restart a node tries to connect to the addresses from anchors.dat

This PR prevents a type of eclipse attack when an attacker exploits a victim node restart to force it to connect to new, probably adversarial, peers.

This is a backport of core#17428 [1/7]
https://github.com/bitcoin/bitcoin/pull/17428/commits/567008d2a0c95bd972f4031f31647c493d1bc2e8

Test Plan: ninja

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D10507

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Sep 12 2020, 14:59
PiRKCommitted on Nov 24 2021, 08:42
PiRKPushed on Nov 24 2021, 08:42
Reviewer
Restricted Project
Differential Revision
D10507: p2p: Add DumpAnchors()
Parents
rABCd10643f30435: [avalanche] Turn fetchOrCreatePeer into createPeer
Branches
Unknown
Tags
Unknown

Event Timeline

PiRK committed rABCbc785db12907: p2p: Add DumpAnchors() (authored by Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>).Nov 24 2021, 08:42