doc: Fix fee field in getblock RPC result #34702

pull nervana21 wants to merge 1 commits into bitcoin:master from nervana21:2026-02-getblock-fee-optional changing 1 files +1 −1
  1. nervana21 commented at 3:00 pm on February 28, 2026: contributor
    The fee field in the getblock RPC result (verbosity 2 and 3) may be omitted when block undo data is not available. Marking it optional in the RPCResult aligns the documented schema with the runtime behavior.
  2. DrahtBot added the label Docs on Feb 28, 2026
  3. DrahtBot commented at 3:00 pm on February 28, 2026: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK instagibbs, w0xlt, mercie-ux, luke-jr, satsfy

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34764 (rpc: replace ELISION references with explicit result fields by satsfy)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. instagibbs commented at 3:18 pm on February 28, 2026: member
    I can’t recall, but would a functional test fail in master when it doesn’t end up existing in a response? If so, worth making a regression test.
  5. maflcko commented at 3:32 pm on February 28, 2026: member

    The check may be skipped due to RPCResult::Type::ELISION?

    0static std::optional<UniValue::VType> ExpectedType(RPCResult::Type type)
    1{
    2    using Type = RPCResult::Type;
    3    switch (type) {
    4    case Type::ELISION:
    5    case Type::ANY: {
    6        return std::nullopt;
    7    }
    8...
    
  6. doc: Fix `fee` field in `getblock` RPC result
    The `fee` field in the `getblock` RPC result (verbosity 2 and 3) may be
    omitted when block undo data is not available. Marking it optional in
    the `RPCResult` aligns the documented schema with the runtime behavior.
    f580cc7e9f
  7. nervana21 force-pushed on Mar 1, 2026
  8. nervana21 commented at 5:14 pm on March 1, 2026: contributor

    I can’t recall, but would a functional test fail in master when it doesn’t end up existing in a response? If so, worth making a regression test.

    This behavior is already covered by a functional test:

    https://github.com/bitcoin/bitcoin/blob/744d47fcee0d32a71154292699bfdecf954a6065/test/functional/rpc_blockchain.py#L766-L767

    So I think only the documentation needs to be updated. Is there anything else that should be considered?

  9. instagibbs approved
  10. instagibbs commented at 2:25 pm on March 2, 2026: member
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2
  11. w0xlt commented at 7:13 pm on March 2, 2026: contributor
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2
  12. luke-jr approved
  13. luke-jr commented at 6:27 pm on March 7, 2026: member
    ACK f580cc7e9f26331f7f03a8bbc5722521eb159bb2
  14. satsfy commented at 3:15 am on March 8, 2026: none

    ACK https://github.com/bitcoin/bitcoin/commit/f580cc7e9f26331f7f03a8bbc5722521eb159bb2

    I wonder why it was not there. If at some point in time it was not optional.

  15. fanquake added the label Needs backport (30.x) on Mar 8, 2026
  16. fanquake merged this on Mar 8, 2026
  17. fanquake closed this on Mar 8, 2026

  18. fanquake referenced this in commit 83ee4e5aa8 on Mar 8, 2026
  19. fanquake removed the label Needs backport (30.x) on Mar 8, 2026
  20. fanquake commented at 2:39 pm on March 8, 2026: member
    Backported to 30.x in #34689.
  21. nervana21 commented at 1:34 am on March 9, 2026: contributor

    ACK f580cc7

    I wonder why it was not there. If at some point in time it was not optional.

    IIUC, when this line of code was originally added, fee was meant to be optional. The optional flag existed but just wasn’t set for this field

  22. nervana21 deleted the branch on Mar 9, 2026

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-03-24 09:13 UTC

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