Commit Graph

1343 Commits

Author SHA1 Message Date
thesimplekid
4b82fa82a7 chore: release summary 2025-06-29 17:15:38 +01:00
thesimplekid
56ff5c3f19 chore: bump v0.11 2025-06-29 13:55:59 +01:00
thesimplekid
29ded742c2 feat: refund multi sig (#860) 2025-06-28 21:07:42 +01:00
thesimplekid
b4728d7257 feat: refund multi sig 2025-06-28 12:09:33 +01:00
C
238b09d56a Split the database trait into read and transactions. (#826)
* Split the database trait into read and transactions.

The transaction traits will encapsulate all database changes and also expect
READ-and-lock operations to read and lock records from the database for
exclusive access, thereby avoiding race conditions.

The Transaction trait expects a `rollback` operation on Drop unless the
transaction has been committed.

* fix: melt quote duplicate error

This change stops a second melt quote from being created
if there is an existing valid melt quote for an invoice already.
If the first melt quote has expired then we allow for a new melt quote to be created.

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-06-28 12:07:47 +01:00
thesimplekid
3f84b3b4c8 Merge pull request #858 from thesimplekid/mint_error_code
fix: mint error codes
2025-06-27 22:48:07 +01:00
thesimplekid
9de3314817 fix: mint error codes 2025-06-27 21:49:44 +01:00
thesimplekid
ea227308b5 Merge pull request #855 from davidcaseria/send-options-max-proofs
Provide option to limit the send token size
2025-06-27 21:38:53 +01:00
thesimplekid
98929e4868 Merge pull request #856 from davidcaseria/amount-convert-unit
Add Amount::convert_unit convenience method
2025-06-27 21:12:10 +01:00
David Caseria
8d32af740e Add Amount::convert_unit convenience method 2025-06-27 15:28:39 -04:00
David Caseria
5fe8b11654 Provide option to limit the send token size 2025-06-27 11:45:00 -04:00
thesimplekid
dd81b9a947 fix: name of blinded_message col in blind_signature (#845) 2025-06-27 09:19:56 +01:00
thesimplekid
34d8ab763b fix: name of blinded_message col in blind_signature 2025-06-26 12:28:22 +01:00
gudnuf
78c3a9f807 fix: also check UNPAID mint quotes on startup (#844)
* fix: also check UNPAID mint quotes on startup

* chore: clippy warning

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-06-26 11:50:53 +01:00
thesimplekid
a2b9a793a9 Merge pull request #842 from thesimplekid/remove_dead_code
chore: remove dead code
2025-06-25 21:36:52 +01:00
thesimplekid
fb789be08d Merge pull request #841 from thesimplekid/unit_wallets
fix: cdk-cli create wallets for units mint supports
2025-06-25 21:02:53 +01:00
thesimplekid
b42e95d2b1 chore: remove dead code 2025-06-25 20:05:58 +01:00
thesimplekid
ae84c61a03 fix: cdk-cli create wallets for units mint supports 2025-06-25 19:45:20 +01:00
thesimplekid
738202b957 fix: non sat amounts on melt (#839) 2025-06-25 14:08:00 +01:00
thesimplekid
4f4605df9e chore: update flake 2025-06-25 11:12:37 +01:00
thesimplekid
ecf879901a Merge pull request #836 from thesimplekid/fix_crypo_signatory
fix: install crypto
2025-06-25 09:43:41 +01:00
thesimplekid
896b1dfa5f Merge pull request #835 from cashubtc/revert-830-fix_auth_keyset_created
Revert "fix: creating auth keyset when auth disabled"
2025-06-24 14:53:29 +01:00
thesimplekid
dbadfc35b8 Revert "fix: creating auth keyset when auth disabled" 2025-06-24 13:34:28 +01:00
thesimplekid
ee1a978285 Merge pull request #834 from asmogo/fix_get_proofs_by_keyset_id
fix: add missing comma in SQL query
2025-06-24 11:44:34 +01:00
asmo
7a1879e6b4 fix: add missing comma in SQL query 2025-06-24 08:58:46 +02:00
thesimplekid
e016687d20 feat: remove fedimint tonic lnd (#831)
* feat: remove fedimint tonic lnd
2025-06-23 10:59:44 +01:00
thesimplekid
32009c174c Merge pull request #832 from thesimplekid/cln_rpc_new
feat: create new ClnRpc for each request
2025-06-23 10:58:46 +01:00
thesimplekid
c98132a531 Merge pull request #833 from thesimplekid/remove_redb
refactor: redb file was left in
2025-06-23 10:58:10 +01:00
thesimplekid
c2d9982cc4 refactor: redb file was left in 2025-06-23 09:11:14 +01:00
thesimplekid
3ac9c199db feat: create new ClnRpc for each request
This removes the mutex from the ClnRpc client avoiding blocking the mint.
cln-grpc handles this in the same way.
https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=c-lightning
2025-06-22 23:14:14 +01:00
thesimplekid
d44fd7b290 Merge pull request #787 from thesimplekid/remove_redb_mint
refactor: remove redb mint database
2025-06-21 11:54:12 +01:00
thesimplekid
f62992238a refactor: remove redb mint database 2025-06-21 10:32:26 +01:00
thesimplekid
5ffac76eaa Merge pull request #829 from thesimplekid/convert_redb_to_sqlite
feat: redb conversion script
2025-06-20 14:45:01 +01:00
thesimplekid
0aada22e62 fix: creating auth keyset when auth disabled (#830) 2025-06-20 14:44:44 +01:00
thesimplekid
cbb2d5f802 fix: creating auth keyset when auth disabled 2025-06-20 13:47:20 +01:00
thesimplekid
7421c1ea12 feat: redb to sqlite migration script 2025-06-20 13:16:06 +01:00
lollerfirst
c61fd3830a Keysets V2 (#702)
---------
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-06-19 15:36:16 +01:00
C
ad5f29c9a6 Remove melt_request (#819)
* 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

* Remove `melt_request`

Fixes #809

* Remove `get_melt_request` from db trait
2025-06-19 15:03:20 +01:00
asmo
bcd319b9cf Merge pull request #825 from asmogo/arm_fix
fix arm override
2025-06-19 15:02:17 +01:00
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