Skip to content

Finish off support for Bitcoin Core v31.0#615

Open
satsfy wants to merge 12 commits into
rust-bitcoin:masterfrom
satsfy:v31
Open

Finish off support for Bitcoin Core v31.0#615
satsfy wants to merge 12 commits into
rust-bitcoin:masterfrom
satsfy:v31

Conversation

@satsfy

@satsfy satsfy commented May 29, 2026

Copy link
Copy Markdown
Contributor

Closes #599

Completes v31 support across the client, types, and integration tests. Makes v31 the default version.

  • set v31 as the latest version and re-export the v31 types.
  • enabled the v31 integration tests.
  • Dropped the incorrect "fields changed" doc notes on several v31 types.

Fixed:

  • getpeerinfo (network): added inv_to_send and last_inv_sequence, and made startingheight optional now that it is only returned under -deprecatedrpc=startingheight.
  • logging (control): added the new kernel and privatebroadcast categories.
  • getwalletinfo (wallet): no longer returns paytxfee.
  • getdeploymentinfo (blockchain): added the script_flags field.
  • gettxspendingprevout (blockchain): fixed the result type to carry the new spendingtx and blockhash fields, plus added support for the new mempool_only and return_spending_tx arguments.
  • getblock (blockchain): added the coinbase_tx object returned at verbosity 1, 2 and 3.

Added:

  • cluster mempool (blockchain): new getmempoolcluster and getmempoolfeeratediagram RPCs, the chunk_weight and chunk_fee fields on getmempoolentry, getrawmempool, getmempoolancestors and getmempooldescendants, and the cluster_limit and optimal fields on getmempoolinfo.
  • private broadcast (raw transactions): new getprivatebroadcastinfo and abortprivatebroadcast RPCs.

LLM usage: Claude helped on generating tests for new RPCs, verifying things over and over again, attempting to call every RPC, spotting additional unfixed things, and reviewing every change the PR.

When appropriate, comments have been checked to match v31 documentation exactly.

@satsfy

satsfy commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Latest force push uses enums for getpeerinfo types, maintaining full v31 docs in corepc (before, it simply discarded relevant messages from Bitcoin Core documentation).

EDIT: below i retriggered CI

Comment thread types/src/model/blockchain.rs Outdated
Comment thread types/src/v19/blockchain/into.rs Outdated
Comment thread types/src/v31/blockchain/into.rs Outdated
Comment thread types/src/v31/blockchain/into.rs Outdated
Comment thread types/src/v31/blockchain/into.rs Outdated
Comment thread types/src/v31/blockchain/mod.rs
@tcharding

Copy link
Copy Markdown
Member

Looks pretty good man. To create all the new types you just copied the one from the latest version and added the fields, right? I.e for MempoolEntry you copied the one from v24, right?

@tcharding

Copy link
Copy Markdown
Member

Reviewed: 1d584d8

@satsfy

satsfy commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Looks pretty good man. To create all the new types you just copied the one from the latest version and added the fields, right? I.e for MempoolEntry you copied the one from v24, right?

Yes. Everything that didn't need to change hasn't changed. Diffs only in new/modified fields or the corresponding docs. All "institutional memory" is kept.

@jamillambert jamillambert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've had a look through and it all looks good so far. There is a lot here at so will need to have another look tomorrow.

@tcharding

tcharding commented Jun 2, 2026

Copy link
Copy Markdown
Member

The first commit doesn't build. Can you get the PR into a state where I can review patch by patch and on each I can run test30 and test31 cleanly (in integration_test/) please? See the README for these commands if you haven't already.

@satsfy satsfy force-pushed the v31 branch 2 times, most recently from 508d5cf to aad9a24 Compare June 4, 2026 03:17
@satsfy

satsfy commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Force push fixed the bissectability of every commit.

EDIT: no, a90eb31 is broken.

@satsfy satsfy force-pushed the v31 branch 2 times, most recently from 508d5cf to 150016f Compare June 4, 2026 04:14
@apoelstra

Copy link
Copy Markdown
Member

150016f needs rebase

@satsfy satsfy force-pushed the v31 branch 2 times, most recently from bc23b4d to a58753a Compare June 4, 2026 04:31
@satsfy

satsfy commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Force push fixes the other bad force pushes I made. Should be good to go.

Comment thread types/src/v31/blockchain/into.rs
Comment thread types/src/v31/blockchain/into.rs Outdated
Comment thread types/src/v31/mod.rs Outdated
satsfy added 11 commits June 5, 2026 18:24
Converted to enum the type of fields "connection_type" and
"transport_protocol_type" to match Bitcoin Core docs.
New fields kernel and privatebroadcast.
RPC getwalletinfo no longer returns paytxfee
Add getmempoolcluster and getmempoolfeeratediagram RPCs.

Update getmempoolentry, getrawmempool, getmempoolancestors,
getmempooldescendants and getmempoolinfo with new field chunk_weight,
chunk_fee and cluster_limit fields.

Back-fill optional fields as None for earlier versions.
RPC getdeploymentinfo gets script_flags field.
This commit adds an Enum with the possible flags.
RPC gettxspendingprevout adds spending_tx and block_hash fields when
return_spending_tx is set.
RPC getblock gets new field coinbase_tx.
Commit backfills None for earlier versions.
Deny unknown fields.
Use i64 for peer timestamps because time can be emmited as a negative.
getblockfrompeer, disconnectnode, getnetworkinfo, getblocktemplate and
waitfornewblock each carried a a note that said the fields since v30,
but their modelled return types match v30.
Despite getmempoolfeeratediagram being a new RPC, it is hidden. It is
not included in the rustdoc method table.

Remove SetTxFee import because the RPC has been deleted but the
re-export had been kept.
@satsfy

satsfy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Latest force push:

  • Made GetRawTransactionVerboseWithPrevout::into_model_with_prevouts public in v29 so v31 can call it.
  • Refactored the into_model conversions to follow corepc pattern.
  • Routed any call that reach back into older version though mod.rs.
  • GetBlockVerboseThree::into_model now builds correctly.
  • Cleaned up the notes column in the v31 method table.

Drop the v30_and_below gates from tests covering RPCs unchanged in v31.
@satsfy

satsfy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Clean up accidental garbage file

@jamillambert jamillambert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK daf4571

Nice one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finish off support for Core v31

4 participants