Replace bitcoind with corepc_node#1041
Conversation
dad6c92 to
6ae837a
Compare
Pull Request Test Coverage Report for Build 17503708210Details
💛 - Coveralls |
6ae837a to
c95fccc
Compare
bitcoind is no longer maintained and is incompatible with newer versions of Bitcoin Core. corepc-node is the "official" successor (see deprecation notice on https://docs.rs/bitcoind/latest/bitcoind/). However, the the latest tagged release for corepc_node as of writing (0.8.0) contains several bugs when deserializing the [testmempoolaccept](rust-bitcoin/corepc#327), [walletprocesspsbt](rust-bitcoin/corepc#340), and [finalizepsbt](rust-bitcoin/corepc#326) RPC responses. The linked PRs fixed those issues, but haven't been included in a release yet. For now we can point to a specific git rev from https://github.com/rust-bitcoin/corepc to make those fixes available.
c95fccc to
117732d
Compare
6daf7af to
1e97522
Compare
1e97522 to
ddc5264
Compare
arminsabouri
left a comment
There was a problem hiding this comment.
utACK ddc5264
My only suggestion would be to replace the hardcoded u64 expecteded fee components with weight consts. That can be a left as a follow up or done in this PR. Shouldn't be a blocker.
| payjoin = { path = "payjoin" } | ||
| payjoin-directory = { path = "payjoin-directory" } | ||
| payjoin-test-utils = { path = "payjoin-test-utils" } | ||
| # TODO: Remove these patches once a new version (>0.8.0) is released to crates.io |
There was a problem hiding this comment.
Just a reminder to self to create an issue for a follow up
payjoin/tests/integration.rs
Outdated
| do_v1_to_v1(sender, receiver, true) | ||
| // tx_header_vbytes + inputs_vb + outputs_vb - 1 vb saved from signature grinding, | ||
| // at 1 sat/vb | ||
| let expected_fee = Amount::from_sat(10 + (148 * 2) + (31 * 2) - 1); |
There was a problem hiding this comment.
These are a bit hard to read and understand. Would bitcoin::Weight consts help?
Psuedocode:
let weight = Weight::new(NON_SEGWIT_TX_HEADER + (LEGACY_INPUT_WEIGHT * 2) + (P2WPKH_OUTPUT_WEIGHT * 2) - SIG_GRIDING_WEIGHT_SAVINGS))
let expected_fee = Amount::from(to_vsize(weight) * FeeRate::from_sat_vb(1))ddc5264 to
6486282
Compare
|
I had considered the const approach and decided it would be a lot of boilerplate just for tests, but it's actually not that bad and I agree it's more readable this way. Also, using |
Instead of dynamically calculating expected fees with weight predictions, hardcode the expected values and assert that the resulting fees match.
Now that we support later versions of bitcoin core, we can enable the taproot test.
6486282 to
9675c55
Compare
arminsabouri
left a comment
There was a problem hiding this comment.
re-ACK
Thanks for making those changes
The first commit addresses #369 so we can include taproot integration tests ahead of 1.0. The second commit simplifies the fee calculations in the integration tests to simply hardcode expected fees and match those against the actual PSBT fee. Finally, the third commit enables the taproot test with the proper expected fee.
I used Claude Code to troubleshoot some errors and ideate, but rawdogged the actual code changes.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.