test: add unit test coverage for the empty leaves path in MerkleComputation #33858

pull frankomosh wants to merge 1 commits into bitcoin:master from frankomosh:merkle-empty-path changing 1 files +5 βˆ’0
  1. frankomosh commented at 0:08 am on November 12, 2025: contributor

    As noted in #32243 (comment), the early return inside MerkleComputation when leaves.size() == 0 was only exercised by fuzz tests.

    The existing merkle_test_empty_block calls BlockMerkleRoot, which uses ComputeMerkleRoot, but does not exercise the TransactionMerklePath β†’ ComputeMerklePath β†’ MerkleComputation code path.

    Coverage before adding test:

    Coverage after adding test:

  2. test: exercise TransactionMerklePath with empty block; targets the MerkleComputation empty-leaves path that was only reached by fuzz tests ffcae82a68
  3. DrahtBot added the label Tests on Nov 12, 2025
  4. DrahtBot commented at 0:08 am on November 12, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33858.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK kevkevinpal

    If your review is incorrectly listed, please react with πŸ‘Ž to this comment and the bot will ignore it on the next update.

  5. maflcko commented at 8:14 am on November 12, 2025: member

    Coverage before adding test:

    Coverage after adding test:

    I don’t think those links work. Also, this is redundant to the corecheck result anyway?

  6. frankomosh commented at 11:16 am on November 12, 2025: contributor

    I don’t think those links work.

    I’m not sure why they didn’t render correctly here. [Edit: I think it renders now]

    Also, this is redundant to the corecheck result anyway?

    I included them mainly to visually show % increase, but you’re right that they may be redundant. (also, I think you have been against adding tests without showing any proof of coverage)

  7. kevkevinpal commented at 3:07 pm on November 12, 2025: contributor

    ACK ffcae82

    According to corecheck it looks like there was an increase in coverage https://corecheck.dev/bitcoin/bitcoin/pulls/33858


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-11-12 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me