kernel: document `btck_block_check` resets `validation_state` #35189

pull w0xlt wants to merge 1 commits into bitcoin:master from w0xlt:kernel_block_check_doc changing 1 files +5 −3
  1. w0xlt commented at 1:01 AM on May 1, 2026: contributor

    btck_block_check resets the caller-supplied btck_BlockValidationState on entry (state = BlockValidationState{}; in bitcoinkernel.cpp), but the public header doesn't say so. validation_state is tagged [in,out] and the description only mentions that the result is written, not that prior contents are discarded. No behavior change, no API change.

  2. kernel: document btck_block_check resets validation_state
    The implementation does state = BlockValidationState{} on entry, but
    the doc tagged validation_state as [in,out] and said nothing about the
    discard. Re-tag as [out] and state explicitly that any prior contents
    are overwritten, matching the wording used for btck_transaction_check.
    ed81aca01a
  3. DrahtBot added the label Validation on May 1, 2026
  4. DrahtBot commented at 1:01 AM on May 1, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK sedited

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited approved
  6. sedited commented at 7:53 AM on May 1, 2026: contributor

    ACK ed81aca01a058daa3d9b2d15f0db52bf38487879

  7. sedited commented at 7:59 AM on May 1, 2026: contributor

    I wonder what the better pattern is here. Should we always be resetting them?

  8. ?
    added_to_project_v2 fanquake
  9. ?
    project_v2_item_status_changed github-project-automation[bot]
  10. in src/kernel/bitcoinkernel.h:1309 in ed81aca01a
    1307 | - *                                  btck_block_validation_state_create and updated
    1308 | - *                                  in-place with the validation result.
    1309 | + * @param[out]    validation_state  Non-null, previously created with
    1310 | + *                                  btck_block_validation_state_create. Reset on
    1311 | + *                                  entry (any prior contents are overwritten) and
    1312 | + *                                  updated in-place with the validation result
    


    maflcko commented at 3:04 PM on May 5, 2026:

    Doesn't "updated in-place" imply that any value is overwritten? I think it would be better to only document the out-params that are not always updated in-place and overwritten. (or rather, try to always update them and overwrite them, where possible)


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: 2026-05-11 12:12 UTC

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