fuzz: Cover block filter P2P messages #36337

Manually merged
maflcko merged 2 commits from 2609-fuzz-block-filter-p2p into master 2026-10-09 16:08:33 +00:00 AGit
maflcko commented 2026-09-25 17:34:46 +00:00 (Migrated from github.com)

The BIP157 P2P messages are not covered by any fuzz targets at all.

Fix this to cover them via the P2P targets.

Should be possible to test by verifying the integer sanitizer is triggered (https://github.com/bitcoin/bitcoin/pull/36321#issuecomment-5810977529):

$ echo 'FwAAAAEAAABcX2dldGNmY2hlY2twdAAftOvdD0sFqXEx6US5VIknlsOJqZ5goMwtmwZBPdCxQVxf
AfkGKP39/f0v/Q/9E1AP/f2ybAT1Af39A/399wEAuXEAAAAAAAAAAAB1z3QAbgAAQAHm/f39/f39
/f39/S8/D/0B/f3IAAcBBWNmaf8DAAAA' | base64 --decode > /tmp/msg.bin

$ UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=0:halt_on_error=0:report_error_type=1" FUZZ=process_messages ./bld-cmake/bin/fuzz /tmp/msg.bin 

./bld-cmake/bin/fuzz: Running 1 inputs 1 time(s) each.
/src/net_processing.cpp:3662:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_type' (aka 'unsigned long')
/src/net_processing.cpp:3662:18: runtime error: implicit conversion from type 'size_type' (aka 'unsigned long') of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
The BIP157 P2P messages are not covered by any fuzz targets at all. Fix this to cover them via the P2P targets. Should be possible to test by verifying the integer sanitizer is triggered (https://github.com/bitcoin/bitcoin/pull/36321#issuecomment-5810977529): ``` $ echo 'FwAAAAEAAABcX2dldGNmY2hlY2twdAAftOvdD0sFqXEx6US5VIknlsOJqZ5goMwtmwZBPdCxQVxf AfkGKP39/f0v/Q/9E1AP/f2ybAT1Af39A/399wEAuXEAAAAAAAAAAAB1z3QAbgAAQAHm/f39/f39 /f39/S8/D/0B/f3IAAcBBWNmaf8DAAAA' | base64 --decode > /tmp/msg.bin $ UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=0:halt_on_error=0:report_error_type=1" FUZZ=process_messages ./bld-cmake/bin/fuzz /tmp/msg.bin ./bld-cmake/bin/fuzz: Running 1 inputs 1 time(s) each. /src/net_processing.cpp:3662:33: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_type' (aka 'unsigned long') /src/net_processing.cpp:3662:18: runtime error: implicit conversion from type 'size_type' (aka 'unsigned long') of value 18446744073709551615 (64-bit, unsigned) to type 'int' changed the value to -1 (32-bit, signed)
DrahtBot commented 2026-09-25 17:34:56 +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
ACK marcofleon, Crypt-iQ

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.

LLM Linter (✨ experimental)

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • src/test/util/validation.cpp: InitBlockFilterIndex(..., BlockFilterType::BASIC, 1_MiB, /*f_memory=*/true, /*f_wipe=*/true)

2026-10-08 05:10:07

<!--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/36337 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36337.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36337#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 | | ---- | --------- | | ACK | [marcofleon](https://github.com/bitcoin/bitcoin/pull/36337#issuecomment-6064699683), [Crypt-iQ](https://github.com/bitcoin/bitcoin/pull/36337#issuecomment-6084354312) | 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--> ### LLM Linter (✨ experimental) Possible places where named args for integral literals may be used (e.g. `func(x, /*named_arg=*/0)` in C++, and `func(x, named_arg=0)` in Python): - `src/test/util/validation.cpp`: `InitBlockFilterIndex(..., BlockFilterType::BASIC, 1_MiB, /*f_memory=*/true, /*f_wipe=*/true)` <sup>2026-10-08 05:10:07</sup>
DrahtBot commented 2026-09-25 18:34:57 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task MSan, fuzz: https://github.com/bitcoin/bitcoin/actions/runs/36168019330/job/108180422242
LLM reason (✨ experimental): MemorySanitizer (fuzz test) reported a use of an uninitialized value in BaseIndex::Stop() (base.cpp:479), causing exit code 1 and the CI failure.

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.

  • An intermittent issue.

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

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `MSan, fuzz`: https://github.com/bitcoin/bitcoin/actions/runs/36168019330/job/108180422242</sub> <sub>LLM reason (✨ experimental): MemorySanitizer (fuzz test) reported a use of an uninitialized value in `BaseIndex::Stop()` (`base.cpp:479`), causing exit code 1 and the CI failure.</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. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
Crypt-iQ commented 2026-09-26 15:37:33 +00:00 (Migrated from github.com)

I think CI failures are because in process_message(s) the static testing_setup is destructed before static g_filter_indexes so BaseIndex::Stop will try to access testing_setup.m_node.

I think CI failures are because in process_message(s) the `static testing_setup` is destructed before `static g_filter_indexes` so `BaseIndex::Stop` will try to access `testing_setup.m_node`.
Crypt-iQ (Migrated from github.com) reviewed 2026-09-26 16:28:16 +00:00
Crypt-iQ (Migrated from github.com) commented 2026-09-26 16:28:17 +00:00

Can you explain why it deadlocks? I couldn't figure this bit out

Can you explain why it deadlocks? I couldn't figure this bit out
fanquake commented 2026-09-29 12:24:07 +00:00 (Migrated from github.com)

cc @marcofleon

cc @marcofleon
First-time contributor

Base: db0bde16b910f43e37252d4172d97f01653ae0f1
Head: fab64c032c1a0c997c6ec398cc5578df36b33b7d

Design and approach

Measure filter-index sync cost on dirty resets (src/test/util/validation.cpp:145, head)

Both P2P targets rebuild the 200-block fixture after an input changes the block index or mempool, and this sync generates and writes filters for that chain. Please compare fuzz executions per second on the dirty-reset path with and without this setup. If it materially reduces throughput, scope index setup to relevant inputs or use a focused target, recognizing that the latter reduces multi-message interaction coverage. If the measured impact is negligible, the current setup is reasonable.

Review coverage was incomplete. adversarial: BaseIndex::Stop() was not inspected before the review limit, leaving callback unregistration and repeated-stop safety unverified for the newly created, stopped, and later destroyed indexes. adversarial: The remaining ProcessGetCFCheckPt() body and existing blockfilter_index_tests.cpp lifecycle tests were not inspected, leaving the complete newly reachable checkpoint path and compatibility of fixture-wide index destruction unverified.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> Base: `db0bde16b910f43e37252d4172d97f01653ae0f1` Head: `fab64c032c1a0c997c6ec398cc5578df36b33b7d` ##### Design and approach **Measure filter-index sync cost on dirty resets** (src/test/util/validation.cpp:145, head) Both P2P targets rebuild the 200-block fixture after an input changes the block index or mempool, and this sync generates and writes filters for that chain. Please compare fuzz executions per second on the dirty-reset path with and without this setup. If it materially reduces throughput, scope index setup to relevant inputs or use a focused target, recognizing that the latter reduces multi-message interaction coverage. If the measured impact is negligible, the current setup is reasonable. Review coverage was incomplete. adversarial: BaseIndex::Stop() was not inspected before the review limit, leaving callback unregistration and repeated-stop safety unverified for the newly created, stopped, and later destroyed indexes. adversarial: The remaining ProcessGetCFCheckPt() body and existing blockfilter_index_tests.cpp lifecycle tests were not inspected, leaving the complete newly reachable checkpoint path and compatibility of fixture-wide index destruction unverified. [Full review report](<https://review.fish.foo/traces/36337-fab64c032c1a0c997c6ec398cc5578df36b33b7d-565-3.html>)
maflcko (Migrated from github.com) reviewed 2026-09-29 16:29:10 +00:00
maflcko (Migrated from github.com) commented 2026-09-29 16:29:10 +00:00

Sure. I guess the "fuzzed block" explanation is a bit confusing, because this is a general unit test utility, not limited to fuzzing.

The idea is:

I guess in theory one could use ImmediateTaskRunner (reverting https://github.com/bitcoin/bitcoin/pull/36046), but that would bring back the issues from there.

Sure. I guess the "fuzzed block" explanation is a bit confusing, because this is a general unit test utility, not limited to fuzzing. The idea is: * block connection events happens under cs_main: https://github.com/bitcoin/bitcoin/blob/3b9768a07aee6851de24f9c23bcdeeac2d872d23/src/validation.cpp#L3367-L3408 * With `ImmediateBackgroundTaskRunner` a new thread is spawned to handle it, which obviously can't take cs_main again. * Thus, https://github.com/bitcoin/bitcoin/blob/3b9768a07aee6851de24f9c23bcdeeac2d872d23/src/kernel/chain.cpp#L25 will deadlock via callback thread: BaseIndex::BlockConnected() → ProcessBlock() → kernel::MakeBlockInfo() → tries to lock cs_main I guess in theory one could use `ImmediateTaskRunner` (reverting https://github.com/bitcoin/bitcoin/pull/36046), but that would bring back the issues from there.
maflcko (Migrated from github.com) reviewed 2026-09-29 16:30:25 +00:00
maflcko (Migrated from github.com) commented 2026-09-29 16:30:25 +00:00

I think CI failures are because in process_message(s) the static testing_setup is destructed before static g_filter_indexes so BaseIndex::Stop will try to access testing_setup.m_node.

Thx, fixed by destroying the indexes in the testing dtor, which seems useful generally, unrelated to the changes here.

> I think CI failures are because in process_message(s) the `static testing_setup` is destructed before `static g_filter_indexes` so `BaseIndex::Stop` will try to access `testing_setup.m_node`. Thx, fixed by destroying the indexes in the testing dtor, which seems useful generally, unrelated to the changes here.
Crypt-iQ commented 2026-10-01 17:37:31 +00:00 (Migrated from github.com)

crACK fa47c22f7a

Checked this didn't introduce non-determinism using qa-assets corpus. I think new seeds for process_message(s) are needed since no seeds currently reach past PrepareBlockFilterRequest.

crACK fa47c22f7a9e148c6e67ac726ccefb7ceda44cef Checked this didn't introduce non-determinism using qa-assets corpus. I think new seeds for `process_message(s)` are needed since no seeds currently reach past `PrepareBlockFilterRequest`.
maflcko commented 2026-10-02 09:20:24 +00:00 (Migrated from github.com)

I think new seeds for process_message(s) are needed since no seeds currently reach past PrepareBlockFilterRequest.

I had my LLM-based fuzz engine (based on inverse fdp: https://github.com/maflcko/DrahtBot/blob/main/inverse_fdp/build.rs#L1) create the one in the pull description, and I can submit some more later

> I think new seeds for `process_message(s)` are needed since no seeds currently reach past `PrepareBlockFilterRequest`. I had my LLM-based fuzz engine (based on inverse fdp: https://github.com/maflcko/DrahtBot/blob/main/inverse_fdp/build.rs#L1) create the one in the pull description, and I can submit some more later
Crypt-iQ commented 2026-10-02 12:42:54 +00:00 (Migrated from github.com)

I had my LLM-based fuzz engine (based on inverse fdp: https://github.com/maflcko/DrahtBot/blob/main/inverse_fdp/build.rs#L1)

Might be off-topic, but could you explain how this works? I've been trying to come up with ways to have LLMs help with fuzzing and haven't come up with anything that I like. Does the LLM see coverage is stuck and then generate a test case with inverse-fdp to unblock the fuzzer?

> I had my LLM-based fuzz engine (based on inverse fdp: https://github.com/maflcko/DrahtBot/blob/main/inverse_fdp/build.rs#L1) Might be off-topic, but could you explain how this works? I've been trying to come up with ways to have LLMs help with fuzzing and haven't come up with anything that I like. Does the LLM see coverage is stuck and then generate a test case with inverse-fdp to unblock the fuzzer?
maflcko commented 2026-10-02 13:34:47 +00:00 (Migrated from github.com)

Might be off-topic, but could you explain how this works?

It is pretty primitive. I selected a fuzz input manually to start with and then asked the LLM to modify it.

LLM prompt (experimental)
› Ok, so the goal is to reach coverage in net_processing (see the diff, I've marked it, the goal is to reach that)


  I've also applied the inverse fdp from DrahtBot (you can read the repo there)



  Compiling and running the fuzz clang exe will print the fuzz seed.


  A good candidate, which hits the prior line is:


  ifdp.push_integral_in_range(1i32, 1i32, 3i32, );
  ifdp.push_integral_in_range(4395519861509i64, 0i64, 9223372036854775807i64, );
  ifdp.push_integral_in_range(4294967295u32, 4294967294u32, 4294967295u32, );
  ifdp.push_integral_in_range(7u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(0u64, 0u64, 5u64, );
  ifdp.push_bytes(&[0x17,0x0,0x0,0x0,]); // (len=4)
  ifdp.push_integral_in_range(51453u16, 0u16, 65535u16, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(1u64, 0u64, 6u64, );
  ifdp.push_integral_in_range(4245634863u32, 0u32, 4294967295u32, );
  ifdp.push_integral_in_range(18302063728033398269u64, 0u64, 18446744073709551615u64, );
  ifdp.push_integral_in_range(18302037353746661486u64, 0u64, 18446744073709551615u64, );
  ifdp.push_integral_in_range(0u64, 0u64, 5u64, );
  ifdp.push_bytes(&[0x1,0x0,0x0,0x0,]); // (len=4)
  ifdp.push_integral_in_range(29903u16, 0u16, 65535u16, );
  ifdp.push_integral_in_range(117u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(0u64, 0u64, 6u64, );
  ifdp.push_integral_in_range(0u32, 0u32, 4294967295u32, );
  ifdp.push_str_u8(&[]); // (len=0), Limit: 64
  ifdp.push_integral_in_range(0u64, 0u64, 6u64, );
  ifdp.push_integral_in_range(0u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(125039383017469u64, 0u64, 18446744073709551615u64, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(3u64, 0u64, 9u64, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(1u64, 0u64, 6u64, );
  ifdp.push_integral_in_range(245u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(4u64, 0u64, 6u64, );
  ifdp.push_integral_in_range(1823701557i32, 31800i32, 2147483647i32, );
  ifdp.push_integral_in_range(15u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(80u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(18i64, -1i64, 24i64, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(15u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(47u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_integral_in_range(253u8, 0u8, 255u8, );
  ifdp.push_bytes(&[0x67,0x65,0x74,0x63,0x66,0x63,0x68,0x65,0x63,0x6b,0x70,0x74,]); // (len=12)
  ifdp.push_integral_in_range(1618230402i64, 946684801i64, 4133980799i64, );
  ifdp.push_str_u8(&[0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x40,0x0,0x95,0x0,0x1,0x0,0x40,0x1,0x0,0x0,0xc0,0x73,0x65,0x72,0x63,0x27,0x8,0x46,0xd7,0xfd,0xfd,0x50,0xfd,0x78,0x6e,0x0,]); // (len=33), Limit: 4000000; not terminated!
  consider ifdp.push_str_u8_no_term instead?







  Use the inverse fdp, compile and run it, to reach the prior line, then smartly modify it, to reach the goal line.



  Don't modify the fuzz target itself. However, you can add as many prints (std::cout) as you like. For example, if you think it would be useful to print the block header hashes, to use them in the inverse FDP, you may do so.
  You can also print the filter hashes, etc ...

Maybe if someone is bored they can generalize it, so that the LLM decides itself where to start and what coverage to add, but this seems too open ended for me to work on.

> Might be off-topic, but could you explain how this works? It is pretty primitive. I selected a fuzz input manually to start with and then asked the LLM to modify it. <details><summary>LLM prompt (experimental)</summary> ``` › Ok, so the goal is to reach coverage in net_processing (see the diff, I've marked it, the goal is to reach that) I've also applied the inverse fdp from DrahtBot (you can read the repo there) Compiling and running the fuzz clang exe will print the fuzz seed. A good candidate, which hits the prior line is: ifdp.push_integral_in_range(1i32, 1i32, 3i32, ); ifdp.push_integral_in_range(4395519861509i64, 0i64, 9223372036854775807i64, ); ifdp.push_integral_in_range(4294967295u32, 4294967294u32, 4294967295u32, ); ifdp.push_integral_in_range(7u8, 0u8, 255u8, ); ifdp.push_integral_in_range(0u64, 0u64, 5u64, ); ifdp.push_bytes(&[0x17,0x0,0x0,0x0,]); // (len=4) ifdp.push_integral_in_range(51453u16, 0u16, 65535u16, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(1u64, 0u64, 6u64, ); ifdp.push_integral_in_range(4245634863u32, 0u32, 4294967295u32, ); ifdp.push_integral_in_range(18302063728033398269u64, 0u64, 18446744073709551615u64, ); ifdp.push_integral_in_range(18302037353746661486u64, 0u64, 18446744073709551615u64, ); ifdp.push_integral_in_range(0u64, 0u64, 5u64, ); ifdp.push_bytes(&[0x1,0x0,0x0,0x0,]); // (len=4) ifdp.push_integral_in_range(29903u16, 0u16, 65535u16, ); ifdp.push_integral_in_range(117u8, 0u8, 255u8, ); ifdp.push_integral_in_range(0u64, 0u64, 6u64, ); ifdp.push_integral_in_range(0u32, 0u32, 4294967295u32, ); ifdp.push_str_u8(&[]); // (len=0), Limit: 64 ifdp.push_integral_in_range(0u64, 0u64, 6u64, ); ifdp.push_integral_in_range(0u8, 0u8, 255u8, ); ifdp.push_integral_in_range(125039383017469u64, 0u64, 18446744073709551615u64, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(3u64, 0u64, 9u64, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(1u64, 0u64, 6u64, ); ifdp.push_integral_in_range(245u8, 0u8, 255u8, ); ifdp.push_integral_in_range(4u64, 0u64, 6u64, ); ifdp.push_integral_in_range(1823701557i32, 31800i32, 2147483647i32, ); ifdp.push_integral_in_range(15u8, 0u8, 255u8, ); ifdp.push_integral_in_range(80u8, 0u8, 255u8, ); ifdp.push_integral_in_range(18i64, -1i64, 24i64, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(15u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(47u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_integral_in_range(253u8, 0u8, 255u8, ); ifdp.push_bytes(&[0x67,0x65,0x74,0x63,0x66,0x63,0x68,0x65,0x63,0x6b,0x70,0x74,]); // (len=12) ifdp.push_integral_in_range(1618230402i64, 946684801i64, 4133980799i64, ); ifdp.push_str_u8(&[0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x40,0x0,0x95,0x0,0x1,0x0,0x40,0x1,0x0,0x0,0xc0,0x73,0x65,0x72,0x63,0x27,0x8,0x46,0xd7,0xfd,0xfd,0x50,0xfd,0x78,0x6e,0x0,]); // (len=33), Limit: 4000000; not terminated! consider ifdp.push_str_u8_no_term instead? Use the inverse fdp, compile and run it, to reach the prior line, then smartly modify it, to reach the goal line. Don't modify the fuzz target itself. However, you can add as many prints (std::cout) as you like. For example, if you think it would be useful to print the block header hashes, to use them in the inverse FDP, you may do so. You can also print the filter hashes, etc ... ``` </details> Maybe if someone is bored they can generalize it, so that the LLM decides itself where to start and what coverage to add, but this seems too open ended for me to work on.
DrahtBot commented 2026-10-07 14:03:18 +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).
maflcko commented 2026-10-07 14:16:14 +00:00 (Migrated from github.com)

rebased. Should be trivial to re-ack via git range-diff bitcoin-core/master fa47c22f7a fa09c6c140

rebased. Should be trivial to re-ack via `git range-diff bitcoin-core/master fa47c22f7a fa09c6c140`
marcofleon (Migrated from github.com) reviewed 2026-10-07 20:36:09 +00:00
marcofleon (Migrated from github.com) left a comment

ACK fa09c6c140

Coverage from this PR running from scratch:
process message
process messages

I didn't run these for super long (only a couple days) but you can see new coverage easily in blockfilterindex.cpp.

ACK fa09c6c14033cd7d235c0484632749573e51ba0d Coverage from this PR running from scratch: [process message](https://marcofleon.github.io/coverage/process_message/) [process messages](https://marcofleon.github.io/coverage/process_messages/) I didn't run these for super long (only a couple days) but you can see new coverage easily in `blockfilterindex.cpp`.
marcofleon (Migrated from github.com) commented 2026-10-07 20:16:59 +00:00

nit: Could use the new StopIndex() here.

nit: Could use the new [`StopIndex()`](https://github.com/bitcoin/bitcoin/blob/9dfde64cc3262329051fd05fffe40eecc786a99f/src/test/util/validation.cpp#L141) here.
maflcko (Migrated from github.com) reviewed 2026-10-08 05:09:58 +00:00
maflcko (Migrated from github.com) commented 2026-10-08 05:09:58 +00:00

thx, done.

thx, done.
marcofleon commented 2026-10-08 16:46:06 +00:00 (Migrated from github.com)

re-ACK fab64c032c

re-ACK fab64c032c1a0c997c6ec398cc5578df36b33b7d
Crypt-iQ commented 2026-10-09 15:51:30 +00:00 (Migrated from github.com)

re-ACK fab64c032c

re-ACK fab64c032c1a0c997c6ec398cc5578df36b33b7d
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!36337
No description provided.