Skip to content

blockchain: pool.maxPeerHeight is not updated when a peer is removed #2699

@ebuchman

Description

@ebuchman

In the Blockchain Reactor, peers self report their height and we track the highest one, but we can't validate it until we try to receive that block from that peer. Meanwhile, when we disconnect a peer, we don't update the max height. This means a rogue peer could tell us a ridiculously high height, then disconnect, and we will forever be stuck trying to sync to that height, and never switch to consensus.

We need to either update the pool.maxPeerHeight to the next highest reported height when we disconnect from the peer that reported the max height, or we need a different strategy for deciding to switch to consensus.

Note we should also check what happens when a rogue peer reports a high height, and then we try to get blocks that don't exist yet from good peers. Is there an attack here that could cause us to disconnect good peers?

Thanks @milosevic for catching this in #2621 (comment)

Metadata

Metadata

Assignees

Labels

C:syncComponent: Fast Sync, State SyncT:bugType Bug (Confirmed)T:securityType: Security (specify priority)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions