HomePhabricator

net processing, refactor: Decouple PeerManager from gArgs

Description

net processing, refactor: Decouple PeerManager from gArgs

Summary:
[net processing] Introduce PeerManager options

https://github.com/bitcoin/bitcoin/pull/27499/commits/8b877259217c6da316153afb136a55c2dbd401c2


[net processing] Use ignore_incoming_txs from m_opts

https://github.com/bitcoin/bitcoin/pull/27499/commits/4cfb7b925f8fea818f03433882138a7d3d7e179a


[net processing] Move -maxorphantx to PeerManager::Options

https://github.com/bitcoin/bitcoin/pull/27499/commits/567c4e0b6a3fadd2fd1be732076026bf491519b2#


[net processing] Move -blockreconstructionextratxn to PeerManager::Options

https://github.com/bitcoin/bitcoin/pull/27499/commits/bd59bda26b67b53293a5cef7433e992203da325a


[net processing] Move -capturemessages to PeerManager::Options

https://github.com/bitcoin/bitcoin/pull/27499/commits/23c7b51ddd2888cf7fb260c439f004bd28768473

Note that we cannot yet remove include <common/args.h>
The remaining calls to gArgs in net_processing.cpp are mostly related to avalanche options, which I will move in a separate diff.


refactor: set ignore_incoming_txs in ApplyArgsManOptions

Refactor to consistently use ApplyArgsManOptions to set all PeerManager::Options,
including ignore_incoming_txs.

https://github.com/bitcoin/bitcoin/pull/28148/commits/8a3159728ae84cb8093e2e9fa5d2c2b0a7d545da

Note we don't have the duplicated reading of -blocksonly, this is used by core for initializing some fee estimation machinery.


[net_processing] move -maxaddrtosend to PeerManager::Options

Note that this option was added by us in D10823


This is a backport of core#27499 and core#28148

It it missing the -txreconciliation related commit which is part of a feature that we have not yet backported.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
dergoegge <n.goeggi@gmail.com>Authored on Apr 20 2023, 11:05
PiRKCommitted on Jul 12 2024, 10:28
PiRKPushed on Jul 12 2024, 10:28
Reviewer
Restricted Project
Differential Revision
D16455: net processing, refactor: Decouple PeerManager from gArgs
Parents
rABC8de49c3ef86a: validation: fix coins disappearing mid-package evaluation
Branches
Unknown
Tags
Unknown