Commit Graph

1304 Commits

Author SHA1 Message Date
C
ea250a4c3d Merge pull request #820 from crodas/feature/remove-on-conflict
Remove multiple ON CONFLICT from SQLite
2025-06-19 07:07:42 -03:00
Cesar Rodas
5ff30d879c Remove multiple ON CONFLICT from SQLite
Fixes #810
2025-06-19 08:51:11 +01:00
thesimplekid
1a4b21c9ce Merge pull request #824 from crodas/fix/sqlite-race-condition
Fix SQLite race condition
2025-06-19 08:48:31 +01:00
Cesar Rodas
a681c6e054 Fix SQLite race condition
Bug: https://github.com/crodas/cdk/actions/runs/15732950296/job/44339804072#step:5:1853

Reason: When melting in parallel, many update the melt status and attempt to
add proofs and they fail when adding the proof and the rollback code kicks in.
The loser process removes all the proofs, and the winner process has no proof
later on.

Fix: Modify `update_melt_quote_state` requirements and implementation to allow
only one winner.

This will be solved by design with a transaction writer trait
2025-06-18 16:20:24 -03:00
thesimplekid
37f9d9122b Merge pull request #822 from crodas/feature/sqlite-add-busy-timeout
Add 10 second busy timeout
2025-06-18 13:19:04 +01:00
Cesar Rodas
150f2596e7 Enhance add_proofs to fail with a custom error when the proof already exists 2025-06-17 17:49:31 -03:00
Cesar Rodas
7146cb8934 Fixed race condition
Bug: https://github.com/cashubtc/cdk/actions/runs/15683152414/job/44190084378?pr=822#step:5:19212

Reason: a race condition between removing proofs while melting and the quote states being updated.

Solution:

1. Error on duplicate proofs
2. Read quote when updating to avoid race conditions and rollbacks

Real solution: A transaction trait in the storage layer. That is coming next
2025-06-17 01:17:35 -03:00
Cesar Rodas
86eb7b8676 Use BEGIN IMMEDIATE to avoid SQLITE_BUSY_SNAPSHOT error
Context: https://stackoverflow.com/a/57717533
Error: https://github.com/cashubtc/cdk/actions/runs/15670089048/job/44140230127?pr=822#step:6:3586
2025-06-16 14:03:48 -03:00
Cesar Rodas
e465a87b92 Add more logs 2025-06-16 14:03:48 -03:00
Cesar Rodas
06ae9e42b3 Add 10 second busy timeout
Fixes #814
2025-06-16 14:03:48 -03:00
C
6aae5ab431 Merge pull request #821 from crodas/feature/move-info-logs-to-trace
Move some `info` tracing to `trace`
2025-06-16 14:03:13 -03:00
Cesar Rodas
c8c2370606 Move some info tracing to trace
Fixes #811
2025-06-16 11:09:50 -03:00
thesimplekid
8c211519bb Merge pull request #823 from thesimplekid/msrv_fix
fix: msrv of mintd pest
2025-06-16 15:05:19 +01:00
thesimplekid
b7591d5750 fix: msrv of mintd pest 2025-06-16 13:42:27 +01:00
thesimplekid
8c361e7d7a Merge pull request #817 from thesimplekid/fix_cli_send
fix: sqlite get_mints function
2025-06-15 16:41:20 +01:00
thesimplekid
5dc31a0240 Merge pull request #818 from thesimplekid/cli_version
chore: cdk-cli version
2025-06-15 11:16:08 +01:00
thesimplekid
56b0d087db chore: cdk-cli version 2025-06-15 11:02:46 +01:00
thesimplekid
073ac30127 fix: get mints command cdk-sqlite 2025-06-15 10:42:46 +01:00
thesimplekid
727602affe Merge pull request #815 from thesimplekid/fix_wallet_sig
fix: signatory is not required for wallet
2025-06-15 08:21:53 +01:00
thesimplekid
00791a1125 fix: signatory is not required for wallet 2025-06-15 07:34:03 +01:00
C
5a6b28816a Migrate from sqlx to rusqlite (#783)
* Migrate from `sqlx` to rusqlite

1. Add rusqlite with rusqlite with a working thread
2. Add wallet without a thread (synchronous)
3. Add custom migration

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-06-14 12:49:50 +01:00
thesimplekid
a335b269b7 Update ln-bits to support v1 api (#802)
* feat: v1 websockets

* chore: update lnbits dep
2025-06-12 08:40:49 +01:00
thesimplekid
edae2abaf2 Merge pull request #807 from crodas/feature/rwlock-instead-of-mutex
Use `RwLock` instead of `Mutex`.
2025-06-12 08:40:10 +01:00
Cesar Rodas
2e2ce0f621 Use RwLock instead of Mutex.
A mutex is too aggressive when the shared object can be accessed read-only most
of the time instead of requiring exclusive access.
2025-06-11 20:17:04 -03:00
thesimplekid
319133a088 Merge pull request #805 from thesimplekid/docker_publish
fix: prevent docker publish from overwritting other arc
2025-06-10 15:30:16 +01:00
thesimplekid
3b87fff218 chore: changelog and remove flake box 2025-06-10 13:19:59 +01:00
thesimplekid
14efe4a8b8 fix: prevent docker publish from overwritting other arc 2025-06-10 12:53:27 +01:00
thesimplekid
7e8913a1cf Merge pull request #804 from coderwander/main
chore: add the missing right bracket
2025-06-10 10:56:02 +01:00
coderwander
8f6210dba4 chore: add the missing right bracket
Signed-off-by: coderwander <770732124@qq.com>
2025-06-10 17:49:51 +08:00
thesimplekid
26efb79e65 Merge pull request #803 from thesimplekid/mint_info_version
fix: set mint version
2025-06-09 23:27:33 +01:00
thesimplekid
86b03dca6d fix: set mint version 2025-06-09 22:05:50 +01:00
thesimplekid
5ae5d10948 chore: bump v0.10.0 (#797)
* chore: bump v0.10.0

* chore: cdk-signatory metadata
2025-06-07 20:30:09 +01:00
thesimplekid
f7846f65c2 chore: cdk-signatory metadata 2025-06-07 20:16:33 +01:00
thesimplekid
9e8f5a1e7d chore: bump v0.10.0 2025-06-07 20:09:15 +01:00
thesimplekid
21a5ac9406 feat(cli): enhance check-pending to reclaim proofs (#795)
* feat(cli): enhance check-pending to reclaim proofs

The check-pending command now directly attempts to reclaim proofs that
are no longer pending, replacing the previous check-only behavior.

Changes:
- Replace check_all_pending_proofs with reclaim_unspent functionality
- Add more detailed feedback about pending proof status
- Update command description to reflect new reclaim behavior
- Improve error handling and status reporting

This change makes the command more useful by actively reclaiming
proofs rather than just checking their status.

* refactor: remove CheckSpendable command and check_spent module

The CheckSpendable command and its associated check_spent.rs module have been
removed as their functionality is redundant with the CheckPending command.
2025-06-07 17:23:00 +01:00
thesimplekid
0b2b3c6d53 chore: update changelog v0.9.3 (#796) 2025-06-07 16:22:16 +01:00
thesimplekid
4e7d45bb98 chore: update changelog v0.9.3 2025-06-07 16:16:37 +01:00
C
83a919ccd6 Merge pull request #793 from crodas/feature/wallet-swap-before-melt
Perform a swap before melting by default.
2025-06-07 15:21:19 +01:00
thesimplekid
9a62777883 Merge pull request #794 from thesimplekid/mint_info_seq
fix: handle old nut15 spec
2025-06-07 10:42:01 +01:00
thesimplekid
9c3a64b029 fix: handle old nut15 spec 2025-06-06 23:36:45 +01:00
thesimplekid
3c39bd0aec refactor: remove unused fn (#790) 2025-06-06 14:46:26 +01:00
thesimplekid
3c9ceed5e0 refactor: remove unused fn 2025-06-06 13:53:36 +01:00
asmo
d9652d7f53 refactor: fixing pre commit hooks checks (#789) 2025-06-06 11:40:36 +01:00
thesimplekid
9f4d5ba424 chore: publish docker image to cashubtc (#788) 2025-06-05 13:58:47 +01:00
asmo
548bbf1b40 Secret remove pub properties (#782)
* refactor: add getters to Secret and SecretData

* refactor: use new getters for Secret and SecretData in wallet receive

* refactor: using SecretData constructor

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-06-05 12:25:56 +01:00
thesimplekid
d665e2fc38 Merge pull request #786 from thesimplekid/cdk_sqlite_msrv
chore: fix msrv shell
2025-06-04 23:04:11 +01:00
thesimplekid
54b061340f chore: fix msrv shell 2025-06-04 22:53:57 +01:00
thesimplekid
35137424c3 Merge pull request #784 from stefanbitcr/restore_redundant
Remove redundant filter during restoration
2025-06-04 09:19:34 -04:00
thesimplekid
7251121d8e chore: update readme got bolt11 2025-06-04 12:42:18 +01:00
thesimplekid
58d36adc45 Merge pull request #785 from thesimplekid/increase_ci_time
chore: update ci timeout
2025-06-04 07:33:49 -04:00