Page MenuHomePhabricator

mapport: Cleanups to port mapping module post UPnP drop
ClosedPublic

Authored by PiRK on Apr 9 2026, 11:51.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd0fc94179075: mapport: Cleanups to port mapping module post UPnP drop
Summary

Remove dead/unreachable assertions in DispatchMapPort, then drop some logic that was used for switching between mapping protocols and is now unneeded.

This is a backport of core#31157 and concludes backport of core#31130
https://github.com/bitcoin/bitcoin/pull/31130/changes/40e5f26a3ff77e50df808f6f850c617aec2df203
Depends on D19805

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.Apr 9 2026, 11:51

Tail of the build log:

      Start  4: issue200_test
 4/30 Test  #4: issue200_test ....................   Passed    0.03 sec
      Start  5: issue320_test
 5/30 Test  #5: issue320_test ....................   Passed   14.78 sec
      Start  6: env_test
 6/30 Test  #6: env_test .........................   Passed    0.27 sec
      Start  7: status_test
 7/30 Test  #7: status_test ......................   Passed    0.02 sec
      Start  8: no_destructor_test
 8/30 Test  #8: no_destructor_test ...............   Passed    0.02 sec
      Start  9: autocompact_test
 9/30 Test  #9: autocompact_test .................   Passed   21.51 sec
      Start 10: corruption_test
10/30 Test #10: corruption_test ..................   Passed    0.54 sec
      Start 11: db_test
11/30 Test #11: db_test ..........................   Passed   77.38 sec
      Start 12: dbformat_test
12/30 Test #12: dbformat_test ....................   Passed    0.01 sec
      Start 13: filename_test
13/30 Test #13: filename_test ....................   Passed    0.01 sec
      Start 14: log_test
14/30 Test #14: log_test .........................   Passed    0.13 sec
      Start 15: recovery_test
15/30 Test #15: recovery_test ....................   Passed    0.27 sec
      Start 16: skiplist_test
16/30 Test #16: skiplist_test ....................   Passed    0.57 sec
      Start 17: version_edit_test
17/30 Test #17: version_edit_test ................   Passed    0.00 sec
      Start 18: version_set_test
18/30 Test #18: version_set_test .................   Passed    0.00 sec
      Start 19: write_batch_test
19/30 Test #19: write_batch_test .................   Passed    0.00 sec
      Start 20: memenv_test
20/30 Test #20: memenv_test ......................   Passed    0.01 sec
      Start 21: filter_block_test
21/30 Test #21: filter_block_test ................   Passed    0.00 sec
      Start 22: table_test
22/30 Test #22: table_test .......................   Passed    6.79 sec
      Start 23: arena_test
23/30 Test #23: arena_test .......................   Passed    0.72 sec
      Start 24: bloom_test
24/30 Test #24: bloom_test .......................   Passed    0.04 sec
      Start 25: cache_test
25/30 Test #25: cache_test .......................   Passed    0.00 sec
      Start 26: coding_test
26/30 Test #26: coding_test ......................   Passed    0.04 sec
      Start 27: crc32c_test
27/30 Test #27: crc32c_test ......................   Passed    0.00 sec
      Start 28: hash_test
28/30 Test #28: hash_test ........................   Passed    0.00 sec
      Start 29: logging_test
29/30 Test #29: logging_test .....................   Passed    0.00 sec
      Start 30: env_posix_test
30/30 Test #30: env_posix_test ...................   Passed   10.33 sec

100% tests passed, 0 tests failed out of 30

Total Test time (real) = 143.86 sec
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

Tail of the build log:

PASSED                  [ 70%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.592' duration='19' flowId='tests.test_iguana.test_redeem_script_success' name='tests.test_iguana.test_redeem_script_success']

tests/test_iguana.py::test_redeem_script_error ##teamcity[testStarted timestamp='2026-04-09T11:58:52.593' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_error' metainfo='test_redeem_script_error' name='tests.test_iguana.test_redeem_script_error']
PASSED                    [ 75%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.601' duration='7' flowId='tests.test_iguana.test_redeem_script_error' name='tests.test_iguana.test_redeem_script_error']

tests/test_iguana.py::test_redeem_script_exception ##teamcity[testStarted timestamp='2026-04-09T11:58:52.601' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_exception' metainfo='test_redeem_script_exception' name='tests.test_iguana.test_redeem_script_exception']
PASSED                [ 80%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.607' duration='5' flowId='tests.test_iguana.test_redeem_script_exception' name='tests.test_iguana.test_redeem_script_exception']

tests/test_iguana.py::test_redeem_script_empty_stack ##teamcity[testStarted timestamp='2026-04-09T11:58:52.608' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_empty_stack' metainfo='test_redeem_script_empty_stack' name='tests.test_iguana.test_redeem_script_empty_stack']
PASSED              [ 85%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.615' duration='6' flowId='tests.test_iguana.test_redeem_script_empty_stack' name='tests.test_iguana.test_redeem_script_empty_stack']

tests/test_iguana.py::test_redeem_script_false ##teamcity[testStarted timestamp='2026-04-09T11:58:52.616' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_false' metainfo='test_redeem_script_false' name='tests.test_iguana.test_redeem_script_false']
PASSED                    [ 90%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.620' duration='3' flowId='tests.test_iguana.test_redeem_script_false' name='tests.test_iguana.test_redeem_script_false']

tests/test_iguana.py::test_redeem_script_cleanstack ##teamcity[testStarted timestamp='2026-04-09T11:58:52.621' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_cleanstack' metainfo='test_redeem_script_cleanstack' name='tests.test_iguana.test_redeem_script_cleanstack']
PASSED               [ 95%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.629' duration='7' flowId='tests.test_iguana.test_redeem_script_cleanstack' name='tests.test_iguana.test_redeem_script_cleanstack']

tests/test_iguana.py::test_redeem_script_input_sigchecks ##teamcity[testStarted timestamp='2026-04-09T11:58:52.629' captureStandardOutput='false' flowId='tests.test_iguana.test_redeem_script_input_sigchecks' metainfo='test_redeem_script_input_sigchecks' name='tests.test_iguana.test_redeem_script_input_sigchecks']
PASSED          [100%]##teamcity[testFinished timestamp='2026-04-09T11:58:52.652' duration='22' flowId='tests.test_iguana.test_redeem_script_input_sigchecks' name='tests.test_iguana.test_redeem_script_input_sigchecks']


============================== 20 passed in 0.44s ==============================
[523/546] Test Bitcoin utilities...
[524/546] bitcoin: testing scriptnum_63bit_tests
[525/546] Running utility command for check-bitcoin-scriptnum_63bit_tests
[526/546] bitcoin: testing wallet_tests
[527/546] bitcoin: testing transaction_tests
[528/546] Running utility command for check-bitcoin-wallet_tests
[529/546] Running utility command for check-bitcoin-transaction_tests
[530/546] bitcoin: testing random_tests
[531/546] Running utility command for check-bitcoin-random_tests
[532/546] pow: testing aserti32d_tests
[533/546] Running utility command for check-pow-aserti32d_tests
[534/546] Running pow test suite
PASSED: pow test suite
[535/546] bitcoin: testing coinselector_tests
[536/546] Running utility command for check-bitcoin-coinselector_tests
[537/546] bitcoin: testing coins_tests
[538/546] Running utility command for check-bitcoin-coins_tests
[539/546] Running bitcoin test suite
PASSED: bitcoin test suite
[540/546] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/paymentservertests.cpp.o
[541/546] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/__/__/wallet/test/wallet_test_fixture.cpp.o
[542/546] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/addressbooktests.cpp.o
[543/546] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/wallettests.cpp.o
[544/546] Linking CXX executable src/qt/test/test_bitcoin-qt
[545/546] bitcoin-qt: testing test_bitcoin-qt
FAILED: src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt /work/abc-ci-builds/build-clang/src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt 
cd /work/abc-ci-builds/build-clang/src/qt/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-clang/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-clang/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-clang/test/log/bitcoin-qt-test_bitcoin-qt.log /work/abc-ci-builds/build-clang/src/qt/test/test_bitcoin-qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
********* Start testing of AppTests *********
Config: Using QtTest library 5.15.8, Qt 5.15.8 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 12.2.0), debian 12
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin ABC/b0d158eb4677088af1ed726e76a475b17d28a7bbd1bcd99e5e7cf458d9e4c6ac/regtest/guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() initialize : Running initialization in thread
test_bitcoin-qt: /work/src/mapport.cpp:184: void StartMapPort(bool): Assertion `g_mapport_thread.joinable()' failed.
Aborted (core dumped)
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

PASSED: pow test suite
[504/547] seeder: testing db_tests
[505/547] Running utility command for check-seeder-db_tests
[506/547] seeder: testing message_writer_tests
[507/547] Running utility command for check-seeder-message_writer_tests
[508/547] seeder: testing options_tests
[509/547] Running utility command for check-seeder-options_tests
[510/547] seeder: testing p2p_messaging_tests
[511/547] Running utility command for check-seeder-p2p_messaging_tests
[512/547] seeder: testing parse_name_tests
[513/547] bitcoin: testing walletdb_tests
[514/547] Running utility command for check-bitcoin-walletdb_tests
[515/547] Running utility command for check-seeder-parse_name_tests
[516/547] bitcoin: testing validationinterface_tests
[517/547] seeder: testing write_name_tests
[518/547] Running utility command for check-bitcoin-validationinterface_tests
[519/547] Running utility command for check-seeder-write_name_tests
[520/547] Running seeder test suite
PASSED: seeder test suite
[521/547] bitcoin: testing scriptnum_63bit_tests
[522/547] Running utility command for check-bitcoin-scriptnum_63bit_tests
[523/547] bitcoin: testing wallet_crypto_tests
[524/547] Running utility command for check-bitcoin-wallet_crypto_tests
[525/547] avalanche: testing voterecord_tests
[526/547] Running utility command for check-avalanche-voterecord_tests
[527/547] bitcoin: testing validation_chainstatemanager_tests
[528/547] bitcoin: testing validation_block_tests
[529/547] Running utility command for check-bitcoin-validation_chainstatemanager_tests
[530/547] Running utility command for check-bitcoin-validation_block_tests
[531/547] Linking CXX executable src/qt/test/test_bitcoin-qt
[532/547] bitcoin-qt: testing test_bitcoin-qt
FAILED: src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt /work/abc-ci-builds/build-debug/src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt 
cd /work/abc-ci-builds/build-debug/src/qt/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-debug/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-debug/test/log/bitcoin-qt-test_bitcoin-qt.log /work/abc-ci-builds/build-debug/src/qt/test/test_bitcoin-qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
********* Start testing of AppTests *********
Config: Using QtTest library 5.15.8, Qt 5.15.8 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 12.2.0), debian 12
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin ABC/58bf632b87c23f24d6b7d6ea65e5bbf4b4de800ca61b498f6112c1ab099fd7be/regtest/guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() initialize : Running initialization in thread
test_bitcoin-qt: /work/src/mapport.cpp:184: void StartMapPort(bool): Assertion `g_mapport_thread.joinable()' failed.
Aborted (core dumped)
[533/547] avalanche: testing processor_tests
[534/547] Running utility command for check-avalanche-processor_tests
[535/547] Running avalanche test suite
PASSED: avalanche test suite
[536/547] bitcoin: testing wallet_tests
[537/547] Running utility command for check-bitcoin-wallet_tests
[538/547] bitcoin: testing checkqueue_tests
[539/547] Running utility command for check-bitcoin-checkqueue_tests
[540/547] bitcoin: testing coinselector_tests
[541/547] Running utility command for check-bitcoin-coinselector_tests
[542/547] bitcoin: testing coins_tests
[543/547] Running utility command for check-bitcoin-coins_tests
[544/547] bitcoin: testing random_tests
[545/547] Running utility command for check-bitcoin-random_tests
[546/547] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

[504/548] pow: testing eda_tests
[505/548] Running utility command for check-pow-eda_tests
[506/548] bitcoin: testing wallet_crypto_tests
[507/548] Running utility command for check-bitcoin-wallet_crypto_tests
[508/548] pow: testing grasberg_tests
[509/548] Running utility command for check-pow-grasberg_tests
[510/548] Running pow test suite
PASSED: pow test suite
[511/548] bitcoin: testing chronikbridge_tests
[512/548] Running utility command for check-bitcoin-chronikbridge_tests
[513/548] Linking CXX executable src/seeder/test/test-seeder
[514/548] seeder: testing options_tests
[515/548] seeder: testing message_writer_tests
[516/548] seeder: testing db_tests
[517/548] bitcoin: testing scriptnum_63bit_tests
[518/548] Running utility command for check-seeder-message_writer_tests
[519/548] Running utility command for check-seeder-options_tests
[520/548] Running utility command for check-seeder-db_tests
[521/548] Running utility command for check-bitcoin-scriptnum_63bit_tests
[522/548] seeder: testing p2p_messaging_tests
[523/548] seeder: testing parse_name_tests
[524/548] seeder: testing write_name_tests
[525/548] Running utility command for check-seeder-p2p_messaging_tests
[526/548] Running utility command for check-seeder-write_name_tests
[527/548] Running utility command for check-seeder-parse_name_tests
[528/548] Running seeder test suite
PASSED: seeder test suite
[529/548] bitcoin: testing random_tests
[530/548] Running utility command for check-bitcoin-random_tests
[531/548] bitcoin: testing transaction_tests
[532/548] Running utility command for check-bitcoin-transaction_tests
[533/548] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/__/__/wallet/test/wallet_test_fixture.cpp.o
[534/548] bitcoin: testing wallet_tests
[535/548] Running utility command for check-bitcoin-wallet_tests
[536/548] bitcoin: testing coins_tests
[537/548] Running utility command for check-bitcoin-coins_tests
[538/548] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/paymentservertests.cpp.o
[539/548] bitcoin: testing coinselector_tests
[540/548] Running utility command for check-bitcoin-coinselector_tests
[541/548] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/addressbooktests.cpp.o
[542/548] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/wallettests.cpp.o
[543/548] bitcoin: testing bridgeprimitives_tests
[544/548] Running utility command for check-bitcoin-bridgeprimitives_tests
[545/548] Running bitcoin test suite
PASSED: bitcoin test suite
[546/548] Linking CXX executable src/qt/test/test_bitcoin-qt
[547/548] bitcoin-qt: testing test_bitcoin-qt
FAILED: src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt /work/abc-ci-builds/build-clang-tidy/src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt 
cd /work/abc-ci-builds/build-clang-tidy/src/qt/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-clang-tidy/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-clang-tidy/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-clang-tidy/test/log/bitcoin-qt-test_bitcoin-qt.log /work/abc-ci-builds/build-clang-tidy/src/qt/test/test_bitcoin-qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
********* Start testing of AppTests *********
Config: Using QtTest library 5.15.8, Qt 5.15.8 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 12.2.0), debian 12
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin ABC/5cb56d9c3df2389675655bde33815929ae5bfe40f6c3d98dff2a7e3e59d6166b/regtest/guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() initialize : Running initialization in thread
test_bitcoin-qt: /work/src/mapport.cpp:184: void StartMapPort(bool): Assertion `g_mapport_thread.joinable()' failed.
Aborted (core dumped)
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

[460/504] Running utility command for check-bitcoin-skiplist_tests
[461/504] bitcoin: testing util_tests
[462/504] Running utility command for check-bitcoin-sigencoding_tests
[463/504] Running utility command for check-bitcoin-util_tests
[464/504] bitcoin: testing validation_chainstate_tests
[465/504] bitcoin: testing intmath_tests
[466/504] bitcoin: testing validation_flush_tests
[467/504] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/rpcnestedtests.cpp.o
[468/504] Running utility command for check-bitcoin-validation_chainstate_tests
[469/504] Running utility command for check-bitcoin-intmath_tests
[470/504] Running utility command for check-bitcoin-validation_flush_tests
[471/504] Running utility command for check-avalanche-peermanager_tests
[472/504] Running utility command for check-avalanche-processor_tests
[473/504] bitcoin: testing blockindex_comparator_tests
[474/504] Running utility command for check-avalanche-voterecord_tests
[475/504] Running utility command for check-pow-aserti32d_tests
[476/504] Running pow test suite
PASSED: pow test suite
[477/504] Running avalanche test suite
PASSED: avalanche test suite
[478/504] Running utility command for check-bitcoin-blockindex_comparator_tests
[479/504] bitcoin: testing server_tests
[480/504] Running utility command for check-bitcoin-server_tests
[481/504] bitcoin: testing validation_tests
[482/504] Running utility command for check-bitcoin-validation_tests
[483/504] bitcoin: testing txrequest_tests
[484/504] Running utility command for check-bitcoin-txrequest_tests
[485/504] bitcoin: testing validationinterface_tests
[486/504] Running utility command for check-bitcoin-validationinterface_tests
[487/504] bitcoin: testing txvalidationcache_tests
[488/504] Running utility command for check-bitcoin-txvalidationcache_tests
[489/504] bitcoin: testing validation_block_tests
[490/504] Running utility command for check-bitcoin-validation_block_tests
[491/504] bitcoin: testing validation_chainstatemanager_tests
[492/504] Running utility command for check-bitcoin-validation_chainstatemanager_tests
[493/504] bitcoin: testing scriptnum_63bit_tests
[494/504] Running utility command for check-bitcoin-scriptnum_63bit_tests
[495/504] Linking CXX executable src/qt/test/test_bitcoin-qt
[496/504] bitcoin-qt: testing test_bitcoin-qt
FAILED: src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt /work/abc-ci-builds/build-without-wallet/src/qt/test/CMakeFiles/check-bitcoin-qt-test_bitcoin-qt 
cd /work/abc-ci-builds/build-without-wallet/src/qt/test && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-without-wallet/test/junit && /usr/bin/cmake -E make_directory /work/abc-ci-builds/build-without-wallet/test/log && /usr/bin/cmake -E env /work/cmake/utils/log-and-print-on-failure.sh /work/abc-ci-builds/build-without-wallet/test/log/bitcoin-qt-test_bitcoin-qt.log /work/abc-ci-builds/build-without-wallet/src/qt/test/test_bitcoin-qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
********* Start testing of AppTests *********
Config: Using QtTest library 5.15.8, Qt 5.15.8 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 12.2.0), debian 12
PASS   : AppTests::initTestCase()
QINFO  : AppTests::appTests() Backing up GUI settings to "/tmp/test_common_Bitcoin ABC/41dff0842058c3d658f0a7022bc780176225c19ad0a84991a66ccbecb4f84e45/regtest/guisettings.ini.bak"
QDEBUG : AppTests::appTests() requestInitialize : Requesting initialize
QDEBUG : AppTests::appTests() initialize : Running initialization in thread
test_bitcoin-qt: /work/src/mapport.cpp:184: void StartMapPort(bool): Assertion `g_mapport_thread.joinable()' failed.
Aborted (core dumped)
[497/504] bitcoin: testing transaction_tests
[498/504] Running utility command for check-bitcoin-transaction_tests
[499/504] bitcoin: testing random_tests
[500/504] Running utility command for check-bitcoin-random_tests
[501/504] bitcoin: testing coins_tests
[502/504] Running utility command for check-bitcoin-coins_tests
[503/504] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1
PiRK planned changes to this revision.Apr 9 2026, 12:25
PiRK edited the summary of this revision. (Show Details)

squash with the commit we missed in core#31130 removing a couple of assertions
https://github.com/bitcoin/bitcoin/pull/31130/changes/40e5f26a3ff77e50df808f6f850c617aec2df203

This revision is now accepted and ready to land.Apr 9 2026, 15:10