Skip to content

doc: Fix fee field in getblock RPC result#34702

Merged
fanquake merged 1 commit intobitcoin:masterfrom
nervana21:2026-02-getblock-fee-optional
Mar 8, 2026
Merged

doc: Fix fee field in getblock RPC result#34702
fanquake merged 1 commit intobitcoin:masterfrom
nervana21:2026-02-getblock-fee-optional

Conversation

@nervana21
Copy link
Contributor

@nervana21 nervana21 commented Feb 28, 2026

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.

@DrahtBot DrahtBot added the Docs label Feb 28, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 28, 2026

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.

@instagibbs
Copy link
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.

@maflcko
Copy link
Member

maflcko commented Feb 28, 2026

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

static std::optional<UniValue::VType> ExpectedType(RPCResult::Type type)
{
    using Type = RPCResult::Type;
    switch (type) {
    case Type::ELISION:
    case Type::ANY: {
        return std::nullopt;
    }
...

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.
@nervana21 nervana21 force-pushed the 2026-02-getblock-fee-optional branch from 3186847 to f580cc7 Compare March 1, 2026 17:13
@nervana21
Copy link
Contributor Author

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:

assert_fee_not_in_block(block_noundo.hash_hex, 2)
assert_fee_not_in_block(block_noundo.hash_hex, 3)

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

Copy link
Member

@instagibbs instagibbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f580cc7

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f580cc7

@mercie-ux
Copy link

ACK f580cc7

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f580cc7

@satsfy
Copy link

satsfy commented Mar 8, 2026

ACK f580cc7

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

@fanquake fanquake merged commit 9833ef5 into bitcoin:master Mar 8, 2026
26 checks passed
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 8, 2026
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.

Github-Pull: bitcoin#34702
Rebased-From: f580cc7
@fanquake
Copy link
Member

fanquake commented Mar 8, 2026

Backported to 30.x in #34689.

@fanquake fanquake mentioned this pull request Mar 8, 2026
@nervana21
Copy link
Contributor Author

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

@nervana21 nervana21 deleted the 2026-02-getblock-fee-optional branch March 9, 2026 01:34
fanquake pushed a commit to fanquake/bitcoin that referenced this pull request Mar 9, 2026
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.

Github-Pull: bitcoin#34702
Rebased-From: f580cc7
fanquake added a commit that referenced this pull request Mar 11, 2026
49a777d doc: update release notes for v30.x (fanquake)
0f9e08f doc: update build guides pre v31 (fanquake)
597ac36 doc: Fix `fee` field in `getblock` RPC result (nervana21)
47ed306 depends: Allow building Qt packages after interruption (Hennadii Stepanov)
d221d1c psbt: validate pubkeys in MuSig2 pubnonce/partial sig deserialization (tboy1337)
e1210ac doc: Improve dependencies.md IPC documentation (Ryan Ofsky)
c17a5cd test: Add missing timeout_factor to zmq socket (MarcoFalke)
3042509 netif: fix compilation warning in QueryDefaultGatewayImpl() (MarcoFalke)
475a5b0 refactor: Use static_cast<decltype(...)> to suppress integer sanitizer warning (MarcoFalke)
7220ee3 util: Fix UB in SetStdinEcho when ENOTTY (MarcoFalke)

Pull request description:

  Backports:
  * #34093
  * #34219
  * #34597
  * #34690
  * #34702
  * #34706
  * #34713
  * #34789

ACKs for top commit:
  marcofleon:
    ACK 49a777d

Tree-SHA512: b4ce54860b7306b22de75bb093ad574110875253e4ea3ca96a736809c8291dea1144a617c8791f36618d8e367022709ba5cf84ca0e450ef6d76394ab80f22e2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants