Our bitcoind watchonly wallet could, maybe, have other descriptors that
were imported. Sounds pretty unlikely since we use a dedicated wallet
but hey.
More importantly, we'll need to know the parent descriptor of the coin
in order to recognize it as newly received or change.
49ccc28ca7b0ee6e266d79ace67ff35c3d50905c Cargo: update most dependencies to the latest version (Antoine Poinsot)
a4bdb1efb79b8b87ba6131dea96798766e1fbcf5 tree wide: upgrade to Miniscript 8.0.0 (Antoine Poinsot)
d432745da583e2c38e67cae540b9417d76867bfa Cargo: don't require the 'compiler' feature from miniscript (Antoine Poinsot)
f7ca86191a6972bb6a8e3d78261159648db4ca23 ci: temporary disable 1.48 build on macOS (Antoine Poinsot)
f3e93df80c5f400e0b8f83c4862f0ff4b9f0f367 qa: add missing sighash type to dummy signatures in test_update_spend (Antoine Poinsot)
Pull request description:
Took the opportunity to update some dependencies, too.
ACKs for top commit:
darosior:
ACK 49ccc28ca7b0ee6e266d79ace67ff35c3d50905c
Tree-SHA512: babd0ac6af752e4671b1221f63bcc85cf9f1029162893c71ba991b2da0c16bf02e70bf061969b1a058d7c22d57061d99a82d4ed8564787a38f8a35a784d21812
This also updates the indirect rust-bitcoin dependency to 0.29.
Major changes are in the descriptors management:
- The rust-miniscript descriptors don't support raw hashes
within the pk_h() fragments, so we don't need all the boutique
management for this.
- The key translator API changed.
- We now take a u16 for the timelock instead of our previous
checks. This was inspired by the new rust-bitcoin Sequence
type.
- We now take a path instead of just a derivation index in
DerivedKey. We might use paths after all...
As for rust-bitcoin it's just a few nits:
- No more 'global' field on PSBTs (yay)
- Couple more trait derivation on types
- Some APIs were renamed.
b89401e5835b94f7e5341028357b11db69f8e37d qa: remove an unused variable in test_update_spend (Antoine Poinsot)
af9f0aeaed0f5607db94348c136325cf5fe9e387 qa: replace our PSBT implementation with a tweaked version of Bitcoin Core's (Antoine Poinsot)
eff39ee35a4b4d9133586ab5200689da40ef254f rpc: a new 'broadcastspend' command (Antoine Poinsot)
37ee93a1e6ddd5089c1cc3d2cfa6f263b691cf32 commands: a new command for broadcasting a Spend transaction (Antoine Poinsot)
b14bc602d45cac8191059d8ed6a5391ca7cfc68f bitcoin: interface for broadcasting a transaction (Antoine Poinsot)
Pull request description:
This implements a new command to broadcast an existing Spend transaction.
Fixes#58.
Fixes#66.
ACKs for top commit:
darosior:
ACK b89401e5835b94f7e5341028357b11db69f8e37d
Tree-SHA512: 299f7ba1df48ff2bbda68055df885474f5ca2b8336c46403d5f0bdfc30ec66d52653615780c187c8cab23b756fd9dad97f02c7ac20c71d833c54183d3c2e5f0a
This replaces our existing implementation of PSBTs with a more
straightforward one, adapted from the Bitcoin Core functional tests
framework. This fixes a few flakes that occured because the previous
implementation could produce invalid PSBTs.
The Bitcoin Core implementation is pretty low level and was adapted to
treat mappings as such (the value in the PSBTMap can itself be a
mapping, like for partial signatures or BIP32 derivation paths).
The rest of the diff is adapting the users of PSBT to use the new
implementation and the clearly superior interface (yay!).
e75637d3629df901b1aa453b131c1c780bfd8724 jsonrpc: fixup two typos in error messages (Antoine Poinsot)
a9b0e5e559b0ddddbd8e612771a95182f131e0f0 qa: functional tests for block chain reorganization (Antoine Poinsot)
e88bbbe65b34cf7af645fc3f07a90266d4a66792 poller: block chain reorganization handling (Antoine Poinsot)
d6f24e1c6a20d961128aa9c95367bd62aa8cb229 bitcoind: don't return spent coins with unfetchable spending tx as spent (Antoine Poinsot)
99ab0d7add5f9f3f924a6bd61263135c09e2a4cc commands: add a 'spend_info' field to the 'listcoins' entries (Antoine Poinsot)
57add1d86bb734b0f5291b2f266ef5652c93bc8d commands: return the DB's block height in 'getinfo' (Antoine Poinsot)
92f7ef12251309a30d100108ad82cd6790b5f4ac commands: make listcoins return all coins by default (Antoine Poinsot)
e9e4acd69de55e0c32c7e275e3b5318b5e161c46 db: database interface to rollback to a previous best block (Antoine Poinsot)
972c8dac86976723f4c417142999d4850c2fb9b6 db: require the spend block height from the DB interface (Antoine Poinsot)
6038843d33621c098d958d343c8b6d038922f72f database: rename coins' spent_at in spend_block_time (Antoine Poinsot)
cce227f80fbcbb32c5fca6fe78142131d7f35a53 bitcoin: interface to get the common block in our and the backend's chains (Antoine Poinsot)
Pull request description:
This finally implements our reorganization handling. Like in revaultd, upon noticing a tip change that indicates a reorg happened in our Bitcoin backend we rollback our state to the common ancestor between our state and the new chain, then start rescanning from there. The logic is much more straightforward than in revaultd though, as there is no presigned transactions to care about.
The PR grew a bit large as this needed a bit of preparatory work in order to be reasonably tested (and i noticed a few bugs and cleanups that slipped through review in #29). Please let me know if reviewers prefer that i split the prep work on the commands in another PR.
Fixes#15.
ACKs for top commit:
darosior:
ACK e75637d3629df901b1aa453b131c1c780bfd8724
Tree-SHA512: 1ebb2a3e10b462b739e1d5cb831de946177436c8fad4dcb20eb575fd0f58bef98a86e25c5fe0ed07d946975f982a420940607a69e74f24a02ef16271c92eceba
Hence add a 'spend_block_height' field to the 'coin' column in the
SQLite implementation. This also contains a couple cleanups, as well as
a fix (we were still checking if the blockheight was > 1).
7e911b8bb7ccca866db2afadb357615d3712a4cb ci: add Clippy check for both the daemon and the GUI (Antoine Poinsot)
6871407b1a2514c8c3b259a88cd5c267b206761e gui: clippification (Antoine Poinsot)
8b4866158bc2097a14857194d38bfb058678a55b daemon: clippification (Antoine Poinsot)
Pull request description:
This fixes *all* clippy warning from the whole repository. Some of them are... Well very opinionated to say the least. But to avoid bikeshedding i just applied all of them. Let's start fresh!
@edouardparis can you skim through the clippy fixes in the GUI folder? I checked the daemon one already.
Fixes#10.
ACKs for top commit:
edouardparis:
ACK 7e911b8bb7ccca866db2afadb357615d3712a4cb
Tree-SHA512: acebc86425039511d090b58139e12c149463d7a288d0d2aed3ba75d303aa2034db65f39f7e00436d556e86aa382686acab6699e65afe10ea31238c0a48a0635c
172cda19a0a72b77e3832f2e29ed7ff6f8062c44 bitcoin: avoid an unnecessary large clone() (Antoine Poinsot)
7513bcbf09f13f1625b989d52c52087048d90a73 bitcoind: use and_then instead of map().flatten() (Antoine Poinsot)
51f11a9e2f51945c7ec1f59a9acfd43d2f3977d3 looper: cleanup the check for spending coins' confirmation (Antoine Poinsot)
c9b6c6dedbc1e28b05543191238d0a81a92ba238 db: re-rename list_unspent_coins into unspent_coins (Antoine Poinsot)
3534e35b8721c5026b27d4d3c07b87dc6e4fa3dd bitcoin: remove erroneous block height check (Antoine Poinsot)
bb9897bdbb9926f6c3f8d9fb95339e45546372e2 Update coin txid if conflicting tx was confirmed (edouard)
3cf6bcbb98fc0034bc46ed58564e8aa4a1b6ffa6 add spent_coins to bitcoind poller (edouard)
94ee94edbdcdd917df131ad87893406f5f8597a2 Add blocktime and spent_at to coins table (edouard)
Pull request description:
Add two new columns:
- `blocktime`: timestamp of the block containing the transaction funding the coin.
- `spent_at`: timestamp of the block containing the transaction spending the coin.
Update the coin `spent_at` when the spend transaction is confirmed
ACKs for top commit:
darosior:
ACK 172cda19a0a72b77e3832f2e29ed7ff6f8062c44
Tree-SHA512: 4f12dd273784c1e8fab7f6427800fd10e6404d47e07e2293106d4454165dffb856cd65c5f4e4537867be403bd1790ce363968bfb94fec58ab02af3624ed68f22
c73e8a42dd050c1e24daf295c666f6aa625f3bee commands: add a new 'delspendtx' command (Antoine Poinsot)
d5bd10add8270c1e0aae1855e6f8a96649323e24 commands: add a change_index field to listspendtxs entries (Antoine Poinsot)
c6e004806aecef54c640119439406b5308fbacd0 commands: add a 'list_spend' command (and 'listspendtxs' RPC) (Antoine Poinsot)
Pull request description:
Based on #27 this implements listing and deletion of Spend transaction from database. The API was based off revaultd's one and @edouardparis' suggestions in #1. We could be smarter in various places but at the moment we KISS.
ACKs for top commit:
darosior:
ACK c73e8a42dd050c1e24daf295c666f6aa625f3bee
Tree-SHA512: d4a13b9cbc9a6d48f698ba2f113c5de116b17cc51ed1f8dba578c041d9a70249699627729562ea199b32db6aaa9d2eb973d2b890f35a5e398e9c34940701ea86
3dfc7261db33a4db85772dfa9db5f61f8d8952e2 jsonrpc: a new 'updatespend' RPC (Antoine Poinsot)
cf45ba0fa5ead02997f1ffe7fea4faf83894ec8d commands: add a new 'update_spend' command (Antoine Poinsot)
bafcadf39870c02b89a9a4627a6918fce6c54f30 db: interface to upsert a Spend PSBT and query it by txid (Antoine Poinsot)
7d015bcf435897fa6e129b931fd2bea742ff7bc5 jsonrpc: add a 'createspend' RPC command (Antoine Poinsot)
7468a7fcfb37736c4585d16c091fb5db68bf50cc qa: add PSBT and transaction serialization to the test framework (Antoine Poinsot)
09f59c417ba04a153887a7cdf1e284703c9647aa qa: fix the UDS class' forwarding method calls as JSONRPC calls (Antoine Poinsot)
9afd44061e12c4b50720571d7e6aa0c260e725eb commands: add a new create_spend command (Antoine Poinsot)
12188f0c52d5ab141c1dcea194851ba01c04a57d descriptors: add more utilities to the derived descriptor type (Antoine Poinsot)
46320d5fc09371d1657044fd1a8507e919bcaff4 db: an interface to query coins by their outpoints (Antoine Poinsot)
Pull request description:
This implements two new commands to create and store a Spend transaction PSBT. We'll need a `listspendtxs` and `delspendtx` eventually as in `revaultd`.
This has poor change management (address reuse for simplicity). I was thinking of using odd/even indexes to differentiate receive/change addresses before we have [multi-path descriptors](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-July/020791.html). Now i wonder if it makes sense at all to implement this odd/even thing and just stick with address reuse before multi-paths descriptors. Nobody is supposed to use that anyways.
ACKs for top commit:
darosior:
ACK 3dfc7261db33a4db85772dfa9db5f61f8d8952e2
Tree-SHA512: 7f148c4d0d9ff8054c6405ca3031c2629c79917cdbf0134949ce7e066fa5aa157eb5bbe823d56a165a14c946d72c615d7dafa920899ba21d8471cc935c14790b
24cf9645e0897ab880949813daceac07ddb67234 ci: add a Cirrus configuration for the functional tests (Antoine Poinsot)
Pull request description:
Taken and adapted from revaultd.
Now that 24.0rc1 of Bitcoin Core is released we can actually have a CI for functional tests.
Fixes#14.
ACKs for top commit:
darosior:
ACK 24cf9645e0897ab880949813daceac07ddb67234
Tree-SHA512: d1157fc6caf507c6507a2c73df02b097c9e2f1b8ecb2330f8b2f65ffe8a368e7d6265a9d0538c5c9ed3623df6fd03f49dff259bdd0019784008106f392e0ab0b