39299263954b4d29f6bdcb177e9b2377d1ea92ed descriptors: add a method to get a PSBT's change outputs (Antoine Poinsot)
c6b554da93bdc90b0c2a6cb70d962fcaaf718aff descriptors: unit test we do take into account derivation steps before wildcard and multipath (Antoine Poinsot)
Pull request description:
Fixes#857.
ACKs for top commit:
darosior:
ACK 39299263954b4d29f6bdcb177e9b2377d1ea92ed -- re-applying Edouard's ACK. Only change is the addition of an `index()` method on the `ChangeOutput` enum.
Tree-SHA512: fceaa4e492684be08d45ab09d74345d5825b73d930f5caa4162862e5ff94f32cd5e9ab23b0730bc7ef44569c8e10cfed0f343b4843590a2163122d3402fc3734
13398982534d56a5723dfa86723c5917483c8653 commands: include missing amount in response (jp1ac4)
Pull request description:
This PR follows a discussion around https://github.com/wizardsardine/liana/pull/873#issuecomment-1886715468.
The GUI uses the `InsufficientFunds` error to get the missing amount when the user is creating a new spend, but it is not straightforward to extract this information in a general way from the RPC error (see https://github.com/wizardsardine/liana/issues/822#issuecomment-1836482355) and instead the spend module's `create_spend` is currently used (see https://github.com/wizardsardine/liana/pull/863).
With this PR, the missing amount will be included in the `createspend` response rather than as an error.
These changes are based on suggestions from @darosior and @edouardparis.
In a follow-up PR, the GUI should revert to using the `createspend` command to calculate the amount left to select.
ACKs for top commit:
darosior:
re-ACK 1339898
Tree-SHA512: bf702d6b355339e96e719c1d95824e7941ac4fbaece4ec4cccd00b56ea4683ce7fb0cefc43faa5731b57e7935ef99da3a2c73b84aaeb9fa5f67703c799be2196
The GUI uses the InsufficientFunds error to get the missing
amount when the user is creating a new spend.
It is not straightforward to extract this information in a
general way from the RPC error. Instead, this missing amount
will be included in the command response.
These changes are based on suggestions from darosior
and edouardparis.
0e99136404fcbbdee09eef4b116f17222cb2dee0 Clippification (Antoine Poinsot)
4949632fe6510151df9281b55a049169842ee5ef bitcoin: remove unused import (Antoine Poinsot)
ce026a62e6bf064cea249f391e4ab870f1cbcb61 Update rust-bitcoin and rust-miniscript (Antoine Poinsot)
2bce4c525d51b8ecbc923a43632ef8a724426453 Cargo: bump jsonrpc version to 0.17 (Antoine Poinsot)
65c9e389bb89197c2e9066b82789cec63b18d2d1 Cargo: bump rusqlite to 0.30 (Antoine Poinsot)
84e8a2ae8630789f5b8cc3796e0f1e4ff87614f2 Cargo.lock: update minor dependencies after MSRV bump (Antoine Poinsot)
92328fb8f6e34a383e876a79fad3fee4110c09a5 Bump MSRV for lianad to 1.63 (Antoine Poinsot)
Pull request description:
New years' cleanup!
Our MSRV was becoming too restrictive to keep being able to benefit from the latest releases of our dependencies. Strike a better balance between not requiring a recklessly new compiler and still being able to get upstream bug fixes.
From this update most of our dependencies to their latest point releases. Then upgrade rusqlite, jsonrpc and rust-[bitcoin, miniscript] to their latest major version. Note their is a ton of updates. I've done a minimal due diligence to check what was updated, to what version, what changed, but i can't realistically audit all the code changes this is effectively pulling. I think we need to look into `cargo-crev`.
Take the opportunity to apply some clippy cleanups, and bump the version we're using in CI.
See commit messages for details.
ACKs for top commit:
darosior:
reACK 0e99136404fcbbdee09eef4b116f17222cb2dee0 -- re-applying jp1ac4's ACK after addressing review
Tree-SHA512: f7940a90065fdf2e9c2013a882955f8f8febe537f8268224a321ae2df2e380c5a34c8c99891b25aa3ee14efe9c5eaaa7ee3ffa6ea163a749cec044db351dd408
The most notable change is rust-bitcoin's change in the serialization of
transaction with no input. It now accounts for the segwit marker even
for those. The base tx weight in coin selection had to be adapted to
handle this.
See https://gnusha.org/bitcoin-rust/2024-01-04.log for details.
This is a temporary partial fix for
https://github.com/bitcoindevkit/coin-select/issues/6 that should be
reverted once the upstream fix has been made.
When calculating the score, the excess should be added to changeless solutions
instead of those with change.
Given a solution has been found, this fix adds or removes the excess to its
incorrectly calculated score as required so that two changeless solutions can
be differentiated if one has higher excess (and therefore pays a higher fee).
Note that the `bound` function is also affected by this bug, which could mean
some branches are not considered when running BnB, but at least this fix will
mean the score for those solutions that are found is correct.
572567a7e4ceb838edcdf765af01b4aa69ac230d Expose ListCoinsEntry derivation_index and is_change (edouardparis)
3200c942fb048ea23f0bd663c53f756a646e848b lib: expose spend module (edouardparis)
Pull request description:
In order to externally use create_spend, the spend module must be exposed and the listcoinsentry must include the derivation_index and is_change fields.
ACKs for top commit:
darosior:
utACK 572567a7e4ceb838edcdf765af01b4aa69ac230d
Tree-SHA512: 536a379974f58929f0036340e9f888614094e367cecaa474afa5f7f60ad1be73aac9bf8c7fbb1e7fc5947fc70dc44667462655147b287a10210f99d75061419b
Allows for a clearer interface: you explicitly set whether you are
creating a replacement, and you don't have dangling 0s when you don't
which necessitate a comment to explain what they correspond to.
This is a first step toward removing the database accesses from the
spend PSBT creation helper. It now always take a change address, and
return whether it used it. If it did the caller retrieves the
information about the change address and if necessary bumps the next
derivation index to use.
This is a more general version of `create_spend` in that it allows
for a mixure of both mandatory and optional coin selection candidates
and has a `min_fee` parameter.
Another difference is that it takes destination addresses that have
been checked for the network and amounts as `Amount`.
`create_spend` has been updated to call `create_spend_internal`.
We leverage the change logic for this. By making it possible to set the
change address to an external address, one can send all the value from
the inputs to this address.