Page MenuHomePhabricator

p2p: Make block stalling timeout adaptive
ClosedPublic

Authored by PiRK on Jan 4 2024, 13:14.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC3a33b4bd4156: p2p: Make block stalling timeout adaptive
Summary

This makes the stalling detection mechanism (previously a fixed
timeout of 2s) adaptive:
If we disconnect a peer for stalling, double the timeout for the
next peer - and let it slowly relax back to its default
value each time the tip advances. (Idea by Pieter Wuille)

This makes situations more unlikely in which we'd keep on
disconnecting many of our peers for stalling, even though our
own bandwidth is insufficient to download a block in 2 seconds.

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

This is a backport of [ core#25880 and core#26982
Note that we need to specify version=4 when calling create_block in the test because we miss core#16333 (which make 4 the default version for create_block)

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jan 4 2024, 13:14
PiRK edited the summary of this revision. (Show Details)

squash core#26982

This revision is now accepted and ready to land.Jan 4 2024, 14:02