1332 Commits

Author SHA1 Message Date
edouardparis
683a500dd0
Merge #879: fix bitbox unsupported status when no wallet yet
1fa414be75cc99b4d95d6a7f3048cbfe62bdeb9b fix bitbox unsupported status when no wallet yet (edouardparis)

Pull request description:

  During the install process, no wallet yet is created and bitbox should not be marked as unsupported if
  its fingerprint is not in any descriptor.

ACKs for top commit:
  edouardparis:
    Self-ACK 1fa414be75cc99b4d95d6a7f3048cbfe62bdeb9b

Tree-SHA512: 6f6287bf4e001253c369b282ae9ef3eec7163fdd45b09022e77e61c2e08ddf656c60414239a69fd466448132bc837655fbe68b9cebc6d74fa5524f0d8b4adc7c
2023-12-14 14:11:15 +01:00
edouardparis
1fa414be75 fix bitbox unsupported status when no wallet yet
During the install process, no wallet yet is created
and bitbox should not be marked as unsupported if
its fingerprint is not in any descriptor.
2023-12-14 14:00:41 +01:00
Antoine Poinsot
b9cf62d71b
Merge #871: Prepare v4 release (GUI version)
dc300d3e66b8eba4eff2be9234a7bcb7b80f86ea gui: upgrade to latest Liana master (Antoine Poinsot)
56134b9f54a238a15428580e9ddb28122e23a4b1 gui: bump version to 4.0 (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    self-ACK dc300d3e66b8eba4eff2be9234a7bcb7b80f86ea

Tree-SHA512: 65ae761d69e88595929a8003205039422969e98d293b54e25f521b8b13e48b6433388317284d7d314e444588447b0075b18c80fed26c4670494cada17ca5442e
2023-12-12 18:35:14 +01:00
Antoine Poinsot
dc300d3e66
gui: upgrade to latest Liana master 2023-12-12 18:34:17 +01:00
Antoine Poinsot
56134b9f54
gui: bump version to 4.0 2023-12-12 18:33:50 +01:00
Antoine Poinsot
87d1c55d2e
Merge #870: Prepare v4 release
6625e67eed37ba385223dab6256478c312a190dc CHANGELOG: release notes for v4 (Antoine Poinsot)
35e50b4f383652b3cc7929a93e2dd5737fa74118 Bump lianad version to 4.0 (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    self-ACK 6625e67eed37ba385223dab6256478c312a190dc

Tree-SHA512: 2fd3492578ab1bd92c9249b1a4f5bb6134fac6b86febc1bffb33edc184bcbd30aad8554d5e3cb3bb5640ffe8b51c78d7839e1913c126edc5d6de0043c0d54a51
2023-12-12 18:32:52 +01:00
Antoine Poinsot
e79897892f
Merge #867: spend: a temporary partial fix for LowestFee
5f534eb988b903c28b8c2edb1db9a6389aadfdc0 spend: a temporary partial fix for `LowestFee` (jp1ac4)

Pull request description:

  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.

  The new functional test included here fails without this fix.

ACKs for top commit:
  darosior:
    ACK 5f534eb988b903c28b8c2edb1db9a6389aadfdc0

Tree-SHA512: f3a0e67434cad005389a938c0833394ff2c242d262f1ed1e6da9d1ce403af221bbce265a6fe67ad72f8fa8b461530faac1387c980f7f539cbb187603371c58d7
2023-12-12 18:32:04 +01:00
Antoine Poinsot
bf7f34feeb
Merge #869: gui: set max feerate in RBF modal
dfc4342d44cc2a3bcc080050fa636c5db78a2768 gui: set max feerate in RBF modal (jp1ac4)

Pull request description:

  This applies a similar change to feerate form validation as in #863 to ensure value is not too high.

  ![image](https://github.com/wizardsardine/liana/assets/121959000/caa31a99-8bc7-43bb-a2c2-a9d41d752f50)

ACKs for top commit:
  edouardparis:
    utACK dfc4342d44cc2a3bcc080050fa636c5db78a2768

Tree-SHA512: 7f1fa5eb71ea2c5bc6b2c28bd79ba39e3be4b39fcade89e1978441937cbb75a9de8c52ea397fc0c7ef9ef3858995bca69a077b9c3625bb027d39e3d57bf3fa7f
2023-12-12 16:04:08 +01:00
Antoine Poinsot
6625e67eed
CHANGELOG: release notes for v4 2023-12-12 15:42:15 +01:00
jp1ac4
5f534eb988
spend: a temporary partial fix for LowestFee
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.
2023-12-12 14:31:36 +00:00
Antoine Poinsot
35e50b4f38
Bump lianad version to 4.0 2023-12-12 15:10:50 +01:00
jp1ac4
dfc4342d44
gui: set max feerate in RBF modal 2023-12-12 13:51:36 +00:00
Antoine Poinsot
0346b7a11d
Merge #863: Use create_spend to calculate amount left to select and coin selection
a7324681e1072e4b53cd932cb49d462e9cc35956 spend: check max feerate (edouardparis)
4ccecd1cdfbd58bcbf86df82aa4c0bcc4fc0678e Use create_spend to calculate amount left to select (edouardparis)

Pull request description:

  Fixes #822. based on #865

ACKs for top commit:
  jp1ac4:
    ACK a7324681e1.

Tree-SHA512: aa2728218d9ccf7b6511f881d88b262522705b4162b5b4235560626ee8b5b8c6d57e743ebfaf85dc633d6e3d2380badfe354a6dc4d19b89d3f380c63e123704e
2023-12-12 14:20:55 +01:00
edouardparis
a7324681e1 spend: check max feerate 2023-12-12 10:07:43 +01:00
edouardparis
4ccecd1cdf Use create_spend to calculate amount left to select
close #822
2023-12-12 10:07:43 +01:00
Antoine Poinsot
3e0f82a71e
Merge #864: gui: add option to delete wallet
279c1c75a1dfe6617798b59cbe3932c803aeb90f gui: add option to delete wallet (jp1ac4)

Pull request description:

  This is to resolve #543.

  I've used a trash icon instead of a cross, but can change it to a cross if preferred.

ACKs for top commit:
  edouardparis:
    ACK 279c1c75a1dfe6617798b59cbe3932c803aeb90f

Tree-SHA512: d6bdbf7894726be5e1eb0b6d62d3689d1828222deba3ae84814396ae7e2b1aa144ff12908ecc1d8e1f26fc3cc29e0d137200d3039eeb870226feabb7a8aec428
2023-12-11 16:55:40 +01:00
jp1ac4
279c1c75a1
gui: add option to delete wallet 2023-12-11 14:57:21 +00:00
Antoine Poinsot
23e834a978
Merge #865: Expose spend module and coins fields
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
2023-12-11 15:23:35 +01:00
edouardparis
572567a7e4 Expose ListCoinsEntry derivation_index and is_change 2023-12-11 13:35:30 +01:00
edouardparis
3200c942fb lib: expose spend module 2023-12-11 11:52:00 +01:00
Antoine Poinsot
fe14cbec58
Merge #856: spend: Scale down the number of BnB rounds in debug mode and with a high number of candidates
c002ab95799750c1957d9172d9e255a2f3511fe4 spend: scale down the number of BnB when not compiling with optimizations (Antoine Poinsot)
f18086c152ffa033def8cbed52895fd1d99ffc6d spend: scale down the number of BnB rounds as number of candidates increases (Antoine Poinsot)

Pull request description:

  Based on #842.

  Performing BnB with a large number of candidates can be computation expensive. Especially in debug mode. It can make the software lag in situations where it's called repeatedly.
  Reasonably scale down the number of rounds performed depending on the number of candidates and whether optimizations are enabled.

  Fixes #846

ACKs for top commit:
  jp1ac4:
    ACK c002ab9579.

Tree-SHA512: 83de99d54c427de86dad779549280b3316b0e72a9e3a5cb4af22d44eefa9832408b974f2a2aca0847b13ad5899e324ad43f32e99eb4efb69716c827f3ab47aaf
2023-12-08 17:09:06 +01:00
Antoine Poinsot
c002ab9579
spend: scale down the number of BnB when not compiling with optimizations 2023-12-08 15:10:44 +01:00
Antoine Poinsot
f18086c152
spend: scale down the number of BnB rounds as number of candidates increases 2023-12-08 15:10:43 +01:00
Antoine Poinsot
b5a3e78b38
Merge #842: Standalone module for creating a spend transaction
0f6941150cdf98da92c40f85526735ec10e9daf1 spend: a nicer interface for providing fee informations (Antoine Poinsot)
990b153107dfae779b054d7ae52bcad574982f5f commands: don't query unconfirmed coins when creating recovery tx (Antoine Poinsot)
c63a120794af593704cede911f666467d3ce4c1e spend: don't use database's Coin type (Antoine Poinsot)
08ce0ad1d7ac7b4d519ca98a44ecaeb45c7d063c spend: update comment about create_spend behaviour (Antoine Poinsot)
0c395bb63c5e7c7f4ad53ae25743efa0f6afb4c7 spend: document the create_spend function (Antoine Poinsot)
f3113ba0d20ebed69a21ea50ed3adfe7f7c82a7d commands: remove redundant output value check (Antoine Poinsot)
5894e788b87f7335fb7715036e55add4202a83a8 spend: move tx size calc helper back to command module (Antoine Poinsot)
6ddda6137cd1a19e446a9a81623290de8ff0d5b8 spend: make coin selection helpers private (Antoine Poinsot)
33be1ff18bf3eeda772efaf29439340b30b5c5e9 commands: make create_recovery use the create_spend helper (Antoine Poinsot)
0523f0047fd463945cdb2147c2dc13c8538bb0d3 commands: update next deriv index for any spend output address (Antoine Poinsot)
5d5015553239fb19de0890a6956c8e22ebfec0f4 spend: avoid direct access to our Bitcoin backend (Antoine Poinsot)
7c238124bebf38fc93994b183de90c2baf0cb0c3 spend: don't access the database in the PSBT creation function (Antoine Poinsot)
22f97e11b7ab772d30ca9ccd992c9092559ab493 spend: let caller update next derivation index (Antoine Poinsot)
9fdb75cf883c53af97fbbe40a4d7f727611aebac commands: split up spend transaction creation into its own module (Antoine Poinsot)

Pull request description:

  Based on top of #816, this introduces a new `spend` module with a helper to create a transaction spending coins from the wallet. It can be leveraged to create regular or recovery transactions, and also replacement for them. All the data structures used by the exposed spend creation function are contained with this module, in order to make it usable without a `lianad`-specific database and Bitcoin interface.

  This PR is structured in an incremental fashion. First we pull out the `create_spend_internal` method introduced in #816 into a standalone `spend` module, then we incrementally remove the cruft and the ties from the spend module to the other components.

ACKs for top commit:
  darosior:
    self-ACK 0f6941150cdf98da92c40f85526735ec10e9daf1

Tree-SHA512: a75afeb2c1f58e685c6b6e0d88c53e158ad850266261ef93b20065f6b02ad9e817cefcef4a89dc038e4db81549efc6d5393e4c59b4f7d86b69dc2168b9d818d3
2023-12-08 15:10:14 +01:00
Antoine Poinsot
0f6941150c
spend: a nicer interface for providing fee informations
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.
2023-12-08 15:08:22 +01:00
Antoine Poinsot
990b153107
commands: don't query unconfirmed coins when creating recovery tx
They would be discarded immediately in the filter below.
2023-12-08 15:07:33 +01:00
Antoine Poinsot
c63a120794
spend: don't use database's Coin type
We could use a trait but instead there is just a couple fields we need so simply copy them over.
2023-12-08 15:07:33 +01:00
Antoine Poinsot
08ce0ad1d7
spend: update comment about create_spend behaviour 2023-12-08 15:07:32 +01:00
Antoine Poinsot
0c395bb63c
spend: document the create_spend function 2023-12-08 15:07:29 +01:00
Antoine Poinsot
f3113ba0d2
commands: remove redundant output value check
It's already performed (twice) in spend::create_psbt()
2023-12-08 15:03:28 +01:00
Antoine Poinsot
5894e788b8
spend: move tx size calc helper back to command module
It's not needed in spend anymore
2023-12-08 15:03:27 +01:00
Antoine Poinsot
6ddda6137c
spend: make coin selection helpers private
They aren't externally called anymore
2023-12-08 15:03:27 +01:00
Antoine Poinsot
33be1ff18b
commands: make create_recovery use the create_spend helper
Now that we have sweep capability no need to duplicate half the logic, just reuse the helper.
2023-12-08 15:03:26 +01:00
Antoine Poinsot
0523f0047f
commands: update next deriv index for any spend output address
It's basically free to do now, so we might as well do it.
2023-12-08 15:03:26 +01:00
Antoine Poinsot
5d50155532
spend: avoid direct access to our Bitcoin backend
We introduce a trait to get the wallet transaction correponding to the
transaction input in order to encapsulate the spend module.
2023-12-08 15:03:24 +01:00
Antoine Poinsot
102ae705c9
Merge #859: gui: add env var to override log_level
0741801b0fe132925e875c8cef5c797dbf42ea0e gui: add env var to override log_level (edouardparis)

Pull request description:

  close #782

ACKs for top commit:
  darosior:
    tested ACK 0741801b0fe132925e875c8cef5c797dbf42ea0e

Tree-SHA512: 22f0082ad25164c1d0aa9b37b93a3819df65fcd4f2fb97f0f141a7826f50c3454cbd69500a5447e11b081cb952f931fd0c31d4c96979efb62a3845c3d23a30e9
2023-12-08 15:01:39 +01:00
edouardparis
0741801b0f gui: add env var to override log_level
close #782
2023-12-08 14:18:05 +01:00
Antoine Poinsot
321104531b
Merge #852: gui: enable use of RBF on unconfirmed transactions
71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e gui: enable use of RBF on pending transactions (jp1ac4)
ce50dd8c41522a2f45c5bc79505762857c8f8bcd gui: optionally filter spend transactions by txids (jp1ac4)
4846a0b05a9ea32d1fd3bb7852b3b74cee99daeb gui: update liana dependency (jp1ac4)

Pull request description:

  This is to resolve #43.

  When viewing an unconfirmed transaction, a user can now either bump its fee or cancel it. This will generate a new PSBT that the user can jump to in order to sign and broadcast it.

  I haven't added any comparison between the previous and replacement inputs as suggested in https://github.com/wizardsardine/liana/issues/43#issuecomment-1825623520. I think that would be a bigger change and might be better as a follow-up.

  I decided not to add "Unconfirmed" on the transaction screen as suggested in https://github.com/wizardsardine/liana/issues/43#issuecomment-1831763013 as I thought it might be better as a separate PR.

  I haven't yet added the RBF buttons to the home screen, but that could also be done as a follow-up :)

  In a separate commit, I pass `None` to `create_spend` following #821.

ACKs for top commit:
  darosior:
    tested-but-not-review ACK 71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e
  edouardparis:
    ACK 71fd9c4900bb1bf6f263867eb85b6e81da6c4b1e

Tree-SHA512: c3ddbb85ad008e9e450b79ba77816ad9065f1eec675913f20463c4271ff017d5cb9ff0a0fca9ed919c97b3f6bb2b806344dc4ff062f5393ad5ac85c8c039ab83
2023-12-08 11:41:43 +01:00
jp1ac4
71fd9c4900
gui: enable use of RBF on pending transactions 2023-12-08 00:39:14 +00:00
jp1ac4
ce50dd8c41
gui: optionally filter spend transactions by txids 2023-12-07 23:28:47 +00:00
jp1ac4
4846a0b05a
gui: update liana dependency
This is needed to use the `rbfpsbt` command.

Now, `create_spend` has an additional parameter
for change address, which we leave as `None`.
2023-12-07 18:46:57 +00:00
Antoine Poinsot
6151c57af4
Merge #848: Grey out harware wallets when unrelated or do not support method
3372e2f1e0be711dac71becf57541e48309e93e4 gui: grey out hws with addr verif unimplemented (edouardparis)
0ef49ed3f716e57f4bcd9a3f95d9c48dbce488d3 gui: grey out unrelated hws (edouardparis)

Pull request description:

  close #830

ACKs for top commit:
  jp1ac4:
    ACK 3372e2f1e0.

Tree-SHA512: 8c8cf17b05d3920dfd32e558c3ee27b94c4b9f65e931734cfc62cb8479e986d60882796bbc48b0c5f0061cda689a3b837b6d6bb159738139fa7f30684fa956a2
2023-12-07 14:54:09 +01:00
edouardparis
3372e2f1e0 gui: grey out hws with addr verif unimplemented 2023-12-07 14:39:45 +01:00
Antoine Poinsot
483ac4798d
Merge #855: gui: upgrade managed bitcoind version to 26.0
7d993ac021d8f4e7dcb2f8500272dd2550cf6d03 gui: bump managed bitcoind version to 26.0 (jp1ac4)

Pull request description:

  This is to close #851.

ACKs for top commit:
  darosior:
    ACK 7d993ac021d8f4e7dcb2f8500272dd2550cf6d03

Tree-SHA512: 1e0c727557d4b3566f505689d1937b7a148240f937e4edc1b9ed12e983b3a1dc56f11e39fc8342b32c1d0580c970462b2bc62d4bdfea8748d63347da9cab0901
2023-12-07 14:35:20 +01:00
jp1ac4
7d993ac021
gui: bump managed bitcoind version to 26.0 2023-12-07 13:26:33 +00:00
Antoine Poinsot
7c238124be
spend: don't access the database in the PSBT creation function
Instead, pass the address details, if known, as a parameter.
2023-12-07 10:31:10 +01:00
Antoine Poinsot
22f97e11b7
spend: let caller update next derivation index
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.
2023-12-07 10:31:10 +01:00
Antoine Poinsot
9fdb75cf88
commands: split up spend transaction creation into its own module
This moves create_spend_internal in bulk. The interface is still inappropriate and will be adapted in the next commits.
2023-12-07 10:31:08 +01:00
Antoine Poinsot
870d4899b1
Merge #845: Cargo: use the published bdk_coin_select
36700c47596c396fe9b6cde432bd6c33961aceed Cargo: use the published bdk_coin_select (Antoine Poinsot)

Pull request description:

  Draft until https://github.com/bitcoindevkit/coin-select/pull/9 is published on crates.io.

ACKs for top commit:
  jp1ac4:
    ACK 36700c4759.

Tree-SHA512: 52caf8e79641e6f2bb0a58a75480866d5e99d9a6d9e220cd92b3de1c7f612166ee220c49f49c766271dac67c317c7b50a09763c4451988e2cfff517234833af7
2023-12-07 10:04:02 +01:00
Antoine Poinsot
f4d22a987e
Merge #816: commands: add rbfpsbt command
0ab00cd6580ddc1964f4f328a90ab9c5f3f87efa gui: keep conflicting PSBTs as Pending until confirmation (jp1ac4)
5391bfe04ccbe2103460cd195fe4ea3309507118 commands: add `rbfpsbt` command (jp1ac4)
d5f31674045155b6a9be7e08e4beab4c2187b573 commands: add `create_spend_internal` function (jp1ac4)
714fd5e142ffdf95d5ca96cd5a1d6edbc68239bb bitcoin: add `mempool_spenders` to Bitcoin interface (jp1ac4)
68b2503b12cececb1e3259d2d88a34e5191ec232 func tests: move function to utils (jp1ac4)
fdab722effa79c6063e5b40748409ac4048aa1b6 func tests: run black (jp1ac4)

Pull request description:

  This PR relates to #43 and #236.

  It adds a `rbfpsbt` command that generates a PSBT to replace an existing transaction using RBF. This replacement can either preserve non-change outputs and simply bump fees or remove non-change outputs and effectively cancel the transaction. The inputs and change output may need to be updated in accordance with the higher fee.

  I've also added a `getmempoolentry` call to the bitcoin interface that is used for checking information about descendant transactions.

  To facilitate development, I've made some temporary changes in the GUI so that replacement PSBTs can be signed and broadcast, but these changes might not be part of this PR in the end.

ACKs for top commit:
  darosior:
    ACK 0ab00cd6580ddc1964f4f328a90ab9c5f3f87efa

Tree-SHA512: a172ad895fac13be294451f2ffeccb91af521d58a3bc6d08e09688996f9a3e07a3e230091982ef5e92472d44db77b34f93b81d1111d2c570d9c5dd85b7c21f0f
2023-12-06 20:25:57 +01:00