190 Commits

Author SHA1 Message Date
Michael Mallan
4ce5ca4d80
qa: check psbt must be saved in db to use rbf 2025-01-29 15:45:20 +00:00
damuzhi0810
f12c65cdd2 chore: fix some comments
Signed-off-by: damuzhi0810 <rust@before.tech>
2025-01-23 22:05:18 +08:00
edouardparis
440efa7b61
Merge #1271: tests: add a note to README.md about running tests in parallel
ef5291d7e8ebfd4ab14a91197ef5d0bf275586f9 tests: add a note to README.md about running tests in parallel (pythcoiner)

Pull request description:

ACKs for top commit:
  edouardparis:
    ACK ef5291d7e8ebfd4ab14a91197ef5d0bf275586f9

Tree-SHA512: 23430e65e05c4b54a7a9eae2110a4e17c14952bcd727284805201deedd5eeee36b2a9ebc1a612624e8a2cff3e6943d31515008c65a0b5d4fbb3a34734a3b57dd
2025-01-23 12:34:33 +01:00
edouardparis
d0fefc37f4 Prepare v9 release 2025-01-07 11:22:24 +01:00
edouardparis
126fdb7bbe
Merge #1504: chore: fix some typos
96fd7b5ee35b715bde1b8a91b9f1defd5a3b888f chore: fix some typos (fudancoder)

Pull request description:

ACKs for top commit:
  jp1ac4:
    ACK 96fd7b5ee3.

Tree-SHA512: a42edeb6ca5610a0168efbea6b5678ac88a351e6b43d9137c2bee5134857b8419e5dedb23393577196b777547e8ece018e68c8796f61e8de03bc818e648766e2
2025-01-06 17:38:47 +01:00
Michael Mallan
6b914fd249
bitcoind: parse descriptor before comparing strings
Parsing the descriptor first will ensure a match is found
regardless of whether bitcoind uses `h` or `'`.
2024-12-30 17:12:28 +00:00
fudancoder
96fd7b5ee3 chore: fix some typos
Signed-off-by: fudancoder <fudancoder@icloud.com.>
2024-12-19 21:04:04 +08:00
Michael Mallan
091d7728ee
commands: use unconfirmed from self for coin selection
We previously used unconfirmed change as a best-guess way of
identifying those coins from self, but now we have the
`is_from_self` field we can use it directly and be sure we only
select coins that are fully under our control.
2024-12-16 10:24:19 +00:00
Michael Mallan
1c0338610f
commands: add is_from_self to listcoins response 2024-12-02 10:08:18 +00:00
edouardparis
c14c55beee remove daemonize from config 2024-11-18 18:36:23 +01:00
pythcoiner
5c088b2eb6 tests: notifyAll() is deprecated, replace w/ notify_all() 2024-11-18 11:35:12 +01:00
Michael Mallan
6e74a96e12
Revert "spend: add 10 sats to fee for 1 sat/vb txs"
This reverts commit 74a53baa39c409d8a39a27affc5ebac34128cb24.

I also removed the extra sats being added in the functional test.
2024-11-08 15:27:25 +00:00
Michael Mallan
cf88aca3ae
descriptors: fix satisfaction size for Taproot
This includes the sizes of the script and control block elements.
2024-11-08 15:27:23 +00:00
Michael Mallan
e9c6995706
qa: add threshold paramater for multisig descs 2024-11-08 15:26:36 +00:00
edouardparis
95e97bc7dc Bump liana version v8 2024-11-05 11:11:20 +01:00
Michael Mallan
0f9f1f352c
commands: return last poll timestamp from getinfo 2024-10-24 11:24:31 +01:00
Michael Mallan
c6add0aeb1
qa: add method to get lianad poll interval 2024-10-24 11:24:27 +01:00
edouardparis
aa1ca64816 Bump liana v7.0 2024-09-12 09:31:21 +02:00
Michael Mallan
74a53baa39
spend: add 10 sats to fee for 1 sat/vb txs
This is a quick change to prevent the fee being below the
min relay fee.
2024-09-11 15:30:32 +01:00
Antoine Poinsot
3d7b3e4473
qa: correct reorg_shit function to use given height
It was using the passed height for all other calculation, except for the
invalidation itself where it was using the wider-scope-initial-tip! This
is probably a mistake due to moving it to its own, inner, function.
2024-09-11 10:12:34 +02:00
Michael Mallan
537ebb2fb3
func test: check electrs has started 2024-09-10 14:19:48 +01:00
pythcoiner
ef5291d7e8 tests: add a note to README.md about running tests in parallel 2024-09-06 05:01:39 +02:00
Antoine Poinsot
8b76a6b977
Merge #1269: Couple fixes to the functional tests
7cce13656266d90431133ccb4de5ccf086f4aa82 qa: test proc stderr isn't None before closing it (Antoine Poinsot)
ba553e9ddb104af454d9eff9969c0e37a1f3061a qa: adapt bitcoind config to support 28.0 (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    ACK 7cce13656266d90431133ccb4de5ccf086f4aa82

Tree-SHA512: ff0a9addd6063cd31b8e7f76cbf2b7ed1f5e85c2d7192ed5e73bba1c81a3bb4e8740ff7c5242d054115e28e484c87f85cafcbbc4dcc4ecf24ff415a028e1b0b5
2024-09-05 17:10:30 +02:00
Michael Mallan
341f940664
func test: prevent disconnects when using mocktime
Thanks to pythcoiner for providing this fix.
2024-09-05 14:56:01 +01:00
Michael Mallan
b630d46770
func test: wait for block heights to match
This is copied from darosior's changes in
https://github.com/wizardsardine/liana/pull/1222#issuecomment-2324894986.
2024-09-05 14:56:00 +01:00
jp1ac4
371e31e3f3
func test: allow to run using electrs backend 2024-09-05 14:55:53 +01:00
jp1ac4
a85d4887e9
func test: allow for different bitcoin backends 2024-09-05 14:55:50 +01:00
jp1ac4
1b04b29491
func test: fix min rbf feerate
Here, the min RBF feerate is 1 more than that of the transaction
to be replaced.

The feerate of the transaction to be replaced may vary slightly
depending on the signature size and is calculated during the test.
As such, the min feerate should be set according to this
calculated value.
2024-09-05 14:55:48 +01:00
Antoine Poinsot
7cce136562
qa: test proc stderr isn't None before closing it 2024-09-05 14:32:03 +02:00
Antoine Poinsot
ba553e9ddb
qa: adapt bitcoind config to support 28.0
Got broken by bca346a970
2024-09-05 14:31:01 +02:00
Antoine Poinsot
26ade7ebdd
qa: pipe stderr to stdout, not PIPE
It turns out that setting both to PIPE would result in stderr not being
read for some reason. So follow
https://docs.python.org/3/library/subprocess.html and set stdout to PIPE
and stderr to STDOUT.

Tested with a process (electrs) which logs on stderr.
2024-09-04 11:22:51 +02:00
Antoine Poinsot
b2aeafab56
Merge #1186: Add minimum feerate to TooLowFeerate error message
8be0d9856b29eb30593ae7614fe74430ffd206d4 commands: add minimum feerate to TooLowFeerate error message (Aaron Carlucci)

Pull request description:

  This PR adds the minimum feerate value into the `TooLowFeerate` error message for additional context. Addresses the second bullet point in #853.

ACKs for top commit:
  jp1ac4:
    ACK 8be0d9856b29eb30593ae7614fe74430ffd206d4. Thanks!

Tree-SHA512: 3a0e9c69ddb40433faf1e58c16dfee0212641b34478eddeda99388ebf82e2fb466633ab8f79c9bb0bb784f4a46807aa0a5abd65b9d92506144b84addb01dfdd8
2024-07-29 13:53:27 +02:00
Antoine Poinsot
bb68fb5ec1
Merge #1092: spend: randomized anti-fee sniping
f2791744d8ad3068d12a39bb07f3745012785a5f spend: set locktime for anti-fee sniping (jp1ac4)

Pull request description:

  This is to resolve #44.

  In the first commit, I combine the destinations and change parameters in `spend::create_spend` in order to avoid "too many arguments" error when adding a new parameter. I think these two parameters combine naturally so that `destinations` includes both recipients and change address.

  The second commit sets locktime following the same approach as Bitcoin Core:
  - locktime is set to current tip height, but randomly (about 10% of cases) value is set up to 100 blocks earlier
  - if tip is more than 8 hours old, locktime is set to 0

  For randomness, I'm currently using the current time's milliseconds in order not to add another dependency, which I think is good enough for this use case.

  For consistency, I decided to use "locktime" everywhere instead of "lock time" or "lock-time".

ACKs for top commit:
  darosior:
    ACK f2791744d8ad3068d12a39bb07f3745012785a5f

Tree-SHA512: 69a57cf664e24b32a835c35eaf9016961b2d0f396891a826582044e6302b2ca04dcf5bf2617b5e18dcbfa25cc254a6e8025262718984095677c829ce051a66cc
2024-07-29 12:32:29 +02:00
Aaron Carlucci
8be0d9856b commands: add minimum feerate to TooLowFeerate error message 2024-07-10 14:47:10 +02:00
Antoine Poinsot
168112de10
Bump version to 6.0 2024-06-27 15:53:30 +02:00
jp1ac4
0eda557fdf
descriptors: improve satisfaction size estimate for primary path
Thanks to darosior for providing the changes to `max_sat_weight`
and the Taproot sanity checks test.
2024-06-20 17:09:38 +01:00
jp1ac4
f2791744d8
spend: set locktime for anti-fee sniping 2024-05-28 07:50:48 +01:00
jp1ac4
ed86696daf
tests: remove print statements 2024-03-28 12:38:09 +00:00
jp1ac4
5d6ca97e4c
spend: reword warning messages 2024-03-28 11:08:49 +00:00
jp1ac4
8078a2791a
tests: use function to calculate additional fee
This will reduce flakiness in case the ancestor size differs due
to changes in signature size.
2024-03-28 11:03:21 +00:00
jp1ac4
deb75884bf
tests: run black 2024-03-28 11:03:15 +00:00
Antoine Poinsot
6d498db5e5
Merge #1034: Prepare v5 release
2dc8cb0d422d2f601c8662df71651c596d15ae36 README: add Coldcard as supported signing device (Antoine Poinsot)
abf15fea3c15ca5f0005417a1490e057d40e6c6b CHANGELOG: release notes for v5 (Antoine Poinsot)
b5c2375d0bb6bef6cd2f0d7534c303fe71118105 doc: update the signing devices compatibility documentation (Antoine Poinsot)
d9337121abe486389514c7b2336e39d2a1f0c8de Bump Liana version (Antoine Poinsot)
de05460ad01145df9bbf63ec58932a72dd1a14d3 doc/BUILD.md: correct MSRV (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  darosior:
    self-ACK 2dc8cb0d422d2f601c8662df71651c596d15ae36 -- not code

Tree-SHA512: b84ea6dabf3ff41ac9b61c6ee8ef7cbbdb5942d13bff83b70e60c93e2f61a14db164b7987129cfde5fd59a667297e2832458f62f0e979d949667d0cc2c168f37
2024-03-25 16:33:51 +01:00
Antoine Poinsot
d9337121ab
Bump Liana version 2024-03-22 16:42:33 +01:00
jp1ac4
3a7c151674
database: allow for coinbase transactions to change addresses
`is_change` is `true` for a coin if its address is derived
from our change descriptor and could in principle be used for a
coinbase transaction.

The functional test was provided by darosior in a PR comment:
https://github.com/wizardsardine/liana/pull/1001#pullrequestreview-1948564150
2024-03-20 18:29:37 +00:00
Antoine Poinsot
4bb2372a63
qa: drop specific value assertions in coin selection test
They don't add much value and cause flakiness because the size might sometimes be lower than that due to low-R signature grinding.

Fixes #1000.
2024-03-13 19:21:54 +01:00
Antoine Poinsot
687a0c2816
qa: adapt hardcoded coin selection tests to Taproot 2024-03-13 19:21:53 +01:00
Antoine Poinsot
ecef6bff5e
qa: functional tests lianad using Taproot descriptors
We introduce Taproot support in the test framework through a global
toggle. A few modifications are made to some tests to adapt them under
Taproot (notably the hardcoded fees / amounts).

This is based on my introduction of a quick and dirty support for
TapMiniscript in my python-bip380 library:
https://github.com/darosior/python-bip380/pull/23. In addition to this i
didn't want to implement a signer in the Python test suite so here we
introduce a simple Rust program based on our "hot signer" which will
sign a PSBT with an xpriv provided through its stdin and output the
signed PSBT on its stdout. Eventually it would be nicer to have a Python
signer instead of having to call a program.

The whole test suite should pass under both Taproot and P2WSH. Only a
single test is skipped for now under Taproot since it needs a finalizer
in the test suite.

I also caught a bug in the RBF tests which i fixed in place.
2024-03-13 19:21:52 +01:00
Antoine Poinsot
8d33f49935
Merge #965: poller: unspend expired before new spend
cc1de1d6d6710f1426a957806661e7f3461a7cb5 poller: unspend coins before spending new (jp1ac4)
1e7653e08a3778446ff677bb147df68b734a31fd tests: add function to wait while condition holds (jp1ac4)

Pull request description:

  This change ensures that the spend txid of a coin is updated directly to another value in case a conflicting spend is detected.

  The previous order caused the spend txid to first be cleared, which would misleadingly make the coin appear as confirmed
  rather than spending.

  I've added a new utils function for the functional tests that is a slight generalisation of `wait_for` with an additional condition that must always be met while waiting.

  `wait_for` now calls this new function with the condition being one that is always true.

ACKs for top commit:
  darosior:
    ACK cc1de1d6d6710f1426a957806661e7f3461a7cb5

Tree-SHA512: e3f00804a63b0e94bc1b2cbee03cac63dd6e2555ca6d301589b356b2baf8e0cf27362e1dda44018d1d8282e300b187079fcf61f5d2754263b9e8b08cd34be06e
2024-03-12 08:47:41 +01:00
jp1ac4
cc1de1d6d6
poller: unspend coins before spending new
This change ensures that the spend txid of a coin is updated
directly to another value in case a conflicting spend is
detected.

The previous order caused the spend txid to first be cleared,
which would misleadingly make the coin appear as confirmed
rather than spending.
2024-03-11 15:41:17 +00:00
jp1ac4
1e7653e08a
tests: add function to wait while condition holds
This adds a new utils function that is a slight generalisation
of `wait_for` with an additional condition that must always be
met while waiting.

`wait_for` now calls this new function with the condition being
one that is always true.
2024-03-11 15:41:17 +00:00