Skip to content

[30.x] Backports - #34459

Merged
fanquake merged 16 commits into
bitcoin:30.xfrom
fanquake:more_30_x_backports
Feb 27, 2026
Merged

fanquake merged 16 commits into
bitcoin:30.xfrom
fanquake:more_30_x_backports

Conversation

fanquake and others added 4 commits January 30, 2026 11:48
Change this so we catch the case where the capnp shared libs have been
updated, and can no-longer be loaded by the Python module, resulting in
a skipped test, even though pycapnp is installed. i.e:
```bash
stderr:
Traceback (most recent call last):
  File "/root/ci_scratch/build/test/functional/interface_ipc.py", line 20, in <module>
    import capnp  # type: ignore[import] # noqa: F401
    ^^^^^^^^^^^^
  File "/usr/local/lib64/python3.14/site-packages/capnp/__init__.py", line 36, in <module>
    from .version import version as __version__
  File "/usr/local/lib64/python3.14/site-packages/capnp/version.py", line 1, in <module>
    from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libcapnpc.so.1.0.1: cannot open shared object file: No such file or directory
```

Failing in this way should make it clear that `pycapnp` needs to be
reinstalled/rebuilt.

If  `pycapnp` is not installed, the test still skips as expected:
```bash
Remaining jobs: [interface_ipc.py]
1/1 - interface_ipc.py skipped (capnp module not available.)

TEST             | STATUS    | DURATION

interface_ipc.py | ○ Skipped | 0 s
```

Fixes: bitcoin#34016.

Co-authored-by: Ryan Ofsky <[email protected]>

Github-Pull: bitcoin#34409
Rebased-From: 905dfde
and_v() must never be 'd'. This is not a bug fix since this was
unreachable in valid Miniscripts: the first sub of an and_v() must be of
type V, which conflicts with (i.e. never has) property 'd'.

Github-Pull: bitcoin#34434
Rebased-From: 4fab35c
Use the AFL++ shared memory ID environment variable to create
a deterministic datadir path. This prevents accumulation of stale
directories after a fuzz iteration crashes or times out. During
long fuzz campaigns, this accumulation has occasionally resulted
in running out of disk space.

Github-Pull: bitcoin#34445
Rebased-From: d3e681b
@fanquake fanquake added this to the 30.3 milestone Jan 30, 2026
@DrahtBot

DrahtBot commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK willcl-ark, marcofleon

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • hitrate -> hit rate [Compound word "hitrate" is nonstandard; "hit rate" (or "hit-rate") is the correct, clear phrasing]

2026-02-26 09:42:59

@fanquake
fanquake force-pushed the more_30_x_backports branch from eb1f680 to 5bfc1ca Compare February 2, 2026 10:48
Also, use str(e) consistently in all run helpers.

This refactor does not change any behavior.

This can be reviewed by checking that all instances are exactly
identical code now:
$ git grep --function-context 'def run(cmd'

Github-Pull: bitcoin#34461
Rebased-From: 2222dad
@fanquake
fanquake force-pushed the more_30_x_backports branch from d019f08 to ca1162a Compare February 3, 2026 12:33
The bpftrace project moved from iovisor/bpftrace to bpftrace/bpftraceand
removed the separate INSTALL.md file. Installation instructionsare now
in the README.md Quick Start section.

Github-Pull: bitcoin#34510
Rebased-From: 42ee31e
@fanquake
fanquake force-pushed the more_30_x_backports branch from ca1162a to 2ded49b Compare February 9, 2026 14:29
Take advantage of the new secp256k1 option to avoid visibility attributes on
API functions.

While most users of a shared libsecp always want API functions exported so that
they can actually be linked against, we always build it statically. When that
static lib is linked into a (static or shared) libbitcoinkernel, by default its
symbols end up exported there as well.

As libsecp is an implementation detail of the kernel (and any future Core lib),
its symbols should never be exported.

Github-Pull: bitcoin#34554
Rebased-From: 2ccfdb5
Users running on home networks with routers that don't support PCP (Port
Control Protocol) or NAT-PMP port mapping receive frequent warning-level
log messages every few minutes:

  "pcp: Mapping failed with result NOT_AUTHORIZED (code 2)"

This is expected behavior for many consumer routers that have PCP
disabled by default, not an actionable error.

Add explicit constants for the NOT_AUTHORIZED result code (value 2)
for both NAT-PMP and PCP protocols. Log the first NOT_AUTHORIZED
failure at warning level for visibility, then downgrade subsequent
occurrences to LogDebug to avoid log noise. Other failure types
continue to warn unconditionally.

Fixes bitcoin#34114

Co-authored-by: willcl-ark <[email protected]>

Github-Pull: bitcoin#34549
Rebased-From: afea2af
The function signature for the `send` RPC is:
```
send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options version )
```

The last example in the manpage is missing the `fee_rate` arg, but is trying to specify the `options` arg, by index.
The parser confuses the intended `options` arg as the missing `fee_rate` arg.

See:
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
error code: -8
error message:
Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.
```
vs
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical null '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
{
  "psbt": "cHNidP8BAHECAAAAAa2qY4+SieuSo9idL5tiM5h9bW6xNnkYprdIyR1HGn4LAAAAAAD9////AkR2DwQAAAAAFgAUpLDwJu+wFRHLQAgKAb0psk7UVd2AlpgAAAAAABYAFOQ3U4t/E4cVYgZrq9H7q3K0+6lYAAAAAAABAIUCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQC4wMA/////wLIF6gEAAAAABYAFLMY1zihXrefAA0DA5nld4MCPjkrAAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQEfyBeoBAAAAAAWABSzGNc4oV63nwANAwOZ5XeDAj45KwEIawJHMEQCIElTV4pbUrsPR9qHWcioowVv3QVWHizxwevfD0u/I8YyAiBCY3OzF81PSLM00h4ueQkehYuxDFZu7Jk51iejphKnnwEhA0VKdYVSyBpWoxBwTDOupB58Fi3mEBs+u+OOqEYVd2sZACICA98YLWyH7dBCfXVxe7woiLSTgV1mJN8Zc8KgZ77pVSg+GNBMeT5UAACAAQAAgAAAAIABAAAAbAAAAAAA",
  "txid": "625b71b314a6ac4f738634e29dc007cd5edc0427c1ae96ab706d06a62910cea2",
  "hex": "02000000000101adaa638f9289eb92a3d89d2f9b6233987d6d6eb1367918a6b748c91d471a7e0b0000000000fdffffff0244760f0400000000160014a4b0f026efb01511cb40080a01bd29b24ed455dd8096980000000000160014e437538b7f13871562066babd1fbab72b4fba9580247304402204953578a5b52bb0f47da8759c8a8a3056fdd05561e2cf1c1ebdf0f4bbf23c6320220426373b317cd4f48b334d21e2e79091e858bb10c566eec9939d627a3a612a79f012103454a758552c81a56a310704c33aea41e7c162de6101b3ebbe38ea84615776b1900000000",
  "complete": true
}
```

Github-Pull: bitcoin#34561
Rebased-From: 50cf683
MarcoFalke added 3 commits February 25, 2026 10:56
Prior to this commit, tool_bitcoin.py was failing:

```sh
$ ./bld-cmake/test/functional/tool_bitcoin.py --valgrind
TestFramework (ERROR): Unexpected exception
Traceback (most recent call last):
  File "./test/functional/test_framework/test_framework.py", line 138, in main
    self.setup()
    ~~~~~~~~~~^^
  File "./test/functional/test_framework/test_framework.py", line 269, in setup
    self.setup_network()
    ~~~~~~~~~~~~~~~~~~^^
  File "./test/functional/tool_bitcoin.py", line 38, in setup_network
    assert all(node.args[:len(node_argv)] == node_argv for node in self.nodes)
           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
```

This commit fixes this issue by running `bitcoin` under valgrind. Also,
it comes with other improvements:

* Drop the outdated valgrind 3.14 requirement, because there is no
  distro that ships a version that old anymore.
* Drop the VALGRIND_SUPPRESSIONS_FILE env var handling, because it was
  presumably never used since it was introduced. Also, the use-case
  seems limited.

Review note:

The set_cmd_args was ignoring the --valgrind test option.

In theory, this could be fixed by refactoring Binaries::node_argv() to
be used here. However, for now, just re-implement the node_argv logic in
set_cmd_args to prepend the valgrind cmd.

Github-Pull: bitcoin#34608
Rebased-From: fa03fbf
The error was added in commit 1ea7e45,
because there was an additional confusing `AssertionError: [node 0]
Error: no RPC connection` instead of just a single `FileNotFoundError:
[Errno 2] No such file or directory`.

This is no longer needed on current master.

Also, the test is incomplete, because it was just checking bitcoind and
bitcoin-cli, not any other missing binaries.

Also, after the previous commit, it would not work in combination with
--valgrind.

Instead of trying to make it complete, and work in all combinations,
just remove it, because the already existing error will be clear in any
case.

This can be tested via:

```sh
 ./test/get_previous_releases.py

 mv releases releases_backup
 # Confirm the test is skipped due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py
 # Confirm the test fails due to missing releases
 ./bld-cmake/test/functional/wallet_migration.py --previous-releases
 mv releases_backup releases

 mv ./releases/v28.2 ./releases/v28.2_backup
 # Confirm the test fails with a single FileNotFoundError
 ./bld-cmake/test/functional/wallet_migration.py
 mv ./releases/v28.2_backup ./releases/v28.2
 # Confirm the test runs and passes
 ./bld-cmake/test/functional/wallet_migration.py

 rm ./bld-cmake/bin/bitcoind
 # Confirm the test fails with a single "No such file or directory",
 # testing with and without --valgrind
 ./bld-cmake/test/functional/wallet_migration.py
 ./bld-cmake/test/functional/wallet_migration.py --valgrind
```

Github-Pull: bitcoin#34608
Rebased-From: fa29fb7
@fanquake
fanquake force-pushed the more_30_x_backports branch from cc1ba03 to 6daeeea Compare February 25, 2026 10:58
Remove sponge (moreutils).

Github-Pull: bitcoin#34627
Rebased-From: c86bce5
@fanquake
fanquake force-pushed the more_30_x_backports branch from 6daeeea to e27e32d Compare February 25, 2026 11:10
MarcoFalke and others added 2 commits February 26, 2026 09:40

@willcl-ark willcl-ark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fdaf656

Looks ok to me. 34608 took me a minute, as the backport looks quite messy in the diff, but in reality Binaries had just moved from ustil.py to test_framework.py. This affected the 3rd commit too where --trace-children=yes had moved.

Other than that all backports were clean and look correct.

@fanquake
fanquake marked this pull request as ready for review February 26, 2026 12:45
@fanquake
fanquake requested a review from marcofleon February 26, 2026 16:21

@marcofleon marcofleon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ACK fdaf656

#34445 looking very useful, good choice for a backport.

@fanquake
fanquake merged commit f4f87c9 into bitcoin:30.x Feb 27, 2026
39 of 40 checks passed
@fanquake
fanquake deleted the more_30_x_backports branch February 27, 2026 10:31
morozow pushed a commit to morozow/bitcoin_rd that referenced this pull request May 8, 2026
2c24a3d doc: update release notes for v30.x (fanquake)
06a5976 doc: Update Guix install for Debian/Ubuntu (MarcoFalke)
4f0e2af guix: use a temporary file over sponge (fanquake)
2b33157 test: valgrind --trace-children=yes for bitcoin wrapper (MarcoFalke)
bcba6a8 test: Remove redundant warning about missing binaries (MarcoFalke)
9d30893 test: Fix broken --valgrind handling after bitcoin wrapper (MarcoFalke)
0c8e966 wallet: rpc: manpage: fix example missing `fee_rate` argument (SomberNight)
024e536 net: reduce log level for PCP/NAT-PMP NOT_AUTHORIZED failures (ANAVHEOBA)
53d07d9 build: avoid exporting secp256k1 symbols (Cory Fields)
3fdf443 doc: fix broken bpftrace installation link (jayvaliya)
39d010f ci: Print verbose build error message in test-each-commit (MarcoFalke)
27d44d1 ci: [refactor] Allow overwriting check option in run helper (MarcoFalke)
d04c148 ci: Always print low ccache hit rate notice (MarcoFalke)
1ab0936 fuzz: Use `__AFL_SHM_ID` for naming test directories (marcofleon)
0cafa38 miniscript: correct and_v() properties (Antoine Poinsot)
5b0e6a7 test: use ModuleNotFoundError in interface_ipc.py (fanquake)

Pull request description:

  Backports:
  * bitcoin#34409
  * bitcoin#34434
  * bitcoin#34445
  * bitcoin#34453
  * bitcoin#34461
  * bitcoin#34510
  * bitcoin#34549
  * bitcoin#34554
  * bitcoin#34561
  * bitcoin#34608
  * bitcoin#34627
  * bitcoin#34671

ACKs for top commit:
  willcl-ark:
    ACK 2c24a3d
  marcofleon:
    lgtm ACK 2c24a3d

Tree-SHA512: dc0ca9a6298519e1dc69d37985f82d87765b6857b491285e3ff77eac5870bf72c662f18ab90b35d3df595dc75f9b0762299259e53588efb7f4994797fdd07213
@fanquake fanquake mentioned this pull request Jun 3, 2026
sedited added a commit that referenced this pull request Jun 23, 2026
d52747d doc: update manual pages for v30.3rc1 (fanquake)
a1406d6 build: bump version to v30.3rc1 (fanquake)
1bdd2b1 doc: update release notes for v30.3rc1 (fanquake)
e7c6d39 fuzz: Remove unused g_setup pointers (MarcoFalke)
b7c7d1e coins: compact chainstate in background (Lőrinc)
992b1dd validation: randomly compact chainstate (Lőrinc)
55ead70 coins: test chainstate flush baseline (Lőrinc)
d09bd0f lint: disable leveldb subtree check (fanquake)

Pull request description:

  Backports:
  * #34918
  * #35465

  Final changes for v`30.3rc1`.

  Backports since `30.2`:
  * #34283
  * #34459
  * #34689
  * #34754
  * #34805
  * #34856
  * #35211
  * #35232

ACKs for top commit:
  sedited:
    ACK d52747d
  marcofleon:
    ACK d52747d

Tree-SHA512: 75fb64f744a0689a9bc4f5a25128bf2aaad7459d7a430f552200b995498428d89de28820f477780f95e7e8485eea9f657ad5fdeae253940df4f29bf51346b4ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants