Repository navigation
backport: v0.26 bitcoin#27499 - #84
DCG-Claude wants to merge 1 commit into
Conversation
807c261 to
9bc7bd5
Compare
The lint failure was a new circular dependency, dbwrapper -> node/database_args -> dbwrapper. It came from the Dash-only adaptation in bitcoin#25862 that made util::MakeDbWrapper call node::ReadDatabaseArgs from dbwrapper.h. I removed the <node/database_args.h> include and now set DBOptions{.force_compact = gArgs.GetBoolArg("-forcecompactdb", false)} directly, so -forcecompactdb still applies to Dash's databases as it did before the backport. lint-circular-dependencies.py now passes locally and a syntax-only compile of dbwrapper.h with MakeDbWrapper succeeds; I did not run a full build. (folded into the 🤖 backportsys, on behalf of the Dash backport pipeline. |
I tried a fix but it failed local gates in bitcoin#28148 (verify: Upstream bitcoin#28148 does not touch the -maxorphantxsize handling. This replaces the std::max(int64_t{0}, *value) line kept from the parent commit with a new overflow clamp, which changes behaviour and is not in upstream or in the commit's declared Dash adaptations.; Added only to support the invented std::clamp change. Upstream adds no includes.; Added only to support the invented std::numeric_). bitcoin#28148 has had its repair lane and is being dropped from this branch. 🤖 backportsys, on behalf of the Dash backport pipeline. |
9bc7bd5 to
e796595
Compare
|
Branch rewritten at
🤖 backportsys, on behalf of the Dash backport pipeline. |
e796595 to
8b9cea6
Compare
The backport's Dash adaptation in node/peerman_args.cpp multiplied -maxorphantxsize by 1000000 in uint32_t, which overflows at startup for -maxorphantxsize=100000 (mempool_package_onemore.py); Dash's old inline code had the same overflow but only ran when an orphan was handled. It now clamps the MB value to [0, UINT32_MAX/1000000] before multiplying, using the std::clamp style upstream uses for -blockreconstructionextratxn, so the value saturates at about 4.29 GB instead of wrapping. (folded into the 🤖 backportsys, on behalf of the Dash backport pipeline. |
Potential PR merge conflictsThis is advisory only. It does not block CI, but it marks PRs that will likely need a rebase depending on merge order. If these PRs merge firstThis PR will likely need a rebase:
|
|
tracker#3516 closed by a human |
…rom gArgs 23c7b51 [net processing] Move -capturemessages to PeerManager::Options (dergoegge) bd59bda [net processing] Move -blockreconstructionextratxn to PeerManager::Options (dergoegge) 567c4e0 [net processing] Move -maxorphantx to PeerManager::Options (dergoegge) fa9e6d8 [net processing] Move -txreconciliation to PeerManager::Options (dergoegge) 4cfb7b9 [net processing] Use ignore_incoming_txs from m_opts (dergoegge) 8b87725 [net processing] Introduce PeerManager options (dergoegge) Pull request description: This PR decouples `PeerManager` from our global args manager by introducing `PeerManager::Options`. ACKs for top commit: stickies-v: re-ACK 23c7b51 TheCharlatan: ACK 23c7b51 Tree-SHA512: cd807b36ec018010e11935d3539fa7ed5015fdfb531d13a042a65b54ee8533a35a919a6a6c5fa293b5cba76000e9403c64dfd790fb9c649b7838544929b1fee8 Dash adaptations: - src/net_processing.h: PeerManager::Options has `uint32_t max_orphan_txs_size{DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE * 1000000}` instead of upstream's `max_orphan_txs{DEFAULT_MAX_ORPHAN_TRANSACTIONS}`, because Dash limits orphans by total size (-maxorphantxsize, MB), not by count (-maxorphantx). The DEFAULT_MAX_ORPHAN_TRANSACTIONS constant is not added (Dash doesn't have it), and DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE is kept - src/net_processing.h: DEFAULT_TXRECONCILIATION_ENABLE moved here from node/txreconciliation.h as upstream does, placed above Dash's DEFAULT_MAX_ORPHAN_TRANSACTIONS_SIZE - src/net_processing.h/.cpp: PeerManager::make and the PeerManagerImpl constructor keep all of Dash's extra parameters (dstxman, mn_metaman, mn_sync, sporkman, chainlocks, clhandler, nodeman, dmnman, cj_walletman, isman, llmq_ctx); only the trailing `bool ignore_incoming_txs` becomes `Options opts`, and the m_opts{opts} initializer goes after m_clhandler - src/net_processing.cpp: the orphan-limit line becomes `m_orphanage.LimitOrphans(m_opts.max_orphan_txs_size)` in place of Dash's inline gArgs -maxorphantxsize*1000000 computation. Dash's ForgetTx() call and comments are kept (upstream's m_txrequest.ForgetTxHash/GetWitnessHash lines are not brought in) - src/net_processing.cpp: AddToCompactExtraTransactions keeps Dash's GetInstanceHash() (upstream uses GetWitnessHash()); only the gArgs read becomes m_opts.max_extra_txs - src/net_processing.cpp: upstream's `-#include <common/args.h>` hunk doesn't apply because Dash's net_processing.cpp never included it. util/system.h stays because Dash still uses gArgs there for -pushversion and the devnet name - src/node/peerman_args.cpp: includes <util/system.h> instead of <common/args.h> (Dash hasn't done the common/args split, bitcoin#27419, and ArgsManager lives in util/system.h); reads -maxorphantxsize and stores clamp(>=0)*1000000 into max_orphan_txs_size, the same value Dash computed inline before; the other three options match upstream - src/init.cpp: peerman_opts is built and ApplyArgsManOptions is called just before Dash's PeerManager::make, whose Dash arguments are unchanged, with peerman_opts as the last argument. The node/txreconciliation.h include becomes node/peerman_args.h, and Dash's node/sync_manager.h include stays - src/test/util/setup_common.{h,cpp}: Dash builds peers through its own MakePeerManager(connman, node, banman, ...) helper, so the helper's last parameter changes from `bool ignore_incoming_txs` to `PeerManager::Options opts`. TestingSetup builds peerman_opts with ApplyArgsManOptions(*m_node.args, ...) as upstream does. setup_common.h now includes <net_processing.h> because Options must be a complete type there (node/context.h only forward-declares PeerManager). Upstream's connman line in this hunk is not taken, because Dash creates connman earlier in ChainTestingSetup - src/test/denialofservice_tests.cpp: the four call sites keep Dash's MakePeerManager helper and pass `{}` instead of `/*ignore_incoming_txs=*/false`, which matches upstream's use of `{}` - src/test/net_peer_connection_tests.cpp (Dash-only caller, not touched upstream): its MakePeerManager call now passes `{}` for the new Options parameter
8b9cea6 to
ba1e068
Compare
|
Branch rewritten at
🤖 backportsys, on behalf of the Dash backport pipeline. |
|
folded into backport-0.26-b175-misc: its commits ship there |
Automated Bitcoin Core v0.26 backports, batch
backport-0.26-b064-src-node.ba1e068e68Failed gates (not included):
const ArgsManager& args{EnsureAnyArgsman(...)}in getblockchaininfo. Dash's getblockchaininfo still readsargsfor its devnet chain name (args.IsArgSet("-devnet")/ `args.GetDProvenance
Each commit passed: cherry-pick (adapted by an Opus lane only where conflicts existed), build, touched tests, a mechanical diff-of-diffs check (every upstream hunk landed; no added line without an upstream counterpart), and an independent Opus verification lane where anything was adapted. Gate rows and lane artifacts are in the backportsys DB.