build: UPnP → libnatpmp migration — supersedes #19 #37
Labels
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/Offerings-to-Cthulhu#37
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Replace miniupnpc with libnatpmp as OFF's port-mapping library. Removes the cross-fleet portability surface that has been a recurring source of pain (
libminiupnpcso-major churn across distros,configureauto-detect overridingdepends/static link) while preserving auto-port-forwarding for users behind home-router NAT.This issue supersedes #19. The strip-only plan in #19 would have left end-users with no auto-port-forwarding at all — fine for VPS-hosted nodes, regression for home/desktop users (and especially for the mobile / extension client surface tracked in #36).
Flagged by @9019x on 2026-06-14 as a precondition for retiring the existing cross-fleet portability headache.
Why libnatpmp specifically
.so.16/17/18across distros) — root cause of the cross-fleet portability headacheconfigureauto-detects host versions and overridesbitcoin/bitcoin#23956(2021)bitcoin/bitcoin#19686(2021, v0.21.0)Bitcoin Core upstream did the same swap in 2021 for the same reason. There's a clean reference implementation to port from.
Current state
Auditing the tree:
--without-miniupnpcper the build recipelinux-build-depends.yml:100)--without-miniupnpcwindows-build-depends.yml)depends/So the strip half of the work is small (Windows-CI cleanup +
depends/recipe deletion). The add half is the new scope: wire libnatpmp into the sameMapPort/ThreadMapPortinterface the daemon already uses.Scope
Single bundled PR landing post-Codex (after block 1,050,667). Two layers, same shape as #19 but with libnatpmp added.
Layer 1 —
depends/+ CI--without-miniupnpc --with-natpmpto the Windows CI configure invocation.github/workflows/windows-build-depends.ymlupnp_packages=miniupnpcwithnat_packages=natpmpdepends/packages/packages.mk:19depends/packages/miniupnpc.mkdepends/packages/natpmp.mkLayer 2 — source rewrite
src/net.cpp:24-27ThreadMapPortbody — drop SSDP discovery and SOAP plumbing; use libnatpmp'ssendpublicaddressrequest/readnatpmpresponseorretry/sendnewportmappingrequestpatternsrc/net.cpp:953-1031MapPortwrapper interface unchanged; body simplifiedsrc/net.cpp:1038-1060-upnparg remains as deprecated alias for-natpmp(one release of mercy; see "Backward compat" below)src/init.cpp:236configure.ac: swap--with-miniupnpcfor--with-natpmp, update detection blockconfigure.ac:53-55, 398-403, 590-614Use UPnP→Map ports via NAT-PMPsrc/qt/optionsmodel.cpp,src/qt/forms/optionsdialog.uiNet change: roughly
+~150 / -230LoC.Backward compat for the
-upnpflagExisting operators with
upnp=1inOfferings.confshould not be silently broken. Two options were considered; this issue commits to (a):-upnp=1is accepted, internally translated to-natpmp=1, and emits a one-time WARN log on startup pointing to the new flag. Removal of the alias is its own follow-up issue, no earlier than the release after this one.Why this isn't standalone-mergeable pre-Codex
Same logic as #19. Not consensus-changing, not network-protocol-changing, no urgency. Risk budget around the Codex inscription window should stay protected for things that actually matter to chain health. Land the bundled PR post-block-1,050,667.
Side-effects
depends/cache shrinks marginally; Win64 CI ~1-2 min faster on cold cache.Reversibility
Trivial —
git revertthe PR. Both layers recoverable from git history.Trade-offs / what this isn't
-upnpoff.References
bitcoin/bitcoin#19686(libnatpmp added, 2021, v0.21.0)bitcoin/bitcoin#23956(miniupnpc removed from depends, 2021)depends/packages/packages.mk:19— currentupnp_packages=miniupnpclinedepends/packages/miniupnpc.mk— recipe to delete.github/workflows/windows-build-depends.yml— needs--without-miniupnpc --with-natpmp.github/workflows/linux-build-depends.yml:100— already--without-miniupnpcsrc/net.cpp:24-27, 953-1060— port-mapping code surfacesrc/init.cpp:236—-upnparg help textconfigure.ac:53-55, 398-403, 590-614— UPnP detection blockCommunity chat: https://23skidoo.info/discord