Summary
When upgrading the bitcoind backend to a modern version (v22 → v28+), several RPC response format changes can cause Blockbook to break or behave incorrectly. This issue tracks the known problems and their remediation.
1. 🔴 warnings field is now an array (Core ≥ v25.0) — must merge PR #1633
Bitcoin Core 25.0 changed the "warnings" field of getblockchaininfo and getnetworkinfo from a single string to a JSON array of strings. Without a fix, GetChainInfo() fails at startup with:
cannot unmarshal array into Go struct field .result.warnings of type string
Fix: #1633 introduces a custom coreWarnings type that accepts either wire shape. This PR must be merged before upgrading to Core ≥ 25.0.
2. 🟡 getmempoolentry top-level fee fields deprecated (Core ≥ v23.0)
Bitcoin Core 23.0 deprecated the top-level fee, modifiedfee, ancestorfees, and descendantfees fields in getmempoolentry (and related RPCs) in favour of a nested fees object. The deprecated fields are still returned behind -deprecatedrpc=fees, but may be removed in a future release.
Blockbooks ResGetMempoolEntry (in bchain/coins/btc/bitcoinrpc.go) currently reads only the top-level fields:
Fee common.JSONNumber `json:"fee"`
ModifiedFee common.JSONNumber `json:"modifiedfee"`
DescendantFees uint32 `json:"descendantfees"`
AncestorFees uint32 `json:"ancestorfees"`
If Core eventually drops the deprecated compat flag, these will silently return zero values (or fail to unmarshal), corrupting mempool tracking and fee estimation.
Suggested fix: Add a custom UnmarshalJSON or switch to reading the fees nested object and convert from BTC-denominated values back to satoshis.
3. 🟡 DescendantFees / AncestorFees typed as uint32 — overflow risk
In bchain/coins/btc/bitcoinrpc.go, these fields are typed as uint32:
DescendantFees uint32 `json:"descendantfees"`
AncestorFees uint32 `json:"ancestorfees"`
Bitcoin Core returns them as CAmount (int64, denominated in satoshis). The uint32 maximum is ~4.29 billion satoshis (~42.9 BTC). A sufficiently large mempool descendant tree (more likely with Cores package relay introduced in v26.0 and TRUC transactions in v27.0+) can exceed this threshold, causing silent truncation or a JSON unmarshal error.
Suggested fix: Change the types to common.JSONNumber (matching how Fee and ModifiedFee are already handled) and convert to satoshis via the existing helper.
Affected coins
- Bitcoin and all coins that reuse
bchain/coins/btc/ RPC types (Litecoin, Bitcoin Cash, eCash, Dash, Dogecoin, Firo, etc.)
- Zcash partially — it reuses
ResGetNetworkInfo from the btc package.
- Decred has its own independent RPC implementation and is not affected by items 2 or 3.
Summary
When upgrading the bitcoind backend to a modern version (v22 → v28+), several RPC response format changes can cause Blockbook to break or behave incorrectly. This issue tracks the known problems and their remediation.
1. 🔴
warningsfield is now an array (Core ≥ v25.0) — must merge PR #1633Bitcoin Core 25.0 changed the
"warnings"field ofgetblockchaininfoandgetnetworkinfofrom a single string to a JSON array of strings. Without a fix,GetChainInfo()fails at startup with:Fix: #1633 introduces a custom
coreWarningstype that accepts either wire shape. This PR must be merged before upgrading to Core ≥ 25.0.2. 🟡
getmempoolentrytop-level fee fields deprecated (Core ≥ v23.0)Bitcoin Core 23.0 deprecated the top-level
fee,modifiedfee,ancestorfees, anddescendantfeesfields ingetmempoolentry(and related RPCs) in favour of a nestedfeesobject. The deprecated fields are still returned behind-deprecatedrpc=fees, but may be removed in a future release.Blockbooks
ResGetMempoolEntry(inbchain/coins/btc/bitcoinrpc.go) currently reads only the top-level fields:If Core eventually drops the deprecated compat flag, these will silently return zero values (or fail to unmarshal), corrupting mempool tracking and fee estimation.
Suggested fix: Add a custom
UnmarshalJSONor switch to reading thefeesnested object and convert from BTC-denominated values back to satoshis.3. 🟡
DescendantFees/AncestorFeestyped asuint32— overflow riskIn
bchain/coins/btc/bitcoinrpc.go, these fields are typed asuint32:Bitcoin Core returns them as
CAmount(int64, denominated in satoshis). Theuint32maximum is ~4.29 billion satoshis (~42.9 BTC). A sufficiently large mempool descendant tree (more likely with Cores package relay introduced in v26.0 and TRUC transactions in v27.0+) can exceed this threshold, causing silent truncation or a JSON unmarshal error.Suggested fix: Change the types to
common.JSONNumber(matching howFeeandModifiedFeeare already handled) and convert to satoshis via the existing helper.Affected coins
bchain/coins/btc/RPC types (Litecoin, Bitcoin Cash, eCash, Dash, Dogecoin, Firo, etc.)ResGetNetworkInfofrom the btc package.