compressor: reject oversized scripts during deserialization #36386

Open
l0rinc wants to merge 2 commits from l0rinc/script-compression-replace-oversized into master AGit
l0rinc commented 2026-09-30 01:25:49 +00:00 (Migrated from github.com)

Problem: UTXO insertion excludes scripts larger than MAX_SCRIPT_SIZE as unspendable, so an oversized compressed script indicates corrupt data. Deserialization currently uses an OP_RETURN fallback and skips the oversized payload, hiding the corruption.

Fix: Throw std::ios_base::failure as soon as the decoded script length exceeds MAX_SCRIPT_SIZE.

Context: #7933 added the fallback to avoid an out-of-memory failure in the then-current per-transaction chainstate format, when coin database deserialization errors were indistinguishable from missing entries. #34931 now sends coin deserialization failures to the fatal database-error path, and #24236 removed upgrade support for that old format.

**Problem:** UTXO insertion excludes scripts larger than `MAX_SCRIPT_SIZE` as unspendable, so an oversized compressed script indicates corrupt data. Deserialization currently uses an `OP_RETURN` fallback and skips the oversized payload, hiding the corruption. **Fix:** Throw `std::ios_base::failure` as soon as the decoded script length exceeds `MAX_SCRIPT_SIZE`. **Context:** #7933 added the fallback to avoid an out-of-memory failure in the then-current per-transaction chainstate format, when coin database deserialization errors were indistinguishable from missing entries. #34931 now sends coin deserialization failures to the fatal database-error path, and #24236 removed upgrade support for that old format.
DrahtBot commented 2026-09-30 01:25:55 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Stale ACK jcastros, fametrano, hodlinator, maflcko, optout21

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36946 (scripted-diff: [test] Add util/check.h includes for assertions by maflcko)
  • #36280 (validation: throw when a compressed script can't be decompressed by furszy)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36386 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36386.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36386#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Stale ACK | [jcastros](https://github.com/bitcoin/bitcoin/pull/36386#issuecomment-5997586155), [fametrano](https://github.com/bitcoin/bitcoin/pull/36386#issuecomment-6396973053), [hodlinator](https://github.com/bitcoin/bitcoin/pull/36386#pullrequestreview-5650692444), [maflcko](https://github.com/bitcoin/bitcoin/pull/36386#issuecomment-6440879122), [optout21](https://github.com/bitcoin/bitcoin/pull/36386#issuecomment-6444909520) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36946](https://github.com/bitcoin/bitcoin/pull/36946) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36946.svg"></sub> (scripted-diff: [test] Add util/check.h includes for assertions by maflcko) * [#36280](https://github.com/bitcoin/bitcoin/pull/36280) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36280.svg"></sub> (validation: throw when a compressed script can't be decompressed by furszy) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

🔵 Suggestion · ScriptCompression does not explain its storage-only size limit

ScriptCompression documents encoding larger scripts but omits the coin/undo invariant that makes Unser's new rejection a storage-corruption check rather than a limit on valid transaction outputs.

Location: src/compressor.h:89 (head).

Review coverage was incomplete.


Reviewed: 777ede538bfb · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:e1a29e5e677c47d383756f0fcf8f3760725c91d1104dd3ccb2f333b6217eba26:47880f5569fd2047d249266f337c4f2a509adf7d96c3ccb1c7644c2c2a650bff --> <!-- ralph-base:cc27c50e87f348c154512a15f53cd552d4cd8844 --> <!-- ralph-head:777ede538bfb2e08c021861e21c6408d54637e35 --> <!-- ralph-case:08241c554851389a8b872a4163d3c020c56fca63bda9f5dc0a992c47e002a18d --> **🔵 Suggestion · `ScriptCompression` does not explain its storage-only size limit** `ScriptCompression` documents encoding larger scripts but omits the coin/undo invariant that makes `Unser`'s new rejection a storage-corruption check rather than a limit on valid transaction outputs. Location: [`src/compressor.h:89`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/777ede538bfb2e08c021861e21c6408d54637e35/src/compressor.h#L89>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`777ede538bfb`](<https://git.fish.foo/bitcoin/bitcoin/commit/777ede538bfb2e08c021861e21c6408d54637e35>) · [Review report](<https://review.fish.foo/report/36386-777ede538bfb2e08c021861e21c6408d54637e35-3434-10.html>) · [Previous reports](<https://review.fish.foo/traces/36386/>) [permalink](<https://review.fish.foo/report/36386-777ede538bfb2e08c021861e21c6408d54637e35-3434-10.html>)
maflcko commented 2026-09-30 07:58:40 +00:00 (Migrated from github.com)

it could affect malformed stored records decoded into a reused destination.

Not sure, reusing a destination would be an unrelated bug? So I am half suggesting to drop the test in a third commit again, or at least clarify in the comment that this isn't supposed to test any real production behavior.

lgtm either way.

> it could affect malformed stored records decoded into a reused destination. Not sure, reusing a destination would be an unrelated bug? So I am half suggesting to drop the test in a third commit again, or at least clarify in the comment that this isn't supposed to test any real production behavior. lgtm either way.
l0rinc commented 2026-09-30 18:12:54 +00:00 (Migrated from github.com)

Not sure, reusing a destination would be an unrelated bug?

We do have some existing reuses, e.g. in github.com/bitcoin/bitcoin@e7aef7e86d/src/rpc/blockchain.cpp (L3435-L3462) the snapshot export reuses the same Coin in the loop. Regardless, added a comment clarifying that this tests the fallback directly, since normal UTXO insertion excludes oversized scripts.

> Not sure, reusing a destination would be an unrelated bug? We do have some existing reuses, e.g. in https://github.com/bitcoin/bitcoin/blob/e7aef7e86da79000aa42f5ba6d13b0d123d9da7c/src/rpc/blockchain.cpp#L3435-L3462 the snapshot export reuses the same `Coin` in the loop. Regardless, added a comment clarifying that this tests the fallback directly, since normal UTXO insertion excludes oversized scripts.
jcastros commented 2026-10-05 15:27:09 +00:00 (Migrated from github.com)

Tested ACK f313faff44

I built test_bitcoin (GCC 13.3, RelWithDebInfo) and ran compress_tests on this and on 11494efb01. Both are clean. Putting script << OP_RETURN back makes compress_oversized_script fail, so the new check covers the fix.

Tested ACK f313faff443e5cdbd858a54c6bb939799d7ce714 I built test_bitcoin (GCC 13.3, RelWithDebInfo) and ran compress_tests on this and on 11494efb01d0. Both are clean. Putting `script << OP_RETURN` back makes compress_oversized_script fail, so the new check covers the fix.
hodlinator (Migrated from github.com) reviewed 2026-10-14 09:43:43 +00:00
hodlinator (Migrated from github.com) left a comment

Concept ACK f313faff44

Concept ACK f313faff443e5cdbd858a54c6bb939799d7ce714
hodlinator (Migrated from github.com) commented 2026-10-14 09:36:39 +00:00

This has a bit too much happening at once IMO (+ redundant CScript-ctor-call). Would rather have something closer to

    DataStream oversized_compressed{DataStream{} << Using<ScriptCompression>(CScript{} << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0}))};
    oversized_compressed >> Using<ScriptCompression>(restored);
This has a bit too much happening at once IMO (+ redundant `CScript`-ctor-call). Would rather have something closer to ```suggestion DataStream oversized_compressed{DataStream{} << Using<ScriptCompression>(CScript{} << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0}))}; oversized_compressed >> Using<ScriptCompression>(restored); ```
hodlinator (Migrated from github.com) commented 2026-10-14 09:39:00 +00:00

nit: Could verify that restored starts out spendable before the compression round-trip makes it unspendable?

    CScript restored{ParseScript("0x01")}; // Incomplete push: appending OP_RETURN would make it pushed data
    BOOST_CHECK(!restored.IsUnspendable());
    (DataStream{} << Using<ScriptCompression>(CScript{CScript() << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0})})) >> Using<ScriptCompression>(restored);
nit: Could verify that `restored` starts out spendable before the compression round-trip makes it unspendable? ```suggestion CScript restored{ParseScript("0x01")}; // Incomplete push: appending OP_RETURN would make it pushed data BOOST_CHECK(!restored.IsUnspendable()); (DataStream{} << Using<ScriptCompression>(CScript{CScript() << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0})})) >> Using<ScriptCompression>(restored); ```
hodlinator (Migrated from github.com) commented 2026-10-14 09:43:02 +00:00

Ralph suggested also pinning down the resulting script (#36386 (comment)), which seems fair enough.

Guess it could be done through:

    BOOST_CHECK(restored.IsUnspendable());
    const CScript expected{OP_RETURN};
    BOOST_CHECK_EQUAL_COLLECTIONS(restored.begin(), restored.end(), expected.begin(), expected.end());
Ralph suggested also pinning down the resulting script (https://git.fish.foo/bitcoin/bitcoin/pulls/36386#issuecomment-608275), which seems fair enough. Guess it could be done through: ```suggestion BOOST_CHECK(restored.IsUnspendable()); const CScript expected{OP_RETURN}; BOOST_CHECK_EQUAL_COLLECTIONS(restored.begin(), restored.end(), expected.begin(), expected.end()); ```
fametrano commented 2026-10-25 11:19:22 +00:00 (Migrated from github.com)

tACK 426f29c3f1

I decoded 1307 compressed scripts (raw sizes 0 to 39 and from just under MAX_SCRIPT_SIZE to 200000, truncated streams, every special type) into a fresh target and five reused ones, a P2PKH among them, and compared each result with what a library I maintain decodes from the same bytes. On the base, every complete oversized script decoded into a reused target keeps the old bytes and appends OP_RETURN (35 decodes). On this head every raw and oversized case matches for every target.

One path still depends on the target: an uncompressed P2PK (type 4 or 5) whose x is not on the curve leaves a reused target untouched, so a P2PKH stays a P2PKH. #36280 makes that path throw. Its compressor.h change merges cleanly with this one; only compress_tests.cpp conflicts. With both applied, no decode in the set depends on what the target held before. I can share the vectors and the test.

tACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd I decoded 1307 compressed scripts (raw sizes 0 to 39 and from just under `MAX_SCRIPT_SIZE` to 200000, truncated streams, every special type) into a fresh target and five reused ones, a P2PKH among them, and compared each result with what a library I maintain decodes from the same bytes. On the base, every complete oversized script decoded into a reused target keeps the old bytes and appends `OP_RETURN` (35 decodes). On this head every raw and oversized case matches for every target. One path still depends on the target: an uncompressed P2PK (type 4 or 5) whose x is not on the curve leaves a reused target untouched, so a P2PKH stays a P2PKH. #36280 makes that path throw. Its `compressor.h` change merges cleanly with this one; only `compress_tests.cpp` conflicts. With both applied, no decode in the set depends on what the target held before. I can share the vectors and the test.
hodlinator (Migrated from github.com) approved these changes 2026-10-26 10:45:52 +00:00
hodlinator (Migrated from github.com) left a comment
ACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd
hodlinator (Migrated from github.com) commented 2026-10-26 10:35:02 +00:00

nit: Could compute at compile time:

--- a/src/test/compress_tests.cpp
+++ b/src/test/compress_tests.cpp
@@ -28,6 +28,8 @@
 // amounts 50 .. 21000000
 #define NUM_MULTIPLES_50BTC 420000

+using namespace util::hex_literals;
+
 BOOST_FIXTURE_TEST_SUITE(compress_tests, BasicTestingSetup)

 bool static TestEncode(uint64_t in) {
@@ -172,7 +174,7 @@ BOOST_AUTO_TEST_CASE(compress_p2pk_scripts_not_on_curve)
 BOOST_AUTO_TEST_CASE(compress_oversized_script)
 {
     // Test the fallback directly, since normal UTXO insertion excludes oversized scripts
-    CScript restored{ParseScript("0x01")}; // Incomplete push: appending OP_RETURN would make it pushed data
+    auto restored{CScript{} << "01"_hex}; // Incomplete push: appending OP_RETURN would make it pushed data
     BOOST_CHECK(!restored.IsUnspendable());
     DataStream oversized_compressed{DataStream{} << Using<ScriptCompression>(CScript{} << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0}))};
     oversized_compressed >> Using<ScriptCompression>(restored);
nit: Could compute at compile time: ```diff --- a/src/test/compress_tests.cpp +++ b/src/test/compress_tests.cpp @@ -28,6 +28,8 @@ // amounts 50 .. 21000000 #define NUM_MULTIPLES_50BTC 420000 +using namespace util::hex_literals; + BOOST_FIXTURE_TEST_SUITE(compress_tests, BasicTestingSetup) bool static TestEncode(uint64_t in) { @@ -172,7 +174,7 @@ BOOST_AUTO_TEST_CASE(compress_p2pk_scripts_not_on_curve) BOOST_AUTO_TEST_CASE(compress_oversized_script) { // Test the fallback directly, since normal UTXO insertion excludes oversized scripts - CScript restored{ParseScript("0x01")}; // Incomplete push: appending OP_RETURN would make it pushed data + auto restored{CScript{} << "01"_hex}; // Incomplete push: appending OP_RETURN would make it pushed data BOOST_CHECK(!restored.IsUnspendable()); DataStream oversized_compressed{DataStream{} << Using<ScriptCompression>(CScript{} << std::vector(MAX_SCRIPT_SIZE + 1, uint8_t{0}))}; oversized_compressed >> Using<ScriptCompression>(restored); ```
maflcko commented 2026-10-27 11:34:28 +00:00 (Migrated from github.com)

review ACK 426f29c3f1 🏉

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd 🏉
ZMFrq8y3VWJkvdmEHZqxUEXnr07PVirQi5JeVZZ0cI9PWixMNhtsYF/RYb7eALrDfdaoDa4OPwLQP3GmubegDg==
review ACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd 🏉 <details><summary>Show signature</summary> Signature: ``` untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd 🏉 ZMFrq8y3VWJkvdmEHZqxUEXnr07PVirQi5JeVZZ0cI9PWixMNhtsYF/RYb7eALrDfdaoDa4OPwLQP3GmubegDg== ``` </details>
optout21 (Migrated from github.com) reviewed 2026-10-27 14:16:42 +00:00
optout21 (Migrated from github.com) left a comment

Reviewed, left some comments. Happy to re-check/ack once answered.
(426f29c3f1)

Reviewed, left some comments. Happy to re-check/ack once answered. (426f29c3f1639e4c97be63cdf4c2e76bb86b39dd)
optout21 (Migrated from github.com) commented 2026-10-27 13:57:47 +00:00

426f29c compressor: replace oversized scripts instead of appending:

The commit message states: "so the result is independent of the destination's prior contents". However, this is not always the case. In this branch, DecompressScript could fail in such a way that it does not modify script (in the 0x04/0x05 prefix + error case).
Either adjust this codepath as well (reset it in case of error), or soften the claim.

> [426f29c](https://github.com/bitcoin/bitcoin/pull/36386/changes/426f29c3f1639e4c97be63cdf4c2e76bb86b39dd) _compressor: replace oversized scripts instead of appending_: The commit message states: "so the result is independent of the destination's prior contents". However, this is not always the case. In this branch, `DecompressScript` could fail in such a way that it does not modify `script` (in the `0x04`/`0x05` prefix + error case). Either adjust this codepath as well (reset it in case of error), or soften the claim.
optout21 (Migrated from github.com) commented 2026-10-27 14:15:15 +00:00

426f29c compressor: replace oversized scripts instead of appending:

Would it be possible to clear the script output variable at the beginning of this method? That would ensure the claim (independence of previous value).

> [426f29c](https://github.com/bitcoin/bitcoin/pull/36386/changes/426f29c3f1639e4c97be63cdf4c2e76bb86b39dd) _compressor: replace oversized scripts instead of appending_: Would it be possible to clear the `script` output variable at the beginning of this method? That would ensure the claim (independence of previous value).
optout21 (Migrated from github.com) reviewed 2026-10-27 14:20:26 +00:00
optout21 (Migrated from github.com) commented 2026-10-27 14:20:26 +00:00

I've just realized that #36280 addresses exactly this, so I think it's fine as it is in this PR.

I've just realized that #36280 addresses exactly this, so I think it's fine as it is in this PR.
optout21 commented 2026-10-27 14:40:12 +00:00 (Migrated from github.com)

ACK 426f29c3f1
Upgraded my previous review result, upon reconsideration. This change is a net improvement, independent of #36280 . I'd appreciate answers to my comments, nonetheless.

ACK 426f29c3f1639e4c97be63cdf4c2e76bb86b39dd Upgraded my previous review result, upon reconsideration. This change is a net improvement, independent of #36280 . I'd appreciate answers to my comments, nonetheless.
sedited (Migrated from github.com) reviewed 2026-11-03 21:37:12 +00:00
sedited (Migrated from github.com) left a comment

Not sure why this should be changed from the motivation provided here. If I understand this correctly, the only way to encounter an oversized script outside of loadtxoutset is corruption. Why not just throw in that case? Deserializing potentially corrupt entries as unspendable seems confusing to me in the first place.

Not sure why this should be changed from the motivation provided here. If I understand this correctly, the only way to encounter an oversized script outside of loadtxoutset is corruption. Why not just throw in that case? Deserializing potentially corrupt entries as unspendable seems confusing to me in the first place.
maflcko commented 2026-11-04 09:04:56 +00:00 (Migrated from github.com)

If I understand this correctly, the only way to encounter an oversized script outside of loadtxoutset is corruption.

Even if this happens inside loadtxoutset, such a utxo-file is still only possible after corruption. While reviewing this I thought that this was needed to gracefully upgrade ancient utxo dbs, and looking at the diff of https://github.com/bitcoin/bitcoin/pull/7933, it seems that was accurate?

However, according to git blame ./test/functional/feature_unsupported_utxo_db.py those dbs are now invalid anyway, so throwing seems more consistent with other deser errors.

> If I understand this correctly, the only way to encounter an oversized script outside of loadtxoutset is corruption. Even if this happens inside loadtxoutset, such a utxo-file is still only possible after corruption. While reviewing this I thought that this was needed to gracefully upgrade ancient utxo dbs, and looking at the diff of https://github.com/bitcoin/bitcoin/pull/7933, it seems that was accurate? However, according to `git blame ./test/functional/feature_unsupported_utxo_db.py` those dbs are now invalid anyway, so throwing seems more consistent with other deser errors.
l0rinc commented 2026-12-02 12:13:19 +00:00 (Migrated from github.com)

this was needed to gracefully upgrade ancient utxo dbs

I really hated that ugly, hacky OP_RETURN fallback too. It seems to have been introduced as an OOM mitigation because CDBWrapper::Read() couldn't distinguish a missing entry from a deserialization failure, so throwing would have made the whole transaction's UTXO record look missing. The same decoder also remained part of the old per-transaction chainstate upgrade path, but #24236 removed that path and requires reindexing instead. Now that https://github.com/bitcoin/bitcoin/pull/34931 fixed the error handling for coin reads, we can indeed throw here, which is so much better in every sense. I've updated the PR accordingly. Thanks for the pushback!

> this was needed to gracefully upgrade ancient utxo dbs I really hated that ugly, hacky `OP_RETURN` fallback too. It seems to have been introduced as an OOM mitigation because `CDBWrapper::Read()` couldn't distinguish a missing entry from a deserialization failure, so throwing would have made the whole transaction's UTXO record look missing. The same decoder also remained part of the old per-transaction chainstate upgrade path, but #24236 removed that path and requires reindexing instead. Now that https://github.com/bitcoin/bitcoin/pull/34931 fixed the error handling for coin reads, we can indeed throw here, which is so much better in every sense. I've updated the PR accordingly. Thanks for the pushback!
DrahtBot commented 2026-12-02 12:54:48 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task Windows, test cross-built: https://github.com/bitcoin/bitcoin/actions/runs/46878258029/job/143457183354
LLM reason (✨ experimental): functional_test_fail: feature_unsupported_utxo_db.py failed while starting the node because parsing its RPC auth cookie raised IndexError (split_userpass[1] was missing).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening.

  • A functional or integration test failure may be intermittent or unrelated to this pull request.
    If no dedicated issue thread exists, create a new one to track it.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `Windows, test cross-built`: https://github.com/bitcoin/bitcoin/actions/runs/46878258029/job/143457183354</sub> <sub>LLM reason (✨ experimental): functional_test_fail: `feature_unsupported_utxo_db.py` failed while starting the node because parsing its RPC auth cookie raised `IndexError` (`split_userpass[1]` was missing).</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening. * A functional or integration test failure may be intermittent or unrelated to this pull request. If no dedicated issue thread exists, create a new one to track it. Leave a comment here, if you need help tracking down a confusing failure. </details>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36386
No description provided.