coins,refactor: Reduce getblockstats RPC UTXO overhead estimation #31449

pull l0rinc wants to merge 3 commits into bitcoin:master from l0rinc:l0rinc/coin-fCoinBase-bool changing 10 files +26 −25
  1. l0rinc commented at 5:36 pm on December 9, 2024: contributor

    The getblockstats RPC currently overestimates UTXO overhead by treating the fCoinBase bitfield as a separate bool in PER_UTXO_OVERHEAD. However, fCoinBase and nHeight are packed into a single 32-bit integer (both in memory and when serialized) - the extra bool in the overhead calculation is unnecessary.

    This PR introduces the following changes across three commits:

    • Stores fCoinBase as a proper bool to minimize conversions.
    • Unifies the serialization style for better readability.
    • Adjusts UTXO overhead estimation to reflect the actual structure and updates related tests accordingly.
  2. coins,refactor: Migrate Coin#fCoinBase to bool 5658c51871
  3. DrahtBot commented at 5:36 pm on December 9, 2024: 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/31449.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label CI failed on Dec 9, 2024
  5. coins,refactor: Unify Coin Serialization styles ff9d484876
  6. rpc: Fix utxo_size_inc(_actual) calculation
    `nHeight` and `fCoinBase` are stored in `Coin` as bitfields and are serialized as a single 32 bit number, so the UTXO overhead calculation shouldn't include an additional boolean
    72ec388244
  7. l0rinc force-pushed on Dec 9, 2024
  8. DrahtBot removed the label CI failed on Dec 9, 2024
  9. l0rinc marked this as ready for review on Dec 9, 2024

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: 2024-12-21 12:12 UTC

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