Finish off support for Bitcoin Core v31.0#615
Conversation
|
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 |
| /// Transactions in this chunk in mining order (txids). | ||
| /// Transactions in this chunk in mining order. |
There was a problem hiding this comment.
In Bitcoin Core, it looks like this
RPCResult{RPCResult::Type::ARR, "txs", "transactions in this chunk in mining order",
{RPCResult{RPCResult::Type::STR_HEX, "txid", "transaction And in the docs
"txs" : [ (json array) transactions in this chunk in mining order
"hex", (string) transaction id
...
]
There is no (txids). Whenever this kind of conflict happens (knowing that our existing docs have errors sometimes) I took no chances and copied exactly what core said to prevent drift. I thought this would be the way to go because we will have codegen types which effortlessly copy precisely the same docs as core.
|
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 |
|
Reviewed: 1d584d8 |
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
left a comment
There was a problem hiding this comment.
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.
|
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 |
508d5cf to
aad9a24
Compare
|
Force push fixed the bissectability of every commit. EDIT: no, a90eb31 is broken. |
508d5cf to
150016f
Compare
|
150016f needs rebase |
bc23b4d to
a58753a
Compare
|
Force push fixes the other bad force pushes I made. Should be good to go. |
| } | ||
| } | ||
|
|
||
| impl GetBlockVerboseThree { |
There was a problem hiding this comment.
This doesn't seem right. It should do the parsing of each field in the into_model function like is done for VerboseTwo.
There was a problem hiding this comment.
Yes my mistake. Has been fixed.
| pub fn into_model( | ||
| self, | ||
| ) -> Result<model::GetDeploymentInfo, crate::v23::GetDeploymentInfoError> { | ||
| use crate::v23::GetDeploymentInfoError as E; |
There was a problem hiding this comment.
| use crate::v23::GetDeploymentInfoError as E; | |
| use GetDeploymentInfoError as E; |
Errors from previous versions should be reexported from the module, i.e. in this case types/src/v30/blockchain/mod.rs and then added to the use super at the top of the into.rs file.
There was a problem hiding this comment.
Everything used from previous versions is now exported from the module.
| //! | dumptxoutset | version + model | | | ||
| //! | getbestblockhash | version + model | | | ||
| //! | getblock | version + model | TODO: Fields have changed since v30 | | ||
| //! | getblock | version + model | Includes 'coinbase_tx' object | |
There was a problem hiding this comment.
| //! | getblock | version + model | Includes 'coinbase_tx' object | | |
| //! | getblock | version + model | Includes additional 'verbose' type | |
These comments in the table are saying there are additional types, i.e. more than just the GetBlock type, not what fields were changed in the version. I didn't check the rest of the RPCs in this table but any that have a verbose type should have this comment and all the other comments about what changed removed.
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.
|
Latest force push:
|
Drop the v30_and_below gates from tests covering RPCs unchanged in v31.
|
Clean up accidental garbage file |
Closes #599
Completes v31 support across the client, types, and integration tests. Makes v31 the default version.
Fixed:
inv_to_sendandlast_inv_sequence, and madestartingheightoptional now that it is only returned under-deprecatedrpc=startingheight.kernelandprivatebroadcastcategories.paytxfee.script_flagsfield.spendingtxandblockhashfields, plus added support for the newmempool_onlyandreturn_spending_txarguments.coinbase_txobject returned at verbosity 1, 2 and 3.Added:
getmempoolclusterandgetmempoolfeeratediagramRPCs, thechunk_weightandchunk_feefields ongetmempoolentry,getrawmempool,getmempoolancestorsandgetmempooldescendants, and thecluster_limitandoptimalfields ongetmempoolinfo.getprivatebroadcastinfoandabortprivatebroadcastRPCs.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.