fuzz: Add a target that feeds arbitrary bytes to V2Transport #36635

Open
fametrano wants to merge 1 commit from fuzz-v2-transport-arbitrary-bytes into master AGit
fametrano commented 2026-10-23 23:46:10 +00:00 (Migrated from github.com)

No fuzz target feeds V2Transport bytes that an honest peer would not send past the v2 key exchange. I add p2p_transport_v2_receive. It knows the transport's keys, builds the input from arbitrary bytes and from parts of a valid handshake (the peer key, garbage, the terminator, encrypted packets that may be corrupted, and runs of empty decoys that force a rekey), and feeds it in pieces of arbitrary size. Once the transport reports v2, it checks that its session id matches the peer's.

It reaches the v2 receive states and their failures, except the fallback to v1 and the wrong-magic disconnect, which need a v1 version header at the start of the stream; p2p_transport_bidirectional_v1v2 reaches the first. 15 minutes with libFuzzer, ASan and UBSan found no crash.

No fuzz target feeds V2Transport bytes that an honest peer would not send past the v2 key exchange. I add p2p_transport_v2_receive. It knows the transport's keys, builds the input from arbitrary bytes and from parts of a valid handshake (the peer key, garbage, the terminator, encrypted packets that may be corrupted, and runs of empty decoys that force a rekey), and feeds it in pieces of arbitrary size. Once the transport reports v2, it checks that its session id matches the peer's. It reaches the v2 receive states and their failures, except the fallback to v1 and the wrong-magic disconnect, which need a v1 `version` header at the start of the stream; `p2p_transport_bidirectional_v1v2` reaches the first. 15 minutes with libFuzzer, ASan and UBSan found no crash.
DrahtBot commented 2026-10-23 23:46:20 +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
Concept ACK jeanpablojp

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

Conflicts

No conflicts as of last run.

<!--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/36635 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36635.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36635#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 | | ---- | --------- | | Concept ACK | [jeanpablojp](https://github.com/bitcoin/bitcoin/pull/36635#pullrequestreview-6136929367) | 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 No conflicts as of last run. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: b2636036e679 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:7eebed8027c96ac27bcd79eeb7a88e35799cd96eb8fbacf34d3257986a959f64:cdc1bd61213c9363d5bb4c7b7ee073ccfd6fecdafbb2c4c18d9d9e031a6afcf8 --> <!-- ralph-base:6f1365e34f518fdc9fb963cd246abeb47a34ce8b --> <!-- ralph-head:b2636036e679406fefab8bd123b50ee061a6ac7d --> <!-- ralph-case:bde08fcfe1399c791787b7569df533217b33677fd10b5fcf46360beb74aa1686 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`b2636036e679`](<https://git.fish.foo/bitcoin/bitcoin/commit/b2636036e679406fefab8bd123b50ee061a6ac7d>) · [Review report](<https://review.fish.foo/report/36635-b2636036e679406fefab8bd123b50ee061a6ac7d-2493-4.html>) · [Previous reports](<https://review.fish.foo/traces/36635/>) [permalink](<https://review.fish.foo/report/36635-b2636036e679406fefab8bd123b50ee061a6ac7d-2493-4.html>)
uqlidi (Migrated from github.com) reviewed 2026-10-31 20:40:23 +00:00
uqlidi (Migrated from github.com) commented 2026-10-31 20:29:51 +00:00
    const auto ent{ConsumeFixedLengthByteVector<std::byte>(provider, 32)};
    const auto peer_ent{ConsumeFixedLengthByteVector<std::byte>(provider, 32)};

nit: I think ConsumeFixedLengthByteVector<std::byte>(provider, 32) does the same consume-then-resize and lets these be const:
github.com/bitcoin/bitcoin@a773e1e33b/src/test/fuzz/util.h (L280)

It should read the input the same way.

```suggestion const auto ent{ConsumeFixedLengthByteVector<std::byte>(provider, 32)}; const auto peer_ent{ConsumeFixedLengthByteVector<std::byte>(provider, 32)}; ``` nit: I think `ConsumeFixedLengthByteVector<std::byte>(provider, 32)` does the same consume-then-resize and lets these be `const`: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/test/fuzz/util.h#L280 It should read the input the same way.
uqlidi (Migrated from github.com) commented 2026-10-31 20:31:37 +00:00

nit: the BIP324Cipher(key, ent) constructor calls key.EllSwiftCreate(ent) and nothing else:
github.com/bitcoin/bitcoin@a773e1e33b/src/bip324.cpp (L25-L29)

Maybe call that instead of building a second cipher? It gives the same public key.

    peer.Initialize(key.EllSwiftCreate(ent), /*initiator=*/!initiating);
nit: the `BIP324Cipher(key, ent)` constructor calls `key.EllSwiftCreate(ent)` and nothing else: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/bip324.cpp#L25-L29 Maybe call that instead of building a second cipher? It gives the same public key. ```suggestion peer.Initialize(key.EllSwiftCreate(ent), /*initiator=*/!initiating); ```
uqlidi (Migrated from github.com) commented 2026-10-31 20:36:08 +00:00

I think the transport never rekeys here. The loop stops at 100 actions, so a stream holds fewer than 100 packets, and the transport rekeys every 224:
github.com/bitcoin/bitcoin@a773e1e33b/src/bip324.h (L26)

Maybe add an action that appends a run of empty decoys? With the diff below, libFuzzer's coverage report shows this rekey branch hit:
github.com/bitcoin/bitcoin@a773e1e33b/src/crypto/chacha20poly1305.cpp (L106-L108)

diff --git a/src/test/fuzz/p2p_transport_serialization.cpp b/src/test/fuzz/p2p_transport_serialization.cpp
index 852994afe..c823f669d 100644
--- a/src/test/fuzz/p2p_transport_serialization.cpp
+++ b/src/test/fuzz/p2p_transport_serialization.cpp
@@ -474,6 +474,16 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa
                 peer.Encrypt(contents, MakeByteSpan(aad), ignore, MakeWritableByteSpan(stream).subspan(start));
                 aad.clear();
                 if (corrupt) flip_fn(start);
+            },
+            // A run of empty decoys, so the transport has to rekey (every REKEY_INTERVAL packets).
+            [&] {
+                const auto count{provider.ConsumeIntegralInRange<unsigned>(1, BIP324Cipher::REKEY_INTERVAL)};
+                for (unsigned i{0}; i < count; ++i) {
+                    const auto start = stream.size();
+                    stream.resize(start + BIP324Cipher::EXPANSION);
+                    peer.Encrypt({}, MakeByteSpan(aad), /*ignore=*/true, MakeWritableByteSpan(stream).subspan(start));
+                    aad.clear();
+                }
             }
         );
     }
I think the transport never rekeys here. The loop stops at 100 actions, so a stream holds fewer than 100 packets, and the transport rekeys every 224: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/bip324.h#L26 Maybe add an action that appends a run of empty decoys? With the diff below, libFuzzer's coverage report shows this rekey branch hit: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/crypto/chacha20poly1305.cpp#L106-L108 ```diff diff --git a/src/test/fuzz/p2p_transport_serialization.cpp b/src/test/fuzz/p2p_transport_serialization.cpp index 852994afe..c823f669d 100644 --- a/src/test/fuzz/p2p_transport_serialization.cpp +++ b/src/test/fuzz/p2p_transport_serialization.cpp @@ -474,6 +474,16 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa peer.Encrypt(contents, MakeByteSpan(aad), ignore, MakeWritableByteSpan(stream).subspan(start)); aad.clear(); if (corrupt) flip_fn(start); + }, + // A run of empty decoys, so the transport has to rekey (every REKEY_INTERVAL packets). + [&] { + const auto count{provider.ConsumeIntegralInRange<unsigned>(1, BIP324Cipher::REKEY_INTERVAL)}; + for (unsigned i{0}; i < count; ++i) { + const auto start = stream.size(); + stream.resize(start + BIP324Cipher::EXPANSION); + peer.Encrypt({}, MakeByteSpan(aad), /*ignore=*/true, MakeWritableByteSpan(stream).subspan(start)); + aad.clear(); + } } ); } ```
uqlidi (Migrated from github.com) commented 2026-10-31 20:34:07 +00:00

nit: the code doesn't use more or msg_type.

        const auto& [bytes, _more, _msg_type] = transport.GetBytesToSend(/*have_next_message=*/false);
nit: the code doesn't use `more` or `msg_type`. ```suggestion const auto& [bytes, _more, _msg_type] = transport.GetBytesToSend(/*have_next_message=*/false); ```
uqlidi (Migrated from github.com) commented 2026-10-31 20:28:55 +00:00

The target calls transport.GetInfo() and drops the result.

The transport reports v2 once it verifies the version packet:
github.com/bitcoin/bitcoin@a773e1e33b/src/net.cpp (L1595-L1600)

At that point its session id should match the peer's. Would an assert on that work? I ran the check for 4 minutes and it didn't fail.

    const auto info{transport.GetInfo()};
    if (info.transport_type == TransportProtocolType::V2) {
        assert(info.session_id == uint256{MakeUCharSpan(peer.GetSessionID())});
    }
The target calls `transport.GetInfo()` and drops the result. The transport reports v2 once it verifies the version packet: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/net.cpp#L1595-L1600 At that point its session id should match the peer's. Would an assert on that work? I ran the check for 4 minutes and it didn't fail. ```suggestion const auto info{transport.GetInfo()}; if (info.transport_type == TransportProtocolType::V2) { assert(info.session_id == uint256{MakeUCharSpan(peer.GetSessionID())}); } ```
uqlidi (Migrated from github.com) commented 2026-10-31 20:32:40 +00:00

nit: stream and aad hold uint8_t, but most bytes going in are std::byte. That forces casts both ways: UCharCast in append_fn, and MakeByteSpan / MakeWritableByteSpan for Encrypt.

Maybe store std::byte and convert once with MakeUCharSpan(stream) before ReceivedBytes()? I think that also removes the duplicate insert in the "Arbitrary bytes" and "Garbage" branches, and it reads the input the same way.

nit: `stream` and `aad` hold `uint8_t`, but most bytes going in are `std::byte`. That forces casts both ways: `UCharCast` in `append_fn`, and `MakeByteSpan` / `MakeWritableByteSpan` for `Encrypt`. Maybe store `std::byte` and convert once with `MakeUCharSpan(stream)` before `ReceivedBytes()`? I think that also removes the duplicate insert in the "Arbitrary bytes" and "Garbage" branches, and it reads the input the same way.
uqlidi (Migrated from github.com) commented 2026-10-31 20:33:04 +00:00

diff:

diff --git a/src/test/fuzz/p2p_transport_serialization.cpp b/src/test/fuzz/p2p_transport_serialization.cpp
index 852994afe..d6e0bd5c5 100644
--- a/src/test/fuzz/p2p_transport_serialization.cpp
+++ b/src/test/fuzz/p2p_transport_serialization.cpp
@@ -429,34 +429,33 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa
     peer.Initialize(BIP324Cipher{key, ent}.GetOurPubKey(), /*initiator=*/!initiating);
 
     // Build the byte stream.
-    std::vector<uint8_t> stream;
+    std::vector<std::byte> stream;
     // Garbage appended since the last key, which the first packet after the terminator must
     // authenticate.
-    std::vector<uint8_t> aad;
+    std::vector<std::byte> aad;
     auto append_fn = [&](std::span<const std::byte> bytes) {
-        stream.insert(stream.end(), UCharCast(bytes.data()), UCharCast(bytes.data() + bytes.size()));
+        stream.insert(stream.end(), bytes.begin(), bytes.end());
     };
     // Flip a bit in stream, at or after position start.
     auto flip_fn = [&](size_t start) {
-        stream[provider.ConsumeIntegralInRange<size_t>(start, stream.size() - 1)] ^= 1 << provider.ConsumeIntegralInRange<unsigned>(0, 7);
+        stream[provider.ConsumeIntegralInRange<size_t>(start, stream.size() - 1)] ^= std::byte{1} << provider.ConsumeIntegralInRange<unsigned>(0, 7);
     };
     LIMITED_WHILE (provider.remaining_bytes(), 100) {
         CallOneOf(provider,
             // Arbitrary bytes.
             [&] {
-                auto bytes = provider.ConsumeBytes<uint8_t>(provider.ConsumeIntegralInRange<size_t>(0, 256));
-                stream.insert(stream.end(), bytes.begin(), bytes.end());
+                append_fn(provider.ConsumeBytes<std::byte>(provider.ConsumeIntegralInRange<size_t>(0, 256)));
             },
             // The peer's key.
             [&] {
-                append_fn(std::span{peer.GetOurPubKey().data(), EllSwiftPubKey::size()});
+                append_fn(peer.GetOurPubKey());
                 aad.clear();
             },
             // Garbage.
             [&] {
-                auto bytes = provider.ConsumeBytes<uint8_t>(provider.ConsumeIntegralInRange<size_t>(0, V2Transport::MAX_GARBAGE_LEN));
-                stream.insert(stream.end(), bytes.begin(), bytes.end());
-                aad.insert(aad.end(), bytes.begin(), bytes.end());
+                const auto garbage{provider.ConsumeBytes<std::byte>(provider.ConsumeIntegralInRange<size_t>(0, V2Transport::MAX_GARBAGE_LEN))};
+                append_fn(garbage);
+                aad.insert(aad.end(), garbage.begin(), garbage.end());
             },
             // The garbage terminator, possibly corrupted.
             [&] {
@@ -471,7 +470,7 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa
                 const bool corrupt = provider.ConsumeBool();
                 const auto start = stream.size();
                 stream.resize(start + contents.size() + BIP324Cipher::EXPANSION);
-                peer.Encrypt(contents, MakeByteSpan(aad), ignore, MakeWritableByteSpan(stream).subspan(start));
+                peer.Encrypt(contents, aad, ignore, std::span{stream}.subspan(start));
                 aad.clear();
                 if (corrupt) flip_fn(start);
             }
@@ -479,7 +478,7 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa
     }
 
     // Receive the stream in pieces, and send what the transport wants to send in between.
-    std::span<const uint8_t> to_recv{stream};
+    std::span<const uint8_t> to_recv{MakeUCharSpan(stream)};
     while (!to_recv.empty()) {
         const size_t piece_len = provider.ConsumeIntegralInRange<size_t>(1, to_recv.size());
         std::span<const uint8_t> piece = to_recv.first(piece_len);
diff: ```diff diff --git a/src/test/fuzz/p2p_transport_serialization.cpp b/src/test/fuzz/p2p_transport_serialization.cpp index 852994afe..d6e0bd5c5 100644 --- a/src/test/fuzz/p2p_transport_serialization.cpp +++ b/src/test/fuzz/p2p_transport_serialization.cpp @@ -429,34 +429,33 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa peer.Initialize(BIP324Cipher{key, ent}.GetOurPubKey(), /*initiator=*/!initiating); // Build the byte stream. - std::vector<uint8_t> stream; + std::vector<std::byte> stream; // Garbage appended since the last key, which the first packet after the terminator must // authenticate. - std::vector<uint8_t> aad; + std::vector<std::byte> aad; auto append_fn = [&](std::span<const std::byte> bytes) { - stream.insert(stream.end(), UCharCast(bytes.data()), UCharCast(bytes.data() + bytes.size())); + stream.insert(stream.end(), bytes.begin(), bytes.end()); }; // Flip a bit in stream, at or after position start. auto flip_fn = [&](size_t start) { - stream[provider.ConsumeIntegralInRange<size_t>(start, stream.size() - 1)] ^= 1 << provider.ConsumeIntegralInRange<unsigned>(0, 7); + stream[provider.ConsumeIntegralInRange<size_t>(start, stream.size() - 1)] ^= std::byte{1} << provider.ConsumeIntegralInRange<unsigned>(0, 7); }; LIMITED_WHILE (provider.remaining_bytes(), 100) { CallOneOf(provider, // Arbitrary bytes. [&] { - auto bytes = provider.ConsumeBytes<uint8_t>(provider.ConsumeIntegralInRange<size_t>(0, 256)); - stream.insert(stream.end(), bytes.begin(), bytes.end()); + append_fn(provider.ConsumeBytes<std::byte>(provider.ConsumeIntegralInRange<size_t>(0, 256))); }, // The peer's key. [&] { - append_fn(std::span{peer.GetOurPubKey().data(), EllSwiftPubKey::size()}); + append_fn(peer.GetOurPubKey()); aad.clear(); }, // Garbage. [&] { - auto bytes = provider.ConsumeBytes<uint8_t>(provider.ConsumeIntegralInRange<size_t>(0, V2Transport::MAX_GARBAGE_LEN)); - stream.insert(stream.end(), bytes.begin(), bytes.end()); - aad.insert(aad.end(), bytes.begin(), bytes.end()); + const auto garbage{provider.ConsumeBytes<std::byte>(provider.ConsumeIntegralInRange<size_t>(0, V2Transport::MAX_GARBAGE_LEN))}; + append_fn(garbage); + aad.insert(aad.end(), garbage.begin(), garbage.end()); }, // The garbage terminator, possibly corrupted. [&] { @@ -471,7 +470,7 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa const bool corrupt = provider.ConsumeBool(); const auto start = stream.size(); stream.resize(start + contents.size() + BIP324Cipher::EXPANSION); - peer.Encrypt(contents, MakeByteSpan(aad), ignore, MakeWritableByteSpan(stream).subspan(start)); + peer.Encrypt(contents, aad, ignore, std::span{stream}.subspan(start)); aad.clear(); if (corrupt) flip_fn(start); } @@ -479,7 +478,7 @@ FUZZ_TARGET(p2p_transport_v2_receive, .init = initialize_p2p_transport_serializa } // Receive the stream in pieces, and send what the transport wants to send in between. - std::span<const uint8_t> to_recv{stream}; + std::span<const uint8_t> to_recv{MakeUCharSpan(stream)}; while (!to_recv.empty()) { const size_t piece_len = provider.ConsumeIntegralInRange<size_t>(1, to_recv.size()); std::span<const uint8_t> piece = to_recv.first(piece_len); ```
fametrano commented 2026-11-01 18:51:26 +00:00 (Migrated from github.com)

@uqlidi thanks, all seven comments are applied in 984a01619e.

Once the transport reports v2, the target asserts that its session id matches the peer's; with the check inverted it aborts on the new corpus, so the assert is reached. The old target never rekeyed: a new action appends a run of empty decoys, and replaying the corpora counted 0 rekeys before and 854 after, at about half the exec rate. Both entropies are const, from ConsumeFixedLengthByteVector. The peer is initialized from key.EllSwiftCreate(ent). stream and aad hold std::byte. The unused bindings are _more and _msg_type. The refactors read the input the same way: a hash of the stream, the entropy and the bytes left was identical before and after them on all 601 old-corpus inputs with valid keys.

One note on Ralph's report on 0b0fa362fe: its verifier says the target reaches the wrong-magic disconnect. That branch's log line, net.cpp:1144 at 984a01619e, had 0 hits in the gist's 10-minute run of the new target and its 5-minute run of the final one (results.txt). This is why the description says the target does not reach it: that path needs a v1 version header at the start of the stream.

I also rebased: master gave initialize_p2p_transport_serialization a reachability goal this target never observes, so it now uses initialize_p2p_transport. Commands and output: https://gist.github.com/fametrano/b1d9da3c3312cae5b1029679828ee023/e168d09e55328bc3b2955680154ea4b4687b8e5c

@uqlidi thanks, all seven comments are applied in 984a01619e. Once the transport reports v2, the target asserts that its session id matches the peer's; with the check inverted it aborts on the new corpus, so the assert is reached. The old target never rekeyed: a new action appends a run of empty decoys, and replaying the corpora counted 0 rekeys before and 854 after, at about half the exec rate. Both entropies are `const`, from `ConsumeFixedLengthByteVector`. The peer is initialized from `key.EllSwiftCreate(ent)`. `stream` and `aad` hold `std::byte`. The unused bindings are `_more` and `_msg_type`. The refactors read the input the same way: a hash of the stream, the entropy and the bytes left was identical before and after them on all 601 old-corpus inputs with valid keys. One note on Ralph's report on 0b0fa362fe: its verifier says the target reaches the wrong-magic disconnect. That branch's log line, `net.cpp:1144` at 984a01619e, had 0 hits in the gist's 10-minute run of the new target and its 5-minute run of the final one (`results.txt`). This is why the description says the target does not reach it: that path needs a v1 `version` header at the start of the stream. I also rebased: master gave `initialize_p2p_transport_serialization` a reachability goal this target never observes, so it now uses `initialize_p2p_transport`. Commands and output: https://gist.github.com/fametrano/b1d9da3c3312cae5b1029679828ee023/e168d09e55328bc3b2955680154ea4b4687b8e5c
DrahtBot commented 2026-11-10 13:51:06 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
jeanpablojp (Migrated from github.com) reviewed 2026-12-01 17:56:15 +00:00
jeanpablojp (Migrated from github.com) left a comment

Concept ACK

Concept ACK
jeanpablojp (Migrated from github.com) commented 2026-12-01 17:56:15 +00:00

The description says the stream is fed in pieces of arbitrary size, but once the build loop has used up the input ConsumeIntegralInRange returns 1 here, so 403 of the 430 inputs in your gist's corpus that build a stream are received one byte at a time.

Should the pieces vary for every input, or should the description and the comment at the top of the target say they don't?

The description says the stream is fed in pieces of arbitrary size, but once the build loop has used up the input `ConsumeIntegralInRange` returns 1 here, so 403 of the 430 inputs in your gist's corpus that build a stream are received one byte at a time. Should the pieces vary for every input, or should the description and the comment at the top of the target say they don't?
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!36635
No description provided.